initialize view manager at nasal-dir-initialized sig (was: fdm-initialized)
This commit is contained in:
parent
14e88cef3b
commit
a13361766b
1 changed files with 8 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue