Steam mod compatibility

This commit is contained in:
slweeb 2025-08-27 19:49:45 -04:00
parent f1f025ae9f
commit 5a81639292
2 changed files with 34 additions and 26 deletions

View File

@ -4,9 +4,11 @@ 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));
promptInput("Please input the element you wish to delete. It will not work if you enter multiple element types while paused.", (answer) => {
// 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);
}, "Delete Element")
},
tool: function(pixel) {
if (pixel.element === finalEraseElement) {
@ -21,9 +23,11 @@ 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));
promptInput("Please input the element you do not wish to delete. It will not work if you enter multiple element types while paused.", (answer2) => {
// var answer2 = 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);
}, "Don't Delete")
},
tool: function(pixel) {
if (pixel.element != finalEraseElement2) {

View File

@ -10,7 +10,8 @@ document.addEventListener("keydown", function(e) { //replace prompt listener
});
function replaceElementPrompt() {
var fromElement = prompt("Enter the element you want to change");
promptInput("Enter the element you want to change", (fromElement) => {
// var fromElement = prompt("Enter the element you want to change");
// replace spaces with underscores
fromElement = fromElement.replace(/ /g, "_");
fromElementS = mostSimilarElement(fromElement);
@ -19,7 +20,8 @@ function replaceElementPrompt() {
fromElementS = "rock";
};
var toElement = prompt("Enter what you want to replace \"" + fromElementS + "\" with");
promptInput("Enter what you want to replace \"" + fromElementS + "\" with", (toElement) => {
// var toElement = prompt("Enter what you want to replace \"" + fromElementS + "\" with");
// replace spaces with underscores
toElement = toElement.replace(/ /g, "_");
toElementS = mostSimilarElement(toElement);
@ -30,6 +32,8 @@ function replaceElementPrompt() {
replaceFrom = fromElementS;
replaceTo = toElementS;
updateReplaceDescriptions();
},"Replace With")
},"Replace Element")
}
function updateReplaceDescriptions() {