function initSettingsWindow(){
    //create the window. Inspired by TheJoseph98's amqScriptInfo.js, which can be found in the @require link up top.
    if (!window.setupDocumentDone) return;

    // If it's not set yet, create the object in localStorage using the defaults. Hail persistence!
    !settings.getItem("SoloChatBlock") ? localStorage.setItem("SoloChatBlock", JSON.stringify(gcC_css_default)) : null;
    // Load in whatever the last saved ssettings were, or the defaults if we just set them
    gcC_css = JSON.parse(settings.getItem("SoloChatBlock"));

    // If it doesn't exist, create the entire modal window without the relevant content. THIS IS HELL
    // Adding content is done in a seperate function call to allow for easy fixing when "Cancel" is pressed
    if ($("#soloChatBlock").length === 0) {
        $("#gameContainer").append($(`
            <div class="modal fade" id="soloChatBlock" tabindex="-1" role="dialog">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="cancel" id='x-to-cancel'>
                                <span aria-hidden="true">x</span>
                            </button>
                            <h2 class="modal-title">Solo Chat Block Configuration</h2>
                            <p style='text-align: center; font-style: italic;'>Changes are applied as preview, click 'Cancel' to undo them.<br />Exiting without clicking cancel leaves the preview as-is.</p>
                        </div>
                        <div class="modal-body" style="overflow-y: auto; max-height: calc(83vh - 150px);">
                            <div style='text-align: center;'>
                                <h2 style='display: inline-block;'>Block Ranked Chat?</h2>
                                <div class='customCheckbox' style='margin-left: 2vw;'>
                                    <input type='checkbox' id='mhKillRankedChat'${settings.getItem("BlockRankedChat") ? settings.getItem("BlockRankedChat") == "true" ? " checked=''" : null : settings.setItem("BlockRankedChat", false)} />
                                    <label for='mhKillRankedChat'><i class="fa fa-check" aria-hidden="true"></i></label>
                                </div>
                                <p style='font-style: italic;'>Changing this applies immediately. Re-enter ranked to trigger.</p>
                            </div>
                            <div style='text-align: center;'>
                                <h2 style='display: inline-block;'>No Chat Mode?</h2>
                                <div class='customCheckbox' style='margin-left: 2vw;'>
                                    <input type='checkbox' id='mhNoChatMode'${settings.getItem("NoChatMode") ? settings.getItem("NoChatMode") == "true" ? " checked=''" : null : settings.setItem("NoChatMode", false)} />
                                    <label for='mhNoChatMode'><i class="fa fa-check" aria-hidden="true"></i></label>
                                </div>
                                <p style='font-style: italic;'>Changing this applies immediately. Deletes chat completely.</p>
                            </div>
                            <div id="scbcContainer" style='text-align: center;'>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button id="scbcCancel" class="btn btn-default" type="button" data-dismiss="modal">Cancel</button>
                            <button id="scbcSave" class="btn btn-primary" type="button" data-dismiss="modal">Save</button>
                        </div>
                    </div>
                </div>
            </div>
        `));

        // Add the menu option
        $("#optionsContainer > ul").prepend($(`
            <li id='SoloChatBlockOptionsMenuItem' class="clickAble" data-toggle="modal" data-target="#soloChatBlock">Solo Chat Block</li>
        `));

        // Add the event for turning it on/off for Ranked
        $("#mhKillRankedChat").change(function(){
            // If the setting doesn't exist, or it's false, set it to true. If it's true, set it to false. Double inline if because these are much faster than if{if...else}...else
            settings.getItem("BlockRankedChat") ? settings.getItem("BlockRankedChat") == "true" ? settings.setItem("BlockRankedChat", false) : settings.setItem("BlockRankedChat", true) : settings.setItem("BlockRankedChat", true);
        });

        // Rig up for No Chat Mode
        $("#mhNoChatMode").change(function(){
            settings.getItem("NoChatMode") ? settings.getItem("NoChatMode") == "true" ? settings.setItem("NoChatMode", false) : settings.setItem("NoChatMode", true) : settings.setItem("NoChatMode", false)
            // Alternate between on and off
            NCM_restore ? undoNCM() : noChatMode();
        });

        // Fill up the modal with the configuration options
        addSettingsContent();

        // They clicked "Cancel"! Remove everything we added and create it from scratch. Don't forget to restore shit!
        // The cancel and save buttons are static, so their events should only be assigned an action once
        $("#scbcCancel").click(function(){
            // Put the CSS back to the last saved state
            $("#gcContent").css(gcC_css);
            // Make sure NOTHING remains since we'll be creating everything from scratch
            $("#scbcContainer").empty();
            // And fill it up again, since it's less work to paste HTML than to traverse it
            addSettingsContent();
        });

        // This is the worst case scenario. Someone doesn't like Laevateinn and wants to change the image.
        $("#scbcSave").click(updateSettings);
    }
}
/*
 * Function that runs once to create the settings window and add it to the game.
 * Adds an entry to the settings slide-out to customize options. Use it while in a lobby to see live changes.
 * Click save to save the settings, close the window to undo them.
 * Initializes some starting data as well.
 */
Function that runs once to create the settings window and add it to the game.
Adds an entry to the settings slide-out to customize options. Use it while in a lobby to see live changes.
Click save to save the settings, close the window to undo them.
Initializes some starting data as well.
Function that runs once to create the settings window and add it to the game . Adds an entry to the settings slide - out to customize options . Use it while in a lobby to see live changes . Click save to save the settings close the window to undo them . Initializes some starting data as well .
function initSettingsWindow(){
    if (!window.setupDocumentDone) return;
    !settings.getItem("SoloChatBlock") ? localStorage.setItem("SoloChatBlock", JSON.stringify(gcC_css_default)) : null;
    gcC_css = JSON.parse(settings.getItem("SoloChatBlock"));
    if ($("#soloChatBlock").length === 0) {
        $("#gameContainer").append($(`
            <div class="modal fade" id="soloChatBlock" tabindex="-1" role="dialog">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="cancel" id='x-to-cancel'>
                                <span aria-hidden="true">x</span>
                            </button>
                            <h2 class="modal-title">Solo Chat Block Configuration</h2>
                            <p style='text-align: center; font-style: italic;'>Changes are applied as preview, click 'Cancel' to undo them.<br />Exiting without clicking cancel leaves the preview as-is.</p>
                        </div>
                        <div class="modal-body" style="overflow-y: auto; max-height: calc(83vh - 150px);">
                            <div style='text-align: center;'>
                                <h2 style='display: inline-block;'>Block Ranked Chat?</h2>
                                <div class='customCheckbox' style='margin-left: 2vw;'>
                                    <input type='checkbox' id='mhKillRankedChat'${settings.getItem("BlockRankedChat") ? settings.getItem("BlockRankedChat") == "true" ? " checked=''" : null : settings.setItem("BlockRankedChat", false)} />
                                    <label for='mhKillRankedChat'><i class="fa fa-check" aria-hidden="true"></i></label>
                                </div>
                                <p style='font-style: italic;'>Changing this applies immediately. Re-enter ranked to trigger.</p>
                            </div>
                            <div style='text-align: center;'>
                                <h2 style='display: inline-block;'>No Chat Mode?</h2>
                                <div class='customCheckbox' style='margin-left: 2vw;'>
                                    <input type='checkbox' id='mhNoChatMode'${settings.getItem("NoChatMode") ? settings.getItem("NoChatMode") == "true" ? " checked=''" : null : settings.setItem("NoChatMode", false)} />
                                    <label for='mhNoChatMode'><i class="fa fa-check" aria-hidden="true"></i></label>
                                </div>
                                <p style='font-style: italic;'>Changing this applies immediately. Deletes chat completely.</p>
                            </div>
                            <div id="scbcContainer" style='text-align: center;'>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button id="scbcCancel" class="btn btn-default" type="button" data-dismiss="modal">Cancel</button>
                            <button id="scbcSave" class="btn btn-primary" type="button" data-dismiss="modal">Save</button>
                        </div>
                    </div>
                </div>
            </div>
        `));
        $("#optionsContainer > ul").prepend($(`
            <li id='SoloChatBlockOptionsMenuItem' class="clickAble" data-toggle="modal" data-target="#soloChatBlock">Solo Chat Block</li>
        `));
        $("#mhKillRankedChat").change(function(){
            settings.getItem("BlockRankedChat") ? settings.getItem("BlockRankedChat") == "true" ? settings.setItem("BlockRankedChat", false) : settings.setItem("BlockRankedChat", true) : settings.setItem("BlockRankedChat", true);
        });
        $("#mhNoChatMode").change(function(){
            settings.getItem("NoChatMode") ? settings.getItem("NoChatMode") == "true" ? settings.setItem("NoChatMode", false) : settings.setItem("NoChatMode", true) : settings.setItem("NoChatMode", false)
            NCM_restore ? undoNCM() : noChatMode();
        });
        addSettingsContent();
        $("#scbcCancel").click(function(){
            $("#gcContent").css(gcC_css);
            $("#scbcContainer").empty();
            addSettingsContent();
        });
        $("#scbcSave").click(updateSettings);
    }
}
function initSettingsWindow ( ) { if ( ! window . setupDocumentDone ) return ; ! settings . getItem ( "SoloChatBlock" ) ? localStorage . setItem ( "SoloChatBlock" , JSON . stringify ( gcC_css_default ) ) : null ; gcC_css = JSON . parse ( settings . getItem ( "SoloChatBlock" ) ) ; if ( $ ( "#soloChatBlock" ) . length === 0 ) { $ ( "#gameContainer" ) . append ( $ ( ` ${ settings . getItem ( "BlockRankedChat" ) ? settings . getItem ( "BlockRankedChat" ) == "true" ? " checked=''" : null : settings . setItem ( "BlockRankedChat" , false ) } ${ settings . getItem ( "NoChatMode" ) ? settings . getItem ( "NoChatMode" ) == "true" ? " checked=''" : null : settings . setItem ( "NoChatMode" , false ) } ` ) ) ; $ ( "#optionsContainer > ul" ) . prepend ( $ ( ` ` ) ) ; $ ( "#mhKillRankedChat" ) . change ( function ( ) { settings . getItem ( "BlockRankedChat" ) ? settings . getItem ( "BlockRankedChat" ) == "true" ? settings . setItem ( "BlockRankedChat" , false ) : settings . setItem ( "BlockRankedChat" , true ) : settings . setItem ( "BlockRankedChat" , true ) ; } ) ; $ ( "#mhNoChatMode" ) . change ( function ( ) { settings . getItem ( "NoChatMode" ) ? settings . getItem ( "NoChatMode" ) == "true" ? settings . setItem ( "NoChatMode" , false ) : settings . setItem ( "NoChatMode" , true ) : settings . setItem ( "NoChatMode" , false ) NCM_restore ? undoNCM ( ) : noChatMode ( ) ; } ) ; addSettingsContent ( ) ; $ ( "#scbcCancel" ) . click ( function ( ) { $ ( "#gcContent" ) . css ( gcC_css ) ; $ ( "#scbcContainer" ) . empty ( ) ; addSettingsContent ( ) ; } ) ; $ ( "#scbcSave" ) . click ( updateSettings ) ; } }
Function that runs once to create the settings window and add it to the game.
Function that runs once to create the settings window and add it to the game .
//create the window. Inspired by TheJoseph98's amqScriptInfo.js, which can be found in the @require link up top. // If it's not set yet, create the object in localStorage using the defaults. Hail persistence! // Load in whatever the last saved ssettings were, or the defaults if we just set them // If it doesn't exist, create the entire modal window without the relevant content. THIS IS HELL // Adding content is done in a seperate function call to allow for easy fixing when "Cancel" is pressed // Add the menu option // Add the event for turning it on/off for Ranked // If the setting doesn't exist, or it's false, set it to true. If it's true, set it to false. Double inline if because these are much faster than if{if...else}...else // Rig up for No Chat Mode // Alternate between on and off // Fill up the modal with the configuration options // They clicked "Cancel"! Remove everything we added and create it from scratch. Don't forget to restore shit! // The cancel and save buttons are static, so their events should only be assigned an action once // Put the CSS back to the last saved state // Make sure NOTHING remains since we'll be creating everything from scratch // And fill it up again, since it's less work to paste HTML than to traverse it // This is the worst case scenario. Someone doesn't like Laevateinn and wants to change the image.