예제 #1
0
        public void ConfigureOptionsPanel(IStronglyTypedUIHelper uiHelper)
        {
            try
            {
                var appearanceGroup = uiHelper.AddGroup("Appearance");
                var behaviourGroup  = uiHelper.AddGroup("Behaviour");
                var debugGroup      = uiHelper.AddGroup("Debugging");

                appearanceGroup.AddCheckBox("Hide chirper", ModConfig.Instance.GetSetting <bool>(SettingKeys.HideChirper), ToggleChirper);
                appearanceGroup.AddCheckBox(
                    "Make Chirper draggable (hold ctrl + left mouse button)",
                    ModConfig.Instance.GetSetting <bool>(SettingKeys.Draggable),
                    ToggleDraggable);
                appearanceGroup.AddSpace(10);
                appearanceGroup.AddButton("Reset Chirper position", ResetPosition);

                behaviourGroup.AddCheckBox(
                    "Filter non-important messages",
                    ModConfig.Instance.GetSetting <bool>(SettingKeys.FilterMessages),
                    ToggleFilter);

                debugGroup.AddCheckBox("Enable logging", ModConfig.Instance.GetSetting <bool>(SettingKeys.EnableLogging), ToggleLogging);
            }
            catch (Exception ex)
            {
                logger.LogException(ex);
            }
        }
예제 #2
0
        public void ConfigureOptionsPanel(IStronglyTypedUIHelper uiHelper)
        {
            try
            {
                var appearance = uiHelper.AddGroup("Appearance");

                appearance.AddDropDown(
                    "Popup position",
                    Positions.ToArray(),
                    ModConfig.Instance.GetSetting <int>(SettingKeys.PopupPosition),
                    PositionChanged);

                var behaviour = uiHelper.AddGroup("Behaviour");
                behaviour.AddCheckBox("Enable achievements", ModConfig.Instance.GetSetting <bool>(SettingKeys.EnableAchievements), AchievementStatusChanged);

                var debugging = uiHelper.AddGroup("Debugging");
                debugging.AddCheckBox("Enable logging", ModConfig.Instance.GetSetting <bool>(SettingKeys.EnableLogging), EnableLoggingChanged);

                logger.Info("OnSettingsUi");
            }
            catch (Exception ex)
            {
                logger.LogException(ex);

                throw;
            }
        }
        public void ConfigureOptionsPanel(IStronglyTypedUIHelper uiHelper)
        {
            try
            {
                ConfigureGeneralGroup(uiHelper);
                ConfigureDisableDisastersGroup(uiHelper);
                ConfigureMaxIntensityGroup(uiHelper);
                ConfigureAutoEvacuateGroup(uiHelper);
                ConfigureProbabilityGroup(uiHelper);

                var debuggingGroup = uiHelper.AddGroup("Debugging");
                debuggingGroup.AddCheckBox(
                    "Enable logging",
                    ModConfig.Instance.GetSetting <bool>(SettingKeys.EnableLogging),
                    isChecked =>
                {
                    ModConfig.Instance.SaveSetting(SettingKeys.EnableLogging, isChecked);
                    RagnarokLogger.Enabled = isChecked;
                });
            }
            catch (Exception ex)
            {
                logger.LogException(ex);

                throw;
            }
        }
예제 #4
0
        private void AddDebugSettings(IStronglyTypedUIHelper uiHelper)
        {
            var group = uiHelper.AddGroup("Debugging");

            group.AddCheckBox(
                "Enable logging",
                ModConfig.Instance.GetSetting <bool>(SettingKeys.EnableLogging),
                ToggleLogging);
        }
        private void ConfigureAutoEvacuateGroup(IStronglyTypedUIHelper uiHelper)
        {
            var group = uiHelper.AddGroup("Auto evacuate");

            foreach (var disaster in SettingKeys.DisasterSettingKeys)
            {
                AddAutoEvacuateBehaviourDropDown(group, disaster.Key, disaster.Value.AutoEvacuate);
            }
        }
        private void ConfigureMaxIntensityGroup(IStronglyTypedUIHelper uiHelper)
        {
            var group = uiHelper.AddGroup("Disable disasters over a given intensity");

            group.AddLabel("Use the sliders to set the max intensity for a given disaster.\nSet to zero (0) to allow all intensities.");

            foreach (var disaster in SettingKeys.DisasterSettingKeys)
            {
                AddMaxIntensitySlider(group, disaster.Key, disaster.Value.MaxIntensity);
            }
        }
        private void ConfigureGeneralGroup(IStronglyTypedUIHelper uiHelper)
        {
            var generalGroup = uiHelper.AddGroup("General");

            generalGroup.AddCheckBox(
                "Auto focus on disaster",
                ModConfig.Instance.GetSetting <bool>(SettingKeys.DisableAutofocusDisaster),
                OnAutoFocusDisasterChanged);

            generalGroup.AddCheckBox(
                "Pause on disaster start",
                ModConfig.Instance.GetSetting <bool>(SettingKeys.PauseOnDisasterStart),
                isChecked => SaveSetting(SettingKeys.PauseOnDisasterStart, isChecked));
        }
예제 #8
0
        private void AddAppearanceSettings(IStronglyTypedUIHelper uiHelper)
        {
            var group = uiHelper.AddGroup("Appearance");

            group.AddCheckBox(
                "Hide Chirper",
                ModConfig.Instance.GetSetting <bool>(SettingKeys.HideChirper),
                ToggleChirper);
            group.AddCheckBox(
                "Make Chirper draggable (hold ctrl + left mouse button)",
                ModConfig.Instance.GetSetting <bool>(SettingKeys.Draggable),
                ToggleDraggable);

            group.AddSpace();
            resetPositionButton = group.AddButton("Reset Chirper position", ResetPosition)
                                  .WithTooltip(ResetPositionButtonTooltip);
            resetPositionButton.isEnabled = false;
        }
        private void ConfigureDisableDisastersGroup(IStronglyTypedUIHelper uiHelper)
        {
            var group = uiHelper.AddGroup("Disable disasters");

            group.AddCheckBox(
                "Fires not caused by disasters",
                ModConfig.Instance.GetSetting <bool>(SettingKeys.DisableNonDisasterFires),
                OnDisableNonDisasterFiresChanged);
            group.AddSpace(10);

            foreach (var disableDisaster in SettingKeys.DisasterSettingKeys)
            {
                AddEnabledDisasterCheckbox(group, disableDisaster.Key, disableDisaster.Value.Disable);
            }

            group.AddSpace(10);

            AddEnabledDisasterCheckbox(group, "Disable scenario disasters (really?)", SettingKeys.DisableScenarioDisasters);
        }
        private void ConfigureProbabilityGroup(IStronglyTypedUIHelper uiHelper)
        {
            var probabilityGroup = uiHelper.AddGroup("Disaster probabilities");

            if (!GenericDisasterServices.GetDisasterInfos().Any())
            {
                probabilityGroup.AddLabel("You need to be in an active game or scenario to change these settings.");

                return;
            }

            probabilityGroup.AddLabel(
                "The sliders below indicate the risk of a certain type of disaster spawning.\n\n" +
                "These are in relation to each other meaning that if two sliders are set equally\n" +
                "then they have an equal chance of occurring.");
            var disasterInfos = GenericDisasterServices.GetDisasterInfos().ToList();

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

                AddProbabilitySlider(probabilityGroup, settingKey, disasterInfo);
            }
        }
예제 #11
0
        private void AddBehaviourSettings(IStronglyTypedUIHelper uiHelper)
        {
            var group = uiHelper.AddGroup("Filter chirps");

            group.AddLabel("Mouse over each setting to see an example of each chirp");

            group.AddSpace(25);

            group.AddLabel("Random \"filler\" chirps");
            AddCheckBox(
                group,
                "Citizen chatter",
                SettingKeys.FilterPointlessChirps,
                LocaleID.CHIRP_RANDOM_EXP8);
            AddCheckBox(
                group,
                "Enacted policies and district themes",
                SettingKeys.FilterPoliciesAndThemes,
                LocaleID.CHIRP_ORGANIC_FARMING);
            group.AddSpace();

            group.AddLabel("When you build, unlock or achieve something");
            AddCheckBox(
                group,
                "First time you build  a service building (eg. city's first hospital)",
                SettingKeys.FilterFirstTypeOfServiceBuilt,
                LocaleID.CHIRP_FIRST_FIRE_STATION);
            AddCheckBox(
                group,
                "When subsequent service buildings are built (eg. city's second hospital)",
                SettingKeys.FilterServiceBuilt,
                LocaleID.CHIRP_NEW_FIRE_STATION);
            AddCheckBox(
                group,
                "When you unlock fishery buildings",
                SettingKeys.FilterFishingBuildingUnlocked,
                LocaleID.CHIRP_FISHING_BOAT_HARBOR_04_UNLOCKED);
            AddCheckBox(
                group,
                "Celebrations (high attractiveness, milestone reached etc.)",
                SettingKeys.FilterCelebrations,
                LocaleID.CHIRP_ATTRACTIVE_CITY);
            group.AddSpace();

            group.AddLabel("Citizens reacting to events that happen in your city");
            AddCheckBox(
                group,
                "Varsity sports matches",
                SettingKeys.FilterVarsitySportsMatches,
                LocaleID.VARSITYSPORTSCHIRP_WIN);
            AddCheckBox(group, "Football matches", SettingKeys.FilterFootballMatches, LocaleID.FOOTBALLCHIRP_LOSE);
            AddCheckBox(group, "Concerts", SettingKeys.FilterConcerts, LocaleID.CHIRP_BAND_MOTI);
            AddCheckBox(group, "ChirpX launches", SettingKeys.FilterChirpXLaunches, LocaleID.CHIRP_LAUNCH);
            AddCheckBox(
                group,
                "Toga parties and graduations",
                SettingKeys.FilterTogaPartiesAndGraduations,
                LocaleID.GRADUATIONCHIRP_GENERIC);
            group.AddSpace();

            AddCheckBox(
                group,
                "Actual city problems (high crime, no power etc.)",
                SettingKeys.FilterCityProblems,
                LocaleID.CHIRP_NO_WATER);
            AddCheckBox(
                group,
                "Reactions to disasters",
                SettingKeys.FilterDisasters,
                LocaleID.CHIRP_RANDOM_DISASTERS);

            group.AddSpace();
            AddCheckBox(
                group,
                "Uncategorized chirps (chirps I haven't yet figured out how are triggered)",
                SettingKeys.FilterUncategorized,
                LocaleID.CHIRP_ASSISTIVE_TECHNOLOGIES);

            // foreach (var chirp in Chirps.Uncategorized)
            // {
            //     group.AddTextField(chirp, Locale.Get(chirp), text => { }, text => { })
            //          .AsWideAsGroup(group)
            //          .readOnly = true;
            // }
        }