mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Adds "hide UI" keybind.
Man posting screenshots is much nicer when there's no ugly chat window.
This commit is contained in:
@@ -3,6 +3,9 @@ binds:
|
||||
- function: ShowDebugMonitors
|
||||
key: F3
|
||||
type: Toggle
|
||||
- function: HideUI
|
||||
key: F4
|
||||
type: Toggle
|
||||
- function: MoveUp
|
||||
key: W
|
||||
type: State
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace SS14.Client.Input
|
||||
var common = contexts.GetContext(InputContextContainer.DefaultContextName);
|
||||
common.AddFunction(EngineKeyFunctions.EscapeMenu);
|
||||
common.AddFunction(EngineKeyFunctions.FocusChat);
|
||||
common.AddFunction(EngineKeyFunctions.HideUI);
|
||||
common.AddFunction(EngineKeyFunctions.ShowDebugMonitors);
|
||||
common.AddFunction(EngineKeyFunctions.MoveUp);
|
||||
common.AddFunction(EngineKeyFunctions.MoveDown);
|
||||
|
||||
@@ -49,6 +49,8 @@ namespace SS14.Client.UserInterface
|
||||
|
||||
private readonly List<Control> _modalStack = new List<Control>();
|
||||
|
||||
private bool _rendering = true;
|
||||
|
||||
public void PostInject()
|
||||
{
|
||||
_config.RegisterCVar("key.keyboard.console", Keyboard.Key.Tilde, CVar.ARCHIVE);
|
||||
@@ -69,6 +71,11 @@ namespace SS14.Client.UserInterface
|
||||
_inputManager.SetInputCommand(EngineKeyFunctions.ShowDebugMonitors,
|
||||
InputCmdHandler.FromDelegate(enabled: session => { DebugMonitors.Visible = true; },
|
||||
disabled: session => { DebugMonitors.Visible = false; }));
|
||||
|
||||
_inputManager.SetInputCommand(EngineKeyFunctions.HideUI,
|
||||
InputCmdHandler.FromDelegate(
|
||||
enabled: session => _rendering = false,
|
||||
disabled: session => _rendering = true));
|
||||
}
|
||||
|
||||
private void _initializeCommon()
|
||||
@@ -399,6 +406,10 @@ namespace SS14.Client.UserInterface
|
||||
|
||||
public void Render(IRenderHandle renderHandle)
|
||||
{
|
||||
if (!_rendering)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var drawHandle = renderHandle.CreateHandleScreen();
|
||||
|
||||
_render(drawHandle, RootControl, Vector2.Zero, Color.White, null);
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace SS14.Shared.Input
|
||||
public static readonly BoundKeyFunction Run = "Run";
|
||||
|
||||
public static readonly BoundKeyFunction ShowDebugMonitors = "ShowDebugMonitors";
|
||||
public static readonly BoundKeyFunction HideUI = "HideUI";
|
||||
public static readonly BoundKeyFunction EscapeMenu = "ShowEscapeMenu";
|
||||
public static readonly BoundKeyFunction FocusChat = "FocusChatWindow";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user