mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* more-item-status * update 1 * update 2 * Update pistol.yml * update 3 * yml * oops * BatteryItemStatus * fix ChargeItemStatus * Update item-status.ftl * review update 1 * review fix 1 * Update BatteryInfoSystem.cs * Update TimerTriggerItemStatus * merge fix * merge fix * review update 2 * review update 3 * fix marge * StyleNano * review update 4 * review update 5 * BatteryItemStatus * BatteryItemStatus Client * code cleanup * merge * merge and GasTank fix * Merge * unnecessary components * review * oops * GasTank * wawa
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Content.Client.Items.UI;
|
|
using Content.Client.Message;
|
|
using Content.Client.Stylesheets;
|
|
using Content.Client.Trigger.Systems;
|
|
using Content.Shared.Trigger.Components;
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
namespace Content.Client.Trigger.UI;
|
|
|
|
/// <summary>
|
|
/// Displays timer delay information for <see cref="TimerTriggerComponent"/> from predicted client state.
|
|
/// </summary>
|
|
/// <seealso cref="TimerTriggerItemStatusSystem"/>
|
|
public sealed partial class TimerTriggerStatusControl : PollingItemStatusControl<TimerTriggerStatusControl.Data>
|
|
{
|
|
private readonly Entity<TimerTriggerComponent> _parent;
|
|
private readonly RichTextLabel _label;
|
|
|
|
public TimerTriggerStatusControl(
|
|
Entity<TimerTriggerComponent> parent)
|
|
{
|
|
_parent = parent;
|
|
_label = new RichTextLabel { StyleClasses = { StyleClass.ItemStatus } };
|
|
AddChild(_label);
|
|
}
|
|
|
|
protected override Data PollData()
|
|
{
|
|
return new Data(_parent.Comp.Delay);
|
|
}
|
|
|
|
protected override void Update(in Data data)
|
|
{
|
|
var markup = Loc.GetString("timer-trigger-status-delay", ("delay", data.Delay.TotalSeconds));
|
|
_label.SetMarkup(markup);
|
|
}
|
|
|
|
public readonly record struct Data(TimeSpan Delay);
|
|
}
|