From e608d63861b60422aef5efd62da5faa08c920c83 Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:47:30 +0300 Subject: [PATCH 1/7] add: respawn button --- Content.Client/Ghost/GhostSystem.cs | 6 + .../Systems/Ghost/GhostUIController.cs | 7 ++ .../Systems/Ghost/Widgets/GhostGui.xaml | 1 + .../Systems/Ghost/Widgets/GhostGui.xaml.cs | 2 + .../GameTicking/GameTicker.GamePreset.cs | 8 ++ .../GameTicking/GameTicker.Spawning.cs | 81 +++++++++++++ .../_White/Ghost/GhostReturnToRoundSystem.cs | 108 ++++++++++++++++++ Content.Shared/Ghost/SharedGhostSystem.cs | 5 + Content.Shared/_White/CVars.cs | 10 +- .../Locale/en-US/_white/ghost/ghost-gui.ftl | 1 + .../en-US/_white/ghost/ghost-respawn.ftl | 14 +++ .../Locale/ru-RU/_white/ghost/ghost-gui.ftl | 1 + .../ru-RU/_white/ghost/ghost-respawn.ftl | 15 +++ 13 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 Content.Server/_White/Ghost/GhostReturnToRoundSystem.cs create mode 100644 Resources/Locale/en-US/_white/ghost/ghost-gui.ftl create mode 100644 Resources/Locale/en-US/_white/ghost/ghost-respawn.ftl create mode 100644 Resources/Locale/ru-RU/_white/ghost/ghost-gui.ftl create mode 100644 Resources/Locale/ru-RU/_white/ghost/ghost-respawn.ftl diff --git a/Content.Client/Ghost/GhostSystem.cs b/Content.Client/Ghost/GhostSystem.cs index c42e7cd0e0..4bc6ba4c87 100644 --- a/Content.Client/Ghost/GhostSystem.cs +++ b/Content.Client/Ghost/GhostSystem.cs @@ -181,5 +181,11 @@ public void ToggleGhostVisibility() { GhostVisibility = !GhostVisibility; } + + public void ReturnToRound() // WD EDIT + { + var msg = new GhostReturnToRoundRequest(); + RaiseNetworkEvent(msg); + } } } diff --git a/Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs b/Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs index 12d6c65953..3834b35fe7 100644 --- a/Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs +++ b/Content.Client/UserInterface/Systems/Ghost/GhostUIController.cs @@ -120,6 +120,7 @@ public void LoadGui() Gui.ReturnToBodyPressed += ReturnToBody; Gui.GhostRolesPressed += GhostRolesPressed; Gui.TargetWindow.WarpClicked += OnWarpClicked; + Gui.ReturnToRoundPressed += ReturnToRound; // WD EDIT UpdateGui(); } @@ -133,6 +134,7 @@ public void UnloadGui() Gui.ReturnToBodyPressed -= ReturnToBody; Gui.GhostRolesPressed -= GhostRolesPressed; Gui.TargetWindow.WarpClicked -= OnWarpClicked; + Gui.ReturnToRoundPressed -= ReturnToRound; // WD EDIT Gui.Hide(); } @@ -142,6 +144,11 @@ private void ReturnToBody() _system?.ReturnToBody(); } + private void ReturnToRound() // WD EDIT + { + _system?.ReturnToRound(); + } + private void RequestWarps() { _system?.RequestWarps(); diff --git a/Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml b/Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml index 0f65debb4e..7e1760aa5e 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml +++ b/Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml @@ -5,5 +5,6 @@