32 lines
1023 B
C#
32 lines
1023 B
C#
using Content.Shared._Offbrand.Wounds;
|
|
using Content.Shared.FixedPoint;
|
|
using Content.Shared.MedicalScanner;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Robust.Client.UserInterface;
|
|
|
|
namespace Content.Client.HealthAnalyzer.UI.Tooltips;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class TemperatureTooltip : PanelContainer
|
|
{
|
|
public TemperatureTooltip()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
}
|
|
|
|
public void Update(HealthAnalyzerScannedUserMessage msg, Entity<CryostasisFactorComponent?> ent)
|
|
{
|
|
if (ent.Comp is null)
|
|
{
|
|
Label.Text = Loc.GetString("health-analyzer-plain-temperature-tooltip");
|
|
}
|
|
else
|
|
{
|
|
var factor = Math.Max(ent.Comp.TemperatureCoefficient * msg.Temperature + ent.Comp.TemperatureConstant, 1);
|
|
Label.Text = Loc.GetString("health-analyzer-cryostasis-temperature-tooltip", ("factor", $"{factor * 100:F1}"));
|
|
}
|
|
}
|
|
}
|