Commit b8e83af3 authored by SherryChaos's avatar SherryChaos

new send button for chat

parent 5825fcb2
This diff is collapsed.
...@@ -544,8 +544,10 @@ namespace MDPro3 ...@@ -544,8 +544,10 @@ namespace MDPro3
chainCondition = ChainCondition.No; chainCondition = ChainCondition.No;
OnTiming(); OnTiming();
} }
if (Input.GetKeyDown(KeyCode.Return) if ((Input.GetKeyDown(KeyCode.Return)
|| Input.GetKeyDown(KeyCode.KeypadEnter)) || Input.GetKeyDown(KeyCode.KeypadEnter))
&& (!Program.I().room.chatInput.isFocused
|| Program.I().room.chatInput.text == string.Empty))
{ {
ToChat(); ToChat();
} }
...@@ -1540,8 +1542,8 @@ namespace MDPro3 ...@@ -1540,8 +1542,8 @@ namespace MDPro3
var length_of_message = r.BaseStream.Length; var length_of_message = r.BaseStream.Length;
BinaryMaster binaryMaster; BinaryMaster binaryMaster;
List<string> selections; List<string> selections;
if ((GameMessage)p.Function != GameMessage.UpdateData) //if ((GameMessage)p.Function != GameMessage.UpdateData)
Debug.Log("----------" + (GameMessage)p.Function); // Debug.Log("----------" + (GameMessage)p.Function);
//else //else
// Debug.Log("----------" + (GameMessage)p.Function); // Debug.Log("----------" + (GameMessage)p.Function);
switch ((GameMessage)p.Function) switch ((GameMessage)p.Function)
......
...@@ -110,6 +110,7 @@ namespace MDPro3 ...@@ -110,6 +110,7 @@ namespace MDPro3
roomPlayers.Add(player2); roomPlayers.Add(player2);
roomPlayers.Add(player3); roomPlayers.Add(player3);
} }
public bool chatOn; public bool chatOn;
public bool chatSwitching; public bool chatSwitching;
public void SwitchChat(float moveTime) public void SwitchChat(float moveTime)
...@@ -342,20 +343,22 @@ namespace MDPro3 ...@@ -342,20 +343,22 @@ namespace MDPro3
TcpHelper.CtosMessage_Response(buffer); TcpHelper.CtosMessage_Response(buffer);
} }
public void OnSubmit(string chat)
{
if (chat != string.Empty)
TcpHelper.CtosMessage_Chat(chat);
}
public void OnChat(string content) public void OnChat(string content)
{ {
if (content == string.Empty) if (content == string.Empty)
return; return;
OnSubmit(content); TcpHelper.CtosMessage_Chat(content);
chatInput.text = string.Empty; chatInput.text = string.Empty;
} }
public void OnSend()
{
if (chatInput.text == string.Empty)
return;
AudioManager.PlaySE("SE_MENU_DECIDE");
OnChat(chatInput.text);
}
public void OnToDuel() public void OnToDuel()
{ {
TcpHelper.CtosMessage_HsToDuelist(); TcpHelper.CtosMessage_HsToDuelist();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment