From 53a954d631df7d86acceeb80129e92de9bf36cd8 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sat, 21 May 2011 13:27:09 +0200 Subject: [PATCH] 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. --- src/Main/fg_commands.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 }, -- 2.39.5