drawaria custom-range mod

drawaria custom-range mod!

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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
    });
})();