mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
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:
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue