diff --git a/Nasal/globals.nas b/Nasal/globals.nas index d6604ccb5..9a3d5a3b4 100644 --- a/Nasal/globals.nas +++ b/Nasal/globals.nas @@ -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); diff --git a/Nasal/gui.nas b/Nasal/gui.nas index 00d4ab084..03257c376 100644 --- a/Nasal/gui.nas +++ b/Nasal/gui.nas @@ -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); + } + }); +}); ##