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

View File

@@ -159,8 +159,8 @@ namespace Barotrauma
keyMapping[(int)InputType.Right] = new KeyOrMouse(Keys.D);
keyMapping[(int)InputType.Run] = new KeyOrMouse(Keys.LeftShift);
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.Select] = new KeyOrMouse(Keys.E);

View File

@@ -222,7 +222,8 @@ namespace Barotrauma.Networking
//tab doesn't autoselect the chatbox when debug console is open,
//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)
{
@@ -232,6 +233,12 @@ namespace Barotrauma.Networking
else
{
chatMsgBox.Select();
if (PlayerInput.KeyHit(InputType.RadioChat))
{
chatMsgBox.Text = "r; ";
chatMsgBox.OnTextChanged?.Invoke(chatMsgBox, chatMsgBox.Text);
}
}
}
#endif

View File

@@ -11,7 +11,7 @@ namespace Barotrauma
Up, Down, Left, Right,
Attack,
Run, Crouch,
Chat, CrewOrders
Chat, RadioChat, CrewOrders
}
public class KeyOrMouse