#include <string>
#include <simgear/structure/exception.hxx>
+#include <simgear/structure/commands.hxx>
+
#include <simgear/misc/sg_path.hxx>
#include <simgear/props/props.hxx>
#include <simgear/props/props_io.hxx>
return true;
}
}
+
+void syncPausePopupState()
+{
+ bool paused = fgGetBool("/sim/freeze/master",true) | fgGetBool("/sim/freeze/clock",true);
+ SGPropertyNode_ptr args(new SGPropertyNode);
+ args->setStringValue("id", "sim-pause");
+ if (paused && fgGetBool("/sim/view-name-popup")) {
+ args->setStringValue("label", "Simulation is paused");
+ globals->get_commands()->execute("show-message", args);
+ } else {
+ globals->get_commands()->execute("clear-message", args);
+ }
+
+}
extern void helpCb();
+/// synchronize /sim/freeze properties with visiblity
+/// of the popup-dialog which informs the user
+void syncPausePopupState();
+
typedef struct {
const char *name;
void (*fn)();
fgSetBool("/sim/freeze/clock",!paused);
}
- SGPropertyNode_ptr args(new SGPropertyNode);
- args->setStringValue("id", "sim-pause");
- if (!paused && fgGetBool("/sim/view-name-popup")) {
- args->setStringValue("label", "Simulation is paused");
- globals->get_commands()->execute("show-message", args);
- } else {
- globals->get_commands()->execute("clear-message", args);
- }
-
+ syncPausePopupState();
return true;
}
#include <Scenery/scenery.hxx>
#include <Scenery/redout.hxx>
#include <GUI/new_gui.hxx>
+#include <GUI/gui.h>
+
#include <Instrumentation/HUD/HUD.hxx>
#include <Environment/precipitation_mgr.hxx>
#include <Environment/environment_mgr.hxx>
sAlpha -= SGMiscd::max(0.0,delay_time/fade_time);
FGScenerySwitchCallback::scenery_enabled = (sAlpha<1.0);
_splash_alpha->setDoubleValue((sAlpha < 0) ? 0.0 : sAlpha);
+
+ syncPausePopupState();
}
FGLight *l = static_cast<FGLight*>(globals->get_subsystem("lighting"));