From e21476ac5914633496908875e9a5d95c9ca075d2 Mon Sep 17 00:00:00 2001 From: SquareScreamYT <134925668+SquareScreamYT@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:43:05 +0800 Subject: [PATCH] exclusive eraser --- mods/elementEraser.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mods/elementEraser.js b/mods/elementEraser.js index 5505fa7a..c2c5ceef 100644 --- a/mods/elementEraser.js +++ b/mods/elementEraser.js @@ -15,5 +15,22 @@ elements.element_eraser = { }, category: "tools", excludeRandom: true, - desc: "Input a element to erase only that element." + desc: "Use on pixels to delete specified element." +} +let finalEraseElement2 = null; +elements.exclusive_element_eraser = { + color: "#eeeeee", + onSelect: function() { + var answer = prompt("Please input the element you do not wish to delete. It will not work if you enter multiple element types while paused.",(finalEraseElement2||undefined)); + if (!answer2) { return } + finalEraseElement2 = mostSimilarElement(answer2); + }, + tool: function(pixel) { + if (pixel.element != finalEraseElement2) { + deletePixel(pixel.x,pixel.y) + } + }, + category: "tools", + excludeRandom: true, + desc: "Use on pixels to delete any element except the specified element." }