Files
tbd-station-14/Content.Shared/Shuttles/BUIStates/ShuttleMapInterfaceState.cs
Pieter-Jan Briers 3b791459c7 Refactor FTL time tracking code to fix a UI bug (#26538)
The FTL UI on the shuttle console would reset the FTL progress bar every time you open it. This is because the server only sends "time until completion", not a start/end time. The FTL code now uses a separate start/end time so the exact same progress bar can be preserved.

For convenience, I made a StartEndTime record struct that stores the actual tuple. This is now used by the code and has some helpers.
2024-03-30 12:40:55 +11:00

40 lines
1007 B
C#

using Content.Shared.Shuttles.Systems;
using Content.Shared.Shuttles.UI.MapObjects;
using Content.Shared.Timing;
using Robust.Shared.Serialization;
namespace Content.Shared.Shuttles.BUIStates;
/// <summary>
/// Handles BUI data for Map screen.
/// </summary>
[Serializable, NetSerializable]
public sealed class ShuttleMapInterfaceState
{
/// <summary>
/// The current FTL state.
/// </summary>
public readonly FTLState FTLState;
/// <summary>
/// When the current FTL state starts and ends.
/// </summary>
public StartEndTime FTLTime;
public List<ShuttleBeaconObject> Destinations;
public List<ShuttleExclusionObject> Exclusions;
public ShuttleMapInterfaceState(
FTLState ftlState,
StartEndTime ftlTime,
List<ShuttleBeaconObject> destinations,
List<ShuttleExclusionObject> exclusions)
{
FTLState = ftlState;
FTLTime = ftlTime;
Destinations = destinations;
Exclusions = exclusions;
}
}