mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-20 14:58:29 +00:00
send chat on Enter
This commit is contained in:
parent
030726add0
commit
5ed306d137
1 changed files with 10 additions and 0 deletions
|
@ -33,7 +33,17 @@ namespace SanAndreasUnity.UI
|
|||
|
||||
rect.xMin -= this.textInputWidth;
|
||||
rect.xMax -= buttonSize.x + 15;
|
||||
GUI.SetNextControlName("chat_text_input");
|
||||
m_chatText = GUI.TextField(rect, m_chatText, 100);
|
||||
if (Event.current.isKey && GUI.GetNameOfFocusedControl () == "chat_text_input")
|
||||
{
|
||||
if (Event.current.keyCode == KeyCode.Return)
|
||||
{
|
||||
// enter pressed
|
||||
Chat.ChatManager.SendChatMessageToAllPlayersAsLocalPlayer(m_chatText);
|
||||
m_chatText = "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue