element eraser

This commit is contained in:
SquareScreamYT 2024-03-09 10:48:51 +08:00 committed by GitHub
parent 22b009f7d2
commit 7f2c3d8858
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 0 deletions

19
mods/elementEraser.js Normal file
View File

@ -0,0 +1,19 @@
// made by SquareScreamYT/sqec
let finalEraseElement = null;
elements.element_eraser = {
color: "#eeeeee",
onSelect: function() {
var answer = prompt("Please input the element you wish to delete. It will not work if you enter multiple element types while paused.",(finalEraseElement||undefined));
if (!answer) { return }
finalEraseElement = mostSimilarElement(answer);
},
tool: function(pixel) {
if (pixel.element === finalEraseElement) {
deletePixel(pixel.x,pixel.y)
}
},
category: "tools",
excludeRandom: true,
desc: "Input a element to erase only that element."
}