Closes the chat window after disconnect and prevents opening it again. Fixes #3420.

This was SVN commit r17315.
This commit is contained in:
elexis 2015-11-29 00:51:00 +00:00
parent 7de746cc58
commit d39810df7d
2 changed files with 13 additions and 0 deletions

View file

@ -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");

View file

@ -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.");