drawaria custom-range mod

drawaria custom-range mod!

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         drawaria custom-range mod
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  drawaria custom-range mod!
// @author       YouTube
// @match        https://drawaria.online/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=drawaria.online
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Función para ajustar los valores del control deslizante
    function setRangeValues() {
        const rangeInput = document.getElementById('drawwidthrange');
        if (rangeInput) {
            rangeInput.min = '-1999';
            rangeInput.max = '-1999';
            rangeInput.value = '-1999';
        }
    }

    // Forzar los valores iniciales
    setRangeValues();

    // Observar cambios en el DOM para asegurarse de que los valores se mantengan
    const observer = new MutationObserver(() => {
        setRangeValues();
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });

    // Asegurarse de que los valores se mantengan incluso si el juego intenta cambiarlos
    const originalSetAttribute = Element.prototype.setAttribute;
    Element.prototype.setAttribute = function(name, value) {
        if (this.id === 'drawwidthrange' && (name === 'min' || name === 'max' || name === 'value')) {
            value = '-1999';
        }
        originalSetAttribute.call(this, name, value);
    };

    // Asegurarse de que los elementos de control de dibujo sean visibles
    function ensureControlsVisible() {
        const controls = document.querySelectorAll('#drawcontrols .drawcontrols-button');
        controls.forEach(control => {
            control.style.display = 'initial';
        });
    }

    // Hacer que los controles sean visibles inicialmente
    ensureControlsVisible();

    // Observar cambios en el DOM para asegurarse de que los controles se mantengan visibles
    const controlsObserver = new MutationObserver(() => {
        ensureControlsVisible();
    });

    controlsObserver.observe(document.body, {
        childList: true,
        subtree: true
    });
})();