Steam mod compatibility
This commit is contained in:
parent
f1f025ae9f
commit
5a81639292
|
|
@ -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));
|
||||
if (!answer) { return }
|
||||
finalEraseElement = mostSimilarElement(answer);
|
||||
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));
|
||||
if (!answer2) { return }
|
||||
finalEraseElement2 = mostSimilarElement(answer2);
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -10,26 +10,30 @@ document.addEventListener("keydown", function(e) { //replace prompt listener
|
|||
});
|
||||
|
||||
function replaceElementPrompt() {
|
||||
var fromElement = prompt("Enter the element you want to change");
|
||||
// replace spaces with underscores
|
||||
fromElement = fromElement.replace(/ /g, "_");
|
||||
fromElementS = mostSimilarElement(fromElement);
|
||||
if (fromElementS === null || fromElementS === undefined || fromElementS === "") {
|
||||
alert("Element \"" + fromElement + "\" not found! Defaulting to rock.");
|
||||
fromElementS = "rock";
|
||||
};
|
||||
|
||||
var toElement = prompt("Enter what you want to replace \"" + fromElementS + "\" with");
|
||||
// replace spaces with underscores
|
||||
toElement = toElement.replace(/ /g, "_");
|
||||
toElementS = mostSimilarElement(toElement);
|
||||
if (toElementS === null || toElementS === undefined || toElementS === "") {
|
||||
alert("Element \"" + toElement + "\" not found! Defaulting to sand.");
|
||||
toElementS = "sand";
|
||||
};
|
||||
replaceFrom = fromElementS;
|
||||
replaceTo = toElementS;
|
||||
updateReplaceDescriptions();
|
||||
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);
|
||||
if (fromElementS === null || fromElementS === undefined || fromElementS === "") {
|
||||
alert("Element \"" + fromElement + "\" not found! Defaulting to rock.");
|
||||
fromElementS = "rock";
|
||||
};
|
||||
|
||||
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);
|
||||
if (toElementS === null || toElementS === undefined || toElementS === "") {
|
||||
alert("Element \"" + toElement + "\" not found! Defaulting to sand.");
|
||||
toElementS = "sand";
|
||||
};
|
||||
replaceFrom = fromElementS;
|
||||
replaceTo = toElementS;
|
||||
updateReplaceDescriptions();
|
||||
},"Replace With")
|
||||
},"Replace Element")
|
||||
}
|
||||
|
||||
function updateReplaceDescriptions() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue