prevent opening debug menus without perms (#25091)
prevent people without permissions from opening the tile, entityspawn, or decal menus
This commit is contained in:
@@ -30,6 +30,7 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
|
||||
[Dependency] private readonly IEyeManager _eye = default!;
|
||||
[Dependency] private readonly IInputManager _input = default!;
|
||||
[Dependency] private readonly ILightManager _light = default!;
|
||||
[Dependency] private readonly IClientAdminManager _admin = default!;
|
||||
|
||||
[UISystemDependency] private readonly DebugPhysicsSystem _debugPhysics = default!;
|
||||
[UISystemDependency] private readonly MarkerSystem _marker = default!;
|
||||
@@ -53,13 +54,28 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
|
||||
CheckSandboxVisibility();
|
||||
|
||||
_input.SetInputCommand(ContentKeyFunctions.OpenEntitySpawnWindow,
|
||||
InputCmdHandler.FromDelegate(_ => 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))
|
||||
|
||||
Reference in New Issue
Block a user