]> git.mxchange.org Git - flightgear.git/commitdiff
New "pause" fgcommand.
authorThorstenB <brehmt@gmail.com>
Sat, 21 May 2011 11:27:09 +0000 (13:27 +0200)
committerThorstenB <brehmt@gmail.com>
Sat, 21 May 2011 11:27:09 +0000 (13:27 +0200)
Original property-rules in keyboard.xml toggled master and clock freeze
independently - which caused issues when only one property was true. New
command toggles both properties consistently.

src/Main/fg_commands.cxx

index 45d4b901b5a14f39974ef458547e57763b21f3b8..672065f45a2d0e69339ea0568d2b74789c0e1e95 100644 (file)
@@ -314,6 +314,15 @@ do_resume (const SGPropertyNode * arg)
 
 #endif
 
+static bool
+do_pause (const SGPropertyNode * arg)
+{
+    bool paused = fgGetBool("/sim/freeze/master",true);
+    fgSetBool("/sim/freeze/master",!paused);
+    fgSetBool("/sim/freeze/clock",!paused);
+    if (fgGetBool("/sim/freeze/replay-state",false))
+        fgSetBool("/sim/replay/disable",true);
+}
 
 /**
  * Built-in command: load flight.
@@ -1432,6 +1441,7 @@ static struct {
     { "reinit", do_reinit },
     { "suspend", do_reinit },
     { "resume", do_reinit },
+    { "pause", do_pause },
     { "load", do_load },
     { "save", do_save },
     { "panel-load", do_panel_load },