1
0
Fork 0

gui.nas: use nasal-dir-initialized signal for INIT func, so that it's

earlier available. (The settimer/1 was a workaround for another
    problem that should be fixed by now.)
globals.nas: load $FG_HOME/Nasal/ files as first settimer(0) function,
    so that it always comes after all nasal-dir-initialized callbacks

This should fix the glide_slope_tunnel/popupTip bug and makes the
startup order clearer and cleaner.
This commit is contained in:
mfranz 2008-11-11 14:54:51 +00:00
parent 804ccca250
commit d1fd61c728
2 changed files with 10 additions and 7 deletions

View file

@ -131,11 +131,11 @@ var printlog = func(level, args...) {
# Load and execute ~/.fgfs/Nasal/*.nas files in alphabetic order
# after all $FG_ROOT/Nasal/*.nas files were loaded.
#
_setlistener("/sim/signals/nasal-dir-initialized", func {
settimer(func {
var path = getprop("/sim/fg-home") ~ "/Nasal";
if((var dir = directory(path)) == nil) return;
foreach(var file; sort(dir, cmp))
if(size(file) > 4 and substr(file, -4) == ".nas")
io.load_nasal(path ~ "/" ~ file, substr(file, 0, size(file) - 4));
});
}, 0);

View file

@ -87,7 +87,7 @@ var fdm = getprop("/sim/flight-model");
var screenHProp = nil;
var tipArg = nil;
var INIT = func {
_setlistener("/sim/signals/nasal-dir-initialized", func {
screenHProp = props.globals.getNode("/sim/startup/ysize");
tipArg = props.Node.new({ "dialog-name" : "PopTip" });
@ -104,10 +104,13 @@ var INIT = func {
var fps = props.globals.getNode("/sim/rendering/fps-display", 1);
setlistener(fps, fpsDisplay, 1);
setlistener("/sim/startup/xsize",
func { if (fps.getValue()) { fpsDisplay(0); fpsDisplay(1) } });
}
settimer(INIT, 1);
setlistener("/sim/startup/xsize", func {
if (fps.getValue()) {
fpsDisplay(0);
fpsDisplay(1);
}
});
});
##