From 85bfd27af273175b1a6e13642b2bc6bc30c11408 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 5 Apr 2013 17:20:22 +0100 Subject: [PATCH] Non-sticky scenarios, simpler UX for everyone. If you want a scenario in a particular session of the sim, ask for it on the command line / config files, or enable in the GUI. Note if you had previously 'sticky' scenarios in your autosave.xml, you will still get them until you clean your autosave, or disable them in the GUI. --- src/AIModel/AIManager.cxx | 7 ++----- src/Main/options.cxx | 11 ----------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/AIModel/AIManager.cxx b/src/AIModel/AIManager.cxx index 8652641f9..8ded9204b 100644 --- a/src/AIModel/AIManager.cxx +++ b/src/AIModel/AIManager.cxx @@ -135,12 +135,10 @@ FGAIManager::init() { } void -FGAIManager::postinit() { +FGAIManager::postinit() +{ // postinit, so that it can access the Nasal subsystem - if (!root->getBoolValue("scenarios-enabled", true)) - return; - // scenarios enabled, AI subsystem required if (!enabled->getBoolValue()) enabled->setBoolValue(true); @@ -325,7 +323,6 @@ bool FGAIManager::loadScenarioCommand(const SGPropertyNode* args) for (; root->hasChild("scenario", index); ++index) {} SGPropertyNode* scenarioNode = root->getChild("scenario", index, true); - scenarioNode->setAttribute(SGPropertyNode::USERARCHIVE, true); scenarioNode->setStringValue(name); } diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 8e3e68454..cbc1c2fec 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1146,16 +1146,6 @@ fgOptScenario( const char *arg ) } SGPropertyNode_ptr scenario = ai_node->getNode( "scenario", index + 1, true ); scenario->setStringValue( arg ); - ai_node->setBoolValue( "scenarios-enabled", true ); - return FG_OPTIONS_OK; -} - -static int -fgOptNoScenarios( const char *arg ) -{ - SGPropertyNode_ptr ai_node = fgGetNode( "/sim/ai", true ); - ai_node->removeChildren("scenario",false); - ai_node->setBoolValue( "scenarios-enabled", false ); return FG_OPTIONS_OK; } @@ -1506,7 +1496,6 @@ struct OptionDesc { {"min-status", true, OPTION_STRING, "/sim/aircraft-min-status", false, "all", 0 }, {"livery", true, OPTION_FUNC, "", false, "", fgOptLivery }, {"ai-scenario", true, OPTION_FUNC | OPTION_MULTI, "", false, "", fgOptScenario }, - {"disable-ai-scenarios", false, OPTION_FUNC, "", false, "", fgOptNoScenarios}, {"parking-id", true, OPTION_FUNC, "", false, "", fgOptParking }, {"version", false, OPTION_FUNC, "", false, "", fgOptVersion }, {"enable-fpe", false, OPTION_IGNORE, "", false, "", 0},