Message feedback when changing sim speed-up.
This commit is contained in:
parent
e740b916d3
commit
29438e1e7d
2 changed files with 29 additions and 16 deletions
|
@ -513,6 +513,16 @@ var speedup = func(speed_up)
|
||||||
t = (t < 32) ? t*2 : 32;
|
t = (t < 32) ? t*2 : 32;
|
||||||
}
|
}
|
||||||
setprop("/sim/speed-up", t);
|
setprop("/sim/speed-up", t);
|
||||||
|
|
||||||
|
# reformat as a string, this is borrowed from replay.xml
|
||||||
|
|
||||||
|
if (t<0.9)
|
||||||
|
{
|
||||||
|
t=1/t; # invert the value
|
||||||
|
t = "1/" ~ t; # convert to a string and show inverted
|
||||||
|
}
|
||||||
|
|
||||||
|
gui.popupTip("Time speed-up: " ~ t ~ "x");
|
||||||
}
|
}
|
||||||
|
|
||||||
# mouse-mode handling
|
# mouse-mode handling
|
||||||
|
@ -540,11 +550,18 @@ var cycleMouseMode = func(node)
|
||||||
if (getprop('/sim/view-name-popup') == 0)
|
if (getprop('/sim/view-name-popup') == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mode == 1) {
|
if (mode == 0) {
|
||||||
setprop("/sim/messages/copilot", "Mouse is controlling flight controls. Press TAB to change.");
|
fgcommand("clear-message", props.Node.new({ "id":"mouse-mode" }));
|
||||||
} elsif (mode == 2) {
|
return;
|
||||||
setprop("/sim/messages/copilot","Mouse is controlling view direction. Press TAB to change.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var msg = "";
|
||||||
|
if (mode == 1)
|
||||||
|
msg = "Mouse is controlling flight controls. Press TAB to change.";
|
||||||
|
else
|
||||||
|
msg = "Mouse is controlling view direction. Press TAB to change.";
|
||||||
|
|
||||||
|
fgcommand("show-message", props.Node.new({ "label": msg, "id":"mouse-mode" }));
|
||||||
}
|
}
|
||||||
|
|
||||||
addcommand("cycle-mouse-mode", cycleMouseMode);
|
addcommand("cycle-mouse-mode", cycleMouseMode);
|
||||||
|
|
12
keyboard.xml
12
keyboard.xml
|
@ -654,10 +654,8 @@ top down before the key bindings are parsed.
|
||||||
<name>A</name>
|
<name>A</name>
|
||||||
<desc>Decrease speed-up</desc>
|
<desc>Decrease speed-up</desc>
|
||||||
<binding>
|
<binding>
|
||||||
<command>property-adjust</command>
|
<command>nasal</command>
|
||||||
<property>/sim/speed-up</property>
|
<script>controls.speedup(-1);</script>
|
||||||
<min>1</min>
|
|
||||||
<step type="double">-1</step>
|
|
||||||
</binding>
|
</binding>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
@ -854,10 +852,8 @@ top down before the key bindings are parsed.
|
||||||
<name>a</name>
|
<name>a</name>
|
||||||
<desc>Increase speed-up</desc>
|
<desc>Increase speed-up</desc>
|
||||||
<binding>
|
<binding>
|
||||||
<command>property-adjust</command>
|
<command>nasal</command>
|
||||||
<property>/sim/speed-up</property>
|
<script>controls.speedup(1);</script>
|
||||||
<min>1</min>
|
|
||||||
<step type="double">1</step>
|
|
||||||
</binding>
|
</binding>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue