Remove IItemStatus (#11055)

This commit is contained in:
Alex Evgrashin
2022-09-11 08:53:17 +02:00
committed by GitHub
parent 61655c18b2
commit 385a52c390
18 changed files with 357 additions and 355 deletions

View File

@@ -0,0 +1,42 @@
using Content.Client.Chemistry.Components;
using Content.Client.Message;
using Content.Client.Stylesheets;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Timing;
namespace Content.Client.Chemistry.UI;
public sealed class HyposprayStatusControl : Control
{
private readonly HyposprayComponent _parent;
private readonly RichTextLabel _label;
public HyposprayStatusControl(HyposprayComponent parent)
{
_parent = parent;
_label = new RichTextLabel {StyleClasses = {StyleNano.StyleClassItemStatus}};
AddChild(_label);
Update();
}
protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
if (!_parent.UiUpdateNeeded)
return;
Update();
}
public void Update()
{
_parent.UiUpdateNeeded = false;
_label.SetMarkup(Loc.GetString(
"hypospray-volume-text",
("currentVolume", _parent.CurrentVolume),
("totalVolume", _parent.TotalVolume)));
}
}