]> git.mxchange.org Git - flightgear.git/commitdiff
Non-sticky scenarios, simpler UX for everyone.
authorJames Turner <zakalawe@mac.com>
Fri, 5 Apr 2013 16:20:22 +0000 (17:20 +0100)
committerJames Turner <zakalawe@mac.com>
Fri, 5 Apr 2013 16:20:22 +0000 (17:20 +0100)
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
src/Main/options.cxx

index 8652641f9ff445cbf220f91f06b416ee6f7d2b21..8ded9204b1803574f7b1e0ecefd25a34a6c3c17d 100644 (file)
@@ -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);
     }
     
index 8e3e6845491001a1f7cd9beef3a4bdcb24109079..cbc1c2fecb4b6da2d147127802f01df612d9c37e 100644 (file)
@@ -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},