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