1
0
Fork 0

screen.nas: now *really* do the runway report quietly

startup.nas: cosmetics
This commit is contained in:
mfranz 2007-10-10 09:58:22 +00:00
parent c50aa8d817
commit 520fff1c1e
2 changed files with 8 additions and 9 deletions

View file

@ -229,7 +229,7 @@ var msg_repeat = func {
var atc = nil;
var callsign = nil;
var atclast = nil;
var last_launchbar = nil;
var launchbar = nil;
var listener = {};
_setlistener("/sim/signals/nasal-dir-initialized", func {
@ -253,15 +253,15 @@ _setlistener("/sim/signals/nasal-dir-initialized", func {
return;
if ((var agl = getprop("/position/altitude-agl-ft")) != nil and agl > 100)
return;
atc.setValue("You are on runway " ~ rwy);
screen.log.write("You are on runway " ~ rwy, 0.7, 1.0, 0.7);
}, 1);
}, 5);
setlistener("/gear/launchbar/state", func {
var e = cmdarg().getValue();
if (e != last_launchbar and e == "Engaged")
if (e != launchbar and e == "Engaged")
setprop("/sim/messages/copilot", "Engaged!");
last_launchbar = e;
launchbar = e;
});
# map ATC messages to the screen log and to the voice subsystem

View file

@ -1,10 +1,7 @@
var metar_runway = func {
# select runway according to wind direction reported by METAR
var set_runway_from_metar_wind = func {
if (!getprop("/environment/metar/real-metar"))
return printlog("info", "metar-rwy: no live weather");
if (getprop("/environment/metar/base-wind-speed-kt") < 1)
return; # windspeed pointless for runway choice
if (!getprop("/sim/startup/options/airport"))
return printlog("info", "metar-rwy: no airport requested");
if (getprop("/sim/startup/options/runway"))
@ -13,6 +10,8 @@ var metar_runway = func {
return printlog("info", "metar-rwy: won't override explicit heading");
if (!getprop("/sim/presets/onground"))
return printlog("info", "metar-rwy: we aren't on ground");
if (getprop("/environment/metar/base-wind-speed-kt") < 1)
return;
var from = getprop("/environment/metar/base-wind-range-from");
var to = getprop("/environment/metar/base-wind-range-to");
@ -28,6 +27,6 @@ var metar_runway = func {
_setlistener("/sim/signals/nasal-dir-initialized", func {
metar_runway();
set_runway_from_metar_wind();
delete(globals, "startup");
});