use aircraft.HUD manager methods to control the HUD. Key bindings remain
the same, with one exception: I (=Shift-i) doesn't only switch to the alternative old HUD, but toggles that and the new HUD. Eventually we may want to re-organize the HUD key bindings. Maybe after the old HUD has been removed?
This commit is contained in:
parent
8ecfdb2a96
commit
c8abca597e
1 changed files with 6 additions and 21 deletions
27
keyboard.xml
27
keyboard.xml
|
@ -568,12 +568,7 @@ calculated by adding 256 to the GLUT key value in glut.h.
|
||||||
<desc>Cycle HUD Brightness</desc>
|
<desc>Cycle HUD Brightness</desc>
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>aircraft.HUD.cycle_brightness()</script>
|
||||||
if (getprop("/sim/hud/visibility")) {
|
|
||||||
var br = getprop("/sim/hud/color/brightness") - 0.2;
|
|
||||||
setprop("/sim/hud/color/brightness", br > 0.01 ? br : 1);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</binding>
|
</binding>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
@ -581,7 +576,8 @@ calculated by adding 256 to the GLUT key value in glut.h.
|
||||||
<name>I</name>
|
<name>I</name>
|
||||||
<desc>Minimal HUD</desc>
|
<desc>Minimal HUD</desc>
|
||||||
<binding>
|
<binding>
|
||||||
<command>hud-init2</command>
|
<command>nasal</command>
|
||||||
|
<script>aircraft.HUD.cycle_type()</script>
|
||||||
</binding>
|
</binding>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
@ -760,19 +756,7 @@ calculated by adding 256 to the GLUT key value in glut.h.
|
||||||
<desc>HUD Master Switch</desc>
|
<desc>HUD Master Switch</desc>
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>aircraft.HUD.cycle_color()</script>
|
||||||
if (!getprop("/sim/hud/visibility")) {
|
|
||||||
return setprop("/sim/hud/visibility", 1);
|
|
||||||
}
|
|
||||||
var i = getprop("/sim/hud/current-color") + 1;
|
|
||||||
if (i < 0 or i >= size(props.globals.getNode("/sim/hud/palette", 1).getChildren("color"))) {
|
|
||||||
setprop("/sim/hud/visibility", 0);
|
|
||||||
setprop("/sim/hud/current-color", 0);
|
|
||||||
} else {
|
|
||||||
setprop("/sim/hud/visibility", 1);
|
|
||||||
setprop("/sim/hud/current-color", i);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</binding>
|
</binding>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
@ -780,7 +764,8 @@ calculated by adding 256 to the GLUT key value in glut.h.
|
||||||
<name>i</name>
|
<name>i</name>
|
||||||
<desc>Normal HUD</desc>
|
<desc>Normal HUD</desc>
|
||||||
<binding>
|
<binding>
|
||||||
<command>hud-init</command>
|
<command>nasal</command>
|
||||||
|
<script>aircraft.HUD.normal_type()</script>
|
||||||
</binding>
|
</binding>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue