From a13361766b678f6523a2809e84452d0e724e5ade Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 27 May 2009 16:24:17 +0000 Subject: [PATCH] initialize view manager at nasal-dir-initialized sig (was: fdm-initialized) --- Nasal/view.nas | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Nasal/view.nas b/Nasal/view.nas index 40fec9105..3a89d5125 100644 --- a/Nasal/view.nas +++ b/Nasal/view.nas @@ -422,6 +422,9 @@ var pilot_view_limiter = { me.enable_xoffset = me.right.xoffset_max > 0.001 or me.left.xoffset_max > 0.001; }, update : func { + if (getprop("/devices/status/keyboard/ctrl")) + return; + var hdg = normdeg(me.hdgN.getValue()); if (abs(me.last_hdg - hdg) > 180) # avoid wrap-around skips me.hdgN.setDoubleValue(hdg = me.last_hdg); @@ -613,6 +616,11 @@ _setlistener("/sim/signals/nasal-dir-initialized", func { setlistener("/sim/current-view/view-number", func(n) { current = views[index = n.getValue()]; }, 1); + + props.globals.initNode("/position/altitude-agl-ft"); # needed by Fly-By View + manager.init(); + manager.register("Fly-By View", fly_by_view_handler); + manager.register("Model View", model_view_handler); }); @@ -635,10 +643,6 @@ _setlistener("/sim/signals/fdm-initialized", func { } } - manager.init(); - manager.register("Fly-By View", fly_by_view_handler); - manager.register("Model View", model_view_handler); - forindex (var i; views) { var limits = views[i].getNode("config/limits/enabled"); if (limits != nil) {