Alt+Insert to Render Less

Allows users to use the key combination Alt+Insert to disable less essential rendering.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Alt+Insert to Render Less
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Allows users to use the key combination Alt+Insert to disable less essential rendering.
// @author       MTP3
// @match        *://manyland.com/*
// @icon         http://manyland.com/favicon.ico
// ==/UserScript==

function main() {
	entityTypesToMessWith = [
		"EntityDecoanim", "EntityDecotch", "EntityFurry", "EntityDecobig", "EntityDecovbig",
		"EntityDynathing", "EntityFarback", "EntityDeadPlayer",
		"EntityDust", "EntityRemovedust", "EntityFootdust", "EntityJumpdust",
		"EntityVignette", "EntityLiquidDrop", "EntitySparkle", "EntitySpot",
		"EntityBigDust", "EntityBackgroundBlock", "EntityCrumbleBlock"
	];

	renderingStuff = true;
	tmpfuncs = {};

	ig.input.bind(ig.KEY.ALT, "alt");

	document.addEventListener('keyup', (e) => {
		if (ig.input.state("alt") && e.key == "Insert")
		{
			if (renderingStuff)
			{
				for (let [_, typename] of Object.entries(entityTypesToMessWith))
				{
					tmpfuncs[typename] = unsafeWindow[typename].prototype.draw;
					unsafeWindow[typename].prototype.draw = () => {};
				}
			}
			else
			{
				for (let [_, typename] of Object.entries(entityTypesToMessWith))
					unsafeWindow[typename].prototype.draw = tmpfuncs[typename];
			}

			renderingStuff = !renderingStuff;
		}
	});
};

(() => {
	interval = setInterval(() => {
		if (ig === undefined) return;
		if (ig.input === undefined) return;

		clearInterval(interval);
		main();
	}, 50);
})();