using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Timing;
namespace Content.Client.Disposal.UI
{
[GenerateTypedNameReferences]
public sealed partial class MailingUnitWindow : DefaultWindow
{
+ public TimeSpan FullPressure;
+
public MailingUnitWindow()
{
RobustXamlLoader.Load(this);
Title = Loc.GetString("ui-mailing-unit-window-title", ("tag", state.Tag ?? " "));
UnitState.Text = disposalState.UnitState;
+ FullPressure = disposalState.FullPressureTime;
var pressureReached = PressureBar.UpdatePressure(disposalState.FullPressureTime);
Power.Pressed = disposalState.Powered;
Engage.Pressed = disposalState.Engaged;
return !disposalState.Powered || pressureReached;
}
- public bool UpdatePressure(TimeSpan stateFullPressureTime)
+ protected override void FrameUpdate(FrameEventArgs args)
{
- return PressureBar.UpdatePressure(stateFullPressureTime);
+ base.FrameUpdate(args);
+ PressureBar.UpdatePressure(FullPressure);
}
}
}
using Content.Shared.Interaction;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
+using Robust.Shared.Utility;
namespace Content.Server.Disposal.Mailing;
SubscribeLocalEvent<MailingUnitComponent, DeviceNetworkPacketEvent>(OnPacketReceived);
SubscribeLocalEvent<MailingUnitComponent, BeforeDisposalFlushEvent>(OnBeforeFlush);
SubscribeLocalEvent<MailingUnitComponent, ConfigurationSystem.ConfigurationUpdatedEvent>(OnConfigurationUpdated);
- SubscribeLocalEvent<MailingUnitComponent, ActivateInWorldEvent>(HandleActivate);
+ SubscribeLocalEvent<MailingUnitComponent, ActivateInWorldEvent>(HandleActivate, before: new[] { typeof(DisposalUnitSystem) });
SubscribeLocalEvent<MailingUnitComponent, DisposalUnitUIStateUpdatedEvent>(OnDisposalUnitUIStateChange);
SubscribeLocalEvent<MailingUnitComponent, TargetSelectedMessage>(OnTargetSelected);
}
if (component.DisposalUnitInterfaceState == null)
return;
- var state = new MailingUnitBoundUserInterfaceState(component.DisposalUnitInterfaceState, component.Target, component.TargetList, component.Tag);
+ var state = new MailingUnitBoundUserInterfaceState(component.DisposalUnitInterfaceState, component.Target, component.TargetList.ShallowClone(), component.Tag);
_userInterfaceSystem.SetUiState(uid, MailingUnitUiKey.Key, state);
}