From 783256433a7a42fe8eb6803e1e86645a08481d5a Mon Sep 17 00:00:00 2001 From: mfranz Date: Fri, 24 Feb 2006 11:05:13 +0000 Subject: [PATCH] if a tutorial is running, let the '+' make the instructor repeat his last message; otherwise ATC --- Nasal/screen.nas | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/Nasal/screen.nas b/Nasal/screen.nas index a2507d60b..cc5e1cf2d 100644 --- a/Nasal/screen.nas +++ b/Nasal/screen.nas @@ -174,18 +174,28 @@ settimer(func { ############################################################################## -atc_repeat = func { - var callsign = getprop("/sim/user/callsign"); - var atc = props.globals.getNode("/sim/messages/atc", 1); - var last = atc.getValue(); - if (last == nil) { - return; +msg_repeat = func { + if (getprop("/sim/tutorial/running")) { + var last = getprop("/sim/tutorial/last-message"); + if (last == nil) { + return; + } + setprop("/sim/messages/pilot", "Say again ..."); + settimer(func { setprop("/sim/messages/copilot", last) }, 1.5); + + } else { + var callsign = getprop("/sim/user/callsign"); + var atc = props.globals.getNode("/sim/messages/atc", 1); + var last = atc.getValue(); + if (last == nil) { + return; + } + setprop("/sim/messages/pilot", "This is " ~ callsign ~ ". Say again, over."); + settimer(func { + atc.setValue("I say again:"); + atc.setValue(last) + }, 6); } - setprop("/sim/messages/pilot", "This is " ~ callsign ~ ". Say again, over."); - settimer(func { - atc.setValue("I say again:"); - atc.setValue(last) - }, 6); }