1
0
Fork 0

OVFY and PLUSMINUS

This commit is contained in:
Jonathan Redpath 2022-01-25 09:51:59 +00:00
parent 35fa1ff224
commit 7201e89498

View file

@ -1534,17 +1534,16 @@ var button = func(btn, i, event = "") {
} else if (btn == "DOT") {
mcdu_scratchpad.scratchpads[i].addChar(".");
} else if (btn == "PLUSMINUS") {
if (right(mcdu_scratchpad.scratchpads[i].scratchpad, 1) == "-") {
var _toggle = right(scratchpad,1);
if (_toggle == "+" or _toggle == "-") {
_toggle = (_toggle == "-") ? "+" : "-";
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("-");
mcdu_scratchpad.scratchpads[i].addChar(_toggle);
} else {
mcdu_scratchpad.scratchpads[i].addChar("-");
}
} else if (btn == "OVFY") {
if (mcdu_scratchpad.scratchpads[i].scratchpad == "") {
if (size(scratchpad) == 0) {
mcdu_scratchpad.scratchpads[i].addChar("@");
} else {
mcdu_message(i, "NOT ALLOWED");