1
0
forked from mirrors/0ad

Add a chat-command to clear all messages. Works for lobby, gamesetup and session. Patch by ruiRanger, fixes #3396.

This was SVN commit r17465.
This commit is contained in:
elexis
2015-12-14 03:12:26 +00:00
parent f776e06044
commit 6e80288d30
3 changed files with 13 additions and 0 deletions
@@ -230,3 +230,9 @@ function autoCompleteNick(guiName, playerList)
input.caption = newText + text.substring(bufferPosition);
input.buffer_position = bufferPosition + (newText.length - textTillBufferPosition.length);
}
function clearChatMessages()
{
g_ChatMessages.length = 0;
Engine.GetGUIObjectByName("chatText").caption = "";
}
@@ -84,6 +84,10 @@ function executeNetworkCommand(input)
if (!Engine.KickPlayer(argument, true))
addChatMessage({ "type": "system", "text": sprintf(translate("Could not ban %(name)s."), { "name": argument }) });
return true;
case "/clear":
clearChatMessages();
return true;
}
return false;
}
@@ -688,6 +688,9 @@ function handleSpecialCommand(text)
case "quit":
returnToMainMenu();
break;
case "clear":
clearChatMessages();
break;
case "say":
case "me":
return false;