Make MCDU Menu work properly

This commit is contained in:
Joshua Davidson 2017-05-26 13:56:32 -04:00
parent f42ced8031
commit b16ea6861d
2 changed files with 10 additions and 2 deletions

View file

@ -9,6 +9,7 @@ var MCDU_init = func {
var MCDU_reset = func { var MCDU_reset = func {
setprop("/it-autoflight/settings/togaspd", 157); setprop("/it-autoflight/settings/togaspd", 157);
setprop("/MCDU[0]/last-fmgc-page", "STATUS");
setprop("/MCDU[0]/page", "STATUS"); setprop("/MCDU[0]/page", "STATUS");
setprop("/MCDU[0]/scratchpad", ""); setprop("/MCDU[0]/scratchpad", "");
setprop("/MCDUC/flight-num", ""); setprop("/MCDUC/flight-num", "");
@ -38,7 +39,9 @@ var MCDU_reset = func {
var lskbutton = func(btn) { var lskbutton = func(btn) {
if (btn == "1") { if (btn == "1") {
if (getprop("/MCDU[0]/page") == "TO") { if (getprop("/MCDU[0]/page") == "MCDU") {
setprop("/MCDU[0]/page", getprop("/MCDU[0]/last-fmgc-page"));
} else if (getprop("/MCDU[0]/page") == "TO") {
PerfTOInput("L1"); PerfTOInput("L1");
} }
} else if (btn == "2") { } else if (btn == "2") {
@ -456,6 +459,7 @@ var pagebutton = func(btn) {
} else if (btn == "data") { } else if (btn == "data") {
setprop("/MCDU[0]/page", "DATA"); setprop("/MCDU[0]/page", "DATA");
} else if (btn == "mcdu") { } else if (btn == "mcdu") {
setprop("/MCDU[0]/last-fmgc-page", getprop("/MCDU[0]/page"));
setprop("/MCDU[0]/page", "MCDU"); setprop("/MCDU[0]/page", "MCDU");
} }
} }

View file

@ -9,6 +9,7 @@ var MCDU_init = func {
var MCDU_reset = func { var MCDU_reset = func {
setprop("/it-autoflight/settings/togaspd", 157); setprop("/it-autoflight/settings/togaspd", 157);
setprop("/MCDU[1]/last-fmgc-page", "STATUS");
setprop("/MCDU[1]/page", "STATUS"); setprop("/MCDU[1]/page", "STATUS");
setprop("/MCDU[1]/scratchpad", ""); setprop("/MCDU[1]/scratchpad", "");
setprop("/MCDUC/flight-num", ""); setprop("/MCDUC/flight-num", "");
@ -38,7 +39,9 @@ var MCDU_reset = func {
var lskbutton = func(btn) { var lskbutton = func(btn) {
if (btn == "1") { if (btn == "1") {
if (getprop("/MCDU[1]/page") == "TO") { if (getprop("/MCDU[1]/page") == "MCDU") {
setprop("/MCDU[1]/page", getprop("/MCDU[1]/last-fmgc-page"));
} else if (getprop("/MCDU[1]/page") == "TO") {
PerfTOInput("L1"); PerfTOInput("L1");
} }
} else if (btn == "2") { } else if (btn == "2") {
@ -456,6 +459,7 @@ var pagebutton = func(btn) {
} else if (btn == "data") { } else if (btn == "data") {
setprop("/MCDU[1]/page", "DATA"); setprop("/MCDU[1]/page", "DATA");
} else if (btn == "mcdu") { } else if (btn == "mcdu") {
setprop("/MCDU[1]/last-fmgc-page", getprop("/MCDU[1]/page"));
setprop("/MCDU[1]/page", "MCDU"); setprop("/MCDU[1]/page", "MCDU");
} }
} }