예제 #1
0
        /*Old and slow
         * public static Settings Get()
         * {
         *      return LoadedModManager.GetMod<Mod>().GetSettings<Settings>();
         * }
         */

        public void DoWindowContents(Rect wrect)
        {
            var options = new Listing_Standard();

            Rect viewRect = new Rect(0f, 0f, wrect.width - 16f, scrollViewHeight);

            options.BeginScrollViewEx(wrect, ref scrollPosition, viewRect);


            //Area / Zone things
            options.LabelHeader("TD.SettingsHeaderArea".Translate());
            options.CheckboxLabeled("TD.NoLimitOnTheNumberOfAreas".Translate(), ref areasUnlimited);
            options.CheckboxLabeled("TD.SettingMatchGrow".Translate(), ref matchGrowButton, "TD.SettingMatchGrowDesc".Translate());
            options.CheckboxLabeled("TD.SettingZoneSize".Translate(), ref showZoneSize, "TD.SettingZoneSizeDesc".Translate());
            options.CheckboxLabeled("TD.SettingAllowHarvesting".Translate(), ref zoneHarvestableToggle, "TD.SettingAllowHarvestingDesc".Translate());
            options.CheckboxLabeled("TD.SettingAreaForTypes".Translate(), ref areaForTypes, "TD.SettingAreaForTypesDesc".Translate());
            options.CheckboxLabeled("TD.NeverHome".Translate(), ref neverHome);
            options.CheckboxLabeled("TD.SlaughterZone".Translate(), ref slaughterZone);
            options.CheckboxLabeled("TD.SettingsCleanZone".Translate(), ref fieldEdgesRedo);
            options.Label("TD.AreaEditing".Translate());
            options.GapLine();


            //Overlays
            options.LabelHeader("TD.SettingsHeaderOverlays".Translate());
            options.CheckboxLabeled("TD.SettingOverlayBuildable".Translate(), ref showOverlayBuildable, "TD.SettingOverlayBuildableDesc".Translate());
            options.CheckboxLabeled("TD.SettingAutoBuildable".Translate(), ref autoOverlayBuildable, "TD.SettingAutoBuildableDesc".Translate());
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayCoverage".Translate(), ref showOverlayCoverage, "TD.SettingOverlayCoverageDesc".Translate());
            options.CheckboxLabeled("TD.SettingAutoCoverage".Translate(), ref autoOverlayCoverage, "TD.SettingAutoCoverageDesc".Translate());
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayFertility".Translate(), ref showOverlayFertility);
            bool before = cheatFertilityUnderGrid;

            options.CheckboxLabeled("TD.SettingOverlayFertilityUnder".Translate(), ref cheatFertilityUnderGrid);
            if (before != cheatFertilityUnderGrid)
            {
                BaseOverlay.SetDirty(typeof(FertilityOverlay));
            }
            options.CheckboxLabeled("TD.SettingAutoFertility".Translate(), ref autoOverlayFertility);
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayLighting".Translate(), ref showOverlayLighting, "TD.SettingOverlayLightingDesc".Translate());
            options.CheckboxLabeled("TD.SettingAutoLighting".Translate(), ref autoOverlayLighting);
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayWalkSpeed".Translate(), ref showOverlayWalkSpeed);
            options.CheckboxLabeled("TD.SettingOverlayBeauty".Translate(), ref showOverlayBeauty);
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayPlantHarvest".Translate(), ref showOverlayPlantHarvest);
            options.CheckboxLabeled("TD.SettingAutoPlantHarvest".Translate(), ref autoOverlayPlantHarvest);
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayPower".Translate(), ref showOverlayPower);
            options.CheckboxLabeled("TD.SettingAutoSmoothable".Translate(), ref autoOverlaySmoothable);
            options.CheckboxLabeled("TD.SettingAutoTreeGrowth".Translate(), ref autoOverlayTreeGrowth, "TD.SettingAutoTreeGrowthDesc".Translate());
            options.CheckboxLabeled("TD.SettingAutoWindBlocker".Translate(), ref autoOverlayWindBlocker);
            options.Gap();
            float beforeO = overlayOpacity;

            options.SliderLabeled("TD.LowerOverlayOpacities".Translate(), ref overlayOpacity, "{0:P0}");
            if (beforeO != overlayOpacity)
            {
                BaseOverlay.ResetAll();
            }
            options.GapLine();


            //Hide bottom-right Toggleable buttons
            options.LabelHeader("TD.SettingHeaderToggleButtons".Translate());
            options.Label("TD.SettingHeaderToggleButtonsDesc".Translate());
            options.CheckboxLabeled("TD.Show".Translate("ShowLearningHelperWhenEmptyToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleLearning);
            options.CheckboxLabeled("TD.Show".Translate("ZoneVisibilityToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleZone);
            options.CheckboxLabeled("TD.Show".Translate("ShowBeautyToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleBeauty);
            options.CheckboxLabeled("TD.Show".Translate("ShowRoomStatsToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleRoomstats);
            options.CheckboxLabeled("TD.Show".Translate("ShowColonistBarToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleColonists);
            options.CheckboxLabeled("TD.Show".Translate("ShowRoofOverlayToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleRoof);
            options.CheckboxLabeled("TD.Show".Translate("AutoHomeAreaToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleHomeArea);
            options.CheckboxLabeled("TD.Show".Translate("AutoRebuildButton".Translate().RawText.Split('\n')[0]), ref showToggleRebuild);
            options.CheckboxLabeled("TD.Show".Translate("ShowFertilityOverlayToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleFertility);
            options.CheckboxLabeled("TD.Show".Translate("ShowTerrainAffordanceOverlayToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleAffordance);
            options.CheckboxLabeled("TD.Show".Translate("CategorizedResourceReadoutToggleButton".Translate().RawText.Split('\n')[0]), ref showToggleCategorized);
            options.GapLine();


            //Game improvements
            options.LabelHeader("TD.SettingsHeaderGame".Translate());
            options.CheckboxLabeled("TD.SettingAutoAutorebuild".Translate(), ref autorebuildDefaultOn);
            options.CheckboxLabeled("TD.SettingAutoRebuildTransportPod".Translate(), ref autoRebuildTransportPod);
            options.Gap();
            options.CheckboxLabeled("TD.CaravanLoadSelection".Translate(), ref caravanLoadSelection);
            options.CheckboxLabeled("TD.CaravanSaveManifest".Translate(), ref caravanSaveManifest);
            options.Label("TD.CaravanDesc".Translate());
            options.CheckboxLabeled("TD.CaravanWorstFirst".Translate(), ref tradeRequestWorstFirst, "TD.CaravanWorstFirstDesc".Translate());
            options.Gap();
            options.CheckboxLabeled("TD.BlueprintAnyStuff".Translate(), ref blueprintAnyStuff);
            options.CheckboxLabeled("TD.SettingCopyPolicy".Translate(), ref copyPolicyButton);
            options.CheckboxLabeled("TD.SettingBillCountEquippedAny".Translate(), ref billCountEquippedAny, "TD.SettingBillCountEquippedAnyDesc".Translate());
            options.Label("TD.SarcophagusPreferred".Translate(), tooltip: "TD.SarcophagusPreferredDesc".Translate());
            options.GapLine();


            //Color variations
            options.LabelHeader("TD.SettingHeaderColorVariations".Translate());
            options.CheckboxLabeled("TD.SettingColorVariation".Translate(), ref colorVariation, "TD.SettingColorVariationDesc".Translate());
            options.Gap();
            options.CheckboxLabeled("TD.SettingColorGenerator".Translate(), ref colorGenerator, "TD.SettingColorGeneratorDesc".Translate());
            if (colorGenerator)
            {
                options.SliderLabeled("TD.SettingColorGeneratorChance".Translate(), ref colorGenChance, "{0:P0}", 0, 1);
                options.CheckboxLabeled("TD.SettingColorGenNoVariation".Translate(), ref colorGenNoVariation);
            }
            options.Gap();

            options.CheckboxLabeled("TD.SettingFixColorStuff".Translate(), ref colorFixStuffColor, "TD.SettingFixColorStuffDesc".Translate());
            options.CheckboxLabeled("TD.SettingFixUncoloredStuff".Translate(), ref colorFixDominant, "TD.SettingFixUncoloredStuffDesc".Translate());
            options.Gap();

            if (options.ButtonTextLabeled("TD.SettingReapplyColorVariations".Translate(), "TD.Go".Translate()))
            {
                ReapplyAll.Go();
            }
            options.Label("TD.SettingReapplyColorVariationsDesc".Translate());
            options.GapLine();


            //UI / Info
            options.LabelHeader("TD.SettingsHeaderInfo".Translate());
            options.CheckboxLabeled("TD.SettingRememberResourceReadout".Translate(), ref rememberResourceReadout);
            options.CheckboxLabeled("TD.SettingNewGameOpenResourceReadout".Translate(), ref startOpenResourceReadout);
            options.Gap();
            options.CheckboxLabeled("TD.SettingPawnTableHighlightSelected".Translate(), ref pawnTableHighlightSelected, "TD.SettingPawnTableHighlightSelectedDesc".Translate());
            options.CheckboxLabeled("TD.SettingPawnTableArrowMouseover".Translate(), ref pawnTableArrowMouseover);
            options.CheckboxLabeled("TD.SettingPawnTableClickSelect".Translate(), ref pawnTableClickSelect, "TD.SettingPawnTableClickSelectDesc".Translate());
            options.CheckboxLabeled("TD.SettingJumpToSelectedItems".Translate(), ref selectedItemsZoomButton);
            options.Gap();
            options.CheckboxLabeled("TD.SettingTopRightMouseover".Translate(), ref mouseoverInfoTopRight, "TD.SettingTopRightMouseoverDesc".Translate());
            options.CheckboxLabeled("TD.SettingStopForcedSlowdown".Translate(), ref stopForcedSlowdown);
            options.CheckboxLabeled("TD.SettingTradeClose".Translate(), ref changeSpeedAfterTrader);
            options.SliderLabeled("TD.SettingTradeCloseSpeed".Translate(), ref afterTraderSpeed, "{0}x", 0, 4);
            options.Gap();
            options.CheckboxLabeled("TD.SettingResearchingArrow".Translate(), ref researchingArrow);
            options.CheckboxLabeled("TD.SettingSkillGainArrow".Translate(), ref skillUpArrows, "TD.SettingSkillGainArrowDesc".Translate());
            options.CheckboxLabeled("TD.SettingSkillLossArrow".Translate(), ref skillDownArrows, "TD.SettingSkillLossArrowDesc".Translate());
            skillArrows = skillUpArrows || skillDownArrows;
            options.CheckboxLabeled("TD.DropPodWhatDropped".Translate(), ref dropPodWhatDropped);
            options.Gap();
            options.Label("TD.FeatureConditionGreen".Translate());
            options.GapLine();


            //Alerts
            options.LabelHeader("TD.SettingsHeaderAlerts".Translate());
            options.CheckboxLabeled("TD.SettingAlertDeterioration".Translate(), ref alertDeteriorating, "TD.SettingAlertDeteriorationDesc".Translate());
            options.CheckboxLabeled("TD.SettingAlertBurning".Translate(), ref alertBurning);
            options.CheckboxLabeled("TD.SettingAlertToxic".Translate(), ref alertToxic);
            options.CheckboxLabeled("TD.SettingAlertNoBill".Translate(), ref alertNoBill);
            options.CheckboxLabeled("TD.AlertWindBlocked".Translate(), ref alertWindBlocker);
            options.GapLine();


            //AI
            options.LabelHeader("TD.SettingsHeaderAI".Translate());
            options.CheckboxLabeled("TD.SettingsIgnoreSleeping".Translate(), ref ignoreSleepingEnemies, "TD.SettingsIgnoreSleepingDesc".Translate());
            options.CheckboxLabeled("TD.SettingStopFlee".Translate(), ref stopFlee, "TD.SettingStopFleeDesc".Translate());
            options.Gap();
            options.CheckboxLabeled("TD.SettingDodgeGrenades".Translate(), ref dodgeGrenade, "TD.SettingDodgeGrenadesDesc".Translate());
            options.CheckboxLabeled("TD.SettingDodgeGrenadesEnemy".Translate(), ref dodgeGrenadeEnemy, "TD.SettingDodgeGrenadesEnemyDesc".Translate());
            options.CheckboxLabeled("TD.SettingDodgeGrenadesNPC".Translate(), ref dodgeGrenadeNPC, "TD.SettingDodgeGrenadesNPCDesc".Translate());
            options.CheckboxLabeled("TD.SettingDodgeGrenadesUnlessBelt".Translate(), ref dodgeGrenadeUnlessBelt);
            options.Gap();
            options.CheckboxLabeled("TD.ShowStopButtonDrafted".Translate(), ref showStopGizmoDrafted);
            options.CheckboxLabeled("TD.ShowStopButtonUnDrafted".Translate(), ref showStopGizmo);
            options.GapLine();


            options.Label("TD.RequiresRestart".Translate());
            options.CheckboxLabeled("TD.SettingUrgentRefill".Translate(), ref zoneRefill, "TD.SettingUrgentRefillDesc".Translate());
            options.CheckboxLabeled("TD.SettingCameraDragFix".Translate(), ref cameraDragFixes, "TD.SettingCameraDragFixDesc".Translate());
            options.GapLine();

            options.Label("TD.OtherFeatures".Translate());
            options.CheckboxLabeled("TD.SettingsZoomToMouse".Translate(), ref zoomToMouse, "TD.SettingsZoomToMouseDesc".Translate());
            options.Label("TD.NoFrameDecon".Translate(), tooltip: "TD.NoFrameDeconDesc".Translate());
            options.Label("TD.DropdownBuildingsOrder".Translate(), tooltip: "TD.DropdownBuildingsOrderDesc".Translate());
            options.Label("TD.FeatureConfirmRestoreSettings".Translate());

            options.EndScrollView(ref viewRect);
            scrollViewHeight = viewRect.height;
        }
예제 #2
0
 public static void Postfix()
 {
     BaseOverlay.ResetAll();
 }
예제 #3
0
        public void DoWindowContents(Rect wrect)
        {
            var options = new Listing_Standard();

            Rect viewRect = new Rect(0f, 0f, wrect.width - 16f, scrollViewHeight);

            options.BeginScrollViewEx(wrect, ref scrollPosition, ref viewRect);


            //Area / Zone things
            options.LabelHeader("TD.SettingsHeaderArea".Translate());
            options.CheckboxLabeled("TD.SettingMatchGrow".Translate(), ref matchGrowButton, "TD.SettingMatchGrowDesc".Translate());
            options.CheckboxLabeled("TD.SettingZoneSize".Translate(), ref showZoneSize, "TD.SettingZoneSizeDesc".Translate());
            options.CheckboxLabeled("TD.SettingAllowHarvesting".Translate(), ref zoneHarvestableToggle, "TD.SettingAllowHarvestingDesc".Translate());
            options.CheckboxLabeled("TD.NeverHome".Translate(), ref neverHome);
            options.CheckboxLabeled("TD.SlaughterZone".Translate(), ref slaughterZone);
            options.CheckboxLabeled("TD.SettingsCleanZone".Translate(), ref fieldEdgesRedo);
            options.Label("TD.AreaEditing".Translate());
            options.GapLine();


            //Overlays
            options.LabelHeader("TD.SettingsHeaderOverlays".Translate());
            options.CheckboxLabeled("TD.SettingOverlayBuildable".Translate(), ref showOverlayBuildable, "TD.SettingOverlayBuildableDesc".Translate());
            options.CheckboxLabeled("TD.SettingAutoBuildable".Translate(), ref autoOverlayBuildable, "TD.SettingAutoBuildableDesc".Translate());
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayFertility".Translate(), ref showOverlayFertility);
            bool before = cheatFertilityUnderGrid;

            options.CheckboxLabeled("TD.SettingOverlayFertilityUnder".Translate(), ref cheatFertilityUnderGrid);
            if (before != cheatFertilityUnderGrid)
            {
                BaseOverlay.SetDirty(typeof(FertilityOverlay));
            }
            options.CheckboxLabeled("TD.SettingAutoFertility".Translate(), ref autoOverlayFertility);
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayLighting".Translate(), ref showOverlayLighting, "TD.SettingOverlayLightingDesc".Translate());
            options.CheckboxLabeled("TD.SettingAutoLighting".Translate(), ref autoOverlayLighting);
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayWalkSpeed".Translate(), ref showOverlayWalkSpeed);
            options.CheckboxLabeled("TD.SettingOverlayBeauty".Translate(), ref showOverlayBeauty);
            options.Gap();
            options.CheckboxLabeled("TD.SettingOverlayPlantHarvest".Translate(), ref showOverlayPlantHarvest);
            options.CheckboxLabeled("TD.SettingAutoPlantHarvest".Translate(), ref autoOverlayPlantHarvest);
            options.Gap();
            options.CheckboxLabeled("TD.SettingAutoSmoothable".Translate(), ref autoOverlaySmoothable);
            options.CheckboxLabeled("TD.SettingAutoTreeGrowth".Translate(), ref autoOverlayTreeGrowth, "TD.SettingAutoTreeGrowthDesc".Translate());
            options.CheckboxLabeled("TD.SettingAutoWindBlocker".Translate(), ref autoOverlayWindBlocker);
            options.Gap();
            float beforeO = overlayOpacity;

            options.SliderLabeled("TD.LowerOverlayOpacities".Translate(), ref overlayOpacity, "{0:P0}");
            if (beforeO != overlayOpacity)
            {
                BaseOverlay.ResetAll();
            }
            options.GapLine();


            //Game improvements
            options.LabelHeader("TD.SettingsHeaderGame".Translate());
            options.CheckboxLabeled("TD.DeepDrillRandomrock".Translate(), ref deepDrillRandom, "TD.DeepDrillRandomrockDesc".Translate());
            options.CheckboxLabeled("TD.SettingAutoAutorebuild".Translate(), ref autorebuildDefaultOn);
            options.Gap();
            options.CheckboxLabeled("TD.CaravanLoadSelection".Translate(), ref caravanLoadSelection);
            options.CheckboxLabeled("TD.CaravanSaveManifest".Translate(), ref caravanSaveManifest);
            options.Label("TD.CaravanDesc".Translate());
            options.Gap();
            options.CheckboxLabeled("TD.BlueprintAnyStuff".Translate(), ref blueprintAnyStuff);
            options.Label("TD.SarcophagusPreferred".Translate(), tooltip: "TD.SarcophagusPreferredDesc".Translate());
            options.GapLine();


            //Notifications / Info
            options.LabelHeader("TD.SettingsHeaderInfo".Translate());
            options.CheckboxLabeled("TD.SettingPawnTableHighlightSelected".Translate(), ref pawnTableHighlightSelected);
            options.CheckboxLabeled("TD.SettingPawnTableClickSelect".Translate(), ref pawnTableClickSelect, "TD.SettingPawnTableClickSelectDesc".Translate());
            options.CheckboxLabeled("TD.SettingTopRightMouseover".Translate(), ref mouseoverInfoTopRight, "TD.SettingTopRightMouseoverDesc".Translate());
            options.CheckboxLabeled("TD.SettingTradeClose".Translate(), ref changeSpeedAfterTrader);
            options.SliderLabeled("TD.SettingTradeCloseSpeed".Translate(), ref afterTraderSpeed, "{0}x", 0, 4);
            options.Gap();
            options.CheckboxLabeled("TD.SettingResearchingArrow".Translate(), ref researchingArrow);
            options.CheckboxLabeled("TD.SettingSkillGainArrow".Translate(), ref skillUpArrows, "TD.SettingSkillGainArrowDesc".Translate());
            options.CheckboxLabeled("TD.SettingSkillLossArrow".Translate(), ref skillDownArrows, "TD.SettingSkillLossArrowDesc".Translate());
            skillArrows = skillUpArrows || skillDownArrows;
            options.Gap();
            options.Label("TD.FeatureConditionGreen".Translate());
            options.Label("TD.DropPodWhatDropped".Translate());
            options.GapLine();


            //Notifications / Info
            options.LabelHeader("TD.SettingsHeaderAlerts".Translate());
            options.CheckboxLabeled("TD.SettingAlertDeterioration".Translate(), ref alertDeteriorating, "TD.SettingAlertDeteriorationDesc".Translate());
            options.CheckboxLabeled("TD.SettingAlertHeatstroke".Translate(), ref alertHeatstroke);
            options.CheckboxLabeled("TD.SettingAlertBurning".Translate(), ref alertBurning);
            options.CheckboxLabeled("TD.SettingAlertToxic".Translate(), ref alertToxic);
            options.CheckboxLabeled("TD.SettingAlertNoBill".Translate(), ref alertNoBill);
            options.GapLine();


            //AI
            options.LabelHeader("TD.SettingsHeaderAI".Translate());
            options.CheckboxLabeled("TD.SettingsIgnoreSleeping".Translate(), ref ignoreSleepingEnemies, "TD.SettingsIgnoreSleepingDesc".Translate());
            options.CheckboxLabeled("TD.SettingStopFlee".Translate(), ref stopFlee, "TD.SettingStopFleeDesc".Translate());
            options.CheckboxLabeled("TD.SettingDodgeGrenades".Translate(), ref dodgeGrenade, "TD.SettingDodgeGrenadesDesc".Translate());
            options.CheckboxLabeled("TD.SettingDodgeGrenadesUnlessBelt".Translate(), ref dodgeGrenadeUnlessBelt);
            options.Gap();
            options.CheckboxLabeled("TD.ShowStopButtonDrafted".Translate(), ref showStopGizmoDrafted);
            options.CheckboxLabeled("TD.ShowStopButtonUnDrafted".Translate(), ref showStopGizmo);
            options.GapLine();


            options.Label("TD.RequiresRestart".Translate());
            options.CheckboxLabeled("TD.SettingUrgentRefill".Translate(), ref zoneRefill, "TD.SettingUrgentRefillDesc".Translate());
            options.CheckboxLabeled("TD.SettingCameraDragFix".Translate(), ref cameraDragFixes, "TD.SettingCameraDragFixDesc".Translate());
            options.GapLine();

            options.Label("TD.OtherFeatures".Translate());
            options.CheckboxLabeled("TD.SettingsZoomToMouse".Translate(), ref zoomToMouse);
            options.Label("TD.NoFrameDecon".Translate(), tooltip: "TD.NoFrameDeconDesc".Translate());
            options.Label("TD.DropdownBuildingsOrder".Translate(), tooltip: "TD.DropdownBuildingsOrderDesc".Translate());

            options.EndScrollView(ref viewRect);
            scrollViewHeight = viewRect.height;
        }