Exemple #1
0
 private static void InitiateQuickstart()
 {
     if (!quickstartPending)
     {
         return;
     }
     quickstartPending = false;
     statusBox         = null;
     try {
         if (Settings.OperationMode == QuickstartSettings.QuickstartMode.Disabled)
         {
             return;
         }
         CheckForErrorsAndWarnings();
         if (Settings.OperationMode == QuickstartSettings.QuickstartMode.GenerateMap)
         {
             if (GenCommandLine.CommandLineArgPassed("quicktest"))
             {
                 // vanilla QuickStarter will change the scene, only set up scenario and map size injection
                 PrepareMapGeneration();
             }
             else
             {
                 InitateMapGeneration();
             }
         }
         else if (Settings.OperationMode == QuickstartSettings.QuickstartMode.LoadMap)
         {
             InitateSaveLoading();
         }
     } catch (WarningException e) {
         HugsLibController.Logger.Error("Quickstart aborted: " + e.Message);
     }
 }
Exemple #2
0
        private static void PrepareQuickstart()
        {
            if (Settings.OperationMode != QuickstartSettings.QuickstartMode.Disabled)
            {
                quickstartPending         = true;
                statusBox                 = new QuickstartStatusBox(GetStatusBoxOperation(Settings));
                statusBox.AbortRequested += StatusBoxAbortRequestedHandler;
            }

            QuickstartStatusBox.IOperationMessageProvider GetStatusBoxOperation(QuickstartSettings settings)
            {
                switch (settings.OperationMode)
                {
                case QuickstartSettings.QuickstartMode.LoadMap:
                    return(new QuickstartStatusBox.LoadSaveOperation(GetSaveNameToLoad() ?? string.Empty));

                case QuickstartSettings.QuickstartMode.GenerateMap:
                    return(new QuickstartStatusBox.GenerateMapOperation(
                               settings.ScenarioToGen, settings.MapSizeToGen));

                default:
                    throw new ArgumentOutOfRangeException("Unhandled operation mode: " + settings.OperationMode);
                }
            }
        }