function changeChat(){
    // This should only be false if a lobby has not been opened before
    chat_exists = true;
    // Then check if this is valid, since we wouldn't want to restore undefined.
    if(!lobbyBypass) { // This is a fix for spectating Ranked before having entered a lobby
        if(!settings || (!inRanked() && lobby.settings.roomSize > 1)){
            restoreChat();
            return;
        }
    }
    // Check if it has a value already, to prevent entering a solo room twice in one session from breaking the chat
    old_gcC_css = old_gcC_css ? old_gcC_css : getOldStyles(Object.keys(gcC_css));
    // unbind all listeners
    gameChat._newMessageListner.unbindListener();
    gameChat._newSpectatorListner.unbindListener();
    gameChat._spectatorLeftListner.unbindListener();
    gameChat._playerLeaveListner.unbindListener();
    gameChat._spectatorChangeToPlayer.unbindListener();
    gameChat._newQueueEntryListener.unbindListener();
    gameChat._playerLeftQueueListener.unbindListener();
    gameChat._hostPromotionListner.unbindListener();
    gameChat._playerNameChangeListner.unbindListener();
    gameChat._spectatorNameChangeListner.unbindListener();
    gameChat._deletePlayerMessagesListener.unbindListener();
    gameChat._deleteChatMessageListener.unbindListener();
    // If you join another game, we gotta restore the chat
    switchGameListener.bindListener();
    // For the complete delete mode
    if(settings.getItem("NoChatMode") ? settings.getItem("NoChatMode") == "true" : false){
        noChatMode();
    }
    // In any other case
    else {
        // Apply the CSS and hide the chat
        $("#gcContent").css(gcC_css);
    }
    // And always remove the input box
    $("#gcChatContent").css("display", "none");
}
/*
 * Function that actually replaces the chatbox with an image.
 * Loads in the last saved settings, or the default if nothing was set.
 */
Function that actually replaces the chatbox with an image.
Loads in the last saved settings, or the default if nothing was set.
Function that actually replaces the chatbox with an image . Loads in the last saved settings or the default if nothing was set .
function changeChat(){
    chat_exists = true;
    if(!lobbyBypass) { 
        if(!settings || (!inRanked() && lobby.settings.roomSize > 1)){
            restoreChat();
            return;
        }
    }
    old_gcC_css = old_gcC_css ? old_gcC_css : getOldStyles(Object.keys(gcC_css));
    gameChat._newMessageListner.unbindListener();
    gameChat._newSpectatorListner.unbindListener();
    gameChat._spectatorLeftListner.unbindListener();
    gameChat._playerLeaveListner.unbindListener();
    gameChat._spectatorChangeToPlayer.unbindListener();
    gameChat._newQueueEntryListener.unbindListener();
    gameChat._playerLeftQueueListener.unbindListener();
    gameChat._hostPromotionListner.unbindListener();
    gameChat._playerNameChangeListner.unbindListener();
    gameChat._spectatorNameChangeListner.unbindListener();
    gameChat._deletePlayerMessagesListener.unbindListener();
    gameChat._deleteChatMessageListener.unbindListener();
    switchGameListener.bindListener();
    if(settings.getItem("NoChatMode") ? settings.getItem("NoChatMode") == "true" : false){
        noChatMode();
    }
    else {
        $("#gcContent").css(gcC_css);
    }
    $("#gcChatContent").css("display", "none");
}
function changeChat ( ) { chat_exists = true ; if ( ! lobbyBypass ) { if ( ! settings || ( ! inRanked ( ) && lobby . settings . roomSize > 1 ) ) { restoreChat ( ) ; return ; } } old_gcC_css = old_gcC_css ? old_gcC_css : getOldStyles ( Object . keys ( gcC_css ) ) ; gameChat . _newMessageListner . unbindListener ( ) ; gameChat . _newSpectatorListner . unbindListener ( ) ; gameChat . _spectatorLeftListner . unbindListener ( ) ; gameChat . _playerLeaveListner . unbindListener ( ) ; gameChat . _spectatorChangeToPlayer . unbindListener ( ) ; gameChat . _newQueueEntryListener . unbindListener ( ) ; gameChat . _playerLeftQueueListener . unbindListener ( ) ; gameChat . _hostPromotionListner . unbindListener ( ) ; gameChat . _playerNameChangeListner . unbindListener ( ) ; gameChat . _spectatorNameChangeListner . unbindListener ( ) ; gameChat . _deletePlayerMessagesListener . unbindListener ( ) ; gameChat . _deleteChatMessageListener . unbindListener ( ) ; switchGameListener . bindListener ( ) ; if ( settings . getItem ( "NoChatMode" ) ? settings . getItem ( "NoChatMode" ) == "true" : false ) { noChatMode ( ) ; } else { $ ( "#gcContent" ) . css ( gcC_css ) ; } $ ( "#gcChatContent" ) . css ( "display" , "none" ) ; }
Function that actually replaces the chatbox with an image.
Function that actually replaces the chatbox with an image .
// This should only be false if a lobby has not been opened before // Then check if this is valid, since we wouldn't want to restore undefined. // This is a fix for spectating Ranked before having entered a lobby // Check if it has a value already, to prevent entering a solo room twice in one session from breaking the chat // unbind all listeners // If you join another game, we gotta restore the chat // For the complete delete mode // In any other case // Apply the CSS and hide the chat // And always remove the input box