Alt+Insert to Render Less

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();