1
0
Fork 0

Only allow ovfy once

This commit is contained in:
Jonathan Redpath 2022-01-13 21:33:12 +00:00
parent f3e17d126c
commit 1f44ce74c6

View file

@ -1528,11 +1528,18 @@ var button = func(btn, i, event = "") {
if (right(mcdu_scratchpad.scratchpads[i].scratchpad, 1) == "-") {
mcdu_scratchpad.scratchpads[i].clear();
mcdu_scratchpad.scratchpads[i].addChar("+");
} else if (right(mcdu_scratchpad.scratchpads[i].scratchpad, 1) == "+") {
mcdu_scratchpad.scratchpads[i].clear();
mcdu_scratchpad.scratchpads[i].addChar("-");
} else {
mcdu_scratchpad.scratchpads[i].addChar("-");
}
} else if (btn == "OVFY") {
mcdu_scratchpad.scratchpads[i].addChar("@");
if (mcdu_scratchpad.scratchpads[i].scratchpad == "") {
mcdu_scratchpad.scratchpads[i].addChar("@");
} else {
mcdu_message(i, "NOT ALLOWED");
}
} else {
mcdu_scratchpad.scratchpads[i].addChar(btn);
}