mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
Closes the chat window after disconnect and prevents opening it again. Fixes #3420.
This was SVN commit r17315.
This commit is contained in:
parent
7de746cc58
commit
d39810df7d
2 changed files with 13 additions and 0 deletions
|
|
@ -209,6 +209,12 @@ function openOptions()
|
|||
|
||||
function openChat()
|
||||
{
|
||||
if (g_Disconnected)
|
||||
{
|
||||
closeChat();
|
||||
return;
|
||||
}
|
||||
|
||||
updateTeamCheckbox(false);
|
||||
|
||||
Engine.GetGUIObjectByName("chatInput").focus(); // Grant focus to the input area
|
||||
|
|
@ -232,6 +238,12 @@ function updateTeamCheckbox(check)
|
|||
|
||||
function toggleChatWindow(teamChat)
|
||||
{
|
||||
if (g_Disconnected)
|
||||
{
|
||||
closeChat();
|
||||
return;
|
||||
}
|
||||
|
||||
var chatWindow = Engine.GetGUIObjectByName("chatDialogPanel");
|
||||
var chatInput = Engine.GetGUIObjectByName("chatInput");
|
||||
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ function handleNetMessage(message)
|
|||
break;
|
||||
case "disconnected":
|
||||
g_Disconnected = true;
|
||||
closeChat();
|
||||
// Translation: States the reason why the client disconnected from the server.
|
||||
let reason = sprintf(translate("Reason: %(reason)s."), { "reason": getDisconnectReason(message.reason) });
|
||||
obj.caption = translate("Connection to the server has been lost.") + "\n" + reason + "\n" + translate("The game has ended.");
|
||||
|
|
|
|||
Loading…
Reference in a new issue