public override void DoSettingsWindowContents(Rect inRect)
        {
            var listing_Standard = new Listing_Standard();

            listing_Standard.Begin(inRect);
            //listing_Standard.AddLabeledCheckbox("CCPP_ColdNightHotDays".Translate(), ref settings.showWeather);
            //listing_Standard.AddHorizontalLine(3f);
            listing_Standard.AddLabeledRadioList($"{"CCPP_CycleTypeChoice".Translate()}:", cycleTypes,
                                                 ref settings.cycleType);
            listing_Standard.GapLine(3f);
            listing_Standard.AddLabeledNumericalTextField("CCPP_Multiplier".Translate(), ref settings.cycleMultiplier,
                                                          minValue: 1f, maxValue: 20f);
            listing_Standard.AddLabeledNumericalTextField("CCPP_Periods".Translate(), ref settings.cyclePeriods,
                                                          minValue: 1f, maxValue: 8f);
            if (currentVersion != null)
            {
                listing_Standard.Gap();
                GUI.contentColor = Color.gray;
                listing_Standard.Label("CurrentModVersion_Label".Translate(currentVersion));
                GUI.contentColor = Color.white;
            }

            listing_Standard.End();
            settings.Write();
        }
Beispiel #2
0
        public override void DoSettingsWindowContents(Rect inRect)
        {
            Listing_Standard listingStandard = new Listing_Standard();

            listingStandard.Begin(inRect);
            listingStandard.AddLabeledRadioList($"Levelling Mode:", labels: LevellingMode, val: ref settings.LevellingType);
            listingStandard.GapLine(3f);
            listingStandard.AddLabeledRadioList($"Health Scaling Mode:", labels: HealthScalingMode, val: ref settings.HealthScalingType);
            listingStandard.GapLine(3f);
            listingStandard.Label($"Levelling Rate ({settings.LevelUpRate.ToStringPercent()})");
            settings.LevelUpRate = listingStandard.Slider(settings.LevelUpRate, 0.001f, 1f);
            listingStandard.Label($"Health Per Level Rate ({settings.LevelUpHealthRate.ToStringPercent()})");
            settings.LevelUpHealthRate = listingStandard.Slider(settings.LevelUpHealthRate, 0.001f, 1f);
            listingStandard.AddLabeledNumericalTextField("Maximum Random Level", ref settings.MaxRandomLevel, minValue: 1f, maxValue: 1000f);
            listingStandard.AddLabeledNumericalTextField("Base XP Required", ref settings.BaseXP, minValue: 1f, maxValue: 100000f);
            listingStandard.End();
            base.DoSettingsWindowContents(inRect);
        }
Beispiel #3
0
        private void DrawVersionNumberSelection(Rect rect)
        {
            Listing_Standard listing = new Listing_Standard();

            listing.Begin(rect);
            listing.AddLabeledRadioList <int>("The following radio values are allowed to set the current version of the Extreme Colds world generation.", this.radioValues, ref settings.selectedVersion);
            listing.AddLabelLine("NOTE: These values are only used during a new game. The value saved with the world will be used during load.");
            listing.End();
            settings.Write();
        }
Beispiel #4
0
        public override void DoSettingsWindowContents(Rect inRect)
        {
            Listing_Standard listing_Standard = new Listing_Standard();

            listing_Standard.Begin(inRect);
            listing_Standard.AddLabeledRadioList("SettingDescription".Translate(), preferabilities, ref settings.foodPreferability);
            listing_Standard.Label("SettingExplanation".Translate());
            listing_Standard.End();

            settings.Write();
        }
        public override void DoSettingsWindowContents(Rect inRect)
        {
            Listing_Standard listing_Standard = new Listing_Standard();

            listing_Standard.Begin(inRect);
            //listing_Standard.AddLabeledCheckbox("CCPP_ColdNightHotDays".Translate(), ref settings.showWeather);
            //listing_Standard.AddHorizontalLine(3f);
            listing_Standard.AddLabeledRadioList($"{"CCPP_CycleTypeChoice".Translate()}:", cycleTypes, ref settings.cycleType);
            listing_Standard.GapLine(3f);
            listing_Standard.AddLabeledNumericalTextField <float>("CCPP_Multiplier".Translate(), ref settings.cycleMultiplier, minValue: 1f, maxValue: 20f);
            listing_Standard.AddLabeledNumericalTextField <float>("CCPP_Periods".Translate(), ref settings.cyclePeriods, minValue: 1f, maxValue: 8f);
            listing_Standard.End();
            settings.Write();
        }
Beispiel #6
0
        public void DoWindowContents(Rect wrect)
        {
            Listing_Standard listing_Standard = new Listing_Standard();
            Color            color            = GUI.color;

            listing_Standard.Begin(wrect);
            GUI.color   = color;
            Text.Font   = GameFont.Small;
            Text.Anchor = TextAnchor.UpperLeft;
            listing_Standard.Gap(12f);
            listing_Standard.AddLabeledRadioList(Translator.Translate("DamageRoundingMode"), damageRoundModes, ref damageRoundMode, null);
            listing_Standard.End();
            base.Mod.GetSettings <ProperShotgunsSettings>().Write();
        }
        public override void DoWindowContents(Rect inRect)
        {
            if (!checkedForBackup || !haveBackup)
            {
                MakeSureSaveExists();
                return;
            }

            Listing_Standard ls = new Listing_Standard();

            ls.Begin(inRect);
            ls.Label(storeIncident.label.CapitalizeFirst());

            ls.Gap();

            if (storeIncident.cost > 0)
            {
                storeIncident.abbreviation = ls.TextEntryLabeled("Purchase Code:", storeIncident.abbreviation);

                ls.Gap();

                ls.AddLabeledNumericalTextField <int>("Cost", ref storeIncident.cost);

                ls.SliderLabeled("Max times per " + ToolkitSettings.EventCooldownInterval + " ingame day(s)", ref storeIncident.eventCap, storeIncident.eventCap.ToString(), 0, 15);

                if (variableIncident && storeIncidentVariables.maxWager > 0)
                {
                    ls.Gap();

                    ls.SliderLabeled("Maximum coin wager", ref storeIncidentVariables.maxWager, storeIncidentVariables.cost.ToString(), storeIncident.cost, 20000f);
                }

                ls.Gap();

                ls.AddLabeledRadioList("Karma Type", karmaTypeStrings, ref setKarmaType);

                storeIncident.karmaType = (KarmaType)Enum.Parse(typeof(KarmaType), setKarmaType);

                if (variableIncident)
                {
                    ls.Gap();
                    ls.GapLine();
                    ls.Label("Custom Settings");

                    int KeyIndex = 0;

                    if (storeIncidentVariables.customSettingStringValues != null)
                    {
                        foreach (string str in storeIncidentVariables.customSettingStringValues)
                        {
                            string key = storeIncidentVariables.customSettingKeys[KeyIndex];
                            CustomSettings.SetStringSetting(key, ls.TextEntryLabeled(StripSettingKey(key), CustomSettings.LookupStringSetting(key)));
                            KeyIndex++;
                        }
                    }

                    if (storeIncidentVariables.customSettingFloatValues != null)
                    {
                        foreach (float flt in storeIncidentVariables.customSettingFloatValues)
                        {
                            string key            = storeIncidentVariables.customSettingKeys[KeyIndex];
                            float  newValue       = CustomSettings.LookupFloatSetting(key);
                            string newValueBuffer = newValue.ToString();
                            ls.TextFieldNumericLabeled <float>(StripSettingKey(key), ref newValue, ref newValueBuffer);
                            CustomSettings.SetFloatSetting(key, newValue);
                            KeyIndex++;
                        }
                    }


                    ls.GapLine();
                }

                ls.Gap();

                if (ls.ButtonTextLabeled("Disable Store Incident", "Disable"))
                {
                    storeIncident.cost = -10;
                }
            }

            ls.Gap();

            if (storeIncident.defName == "Item")
            {
                ls.SliderLabeled("Max times per " + ToolkitSettings.EventCooldownInterval + " ingame day(s)", ref storeIncident.eventCap, storeIncident.eventCap.ToString(), 0, 15);

                ls.Gap();
            }

            if (storeIncident.defName != "Item" && ls.ButtonTextLabeled("Reset to Default", "Reset"))
            {
                Store_IncidentEditor.LoadBackup(storeIncident);
                if (storeIncident.cost < 1)
                {
                    storeIncident.cost = 50;
                }
                MakeSureSaveExists(true);
            }

            if (storeIncident.defName == "Item" && ls.ButtonTextLabeled("Edit item prices", "Edit"))
            {
                Type type = typeof(StoreItemsWindow);
                Find.WindowStack.TryRemove(type);

                Window window = new StoreItemsWindow();
                Find.WindowStack.Add(window);
            }

            ls.End();
        }
Beispiel #8
0
        public override void DoWindowContents(Rect inRect)
        {
            if (!checkedForBackup || !haveBackup)
            {
                MakeSureSaveExists();
                return;
            }

            Listing_Standard ls = new Listing_Standard();

            ls.Begin(inRect);
            ls.Label(storeIncident.label.CapitalizeFirst());

            ls.Gap();

            if (storeIncident.cost > 0)
            {
                storeIncident.abbreviation = ls.TextEntryLabeled("Purchase Code:", storeIncident.abbreviation);

                ls.Gap();

                ls.AddLabeledNumericalTextField <int>("Cost", ref storeIncident.cost);

                ls.SliderLabeled("Max times per " + ToolkitSettings.EventCooldownInterval + " ingame day(s)", ref storeIncident.eventCap, storeIncident.eventCap.ToString(), 0, 15);

                if (variableIncident && storeIncidentVariables.maxWager > 0)
                {
                    ls.Gap();

                    ls.SliderLabeled("Maximum coin wager", ref storeIncidentVariables.maxWager, storeIncidentVariables.cost.ToString(), storeIncident.cost, 20000f);
                }


                ls.Gap();

                ls.AddLabeledRadioList("Karma Type", karmaTypeStrings, ref setKarmaType);

                storeIncident.karmaType = (KarmaType)Enum.Parse(typeof(KarmaType), setKarmaType);

                ls.Gap();

                if (ls.ButtonTextLabeled("Disable Store Incident", "Disable"))
                {
                    storeIncident.cost = -10;
                }
            }

            ls.Gap();

            if (storeIncident.defName == "Item")
            {
                ls.SliderLabeled("Max times per " + ToolkitSettings.EventCooldownInterval + " ingame day(s)", ref storeIncident.eventCap, storeIncident.eventCap.ToString(), 0, 15);

                ls.Gap();
            }

            if (variableIncident && storeIncidentVariables.customSettings)
            {
                ls.Gap();

                if (ls.ButtonTextLabeled("Edit Extra Settings", "Settings"))
                {
                    storeIncidentVariables.settings.EditSettings();
                }
            }

            ls.Gap();

            if (storeIncident.defName != "Item" && ls.ButtonTextLabeled("Reset to Default", "Reset"))
            {
                Store_IncidentEditor.LoadBackup(storeIncident);
                if (storeIncident.cost < 1)
                {
                    storeIncident.cost = 50;
                }
                MakeSureSaveExists(true);
            }

            if (storeIncident.defName == "Item" && ls.ButtonTextLabeled("Edit item prices", "Edit"))
            {
                Type type = typeof(StoreItemsWindow);
                Find.WindowStack.TryRemove(type);

                Window window = new StoreItemsWindow();
                Find.WindowStack.Add(window);
            }

            ls.End();
        }
        public void DoWindowContents(Rect wrect)
        {
            Listing_Standard options      = new Listing_Standard();
            Color            defaultColor = GUI.color;

            options.Begin(wrect);

            Text.Font   = GameFont.Medium;
            Text.Anchor = TextAnchor.MiddleCenter;
            GUI.color   = Color.yellow;
            options.Label("M4_GreySettingsIgnored".Translate());
            GUI.color   = defaultColor;
            Text.Font   = GameFont.Small;
            Text.Anchor = TextAnchor.UpperLeft;
            options.Gap();

            options.ColumnWidth = wrect.width / 2 - widthFiddler;

            // Left column

            options.CheckboxLabeled("M4_NotifyDeadAnimals".Translate(), ref deathMessagesForAnimals, "M4_NotifyDeadAnimals_Desc".Translate());
            options.GapLine();

            options.CheckboxLabeled("M4_TimetableAssignmentMatters".Translate(), ref workAssignmentMatters, "M4_TimetableAssignmentMatters_Desc".Translate());
            options.GapLine();

            options.CheckboxLabeled("M4_BetterHostileReadouts".Translate(), ref betterHostileReadouts, "M4_BetterHostileReadouts_Desc".Translate());
            options.GapLine();

            options.SliderLabeled("M4_LessLitterLouting".Translate(), ref humanFilthRate, Math.Round(humanFilthRate, 2).ToString(), 0, 25, "M4_LessLitterLouting_Desc".Translate());
            options.GapLine();

            options.CheckboxLabeled("M4_ObedientPredatorsDontHuntTameDesignatedPawns".Translate(), ref obedientPredatorsDeferHuntingTameDesignatedAnimals, "M4_ObedientPredatorsDontHuntTameDesignatedPawns_Desc".Translate());
            options.SliderLabeled("M4_AnimalInteractionHourLimit".Translate(), ref animalInteractionHourLimit, animalInteractionHourLimit + "h", 0, 24, "M4_AnimalInteractionHourLimit_Desc".Translate());

            // Right column

            options.NewColumn();
            options.Gap(yPos);

            options.CheckboxLabeled("M4_SettingBigAnimalMigrations".Translate(), ref bigAnimalMigrations, "M4_SettingBigAnimalMigrations_Desc".Translate());
            options.GapLine();

            options.CheckboxLabeled("M4_SettingEnableLargePacks".Translate(), ref enableLargePacks, "M4_SettingLargePack_Desc".Translate());
            options.GapLine();

            options.CheckboxLabeled("M4_TutorialStyleRolling".Translate(), ref enableTutorialStyleRolling, "M4_TutorialStyleRolling_Desc".Translate());
            options.GapLine();

            options.CheckboxLabeled("M4_ThingFilterInfoCards".Translate(), ref thingFilterInfoCards, "M4_ThingFilterInfoCards_Desc".Translate());
            options.GapLine();

            options.CheckboxLabeled("M4_DisplayRangedDPS".Translate(), ref displayRangedDPS, "M4_DisplayRangedDPS_Desc".Translate());

            options.Gap();
            options.End();

            // More options

            Listing_Standard gapline   = new Listing_Standard();
            Rect             gapliRect = new Rect(wrect.x, wrect.y + moreOptionsRecty - 35f, wrect.width, wrect.height);

            gapline.Begin(gapliRect);
            gapline.GapLine();
            gapline.End();

            Listing_Standard moreOptions     = new Listing_Standard();
            Rect             moreOptionsRect = wrect;

            moreOptionsRect.y      = (moreOptionsRecty + 20f) / 2;
            moreOptionsRect.height = height / 2;
            moreOptionsRect.yMax   = yMax;

            Rect viewRect = new Rect(0, 0, wrect.width - 18f, viewHeight);

            viewRect.width -= 18f;

            moreOptions.Begin(moreOptionsRect);

            moreOptions.BeginScrollView(moreOptionsRect, ref scrollVector2, ref viewRect);

            if (!modifyAutoUndrafter)
            {
                GUI.color = Color.grey;
            }
            moreOptions.CheckboxLabeled("M4_SettingModifyAutoUndrafter".Translate(), ref modifyAutoUndrafter, "M4_SettingModifyAutoUndrafter_Desc".Translate());
            if (modifyAutoUndrafter)
            {
                moreOptions.SliderLabeled("M4_SettingExtendUndraftTimeBy".Translate(), ref extendUndraftTimeBy, extendUndraftTimeBy.ToStringTicksToPeriod(), 0, 60000);
                moreOptions.CheckboxLabeled("M4_SettingWithGunsBlazing".Translate(), ref whenGunsAreFiring, "M4_SettingGunsBlazing_Desc".Translate());
                moreOptions.CheckboxLabeled("M4_SettingLowMoodUndraft".Translate(), ref allowAutoUndraftAtLowMood, "M4_SettingLowMoodUndraft_Desc".Translate());
                GUI.color = defaultColor;
                if (!modifyAutoUndrafter || !allowAutoUndraftAtLowMood)
                {
                    GUI.color = Color.grey;
                }
                moreOptions.AddLabeledRadioList(string.Empty, mentalBreakRisks, ref dontExtendWhenMoodAt);
            }

            GUI.color = defaultColor;
            moreOptions.GapLine();

            moreOptions.CheckboxLabeled("M4_SettingVariableRaidRetreat".Translate(), ref variableRaidRetreat, "M4_SettingVariableRaid_Desc".Translate());
            if (!variableRaidRetreat)
            {
                GUI.color = Color.grey;
            }
            moreOptions.Gap(2);
            moreOptions.FloatRange("M4_SettingRetreatAtPercentageDefeated".Translate(), ref retreatDefeatRange, 0f, 1f, "M4_SettingRandomRaidRetreat_Desc".Translate(
                                       retreatDefeatRange.min.ToStringByStyle(ToStringStyle.PercentZero),
                                       retreatDefeatRange.max.ToStringByStyle(ToStringStyle.PercentZero)
                                       ), ToStringStyle.PercentZero);
            moreOptions.GapLine();

            moreOptions.CheckboxLabeled("M4_SettingDontLeaveJustYet".Translate(), ref allowLongerStays, "M4_SettingDontLeaveJustYet_Desc".Translate());
            if (!allowLongerStays)
            {
                GUI.color = Color.grey;
            }
            moreOptions.SliderLabeled("M4_SettingDaysUntilKickedOut".Translate(), ref extraDaysUntilKickedOut, extraDaysUntilKickedOut.ToString(), 1, 5);
            GUI.color = defaultColor;
            moreOptions.GapLine();

            moreOptions.CheckboxLabeled("I am a modders FFS", ref iAmAModder, "Removes the 6 second cooldown on workshop submissions, unlocks special options.");
            if (iAmAModder)
            {
                moreOptions.Label("Dev mode spawn tweaks [Unsaved. Setting wiped on restart.]");
                moreOptions.CheckboxLabeled("Choose item stuff", ref chooseItemStuff);
                moreOptions.Gap();
                moreOptions.AddLabeledTextField("Stuff defName (blank = default stuff)", ref stuffDefName);
                moreOptions.Gap();
                moreOptions.CheckboxLabeled("Force item quality", ref forceItemQuality);
                moreOptions.Gap();
                moreOptions.SliderLabeled("Item quality", ref forcedItemQuality, ((QualityCategory)forcedItemQuality).ToString(), 0, 6);
                moreOptions.GapLine();
            }
            moreOptions.EndScrollView(ref viewRect);
            moreOptions.End();

            Mod.GetSettings <MeMiMoSettings>().Write();
        }