Examine prediction (#23565)

* Initial prediction

* new group handling

* groups for all examines that use multiple rn

* compile

* why was it doing this??

* handle newlines with sorting properly
This commit is contained in:
Kara
2024-01-05 23:53:13 -07:00
committed by GitHub
parent 731cfc278a
commit 0ae3858b69
41 changed files with 693 additions and 431 deletions

View File

@@ -99,24 +99,27 @@ namespace Content.Server.Tools
private void OnWelderExamine(Entity<WelderComponent> entity, ref ExaminedEvent args)
{
if (_itemToggle.IsActivated(entity.Owner))
using (args.PushGroup(nameof(WelderComponent)))
{
args.PushMarkup(Loc.GetString("welder-component-on-examine-welder-lit-message"));
}
else
{
args.PushMarkup(Loc.GetString("welder-component-on-examine-welder-not-lit-message"));
}
if (_itemToggle.IsActivated(entity.Owner))
{
args.PushMarkup(Loc.GetString("welder-component-on-examine-welder-lit-message"));
}
else
{
args.PushMarkup(Loc.GetString("welder-component-on-examine-welder-not-lit-message"));
}
if (args.IsInDetailsRange)
{
var (fuel, capacity) = GetWelderFuelAndCapacity(entity.Owner, entity.Comp);
if (args.IsInDetailsRange)
{
var (fuel, capacity) = GetWelderFuelAndCapacity(entity.Owner, entity.Comp);
args.PushMarkup(Loc.GetString("welder-component-on-examine-detailed-message",
("colorName", fuel < capacity / FixedPoint2.New(4f) ? "darkorange" : "orange"),
("fuelLeft", fuel),
("fuelCapacity", capacity),
("status", string.Empty))); // Lit status is handled above
args.PushMarkup(Loc.GetString("welder-component-on-examine-detailed-message",
("colorName", fuel < capacity / FixedPoint2.New(4f) ? "darkorange" : "orange"),
("fuelLeft", fuel),
("fuelCapacity", capacity),
("status", string.Empty))); // Lit status is handled above
}
}
}