Exemple #1
0
        public void OnLevelLoaded(LoadMode mode)
        {
            try
            {
                if (!mode.IsGameOrScenario())
                {
                    return;
                }

                if (mode.IsScenario())
                {
                    if (ModConfig.Instance.GetSetting <bool>(SettingKeys.DisableScenarioDisasters))
                    {
                        DisasterManager.instance.ClearAll();
                    }
                }

                BuildingManager.instance.m_firesDisabled = ModConfig.Instance.GetSetting <bool>(SettingKeys.DisableNonDisasterFires);

                GenericDisasterServices.UpdateAutoFollowDisaster(logger);
            }
            catch (Exception ex)
            {
                logger.LogException(ex);

                throw;
            }
        }
        public void OnLevelLoaded(LoadMode mode)
        {
            if (!mode.IsGameOrScenario())
            {
                return;
            }

            logger.Info("Changing max disaster spawn intensity");

            var optionPanel = UnityObject.FindObjectOfType <DisastersOptionPanel>();
            var slider      = optionPanel.GetComponentInChildren <UISlider>();

            slider.maxValue = byte.MaxValue;
            slider.minValue = byte.MinValue;

            logger.Info("Max disaster spawn intensity changed to 25.5");
        }
Exemple #3
0
        public override void OnLevelLoaded(LoadMode mode)
        {
            if (!mode.IsGameOrScenario())
            {
                return;
            }

            var disasterInfos = GenericDisasterServices.GetDisasterInfos();

            foreach (var disasterInfo in disasterInfos)
            {
                var settingKey = string.Format("{0}Probability", disasterInfo.name.Replace(" ", string.Empty));

                if (ModConfig.Instance.HasSetting(settingKey))
                {
                    disasterInfo.m_finalRandomProbability = ModConfig.Instance.GetSetting <int>(settingKey);
                }
            }
        }