From b16ea6861dc213a7c4ad13cb418852b47fe077d0 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Fri, 26 May 2017 13:56:32 -0400 Subject: [PATCH] Make MCDU Menu work properly --- Nasal/MCDU1.nas | 6 +++++- Nasal/MCDU2.nas | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Nasal/MCDU1.nas b/Nasal/MCDU1.nas index 09b3500b..6ea1fbbb 100644 --- a/Nasal/MCDU1.nas +++ b/Nasal/MCDU1.nas @@ -9,6 +9,7 @@ var MCDU_init = func { var MCDU_reset = func { setprop("/it-autoflight/settings/togaspd", 157); + setprop("/MCDU[0]/last-fmgc-page", "STATUS"); setprop("/MCDU[0]/page", "STATUS"); setprop("/MCDU[0]/scratchpad", ""); setprop("/MCDUC/flight-num", ""); @@ -38,7 +39,9 @@ var MCDU_reset = func { var lskbutton = func(btn) { 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"); } } else if (btn == "2") { @@ -456,6 +459,7 @@ var pagebutton = func(btn) { } else if (btn == "data") { setprop("/MCDU[0]/page", "DATA"); } else if (btn == "mcdu") { + setprop("/MCDU[0]/last-fmgc-page", getprop("/MCDU[0]/page")); setprop("/MCDU[0]/page", "MCDU"); } } diff --git a/Nasal/MCDU2.nas b/Nasal/MCDU2.nas index 101dd16b..05215ba6 100644 --- a/Nasal/MCDU2.nas +++ b/Nasal/MCDU2.nas @@ -9,6 +9,7 @@ var MCDU_init = func { var MCDU_reset = func { setprop("/it-autoflight/settings/togaspd", 157); + setprop("/MCDU[1]/last-fmgc-page", "STATUS"); setprop("/MCDU[1]/page", "STATUS"); setprop("/MCDU[1]/scratchpad", ""); setprop("/MCDUC/flight-num", ""); @@ -38,7 +39,9 @@ var MCDU_reset = func { var lskbutton = func(btn) { 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"); } } else if (btn == "2") { @@ -456,6 +459,7 @@ var pagebutton = func(btn) { } else if (btn == "data") { setprop("/MCDU[1]/page", "DATA"); } else if (btn == "mcdu") { + setprop("/MCDU[1]/last-fmgc-page", getprop("/MCDU[1]/page")); setprop("/MCDU[1]/page", "MCDU"); } }