Added hotkey and controller to re-open end of round scoreboard (#25884)

* Added keybind for scoreboard, starting work

* Fixed the window appearing

* Added loc text

* Updated namespace for ScoreboardUIController.cs

* Switched to UISystemDependency

"- UIControllers can use [Dependency] as normal for IoC services and other controllers, but must use [UISystemDependency] for entity systems, which may be null as controllers exist before entity systems do." Jezithyr — 10/12/2022 1:20 PM

* Reverted back to functional state

* Replace with UISystemDependency

* Move RoundEndSummaryWindow to ScoreboardUIController

* Convert to EntitySystem

* Clean up command bind

* Move to RoundEnd directory

* Remove Nukeops rule when no nukies

* Cleanup

* Change to toggle hotkey

* Cleanup

* Revert "Remove Nukeops rule when no nukies"

This reverts commit 5d4bbca09f45110b24a674d59b505be87b602b67.

* Cleanup

* Make the Toggle hotkey work in lobby

* Fix error

---------

Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
wafehling
2024-04-26 05:39:56 -07:00
committed by GitHub
parent 080b1b1e0c
commit 8febdc5fc4
8 changed files with 61 additions and 14 deletions

View File

@@ -7,7 +7,7 @@ using Content.Shared.GameWindow;
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Client.State;
using Robust.Shared.Utility;
using Robust.Client.UserInterface;
namespace Content.Client.GameTicking.Managers
{
@@ -18,16 +18,11 @@ namespace Content.Client.GameTicking.Managers
[Dependency] private readonly IClientAdminManager _admin = default!;
[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly SharedMapSystem _map = default!;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
[ViewVariables] private bool _initialized;
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.
/// </summary>
private RoundEndSummaryWindow? _window;
[ViewVariables] public bool AreWeReady { get; private set; }
[ViewVariables] public bool IsGameStarted { get; private set; }
[ViewVariables] public string? RestartSound { get; private set; }
@@ -152,12 +147,7 @@ namespace Content.Client.GameTicking.Managers
// Force an update in the event of this song being the same as the last.
RestartSound = message.RestartSound;
// Don't open duplicate windows (mainly for replays).
if (_window?.RoundId == message.RoundId)
return;
//This is not ideal at all, but I don't see an immediately better fit anywhere else.
_window = new RoundEndSummaryWindow(message.GamemodeTitle, message.RoundEndText, message.RoundDuration, message.RoundId, message.AllPlayersEndInfo, EntityManager);
_userInterfaceManager.GetUIController<RoundEndSummaryUIController>().OpenRoundEndSummaryWindow(message);
}
}
}