fgdata changes for HUD cycling
This commit is contained in:
parent
506baed845
commit
4bb602c2f1
3 changed files with 18 additions and 6 deletions
|
@ -1034,9 +1034,15 @@ var HUD = {
|
|||
init: func {
|
||||
me.vis1N = props.globals.getNode("/sim/hud/visibility[1]", 1);
|
||||
me.currcolN = props.globals.getNode("/sim/hud/current-color", 1);
|
||||
me.currentPathN = props.globals.getNode("/sim/hud/current-path", 1);
|
||||
me.hudN = props.globals.getNode("/sim/hud", 1);
|
||||
me.paletteN = props.globals.getNode("/sim/hud/palette", 1);
|
||||
me.brightnessN = props.globals.getNode("/sim/hud/color/brightness", 1);
|
||||
me.currentN = me.vis1N;
|
||||
|
||||
# keep compatibility with earlier version of FG - hud/path[1] is
|
||||
# the default Hud
|
||||
me.currentPathN.setIntValue(1);
|
||||
},
|
||||
cycle_color: func { # h-key
|
||||
if (!me.currentN.getBoolValue()) # if off, turn on
|
||||
|
@ -1057,10 +1063,16 @@ var HUD = {
|
|||
me.brightnessN.setValue(br > 0.01 ? br : 1);
|
||||
},
|
||||
normal_type: func { # i-key
|
||||
|
||||
me.currentPathN.setIntValue(1);
|
||||
},
|
||||
cycle_type: func { # I-key
|
||||
|
||||
var i = me.currentPathN.getValue() + 1;
|
||||
if (i < 1 or i > size(me.hudN.getChildren("path"))) {
|
||||
# back to the start
|
||||
me.currentPathN.setIntValue(1);
|
||||
} else {
|
||||
me.currentPathN.setIntValue(i);
|
||||
}
|
||||
},
|
||||
is_active: func {
|
||||
me.vis1N.getValue();
|
||||
|
|
|
@ -685,7 +685,6 @@ top down before the key bindings are parsed.
|
|||
</binding>
|
||||
</key>
|
||||
|
||||
<!-- no longer used
|
||||
<key n="73">
|
||||
<name>I</name>
|
||||
<desc>Switch to and toggle alternative HUD types</desc>
|
||||
|
@ -693,7 +692,7 @@ top down before the key bindings are parsed.
|
|||
<command>nasal</command>
|
||||
<script>aircraft.HUD.cycle_type()</script>
|
||||
</binding>
|
||||
</key> -->
|
||||
</key>
|
||||
|
||||
<key n="77">
|
||||
<name>M</name>
|
||||
|
@ -908,7 +907,6 @@ top down before the key bindings are parsed.
|
|||
</binding>
|
||||
</key>
|
||||
|
||||
<!-- no longer used
|
||||
<key n="105">
|
||||
<name>i</name>
|
||||
<desc>Normal HUD</desc>
|
||||
|
@ -917,7 +915,6 @@ top down before the key bindings are parsed.
|
|||
<script>aircraft.HUD.normal_type()</script>
|
||||
</binding>
|
||||
</key>
|
||||
-->
|
||||
|
||||
<key n="106">
|
||||
<name>j</name>
|
||||
|
|
|
@ -327,6 +327,9 @@ Started September 2000 by David Megginson, david@megginson.com
|
|||
</panel_2>
|
||||
<hud>
|
||||
<path n="1">Huds/default.xml</path>
|
||||
<path n="2">Huds/NTPS.xml</path>
|
||||
<path n="3">Huds/minimal.xml</path>
|
||||
|
||||
<!-- new HUD -->
|
||||
<visibility n="1"
|
||||
type="bool">false</visibility>
|
||||
|
|
Loading…
Reference in a new issue