Turns GameTicker into an EntitySystem. (#4197)

* GameTicker turned into an EntitySystem

* Turns ClientGameTicker into an EntitySystem, turn NetMessages into events

* Change event names to be more consistent with the rest.

* YAML linter uses the dummy gameticker CVar override.

* Fix game ticker initialization order

* Dummy ticker won't spawn players.

* Fix character creation test
This commit is contained in:
Vera Aguilera Puerto
2021-06-20 10:09:24 +02:00
committed by GitHub
parent 15fb554c28
commit d3a611164b
81 changed files with 1711 additions and 1990 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.Utility;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
@@ -22,7 +23,6 @@ namespace Content.Client.LateJoin
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
[Dependency] private readonly IClientGameTicker _gameTicker = default!;
public event Action<string>? SelectedId;
@@ -34,6 +34,8 @@ namespace Content.Client.LateJoin
MinSize = SetSize = (360, 560);
IoCManager.InjectDependencies(this);
var gameTicker = EntitySystem.Get<ClientGameTicker>();
Title = Loc.GetString("Late Join");
var jobList = new VBoxContainer();
@@ -131,7 +133,7 @@ namespace Content.Client.LateJoin
SelectedId?.Invoke(jobButton.JobId);
};
if (!_gameTicker.JobsAvailable.Contains(job.ID))
if (!gameTicker.JobsAvailable.Contains(job.ID))
{
jobButton.Disabled = true;
}
@@ -147,7 +149,7 @@ namespace Content.Client.LateJoin
Close();
};
_gameTicker.LobbyJobsAvailableUpdated += JobsAvailableUpdated;
gameTicker.LobbyJobsAvailableUpdated += JobsAvailableUpdated;
}
private void JobsAvailableUpdated(IReadOnlyList<string> jobs)
@@ -164,7 +166,7 @@ namespace Content.Client.LateJoin
if (disposing)
{
_gameTicker.LobbyJobsAvailableUpdated -= JobsAvailableUpdated;
EntitySystem.Get<ClientGameTicker>().LobbyJobsAvailableUpdated -= JobsAvailableUpdated;
_jobButtons.Clear();
_jobCategories.Clear();
}