Nasal/view.nas: Allow view to be changed by setting /sim/current-view/view-number-raw.
This avoids problems when/if new default views numbers (between 0 and 99) are added.
This commit is contained in:
parent
4b4410becf
commit
768e11d0a6
1 changed files with 14 additions and 0 deletions
|
@ -942,6 +942,20 @@ setlistener("/sim/current-view/view-number", func(n) {
|
|||
current = views[index = n.getValue()];
|
||||
}, 1);
|
||||
|
||||
# Allow view changes by setting view-number-raw - avoids problems when/if we
|
||||
# add new default views (between 0 and 99).
|
||||
#
|
||||
setlistener("/sim/current-view/view-number-raw", func(n) {
|
||||
var index = n.getValue();
|
||||
forindex (var i; views) {
|
||||
if (views[i].getIndex() == index) {
|
||||
props.globals.getNode("/sim/current-view/view-number", 1).setValue(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
printf("Failed to find view-number-raw=%s", index);
|
||||
}, 1);
|
||||
|
||||
props.globals.initNode("/position/altitude-agl-ft"); # needed by Fly-By View
|
||||
screenWidthCompens.init();
|
||||
manager.init();
|
||||
|
|
Loading…
Reference in a new issue