Added radio chat hotkey

This commit is contained in:
Joonas Rikkonen
2017-11-29 19:16:53 +02:00
parent e4664b3d27
commit 6e9c33fe89
3 changed files with 10 additions and 3 deletions
@@ -159,8 +159,8 @@ namespace Barotrauma
keyMapping[(int)InputType.Right] = new KeyOrMouse(Keys.D); keyMapping[(int)InputType.Right] = new KeyOrMouse(Keys.D);
keyMapping[(int)InputType.Run] = new KeyOrMouse(Keys.LeftShift); keyMapping[(int)InputType.Run] = new KeyOrMouse(Keys.LeftShift);
keyMapping[(int)InputType.Chat] = new KeyOrMouse(Keys.Tab); keyMapping[(int)InputType.Chat] = new KeyOrMouse(Keys.Tab);
keyMapping[(int)InputType.RadioChat] = new KeyOrMouse(Keys.OemPipe);
keyMapping[(int)InputType.CrewOrders] = new KeyOrMouse(Keys.C); keyMapping[(int)InputType.CrewOrders] = new KeyOrMouse(Keys.C);
keyMapping[(int)InputType.Select] = new KeyOrMouse(Keys.E); keyMapping[(int)InputType.Select] = new KeyOrMouse(Keys.E);
@@ -222,7 +222,8 @@ namespace Barotrauma.Networking
//tab doesn't autoselect the chatbox when debug console is open, //tab doesn't autoselect the chatbox when debug console is open,
//because tab is used for autocompleting console commands //because tab is used for autocompleting console commands
if (PlayerInput.KeyHit(InputType.Chat) && chatMsgBox.Visible && !DebugConsole.IsOpen) if ((PlayerInput.KeyHit(InputType.Chat) || PlayerInput.KeyHit(InputType.RadioChat)) &&
chatMsgBox.Visible && !DebugConsole.IsOpen)
{ {
if (chatMsgBox.Selected) if (chatMsgBox.Selected)
{ {
@@ -232,6 +233,12 @@ namespace Barotrauma.Networking
else else
{ {
chatMsgBox.Select(); chatMsgBox.Select();
if (PlayerInput.KeyHit(InputType.RadioChat))
{
chatMsgBox.Text = "r; ";
chatMsgBox.OnTextChanged?.Invoke(chatMsgBox, chatMsgBox.Text);
}
} }
} }
#endif #endif
@@ -11,7 +11,7 @@ namespace Barotrauma
Up, Down, Left, Right, Up, Down, Left, Right,
Attack, Attack,
Run, Crouch, Run, Crouch,
Chat, CrewOrders Chat, RadioChat, CrewOrders
} }
public class KeyOrMouse public class KeyOrMouse