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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user