Content update for NetEntities (#18935)
This commit is contained in:
@@ -22,8 +22,8 @@ namespace Content.Client.GameTicking.Managers
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
|
||||
[ViewVariables] private bool _initialized;
|
||||
private Dictionary<EntityUid, Dictionary<string, uint?>> _jobsAvailable = new();
|
||||
private Dictionary<EntityUid, string> _stationNames = new();
|
||||
private Dictionary<NetEntity, Dictionary<string, uint?>> _jobsAvailable = new();
|
||||
private Dictionary<NetEntity, string> _stationNames = new();
|
||||
|
||||
/// <summary>
|
||||
/// The current round-end window. Could be used to support re-opening the window after closing it.
|
||||
@@ -41,14 +41,14 @@ namespace Content.Client.GameTicking.Managers
|
||||
[ViewVariables] public TimeSpan RoundStartTimeSpan { get; private set; }
|
||||
[ViewVariables] public new bool Paused { get; private set; }
|
||||
|
||||
[ViewVariables] public IReadOnlyDictionary<EntityUid, Dictionary<string, uint?>> JobsAvailable => _jobsAvailable;
|
||||
[ViewVariables] public IReadOnlyDictionary<EntityUid, string> StationNames => _stationNames;
|
||||
[ViewVariables] public IReadOnlyDictionary<NetEntity, Dictionary<string, uint?>> JobsAvailable => _jobsAvailable;
|
||||
[ViewVariables] public IReadOnlyDictionary<NetEntity, string> StationNames => _stationNames;
|
||||
|
||||
public event Action? InfoBlobUpdated;
|
||||
public event Action? LobbyStatusUpdated;
|
||||
public event Action? LobbySongUpdated;
|
||||
public event Action? LobbyLateJoinStatusUpdated;
|
||||
public event Action<IReadOnlyDictionary<EntityUid, Dictionary<string, uint?>>>? LobbyJobsAvailableUpdated;
|
||||
public event Action<IReadOnlyDictionary<NetEntity, Dictionary<string, uint?>>>? LobbyJobsAvailableUpdated;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -89,8 +89,18 @@ namespace Content.Client.GameTicking.Managers
|
||||
|
||||
private void UpdateJobsAvailable(TickerJobsAvailableEvent message)
|
||||
{
|
||||
_jobsAvailable = message.JobsAvailableByStation;
|
||||
_stationNames = message.StationNames;
|
||||
foreach (var (job, data) in message.JobsAvailableByStation)
|
||||
{
|
||||
_jobsAvailable.Clear();
|
||||
_jobsAvailable[job] = data;
|
||||
}
|
||||
|
||||
_stationNames.Clear();
|
||||
foreach (var weh in message.StationNames)
|
||||
{
|
||||
_stationNames[weh.Key] = weh.Value;
|
||||
}
|
||||
|
||||
LobbyJobsAvailableUpdated?.Invoke(JobsAvailable);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user