Lets people use keybinds to start chatting in lobby
This commit is contained in:
@@ -33,6 +33,13 @@ namespace Barotrauma
|
||||
private GUIListBox jobList;
|
||||
|
||||
private GUITextBox textBox, seedBox;
|
||||
public GUITextBox TextBox
|
||||
{
|
||||
get
|
||||
{
|
||||
return textBox;
|
||||
}
|
||||
}
|
||||
|
||||
private GUIFrame defaultModeContainer, campaignContainer;
|
||||
|
||||
|
||||
@@ -205,9 +205,10 @@ namespace Barotrauma.Networking
|
||||
public virtual void Update(float deltaTime)
|
||||
{
|
||||
#if CLIENT
|
||||
GUITextBox msgBox = (Screen.Selected == GameMain.GameScreen ? chatMsgBox : GameMain.NetLobbyScreen.TextBox);
|
||||
if (gameStarted && Screen.Selected == GameMain.GameScreen)
|
||||
{
|
||||
chatMsgBox.Visible = Character.Controlled == null || Character.Controlled.CanSpeak;
|
||||
msgBox.Visible = Character.Controlled == null || Character.Controlled.CanSpeak;
|
||||
|
||||
inGameHUD.Update(deltaTime);
|
||||
|
||||
@@ -222,22 +223,21 @@ 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) || PlayerInput.KeyHit(InputType.RadioChat)) &&
|
||||
chatMsgBox.Visible && !DebugConsole.IsOpen && GUIComponent.KeyboardDispatcher.Subscriber == null)
|
||||
if ((PlayerInput.KeyHit(InputType.Chat) || PlayerInput.KeyHit(InputType.RadioChat)) &&
|
||||
(Screen.Selected == GameMain.GameScreen && msgBox.Visible || (!DebugConsole.IsOpen && GUIComponent.KeyboardDispatcher.Subscriber == null)))
|
||||
{
|
||||
if (chatMsgBox.Selected)
|
||||
if (msgBox.Selected)
|
||||
{
|
||||
chatMsgBox.Text = "";
|
||||
chatMsgBox.Deselect();
|
||||
msgBox.Text = "";
|
||||
msgBox.Deselect();
|
||||
}
|
||||
else
|
||||
{
|
||||
chatMsgBox.Select();
|
||||
msgBox.Select();
|
||||
if (PlayerInput.KeyHit(InputType.RadioChat))
|
||||
{
|
||||
chatMsgBox.Text = "r; ";
|
||||
chatMsgBox.OnTextChanged?.Invoke(chatMsgBox, chatMsgBox.Text);
|
||||
|
||||
msgBox.Text = "r; ";
|
||||
msgBox.OnTextChanged?.Invoke(msgBox, msgBox.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user