Example #1
0
        public static void Load(LoadMode mode = LoadMode.NewGame)
        {
            HelpersExtensions.VERBOSE = false;
            Log.Info("LifeCycle.Load() called");
            CSURUtil.Init();
            HarmonyExtension.InstallHarmony();
            NodeControllerTool.Create();
            if (Settings.GameConfig == null)
            {
                switch (mode)
                {
                case LoadMode.NewGameFromScenario:
                case LoadMode.LoadScenario:
                case LoadMode.LoadMap:
                    // no NC or old NC
                    Settings.GameConfig = GameConfigT.LoadGameDefault;
                    break;

                default:
                    Settings.GameConfig = GameConfigT.NewGameDefault;
                    break;
                }
            }

            NodeManager.Instance.OnLoad();
            SegmentEndManager.Instance.OnLoad();
        }
Example #2
0
        public static void SimulationDataReady()
        {
            Log.Info($"LifeCycle.SimulationDataReady() called. mode={Mode} updateMode={UpdateMode}, scene={Scene}");
            System.Threading.Thread.Sleep(1000 * 50); //50 sec
            Log.Info($"LifeCycle.SimulationDataReady() after sleep");

            if (Scene == "ThemeEditor")
            {
                return;
            }
            CSURUtil.Init();
            if (Settings.GameConfig == null)
            {
                switch (Mode)
                {
                case LoadMode.NewGameFromScenario:
                case LoadMode.LoadScenario:
                case LoadMode.LoadMap:
                    // no NC or old NC
                    Settings.GameConfig = GameConfigT.LoadGameDefault;
                    break;

                default:
                    Settings.GameConfig = GameConfigT.NewGameDefault;
                    break;
                }
            }

            HarmonyUtil.InstallHarmony(HARMONY_ID); // game config is checked in patch.

            NodeManager.Instance.OnLoad();
            SegmentEndManager.Instance.OnLoad();
            Loaded = true;
            Log.Info("LifeCycle.SimulationDataReady() sucessful");
        }