Exemple #1
0
 public override void DefsLoaded()
 {
     if (ModActive.CoreSK)
     {
         int maxRaidCount = AnotherTweaks.Settings.Get().CoreSK_MaxRaidCount;
         if (maxRaidCount > 10)
         {
             CoreSK_Utils.Set_Config_MaxRaidCount(maxRaidCount);
         }
     }
 }
        public void DoSettingsWindowContents(Rect rect)
        {
            Listing_Standard modOptions = new Listing_Standard();

            modOptions.Begin(rect);
            modOptions.Gap(20f);

            var defColor = GUI.color;

            if (ModActive.CoreSK)
            {
                GUI.color = Color.yellow;
                modOptions.Label("   CoreSK");
                GUI.color = defColor;
                modOptions.CheckboxLabeled("CoreSK_ShowTPSInRegularGame".Translate(), ref CoreSK_ShowTPSInRegularGame);
                modOptions.CheckboxLabeled("CoreSK_ShowRaidPoints".Translate(), ref CoreSK_ShowRaidPoints);

                int maxRaidCount = CoreSK_MaxRaidCount;
                modOptions.TextFieldNumericLabeled("CoreSK_MaxRaidCount".Translate(), ref CoreSK_MaxRaidCount, ref _bufferMaxRaidCount);
                if (CoreSK_MaxRaidCount != maxRaidCount && CoreSK_MaxRaidCount > 10)
                {
                    CoreSK_Utils.Set_Config_MaxRaidCount(CoreSK_MaxRaidCount);
                }
                modOptions.TextFieldNumericLabeled("CoreSK_Max4Speed".Translate(), ref CoreSK_Max4Speed, ref _bufferMax4Speed);
                modOptions.TextFieldNumericLabeled("CoreSK_MaxTradeshipsTransponder".Translate(), ref CoreSK_MaxTradeshipsTransponder, ref _maxTradeshipsTransponder);
            }

            GUI.color = Color.yellow;
            modOptions.Label("   Vanilla tweaks");
            GUI.color = defColor;

            //modOptions.CheckboxLabeled("HiveAttackTarget".Translate(), ref HiveAttackTarget);
            modOptions.CheckboxLabeled("CutPlantsBeforeBuilding".Translate(), ref CutPlantsBeforeBuilding);
            modOptions.CheckboxLabeled("DevToolsWithHoldShift".Translate(), ref DevToolsWithHoldShift);
            modOptions.TextFieldNumericLabeled("DevToolsPositionX".Translate(), ref DevToolsPositionX, ref _bufferDevToolsPositionX);
            modOptions.TextFieldNumericLabeled("DevToolsPositionY".Translate(), ref DevToolsPositionY, ref _bufferDevToolsPositionY);
            // IngredientSearchRadius
            {
                string str2 = "DefaultIngredientSearchRadius".Translate();
                string str3 = (IngredientSearchRadius == 999f)
                    ? "Unlimited".TranslateSimple()
                    : IngredientSearchRadius.ToString("F0");
                modOptions.Label(str2 + ": " + str3);
                IngredientSearchRadius = modOptions.Slider((IngredientSearchRadius > 100f) ? 100f : IngredientSearchRadius, 3f, 100f);
                if (IngredientSearchRadius >= 100f)
                {
                    IngredientSearchRadius = 999f;
                }
            }
            modOptions.Label("DropOneWithControl".Translate());

            if (!ModActive.ShareTheLoad)
            {
                //GUI.color = Color.yellow;
                //modOptions.Label("   ShareTheLoad");
                //GUI.color = defColor;
                modOptions.CheckboxLabeled("ShareTheLoad_DeliverAsMuchAsYouCan".Translate(), ref ShareTheLoad_DeliverAsMuchAsYouCan);
            }

            if (!ModActive.ReplaceStuff)
            {
                //GUI.color = Color.yellow;
                //modOptions.Label("   ReplaceStuff");
                //GUI.color = defColor;
                modOptions.CheckboxLabeled("ReplaceStuff_CornerBuildable".Translate(), ref ReplaceStuff_CornerBuildable);
            }

            if (!ModActive.MehniMiscModifications)
            {
                //GUI.color = Color.yellow;
                //modOptions.Label("   MehniMiscModifications tweaks");
                //GUI.color = defColor;
                modOptions.CheckboxLabeled("BetterHostileReadouts".Translate(), ref BetterHostileReadouts);
            }

            if (!ModActive.TDEnhancmentPack)
            {
                //GUI.color = Color.yellow;
                //modOptions.Label("   TDEnhancmentPack tweaks");
                //GUI.color = defColor;
                modOptions.CheckboxLabeled("SkillArrows".Translate(), ref SkillArrows);
                modOptions.CheckboxLabeled("ResearchingArrow".Translate(), ref ResearchingArrow);
            }

            modOptions.GapLine();
            if (Prefs.DevMode)
            {
                modOptions.CheckboxLabeled("DEBUG: Override rade points", ref OverrideRadePoints);
                modOptions.TextFieldNumericLabeled("DEBUG: Override rade points value", ref OverrideRadePointsValue, ref _bufferOverrideRadePointsValue);
                modOptions.GapLine();
            }

            GUI.color = Color.cyan;
            modOptions.Label("AT_Credits".Translate());
            GUI.color = defColor;

            if (modOptions.ButtonText($"AnotherTweaks.LogFilter".Translate()))
            {
                Find.WindowStack.Add(new LogHiderWindow());
            }

            modOptions.End();
        }