Focus OOC hotkey (#1272)
This commit is contained in:
@@ -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("[");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user