示例#1
0
        public override void OnLevelLoaded(LoadMode mode)
        {
            base.OnLevelLoaded(mode);
            if (mode != LoadMode.NewGame && mode != LoadMode.NewGameFromScenario && mode != LoadMode.LoadGame)
            {
                return;
            }
            Detours.Deploy();
            SimulationManager.instance.AddAction(() => Object.FindObjectOfType <RenderProperties>().m_edgeFogDistance = 2800f);
            SimulationManager.instance.AddAction(() => Object.FindObjectOfType <FogEffect>().m_edgeFogDistance        = 2800f);
            SimulationManager.instance.AddAction(() => Object.FindObjectOfType <FogProperties>().m_EdgeFogDistance    = 2800f);
            if (Util.IsModActive(Mod.ALL_TILES_START_MOD))
            {
                UIView.library.ShowModal <ExceptionPanel>("ExceptionPanel").SetMessage(
                    "81 Tiles - Incompatible mod detected",
                    $"'81 Tiles' isn't compatible with 'All Tile Start' mod!\nPlease unsubscribe that mod and use '{Mod.UNLOCK_ALL_TILES_FOR_FREE}' button in '81 Tiles' options entry!",
                    false);
            }
            SimulationManager.instance.AddAction(FixNotInIndustryAreaProblem);
            SimulationManager.instance.AddAction(FixNotInCampusAreaProblem);

            if (Enum.GetNames(typeof(DistrictPark.ParkType)).Length > 14)
            {
                UIView.library.ShowModal <ExceptionPanel>("ExceptionPanel").SetMessage("81 Tiles self-check: new park types detected", "This new version of the game added new park types. 81 Tiles has to be updated in order to not get 'Not in X area' errors on save re-load", false);
            }

            if (Enum.GetNames(typeof(ImmaterialResourceManager.Resource)).Length > 28)
            {
                UIView.library.ShowModal <ExceptionPanel>("ExceptionPanel").SetMessage("81 Tiles self-check: new resource types detected", "This new version of the game added new resource types. 81 Tiles has to be updated!", false);
            }
        }
示例#2
0
 public override void OnCreated(ILoading loading)
 {
     base.OnCreated(loading);
     if (loading == null || loading.currentMode == AppMode.Game)
     {
         Detours.SetUp();
     }
 }
 public override void OnLevelLoaded(LoadMode mode)
 {
     base.OnLevelLoaded(mode);
     if (mode != LoadMode.NewGame && mode != LoadMode.NewGameFromScenario && mode != LoadMode.LoadGame)
     {
         return;
     }
     Detours.Deploy();
     SimulationManager.instance.AddAction(() => Object.FindObjectOfType <RenderProperties>().m_edgeFogDistance = 2800f);
     SimulationManager.instance.AddAction(() => Object.FindObjectOfType <FogEffect>().m_edgeFogDistance        = 2800f);
     SimulationManager.instance.AddAction(() => Object.FindObjectOfType <FogProperties>().m_EdgeFogDistance    = 2800f);
     if (Util.IsModActive(Mod.ALL_TILES_START_MOD))
     {
         UIView.library.ShowModal <ExceptionPanel>("ExceptionPanel").SetMessage(
             "81 Tiles - Incompatible mod detected",
             $"'81 Tiles' isn't compatible with 'All Tile Start' mod!\nPlease unsubscribe that mod and use '{Mod.UNLOCK_ALL_TILES_FOR_FREE}' button in '81 Tiles' options entry!",
             false);
     }
 }
示例#4
0
        public void OnSettingsUI(UIHelperBase helper)
        {
            helper.AddGroup("Utilities").AddButton(UNLOCK_ALL_TILES_FOR_FREE, UnlockAllCheat.UnlockAllAreas);
            var      dangerZone = (UIHelper)helper.AddGroup("DANGER ZONE");
            UIButton recovery   = null;

            recovery = (UIButton)dangerZone.AddButton(
                "Activate loading recovery mode -  READ TOOLTIP BEFORE PRESSING!",
                () =>
            {
                Detours.SetUp();
                FakeGameAreaManager.RecoveryMode = true;
                recovery.Disable();
            });
            recovery.textColor = Color.red;
            recovery.tooltip   = "The button is only needed if you saved with 81 Tiles after Sunset Harbor release,\n" +
                                 "but before the mod was fixed for it,\n" +
                                 "If you enable it without having that issue you won't be able to load a properly saved game!\n" +
                                 "The option is not persisted and will be automatically disabled when the save is loaded!\n" +
                                 "As soon as the save is loaded, save it again, exit the game to desktop and load it normally\n" +
                                 "This button will become disabled after pressing it!";
        }
示例#5
0
 public override void OnReleased()
 {
     base.OnReleased();
     Detours.TearDown();
 }
示例#6
0
 public override void OnLevelUnloading()
 {
     Detours.Revert();
 }