From: ThorstenB Date: Sat, 21 May 2011 11:27:09 +0000 (+0200) Subject: New "pause" fgcommand. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=53a954d631df7d86acceeb80129e92de9bf36cd8;p=flightgear.git New "pause" fgcommand. 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. --- diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index 45d4b901b..672065f45 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -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 },