32 lines
902 B
C#
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;
|
|
}
|
|
}
|
|
}
|