Example #1
0
 public override void Start()
 {
     base.Start();
     this.musicManagerPlay = new MusicManagerPlay();
     if (Find.GameInitData != null && !Find.GameInitData.gameToLoad.NullOrEmpty())
     {
         LongEventHandler.QueueLongEvent(delegate
         {
             SavedGameLoader.LoadGameFromSaveFile(Find.GameInitData.gameToLoad);
         }, "LoadingLongEvent", true, new Action <Exception>(GameAndMapInitExceptionHandlers.ErrorWhileLoadingGame));
     }
     else
     {
         LongEventHandler.QueueLongEvent(delegate
         {
             if (Current.Game == null)
             {
                 Root_Play.SetupForQuickTestPlay();
             }
             Current.Game.InitNewGame();
         }, "GeneratingMap", true, new Action <Exception>(GameAndMapInitExceptionHandlers.ErrorWhileGeneratingMap));
     }
     LongEventHandler.QueueLongEvent(delegate
     {
         ScreenFader.SetColor(Color.black);
         ScreenFader.StartFade(Color.clear, 0.5f);
     }, null, false, null);
 }
Example #2
0
 private static void <Start> m__1()
 {
     if (Current.Game == null)
     {
         Root_Play.SetupForQuickTestPlay();
     }
     Current.Game.InitNewGame();
 }
Example #3
0
 public override void Start()
 {
     Log.ResetMessageCount();
     base.Start();
     try
     {
         this.musicManagerPlay = new MusicManagerPlay();
         FileInfo autostart = (!Root.checkedAutostartSaveFile) ? SaveGameFilesUtility.GetAutostartSaveFile() : null;
         Root.checkedAutostartSaveFile = true;
         if (autostart != null)
         {
             LongEventHandler.QueueLongEvent(delegate
             {
                 SavedGameLoaderNow.LoadGameFromSaveFileNow(Path.GetFileNameWithoutExtension(autostart.Name));
             }, "LoadingLongEvent", true, new Action <Exception>(GameAndMapInitExceptionHandlers.ErrorWhileLoadingGame));
         }
         else if (Find.GameInitData != null && !Find.GameInitData.gameToLoad.NullOrEmpty())
         {
             LongEventHandler.QueueLongEvent(delegate
             {
                 SavedGameLoaderNow.LoadGameFromSaveFileNow(Find.GameInitData.gameToLoad);
             }, "LoadingLongEvent", true, new Action <Exception>(GameAndMapInitExceptionHandlers.ErrorWhileLoadingGame));
         }
         else
         {
             LongEventHandler.QueueLongEvent(delegate
             {
                 if (Current.Game == null)
                 {
                     Root_Play.SetupForQuickTestPlay();
                 }
                 Current.Game.InitNewGame();
             }, "GeneratingMap", true, new Action <Exception>(GameAndMapInitExceptionHandlers.ErrorWhileGeneratingMap));
         }
         LongEventHandler.QueueLongEvent(delegate
         {
             ScreenFader.SetColor(Color.black);
             ScreenFader.StartFade(Color.clear, 0.5f);
         }, null, false, null);
     }
     catch (Exception arg)
     {
         Log.Error("Critical error in root Start(): " + arg, false);
     }
 }
Example #4
0
 public static void Notify_LoadedSceneChanged()
 {
     cameraInt = GameObject.Find("Camera").GetComponent <Camera>();
     if (GenScene.InEntryScene)
     {
         ProgramState    = ProgramState.Entry;
         rootEntryInt    = GameObject.Find("GameRoot").GetComponent <Root_Entry>();
         rootPlayInt     = null;
         rootInt         = rootEntryInt;
         cameraDriverInt = null;
         //colorCorrectionCurvesInt = null;
     }
     else if (GenScene.InPlayScene)
     {
         ProgramState    = ProgramState.MapInitializing;
         rootEntryInt    = null;
         rootPlayInt     = GameObject.Find("GameRoot").GetComponent <Root_Play>();
         rootInt         = rootPlayInt;
         cameraDriverInt = cameraInt.GetComponent <CameraDriver>();
         //colorCorrectionCurvesInt = cameraInt.GetComponent<ColorCorrectionCurves>();
         subcameraDriverInt = GameObject.Find("Subcameras").GetComponent <SubcameraDriver>();
     }
 }
Example #5
0
 public override void Start()
 {
     Log.ResetMessageCount();
     base.Start();
     try
     {
         this.musicManagerPlay = new MusicManagerPlay();
         FileInfo autostart = (!Root.checkedAutostartSaveFile) ? SaveGameFilesUtility.GetAutostartSaveFile() : null;
         Root.checkedAutostartSaveFile = true;
         if (autostart != null)
         {
             Action action = delegate()
             {
                 SavedGameLoaderNow.LoadGameFromSaveFileNow(Path.GetFileNameWithoutExtension(autostart.Name));
             };
             string textKey          = "LoadingLongEvent";
             bool   doAsynchronously = true;
             if (Root_Play.< > f__mg$cache0 == null)
             {
                 Root_Play.< > f__mg$cache0 = new Action <Exception>(GameAndMapInitExceptionHandlers.ErrorWhileLoadingGame);
             }
             LongEventHandler.QueueLongEvent(action, textKey, doAsynchronously, Root_Play.< > f__mg$cache0);
         }
         else if (Find.GameInitData != null && !Find.GameInitData.gameToLoad.NullOrEmpty())
         {
             Action action2 = delegate()
             {
                 SavedGameLoaderNow.LoadGameFromSaveFileNow(Find.GameInitData.gameToLoad);
             };
             string textKey2          = "LoadingLongEvent";
             bool   doAsynchronously2 = true;
             if (Root_Play.< > f__mg$cache1 == null)
             {
                 Root_Play.< > f__mg$cache1 = new Action <Exception>(GameAndMapInitExceptionHandlers.ErrorWhileLoadingGame);
             }
             LongEventHandler.QueueLongEvent(action2, textKey2, doAsynchronously2, Root_Play.< > f__mg$cache1);
         }
         else
         {
             Action action3 = delegate()
             {
                 if (Current.Game == null)
                 {
                     Root_Play.SetupForQuickTestPlay();
                 }
                 Current.Game.InitNewGame();
             };
             string textKey3          = "GeneratingMap";
             bool   doAsynchronously3 = true;
             if (Root_Play.< > f__mg$cache2 == null)
             {
                 Root_Play.< > f__mg$cache2 = new Action <Exception>(GameAndMapInitExceptionHandlers.ErrorWhileGeneratingMap);
             }
             LongEventHandler.QueueLongEvent(action3, textKey3, doAsynchronously3, Root_Play.< > f__mg$cache2);
         }
         LongEventHandler.QueueLongEvent(delegate()
         {
             ScreenFader.SetColor(Color.black);
             ScreenFader.StartFade(Color.clear, 0.5f);
         }, null, false, null);
     }
     catch (Exception arg)
     {
         Log.Error("Critical error in root Start(): " + arg, false);
     }
 }