Remove IItemStatus (#11055)
This commit is contained in:
@@ -8,44 +8,11 @@ using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.Stack
|
||||
{
|
||||
[RegisterComponent, Access(typeof(StackSystem), typeof(StatusControl))]
|
||||
[RegisterComponent, Access(typeof(StackSystem), typeof(StackStatusControl))]
|
||||
[ComponentReference(typeof(SharedStackComponent))]
|
||||
public sealed class StackComponent : SharedStackComponent, IItemStatus
|
||||
public sealed class StackComponent : SharedStackComponent
|
||||
{
|
||||
[ViewVariables]
|
||||
public bool UiUpdateNeeded { get; set; }
|
||||
|
||||
public Control MakeControl()
|
||||
{
|
||||
return new StatusControl(this);
|
||||
}
|
||||
|
||||
private sealed class StatusControl : Control
|
||||
{
|
||||
private readonly StackComponent _parent;
|
||||
private readonly RichTextLabel _label;
|
||||
|
||||
public StatusControl(StackComponent parent)
|
||||
{
|
||||
_parent = parent;
|
||||
_label = new RichTextLabel {StyleClasses = {StyleNano.StyleClassItemStatus}};
|
||||
_label.SetMarkup(Loc.GetString("comp-stack-status", ("count", _parent.Count)));
|
||||
AddChild(_label);
|
||||
}
|
||||
|
||||
protected override void FrameUpdate(FrameEventArgs args)
|
||||
{
|
||||
base.FrameUpdate(args);
|
||||
|
||||
if (!_parent.UiUpdateNeeded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_parent.UiUpdateNeeded = false;
|
||||
|
||||
_label.SetMarkup(Loc.GetString("comp-stack-status", ("count", _parent.Count)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user