1
0
Fork 0

Message feedback when changing sim speed-up.

This commit is contained in:
James Turner 2013-03-16 12:46:40 +00:00
parent e740b916d3
commit 29438e1e7d
2 changed files with 29 additions and 16 deletions

View file

@ -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);

View file

@ -653,12 +653,10 @@ top down before the key bindings are parsed.
<key n="65"> <key n="65">
<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> </binding>
<step type="double">-1</step>
</binding>
</key> </key>
<key n="66"> <key n="66">
@ -853,12 +851,10 @@ top down before the key bindings are parsed.
<key n="97"> <key n="97">
<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> </binding>
<step type="double">1</step>
</binding>
</key> </key>
<key n="98"> <key n="98">