DFProfiler Always Open Cell Map

Always open the cell mapview on DFProfiler without having it to be a boss cell

Από την 04/11/2023. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         DFProfiler Always Open Cell Map
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Always open the cell mapview on DFProfiler without having it to be a boss cell
// @author       Runonstof
// @match        https://s2.dfprofiler.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=dfprofiler.com
// @grant        unsafeWindow
// @license MIT
// ==/UserScript==

function runon_openMap() {
    function e(t, e) { $("#mission-info").html("<img src='https://deadfrontier.info/map/Fairview_" + t + "x" + e + ".png' alt='MAP FAILED TO LOAD' />"), $("#mission-holder").show() }

    window.addEventListener('click', function(event) {
        console.log(event.target);

        if(event.target.classList.contains('coord')) {
            event.preventDefault();
            const x = event.target.classList[1].replace('x', '');
            const y = event.target.classList[2].replace('y', '');
            e(x, y);
        }
    });
}

(function() {
    'use strict';
    function ready(fn) {
        if (document.readyState !== 'loading') {
          fn();
        } else {
          document.addEventListener('DOMContentLoaded', fn);
        }
    }
    function withPage(NAMED_FunctionToRun) {
        //--- Use named functions for clarity and debugging...
        var funcText = NAMED_FunctionToRun.toString ();
        var funcName = funcText.replace (/^function\s+(\w+)\s*\((.|\n|\r)+$/, "$1");
        var script = document.createElement ("script");
        script.textContent = funcText + "\n\n";
        script.textContent += 'jQuery(document).ready(function() {'+funcName+'(jQuery);});';
        document.body.appendChild (script);
    }

    withPage(runon_openMap);
})();