2021-06-09 22:19:39 +02:00
|
|
|
using Content.Client.Message;
|
|
|
|
|
using Content.Client.Stylesheets;
|
2021-10-07 13:01:27 +02:00
|
|
|
using Content.Shared.Tools.Components;
|
2020-01-09 00:27:52 +01:00
|
|
|
using Robust.Client.UserInterface;
|
|
|
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
|
using Robust.Shared.Timing;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Client.Tools.Components
|
2020-01-09 00:27:52 +01:00
|
|
|
{
|
2022-08-16 22:19:54 +12:00
|
|
|
public sealed class MultipleToolStatusControl : Control
|
|
|
|
|
{
|
|
|
|
|
private readonly MultipleToolComponent _parent;
|
|
|
|
|
private readonly RichTextLabel _label;
|
2020-01-09 00:27:52 +01:00
|
|
|
|
2022-08-16 22:19:54 +12:00
|
|
|
public MultipleToolStatusControl(MultipleToolComponent parent)
|
2020-01-09 00:27:52 +01:00
|
|
|
{
|
2022-08-16 22:19:54 +12:00
|
|
|
_parent = parent;
|
|
|
|
|
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
|
|
|
|
|
_label.SetMarkup(_parent.StatusShowBehavior ? _parent.CurrentQualityName : string.Empty);
|
|
|
|
|
AddChild(_label);
|
2020-01-09 00:27:52 +01:00
|
|
|
}
|
|
|
|
|
|
2022-08-16 22:19:54 +12:00
|
|
|
protected override void FrameUpdate(FrameEventArgs args)
|
2020-01-09 00:27:52 +01:00
|
|
|
{
|
2022-08-16 22:19:54 +12:00
|
|
|
base.FrameUpdate(args);
|
2020-01-09 00:27:52 +01:00
|
|
|
|
2022-08-16 22:19:54 +12:00
|
|
|
if (_parent.UiUpdateNeeded)
|
2020-01-09 00:27:52 +01:00
|
|
|
{
|
2022-08-16 22:19:54 +12:00
|
|
|
_parent.UiUpdateNeeded = false;
|
2022-02-13 11:18:18 +13:00
|
|
|
Update();
|
|
|
|
|
}
|
2022-08-16 22:19:54 +12:00
|
|
|
}
|
2020-01-09 00:27:52 +01:00
|
|
|
|
2022-08-16 22:19:54 +12:00
|
|
|
public void Update()
|
|
|
|
|
{
|
|
|
|
|
_label.SetMarkup(_parent.StatusShowBehavior ? _parent.CurrentQualityName : string.Empty);
|
2020-01-09 00:27:52 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|