Files
tbd-station-14/Content.Client/Fluids/UI/AbsorbentItemStatus.xaml.cs
metalgearsloth 2c751d5153 Add ItemStatus for mopping (#13745)
* Add ItemStatus for mopping

Big QOL feature

* a
2023-02-11 01:38:45 +00:00

32 lines
902 B
C#

using Content.Shared.Fluids;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing;
namespace Content.Client.Fluids.UI
{
[GenerateTypedNameReferences]
public sealed partial class AbsorbentItemStatus : Control
{
private readonly IEntityManager _entManager;
private readonly EntityUid _uid;
public AbsorbentItemStatus(EntityUid uid, IEntityManager entManager)
{
RobustXamlLoader.Load(this);
_uid = uid;
_entManager = entManager;
}
protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
if (!_entManager.TryGetComponent<AbsorbentComponent>(_uid, out var absorbent))
return;
PercentBar.Value = absorbent.Progress;
}
}
}