Ticket #3396: clearChat_v3.patch

File clearChat_v3.patch, 1.5 KB (added by ruiRanger, 8 years ago)

clear Chat without hotkeys and clearChatMessages function not duplicated

  • binaries/data/mods/public/gui/common/functions_utility.js

     
    230230    input.caption = newText + text.substring(bufferPosition);
    231231    input.buffer_position = bufferPosition + (newText.length - textTillBufferPosition.length);
    232232}
     233
     234function clearChatMessages()
     235{
     236    g_ChatMessages.length = 0;
     237    Engine.GetGUIObjectByName("chatText").caption = "";
     238}
  • 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/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;