Ticket #3396: clearChat.patch

File clearChat.patch, 1.8 KB (added by ruiRanger, 8 years ago)
  • binaries/data/mods/public/gui/common/network.js

     
    8484        if (!Engine.KickPlayer(argument, true))
    8585            addChatMessage({ "type": "system", "text": sprintf(translate("Could not ban %(name)s."), { "name": argument }) });
    8686        return true;
     87    case "/clear":
     88        clearChatMessages();
     89        return true;
    8790    }
    8891    return false;
    8992}
  • binaries/data/mods/public/gui/gamesetup/gamesetup.js

     
    17511751    Engine.SendNetworkChat(text);
    17521752}
    17531753
     1754function clearChatMessages(){
     1755    g_ChatMessages.length = 0;
     1756    Engine.GetGUIObjectByName("chatText").caption = g_ChatMessages.join("\n");
     1757}
     1758
    17541759function addChatMessage(msg)
    17551760{
    17561761    var username = "";
  • binaries/data/mods/public/gui/lobby/lobby.js

     
    688688    case "quit":
    689689        returnToMainMenu();
    690690        break;
     691    case "clear":
     692        clearChatMessages();
     693        break;
    691694    case "say":
    692695    case "me":
    693696        return false;
     
    701704}
    702705
    703706/**
     707 * Blank the chat history
     708 */
     709function clearChatMessages(){
     710    g_ChatMessages.length = 0;
     711    Engine.GetGUIObjectByName("chatText").caption = g_ChatMessages.join("\n");
     712}
     713
     714/**
    704715 * Process and if appropriate, display a formatted message.
    705716 *
    706717 * @param msg {Object} - The message to be processed.