From 2293f46bcac38c73a212fc34ee77d2839cd8558b Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sat, 10 Feb 2024 03:00:52 -0500 Subject: [PATCH] prevent opening debug menus without perms (#25091) prevent people without permissions from opening the tile, entityspawn, or decal menus --- .../Systems/Sandbox/SandboxUIController.cs | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs b/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs index 3ab36a9166..752c89ca97 100644 --- a/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs +++ b/Content.Client/UserInterface/Systems/Sandbox/SandboxUIController.cs @@ -30,6 +30,7 @@ public sealed class SandboxUIController : UIController, IOnStateChanged EntitySpawningController.ToggleWindow())); + InputCmdHandler.FromDelegate(_ => + { + if (!_admin.CanAdminPlace()) + return; + EntitySpawningController.ToggleWindow(); + })); _input.SetInputCommand(ContentKeyFunctions.OpenSandboxWindow, InputCmdHandler.FromDelegate(_ => ToggleWindow())); _input.SetInputCommand(ContentKeyFunctions.OpenTileSpawnWindow, - InputCmdHandler.FromDelegate(_ => TileSpawningController.ToggleWindow())); + InputCmdHandler.FromDelegate(_ => + { + if (!_admin.CanAdminPlace()) + return; + TileSpawningController.ToggleWindow(); + })); _input.SetInputCommand(ContentKeyFunctions.OpenDecalSpawnWindow, - InputCmdHandler.FromDelegate(_ => DecalPlacerController.ToggleWindow())); + InputCmdHandler.FromDelegate(_ => + { + if (!_admin.CanAdminPlace()) + return; + DecalPlacerController.ToggleWindow(); + })); CommandBinds.Builder .Bind(ContentKeyFunctions.EditorCopyObject, new PointerInputCmdHandler(Copy))