Focus OOC hotkey (#1272)

This commit is contained in:
ike709
2020-07-06 08:45:58 -05:00
committed by GitHub
parent 7e4b506aaf
commit 3bab2fd803
5 changed files with 22 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ namespace Content.Client.Input
{
var common = contexts.GetContext("common");
common.AddFunction(ContentKeyFunctions.FocusChat);
common.AddFunction(ContentKeyFunctions.FocusOOC);
common.AddFunction(ContentKeyFunctions.ExamineEntity);
common.AddFunction(ContentKeyFunctions.OpenTutorial);
common.AddFunction(ContentKeyFunctions.TakeScreenshot);

View File

@@ -41,6 +41,9 @@ namespace Content.Client.State
_inputManager.SetInputCommand(ContentKeyFunctions.FocusChat,
InputCmdHandler.FromDelegate(s => FocusChat(_gameChat)));
_inputManager.SetInputCommand(ContentKeyFunctions.FocusOOC,
InputCmdHandler.FromDelegate(s => FocusOOC(_gameChat)));
}
public override void Shutdown()
@@ -61,5 +64,16 @@ namespace Content.Client.State
chat.Input.IgnoreNext = true;
chat.Input.GrabKeyboardFocus();
}
internal static void FocusOOC(ChatBox chat)
{
if (chat == null || chat.UserInterfaceManager.KeyboardFocused != null)
{
return;
}
chat.Input.IgnoreNext = true;
chat.Input.GrabKeyboardFocus();
chat.Input.InsertAtCursor("[");
}
}
}

View File

@@ -75,6 +75,7 @@ Open inventory: [color=#a4885c]{7}[/color]
Open character window: [color=#a4885c]{8}[/color]
Open crafting window: [color=#a4885c]{9}[/color]
Focus chat: [color=#a4885c]{10}[/color]
Focus OOC: [color=#a4885c]{26}[/color]
Use hand/object in hand: [color=#a4885c]{22}[/color]
Do wide attack: [color=#a4885c]{23}[/color]
Use targeted entity: [color=#a4885c]{11}[/color]
@@ -110,7 +111,8 @@ Toggle sandbox window: [color=#a4885c]{21}[/color]",
Key(Use),
Key(WideAttack),
Key(SmartEquipBackpack),
Key(SmartEquipBelt)));
Key(SmartEquipBelt),
Key(FocusOOC)));
//Gameplay
VBox.AddChild(new Label { FontOverride = headerFont, Text = "\nGameplay" });

View File

@@ -11,6 +11,7 @@ namespace Content.Shared.Input
public static readonly BoundKeyFunction Drop = "Drop";
public static readonly BoundKeyFunction ExamineEntity = "ExamineEntity";
public static readonly BoundKeyFunction FocusChat = "FocusChatWindow";
public static readonly BoundKeyFunction FocusOOC = "FocusOOCWindow";
public static readonly BoundKeyFunction OpenCharacterMenu = "OpenCharacterMenu";
public static readonly BoundKeyFunction OpenContextMenu = "OpenContextMenu";
public static readonly BoundKeyFunction OpenCraftingMenu = "OpenCraftingMenu";

View File

@@ -43,6 +43,9 @@ binds:
- function: FocusChatWindow
type: State
key: T
- function: FocusOOCWindow
type: State
key: LBracket
- function: EditorLinePlace
type: State
key: MouseLeft