protected override void FillTab() { Rect rect = new Rect(0f, 0f, size.x, size.y).ContractedBy(10f); Listing_Standard listing = new Listing_Standard(); listing.Begin(rect); listing.Label("PRFArchoCipherInterpreter".Translate()); ciphertext = listing.TextEntryLabeled("PRF_InsertCiphertext".Translate(), ciphertext); if (listing.ButtonText("PRF_ButtonDecipher".Translate())) { string result = ArchoCipher.Decipher(ciphertext); if (result != null) { resultText = result; } else { System.Random random = new System.Random(ciphertext.Sum(Convert.ToInt32)); int length = random.Next(1, 513); string gibberish = "PRF_GibberishAlphabet".Translate(); char[] output = new char[length]; for (int i = 0; i < output.Length; i++) { output[i] = gibberish[random.Next(gibberish.Length)]; } resultText = new string(output); } } if (listing.ButtonText("PRF_ButtonClear".Translate())) { resultText = null; ciphertext = null; } listing.Label(resultText); listing.End(); }
public override void DoSettingsWindowContents(Rect inRect) { Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(inRect); listing_Standard.AddLabeledCheckbox("MessagesEnabledLabel".Translate() + " ", ref Settings.MessagesEnabled); listing_Standard.AddLabeledCheckbox("AggroCalmEnabledLabel".Translate() + " ", ref Settings.AggroCalmEnabled); listing_Standard.AddLabeledCheckbox("OpinionOnlyEnabledLabel".Translate() + " ", ref Settings.OpinionOnly); listing_Standard.AddLabeledCheckbox("NonFactionEnabledLabel".Translate() + " ", ref Settings.NonFaction); listing_Standard.AddLabeledCheckbox("TraderCalmEnabledLabel".Translate() + " ", ref Settings.TraderCalm); listing_Standard.AddLabeledCheckbox("AdvancedMenu".Translate() + " ", ref Settings.AdvancedMenu); if (SOMod.Settings.AdvancedMenu) { listing_Standard.AddLabelLine("Formula = diplomacy skill * social multiplier + opinion * opinion multiplier"); if (SOMod.Settings.OpinionOnly) { listing_Standard.AddLabeledNumericalTextField("OOMultLabel".Translate(), ref Settings.OOpnWeight, (float)0.5, 0, 1); } else { listing_Standard.AddLabeledNumericalTextField("SMultLabel".Translate(), ref Settings.DipWeight, (float)0.5, 0, 1); listing_Standard.AddLabeledNumericalTextField("OMultLabel".Translate(), ref Settings.OpnWeight, (float)0.5, 0, 1); } listing_Standard.AddLabeledNumericalTextField("StunWeight".Translate(), ref Settings.StunWeight, (float)0.5, 0, 1); listing_Standard.AddLabeledNumericalTextField("CalmDuration".Translate(), ref SOMod.Settings.CalmDuration); listing_Standard.AddLabeledNumericalTextField("Cooldown".Translate(), ref SOMod.Settings.Cooldown); listing_Standard.AddLabeledCheckbox("DebugChanceSetting".Translate() + " ", ref Settings.Debug); listing_Standard.AddLabeledCheckbox("LaunchCounterSetting".Translate() + " ", ref Settings.LaunchCounter); listing_Standard.AddLabeledCheckbox("AlwaysSucceedSetting".Translate() + " ", ref Settings.AlwaysSucceed); if (listing_Standard.ButtonText("Default")) { SnapUtils.DebugLog("Reset advanced settings to defaults"); SOMod.Settings.DipWeight = 0.2f; SOMod.Settings.OpnWeight = 0.0014f; SOMod.Settings.OOpnWeight = 0.006f; SOMod.Settings.StunWeight = 0.55f; SOMod.Settings.CalmDuration = 1250; SOMod.Settings.Debug = false; SOMod.Settings.LaunchCounter = true; SOMod.Settings.Cooldown = 15000; } } listing_Standard.End(); Settings.Write(); }
public static void DoRandomStartingSeasonButton(Listing_Standard listing) { // Pick a season, any season if (!TinyTweaksSettings.randomStartingSeason) { return; } if (listing.ButtonText("Randomize".Translate())) { Find.GameInitData.startingSeason = (Season)Rand.RangeInclusive((int)Season.Spring, (int)Season.Winter); } listing.Gap(6); }
public void DoSettingsWindowContents(Rect inRect) { var listing_standard = new Listing_Standard(); listing_standard.Begin(inRect); // デフォルトに戻す if (listing_standard.ButtonText(MizuStrings.OptionSetDefault.Translate())) { this.fertilityFactorInNotWatering = DefaultFertilityFactorInNotWatering; this.fertilityFactorInNotWateringBuffer = this.fertilityFactorInNotWatering.ToString("F2"); this.fertilityFactorInWatering = DefaultFertilityFactorInWatering; this.fertilityFactorInWateringBuffer = this.fertilityFactorInWatering.ToString("F2"); } // 水やりしていない時の肥沃度係数 listing_standard.Label(string.Concat(new string[] { MizuStrings.OptionGrowthRateFactorInNotWatering.Translate(), " (", MinFertilityFactorInNotWatering.ToString("F2"), " - ", MaxFertilityFactorInNotWatering.ToString("F2"), ")" })); listing_standard.TextFieldNumeric( ref this.fertilityFactorInNotWatering, ref this.fertilityFactorInNotWateringBuffer, MinFertilityFactorInNotWatering, MaxFertilityFactorInNotWatering); // 水やりした時の肥沃度係数 listing_standard.Label(string.Concat(new string[] { MizuStrings.OptionGrowthRateFactorInWatering.Translate(), " (", MinFertilityFactorInWatering.ToString("F2"), " - ", MaxFertilityFactorInWatering.ToString("F2"), ")" })); listing_standard.TextFieldNumeric( ref this.fertilityFactorInWatering, ref this.fertilityFactorInWateringBuffer, MinFertilityFactorInWatering, MaxFertilityFactorInWatering); listing_standard.End(); }
public override void DoWindowContents(Rect inRect) { var listing = new Listing_Standard(); listing.Begin(inRect); listing.Label("SettingsName".Translate()); name = listing.TextEntry(name); listing.Gap(4f); listing.Label("Description".Translate()); description = listing.TextEntry(description, 4); listing.Gap(8f); if (listing.ButtonText("PublishSettingsButton".Translate())) { Save(); } listing.End(); }
public void DoSettingsWindow(Rect inRect) { //wide panels look terrible Rect lR = new Rect(inRect.x + 0.25f * inRect.width, inRect.y, inRect.width * 0.5f, inRect.height); Listing_Standard list = new Listing_Standard(); list.ColumnWidth = lR.width; list.Begin(lR); list.Gap(); list.Label("TDiner.TableSearchDist".Translate()); list.Label(tableDistanceUnapplied.ToString()); tableDistanceUnapplied = (int)list.Slider(tableDistanceUnapplied, 0, 400); if (list.ButtonTextLabeled("TDiner.VDefault".Translate(), "TDiner.Set".Translate())) { tableDistanceUnapplied = TableDiner.modInstance.chairSearchDefault; overwriteNonDefaultUnapplied = false; } if (list.ButtonTextLabeled("TDiner.TDDefault".Translate(), "TDiner.Set".Translate())) { tableDistanceUnapplied = 60f; overwriteNonDefaultUnapplied = false; } list.Gap(); list.CheckboxLabeled("TDiner.overwriteNonDefault".Translate(), ref overwriteNonDefaultUnapplied); list.Gap(30f); //only show button if changes are made if (tableDistanceUnapplied != tableDistance || overwriteNonDefaultUnapplied != overwriteNonDefault) { if (list.ButtonText("TDiner.ApplyChanges".Translate())) { //only applying when player presses the 'apply' button, because we hav to search through a bunch of defs when we do apply. tableDistance = tableDistanceUnapplied; overwriteNonDefault = overwriteNonDefaultUnapplied; TableDiner.modInstance.Apply(); } } else { //empty space so alignment remains without the apply button list.Gap(30f); } list.CheckboxLabeled("TDiner.displayRing".Translate(), ref displayRing); list.CheckboxLabeled("TDiner.ExtraFeatures".Translate(), ref useExtraFeatures); list.Label("TDiner.RadiusNote".Translate()); list.End(); }
private static void NumberInput(Listing_Standard l, string label, ref float val, ref string buffer, float defaultVal, float min, float max) { try { l.TextFieldNumericLabeled <float>(label.Translate(), ref val, ref buffer, min, max); if (l.ButtonText("ResetButton".Translate())) { val = defaultVal; buffer = string.Format("{0:0.0###}", defaultVal); } } catch { val = min; buffer = string.Format("{0:0.0###}", min); } }
private static void NumberInput(Listing_Standard l, string label, ref int val, ref string buffer, int defaultVal, int min, int max) { try { l.TextFieldNumericLabeled <int>(label.Translate(), ref val, ref buffer, min, max); if (l.ButtonText("ResetButton".Translate())) { val = defaultVal; buffer = defaultVal.ToString(); } } catch { val = min; buffer = min.ToString(); } }
public override void DoSettingsWindowContents(Rect inRect) { base.DoSettingsWindowContents(inRect); var listing = new Listing_Standard(); Rect buttonRect = new Rect(inRect) { width = inRect.width / 5 }; listing.Begin(buttonRect); //listing.ConfirmationBoxCheckboxLabeled("DebugWriter".Translate(), ref settings.writeAllSettings); if (listing.ButtonText("GenerateLogInfo".Translate(), "GenerateLogInfoTooltip".Translate())) { DebugWriter.PushToFile(); } listing.End(); }
public static void DrawUI(Rect area) { var listingArea = area; listingArea.width = Mathf.Min(460, area.width); Listing_Standard listing = new Listing_Standard(); Widgets.BeginScrollView(listingArea, ref scroll, viewRect); listing.Begin(new Rect(0, 0, listingArea.width - 24, 99999)); listing.Gap(); listing.Label("RFS.Header".Translate()); listing.CheckboxLabeled("RFS.ShowAdvanced".Translate(), ref showAdvanced, "RFS.ShowAdvancedDesc".Translate()); GUI.color = Color.Lerp(Color.red, Color.white, 0.4f); bool reset = listing.ButtonText("Reset All"); GUI.color = Color.white; foreach (var item in GetAllEntries()) { try { if (reset) { item.Reset(); } if (item.IsAdvanced && !showAdvanced) { continue; } item.Draw(listing); } catch (Exception e) { Core.Error($"Exception drawing settings item '{item.Label}':", e); } } float h = listing.CurHeight; listing.End(); Widgets.EndScrollView(); viewRect = new Rect(0, 0, listingArea.width - 25, h); }
public override void DoWindowContents(Rect inRect) { Listing_Standard listing = new Listing_Standard(); listing.Begin(inRect); listing.Label("Toolkit Quick Menu"); foreach (ToolkitAddon addon in AddonRegistry.ToolkitAddons) { if (listing.ButtonText(addon.LabelCap)) { Find.WindowStack.Add(new FloatMenu(addon.GetAddonMenu().MenuOptions())); } } listing.End(); }
public override void DoSettingsWindowContents(Rect inRect) { checked { Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(inRect); listing_Standard.Label("SyrDoorMatsSlowdown".Translate() + ": " + DoorMatsSettings.slowdown, -1, "SyrDoorMatsSlowdownToolTip".Translate()); listing_Standard.Gap(6f); DoorMatsSettings.slowdown = (int)listing_Standard.Slider(GenMath.RoundTo(DoorMatsSettings.slowdown, 5), 0, 100); listing_Standard.Gap(24f); if (listing_Standard.ButtonText("SyrDoorMatsDefaultSettings".Translate(), "SyrDoorMatsDefaultSettingsTooltip".Translate())) { DoorMatsSettings.slowdown = 40; } listing_Standard.End(); settings.Write(); } }
private void ResetButton(Listing_Standard list) { var resetActive = SelShield.HasWantSettings; var prevColor = GUI.color; if (!resetActive) { GUI.color = GreyOutColor; } // TODO doesnt cancel other linear shield if (list.ButtonText("FrontierDevelopments.General.CancelFlick".Translate()) && resetActive) { SelShield.ClearWantSettings(); } GUI.color = prevColor; }
public static void DoSettings(UISettings settings, Rect rect) { float curY = 80; Rect rect2 = new Rect(0, curY, rect.width / 2 - 10, 250f); Listing_Standard listingStandard2 = new Listing_Standard(); listingStandard2.Begin(rect2); listingStandard2.Label("AG.ColorMode".Translate()); if (listingStandard2.RadioButton("AG.ColorNormal".Translate(), settings.colorMode == 0, 8f, "AG.ColorNormalTooltip".Translate(), 0f)) { settings.colorMode = 0; } if (listingStandard2.RadioButton("AG.ColorRPG".Translate(), settings.colorMode == 1, 8f, "AG.ColorRPGTooltip".Translate(), 0f)) { settings.colorMode = 1; } listingStandard2.Gap(30f); listingStandard2.End(); Rect rhs = new Rect(rect.width / 2 + 10, curY, rect.width / 2 - 10, 250f); Listing_Standard listingStandardRhs = new Listing_Standard(); listingStandardRhs.Begin(rhs); listingStandardRhs.CheckboxLabeled("AnimalGenetics.ShowGenesInAnimalsTab".Translate(), ref settings.showGenesInAnimalsTab, "AnimalGenetics.ShowGenesInAnimalsTabTooltip".Translate()); listingStandardRhs.CheckboxLabeled("AnimalGenetics.ShowGenesInWildlifeTab".Translate(), ref settings.showGenesInWildlifeTab, "AnimalGenetics.ShowGenesInWildlifeTabTooltip".Translate()); listingStandardRhs.CheckboxLabeled("AnimalGenetics.ShowBothParentsInPawnTab".Translate(), ref settings.showBothParentsInPawnTab, "AnimalGenetics.ShowBothParentsInPawnTabTooltip".Translate()); listingStandardRhs.CheckboxLabeled("AnimalGenetics.ShowGeneticsTab".Translate(), ref settings.showGeneticsTab, "AnimalGenetics.ShowGeneticsTabTooltip".Translate()); listingStandardRhs.End(); Listing_Standard bottom = new Listing_Standard(); Rect bottomRect = new Rect(0, rect2.y + listingStandard2.CurHeight, rect.width, 100); bottom.Begin(bottomRect); if (bottom.ButtonText("AG.DefaultSettings".Translate())) { settings.Reset(); } bottom.End(); Assembly.AnimalGeneticsAssemblyLoader.PatchUI(); }
public static void DoWindowContents(Rect inRect) { Listing_Standard listing = new Listing_Standard(); listing.Begin(inRect); if (listing.RadioButton("ColorDisplayOptionPillowLabel".Translate(), colorDisplayOption == ColorDisplayOption.Pillow, 0, "ColorDisplayOptionPillowTooltip".Translate())) { colorDisplayOption = ColorDisplayOption.Pillow; } if (listing.RadioButton("ColorDisplayOptionBlanketLabel".Translate(), colorDisplayOption == ColorDisplayOption.Blanket, 0, "ColorDisplayOptionBlanketTooltip".Translate())) { colorDisplayOption = ColorDisplayOption.Blanket; } listing.Gap(12f); int colorWashPercent = (int)(Mathf.Round(colorWash * 10) * 10); if (colorWash < 0.05f) { listing.Label("ColorWashLevel".Translate() + ": " + colorWashPercent + "% (" + "ColorWashNone".Translate() + ")", -1f, null); } else if (colorWash > 0.35f && colorWash < 0.45f) { listing.Label("ColorWashLevel".Translate() + ": " + colorWashPercent + "% (" + "ColorWashNormal".Translate() + ")", -1f, null); } else if (colorWash > 0.95f) { listing.Label("ColorWashLevel".Translate() + ": " + colorWashPercent + "% (" + "ColorWashTotal".Translate() + ")", -1f, null); } else { listing.Label("ColorWashLevel".Translate() + ": " + colorWashPercent + "%", -1f, null); } colorWash = listing.Slider(colorWash, 0f, 1f); listing.CheckboxLabeled("manuallyUnmakeBed".Translate(), ref manuallyUnmakeBed, "manuallyUnmakeBedTooltip".Translate()); listing.Gap(12f); if (listing.ButtonText("Reset", null)) { colorDisplayOption = ColorDisplayOption.Pillow; colorWash = 0.4f; manuallyUnmakeBed = false; } listing.End(); }
private static void DrawFailChances(Listing_Standard l, TechLevelRange techLevel, int[] defaults) { var qualities = Enum.GetValues(typeof(QualityCategory)); for (int i = 0; i < qualities.Length; ++i) { int failChance = techLevel.FailChanceByQuality[i]; string buffer = failChance.ToString(); NumberInput(l, ((QualityCategory)i).ToString(), ref failChance, ref buffer, 0, 100); techLevel.FailChanceByQuality[i] = failChance; } if (l.ButtonText("ResetButton".Translate())) { for (int i = 0; i < defaults.Length; ++i) { techLevel.FailChanceByQuality[i] = defaults[i]; } } }
public override void DoSettingsWindowContents(Rect inRect) { Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(inRect); if (listing_Standard.ButtonText("Default Settings")) { ModSettings.Reset(); } listing_Standard.Label(String.Format("Days for depleted mine to disappear {0}", ModSettings.DaysToDissappear).ToString()); ModSettings.DaysToDissappear = (int)Mathf.Round(listing_Standard.Slider(ModSettings.DaysToDissappear, 3, 60)); listing_Standard.Label(String.Format("Chance for mine to become abadoned after depletion ( every value below 80% might me unbalanced) {0}", ModSettings.ChanceToDissapear).ToString()); ModSettings.ChanceToDissapear = (int)Mathf.Round(listing_Standard.Slider(ModSettings.ChanceToDissapear, 0, 100)); listing_Standard.Label(String.Format("Work time duration, smaller it is the faster is the mining job {0}", (int)ModSettings.WorkDuration).ToString()); ModSettings.WorkDuration = (int)Mathf.Round(listing_Standard.Slider(ModSettings.WorkDuration, 3000, 10000)); listing_Standard.CheckboxLabeled("[Debug] Should mod log chunk/ore chance?", ref ModSettings.ShouldLog); listing_Standard.End(); ModSettings.Write(); }
// Token: 0x06000017 RID: 23 RVA: 0x00002C68 File Offset: 0x00000E68 public static void Draw_FemaleBody(Listing_Standard gui, Rect inRect) { bool flag = gui.ButtonText("Back", null); if (flag) { Settings.draw = new Settings.Draw(Settings.Draw_Root); Settings.Female_BodyLabel_Refresh(); } gui.Gap(10f); gui.ColumnWidth /= 2f; int num = Settings.Female_BodyThin ? 0 : (Settings.Female_BodyAverage ? 1 : (Settings.Female_BodyFat ? 2 : 3)); gui.CheckboxLabeled("Make Average Body Gender-Specific", ref Settings.Female_BodyFix, "Some backstories will give pawns average body of the opposite gender. Enabling this will disable it."); gui.CheckboxLabeled("Thin", ref Settings.Female_BodyThin, null); gui.CheckboxLabeled("Average", ref Settings.Female_BodyAverage, null); gui.CheckboxLabeled("Fat", ref Settings.Female_BodyFat, null); gui.CheckboxLabeled("Hulk", ref Settings.Female_BodyHulk, null); bool flag2 = !Settings.Female_BodyThin && !Settings.Female_BodyAverage && !Settings.Female_BodyFat && !Settings.Female_BodyHulk; if (flag2) { switch (num) { case 0: Settings.Female_BodyThin = true; break; case 1: Settings.Female_BodyAverage = true; break; case 2: Settings.Female_BodyFat = true; break; case 3: Settings.Female_BodyHulk = true; break; } } }
private void AddAssignWorkerButton(Listing_Standard listing_Standard) { var workerLabel = "Anybody".Translate(); if (extendable.AssignedPawn != null) { workerLabel = extendable.AssignedPawn.NameStringShort.CapitalizeFirst().Truncate(listing_Standard.ColumnWidth); } if (listing_Standard.ButtonText(workerLabel, null)) { var list = new List <FloatMenuOption>(); list.Add(new FloatMenuOption("Anybody".Translate(), delegate { extendable.AssignedPawn = null; }, MenuOptionPriority.Default, null, null, 0f, null)); foreach (var colonist in bill.GetSortedSatisfyWorker()) { list.Add(new FloatMenuOption(colonist.NameStringShort, delegate { extendable.AssignedPawn = colonist; }, MenuOptionPriority.Default, null, null, 0f, null)); } Find.WindowStack.Add(new FloatMenu(list)); } }
// private static float scrollViewHeight=100f; public static void DoSettingsWindowContents(Rect inRect) { Listing_Standard l = new Listing_Standard(GameFont.Medium); // my tiny high-resolution monitor :p l.Begin(inRect); l.GapLine(); // Intelligence to haul to string [] intLabels = { "LWM_DS_Int_Animal".Translate(), "LWM_DS_Int_ToolUser".Translate(), "LWM_DS_Int_Humanlike".Translate(), }; // This setting was changed by HugsLib setting. Am phasing out now: if (l.EnumRadioButton <Intelligence>(ref Patch_IsGoodStoreCell.NecessaryIntelligenceToUseDeepStorage, "LWM_DS_IntTitle".Translate(), "LWM_DS_IntDesc".Translate(), false, intLabels)) { intelligenceWasChanged = true; } l.GapLine(); //Storing Delay l.Label("LWMDSstoringDelaySettings".Translate()); l.CheckboxLabeled("LWMDSstoringTakesTimeLabel".Translate(), ref storingTakesTime, "LWMDSstoringTakesTimeDesc".Translate()); l.Label("LWMDSstoringGlobalScale".Translate((storingGlobalScale * 100f).ToString("0."))); storingGlobalScale = l.Slider(storingGlobalScale, 0f, 2f); l.CheckboxLabeled("LWMDSstoringTimeConsidersStackSize".Translate(), ref storingTimeConsidersStackSize, "LWMDSstoringTimeConsidersStackSizeDesc".Translate()); if (l.ButtonText("LWMDSstoringDelaySettings".Translate() + ": " + "ResetBinding".Translate() /*Reset to Default*/)) { storingTakesTime = true; storingGlobalScale = 1f; storingTimeConsidersStackSize = true; } l.GapLine(); l.End(); }
private const float indoorsNoNaturalLightPenaltyDefault = 3f; //indoors accelerated degradation when not under windows public static void DoWindowContents(Rect inRect) { Listing_Standard listing = new Listing_Standard(); listing.Begin(inRect); string label = "IndoorsNoNaturalLightPenalty".Translate() + ": " + IndoorsNoNaturalLightPenalty.ToStringDecimalIfSmall() + "x"; string desc = ("IndoorsNoNaturalLightPenaltyDesc").Translate(); listing.Label(label, -1f, desc); IndoorsNoNaturalLightPenalty = listing.Slider(IndoorsNoNaturalLightPenalty, 1f, 10f); if (IsBeautyOn) { listing.Gap(12f); string label2 = "BeautySensitivityReduction".Translate() + ": " + BeautySensitivityReduction.ToStringPercent(); string desc2 = ("BeautySensitivityReductionDesc").Translate(); listing.Label(label2, -1f, desc2); BeautySensitivityReduction = listing.Slider(BeautySensitivityReduction, 0f, 1f); } listing.Gap(12f); listing.Label(("LinkOptionsLabel").Translate() + " (" + ("RequiresRestart").Translate() + "):"); listing.GapLine(); listing.CheckboxLabeled(("LinkWindowsAndWalls").Translate(), ref LinkWindows); if (LoadedModManager.RunningModsListForReading.Any(x => x.Name.Contains("RimFridge"))) { listing.CheckboxLabeled(("LinkFridgesAndWalls").Translate(), ref LinkVents); } else { listing.CheckboxLabeled(("LinkVentsAndWalls").Translate(), ref LinkVents); } listing.Gap(12f); if (listing.ButtonText("Reset", null)) { BeautySensitivityReduction = 0.25f; IndoorsNoNaturalLightPenalty = 3f; LinkWindows = true; LinkVents = true; } listing.End(); }
//Main window thing public override void DoSettingsWindowContents(Rect inRect) { Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(inRect); listing_Standard.AddLabeledCheckbox("MessagesEnabledLabel".Translate() + " ", ref settings.SOmessagesEnabled); listing_Standard.AddLabeledCheckbox("AggroCalmEnabledLabel".Translate() + " ", ref settings.SOAggroCalmEnabled); listing_Standard.AddLabeledCheckbox("OpinionOnlyEnabledLabel".Translate() + " ", ref settings.SOOpnOnly); listing_Standard.AddLabeledCheckbox("NonFactionEnabledLabel".Translate() + " ", ref settings.SONonFaction); listing_Standard.AddLabeledCheckbox("TraderCalmEnabledLabel".Translate() + " ", ref settings.SOTraderCalm); listing_Standard.AddLabeledCheckbox("AdvancedMenu".Translate() + " ", ref settings.SOAdvanced); if (SOMod.settings.SOAdvanced) { listing_Standard.AddLabelLine("Formula = diplomacy skill * social multiplier + opinion * opinion multiplier"); //listing_Standard.AddLabeledSlider("SMultLabel".Translate() + " - " + SOMod.settings.SODipWeight, ref settings.SODipWeight, 0f, 1f); done //listing_Standard.AddLabeledSlider("OMultLabel".Translate() + " - " + SOMod.settings.SOOpnWeight, ref settings.SOOpnWeight, 0f, 1f); done //listing_Standard.AddLabeledSlider("OOMultLabel".Translate() + " - " + SOMod.settings.SOOOpnWeight, ref settings.SOOOpnWeight, 0f, 1f); done //listing_Standard.AddLabeledSlider("StunWeight".Translate() + " - " + SOMod.settings.SOStunWeight, ref settings.SOStunWeight, 0f, 1f); done listing_Standard.AddLabeledNumericalTextField("SMultLabel".Translate(), ref settings.SODipWeight, (float)0.5, 0, 1); listing_Standard.AddLabeledNumericalTextField("OMultLabel".Translate(), ref settings.SOOpnWeight, (float)0.5, 0, 1); listing_Standard.AddLabeledNumericalTextField("OOMultLabel".Translate().Translate(), ref settings.SOOOpnWeight, (float)0.5, 0, 1); listing_Standard.AddLabeledNumericalTextField("StunWeight".Translate(), ref settings.SOStunWeight, (float)0.5, 0, 1); listing_Standard.AddLabeledNumericalTextField("CalmDuration".Translate(), ref SOMod.settings.SOCalmDuration); listing_Standard.AddLabeledNumericalTextField("Cooldown".Translate(), ref SOMod.settings.SOCooldown); listing_Standard.AddLabeledCheckbox("DebugChanceSetting".Translate() + " ", ref settings.SODebug); if (listing_Standard.ButtonText("Default")) { SnapUtils.logThis("Reset advanced settings to defaults"); SOMod.settings.SODipWeight = 0.2f; SOMod.settings.SOOpnWeight = 0.0014f; SOMod.settings.SOOOpnWeight = 0.006f; SOMod.settings.SOStunWeight = 0.55f; SOMod.settings.SOCalmDuration = 1250; SOMod.settings.SODebug = false; SOMod.settings.SOCooldown = 15000; } } listing_Standard.End(); settings.Write(); }
private void DrawModsEditing(Listing_Standard lst) { lst.Label("Additional mod(s) needed:"); modIdToAdd = lst.TextEntry(modIdToAdd); if (lst.ButtonText("Add mod package id")) { this.mods.Add(modIdToAdd); } if (this.mods.Count > 0) { foreach (string mod in this.mods) { if (lst.ButtonTextLabeled(mod, "Remove mod")) { this.mods.Remove(mod); break; } } } }
protected override void FillTab() { Rect rect = new Rect(0f, 0f, size.x, size.y).ContractedBy(10f); Listing_Standard listing = new Listing_Standard(GameFont.Small); listing.Begin(rect); listing.Label(SelBuilding.LabelCap); if (listing.ButtonTextLabeled("PRFBoundStorageBuilding".Translate(), SelBuilding.boundStorageUnit?.LabelCap ?? "NoneBrackets".Translate())) { List <FloatMenuOption> list = (from Building_MassStorageUnit b in Find.CurrentMap.listerBuildings.AllBuildingsColonistOfClass <Building_MassStorageUnit>() select new FloatMenuOption(b.LabelCap, () => SelBuilding.boundStorageUnit = b)).ToList(); if (list.Count == 0) { list.Add(new FloatMenuOption("NoneBrackets".Translate(), null)); } Find.WindowStack.Add(new FloatMenu(list)); } listing.GapLine(); listing.Label("PRFDepositWithdraw".Translate()); if (listing.ButtonTextLabeled("PRFDepositWithdrawMode".Translate(), (deposit ? "PRFDeposit" : "PRFWithdraw").Translate())) { Find.WindowStack.Add(new FloatMenu(new List <FloatMenuOption>() { new FloatMenuOption("PRFDeposit".Translate(), () => { deposit = true; }), new FloatMenuOption("PRFWithdraw".Translate(), () => { deposit = false; }) })); } amountTextArea = listing.TextEntryLabeled("PRFAmount".Translate(), amountTextArea); if (listing.ButtonText("PRFDepositWithdraw".Translate())) { HandleDepositWithdrawRequest(); } listing.End(); }
public static void DoWindowContents(Rect rect, Listing_Standard optionsListing) { optionsListing.Label("TwitchToolkitCommandsMenuExpl".Translate()); optionsListing.Gap(); optionsListing.CheckboxLabeled("TwitchToolkitCommandsModsEnabled".Translate(), ref ToolkitSettings.CommandsModsEnabled); optionsListing.Gap(); optionsListing.AddLabeledTextField("TwitchToolkitBalancecmd".Translate(), ref ToolkitSettings.BalanceCmd); optionsListing.AddLabeledTextField("TwitchToolkitBuyeventcmd".Translate(), ref ToolkitSettings.BuyeventCmd); optionsListing.AddLabeledTextField("TwitchToolkitBuyitemcmd".Translate(), ref ToolkitSettings.BuyitemCmd); optionsListing.AddLabeledTextField("TwitchToolkitInstructionscmd".Translate(), ref ToolkitSettings.InstructionsCmd); optionsListing.AddLabeledTextField("TwitchToolkitPurchaselistcmd".Translate(), ref ToolkitSettings.PurchaselistCmd); optionsListing.AddLabeledTextField("TwitchToolkitModinfocmd".Translate(), ref ToolkitSettings.ModinfoCmd); optionsListing.AddLabeledTextField("TwitchToolkitModsettingscmd".Translate(), ref ToolkitSettings.ModsettingsCmd); optionsListing.AddLabeledTextField("TwitchToolkitKarmacmd".Translate(), ref ToolkitSettings.KarmaCmd); optionsListing.AddLabeledTextField("TwitchToolkitGiftcmd".Translate(), ref ToolkitSettings.GiftCmd); optionsListing.AddLabeledTextField("TwitchToolkitCommandhelpcmd".Translate(), ref ToolkitSettings.CommandHelpCmd); optionsListing.Gap(); optionsListing.ColumnWidth = rect.width / 3; optionsListing.NewColumn(); if (optionsListing.ButtonText("TwitchToolkitCommandsLanguage".Translate())) { ToolkitSettings.BalanceCmd = "TwitchToolkitBalCmd".Translate(); ToolkitSettings.BuyeventCmd = "TwitchToolkitBuyEventCmd".Translate(); ToolkitSettings.BuyitemCmd = "TwitchTookitBuyItemCmd".Translate(); ToolkitSettings.InstructionsCmd = "TwitchToolkitInstructionsCmd".Translate(); ToolkitSettings.PurchaselistCmd = "TwitchToolkitPurchaseListCmd".Translate(); ToolkitSettings.ModinfoCmd = "TwitchToolkitModInfoCmd".Translate(); ToolkitSettings.ModsettingsCmd = "TwitchToolkitModSettingsCmd".Translate(); ToolkitSettings.KarmaCmd = "TwitchToolkitKarmaCmd".Translate(); ToolkitSettings.GiftCmd = "TwitchToolkitGiftCmd".Translate(); ToolkitSettings.CommandHelpCmd = "TwitchToolkitCmdHelpCmd".Translate(); } optionsListing.NewColumn(); }
public override void DoWindowContents(Rect inRect) { MapDesignerSettings settings = MapDesignerMod.mod.settings; List <ThingDef> list = HelperMethods.GetMineableList(); Listing_Standard outerListing = new Listing_Standard(); outerListing.Begin(inRect); if (outerListing.ButtonText("ZMD_resetOreTypes".Translate())) { ResetAllOre(settings, list); } Rect windowRect = outerListing.GetRect(inRect.height - outerListing.CurHeight).ContractedBy(4f); Rect viewRect = new Rect(0f, 0f, 400f, 50f + 24 * list.Count()); Widgets.BeginScrollView(windowRect, ref scrollPosition, viewRect, true); Listing_Standard listing = new Listing_Standard(); listing.Begin(viewRect); foreach (ThingDef ore in list) { float commonality = settings.oreCommonality[ore.defName]; //listing.CheckboxLabeled(ore.label, ref commonality); commonality = InterfaceUtility.LabeledSlider(listing, settings.oreCommonality[ore.defName], 0f, 2.5f, ore.label);; settings.oreCommonality[ore.defName] = commonality; } listing.End(); Widgets.EndScrollView(); }
private void DrawTagsEditing(Listing_Standard lst) { lst.Label("Structure tags:"); tempTagToAdd = lst.TextEntry(tempTagToAdd); if (lst.ButtonText("Add tag")) { this.tags.Add(tempTagToAdd); } if (this.tags.Count > 0) { foreach (string tag in this.tags) { if (lst.ButtonTextLabeled(tag, "Remove tag")) { this.tags.Remove(tag); break; } } } lst.Gap(); }
public override void DoSettingsWindowContents(Rect inRect) { var rect = inRect.GetHGrid(1f, -1f, 400f, -1f)[2]; var listing = new Listing_Standard(); listing.Begin(rect); if (Registry.IsActive) { if (listing.ButtonText(Lang.Get("Button.RemoveMod"), Lang.Get("Button.RemoveModDesc"))) { Dialog_Alert.Open(Lang.Get("Button.RemoveModConfirm"), Dialog_Alert.Buttons.YesNo, Registry.DeactivateMod); } } else { listing.Label(Lang.Get("Settings.NoGame")); } listing.End(); }
public override void DoSettingsWindowContents(Rect inRect) { var listingStandard = new Listing_Standard(); listingStandard.Begin(inRect); var borderSizeBuffer = ((int)Settings.BorderSize).ToString(); listingStandard.Label("Set border size in pixels"); listingStandard.IntEntry(ref _borderSize, ref borderSizeBuffer); Settings.BorderSize = _borderSize; listingStandard.Label("Gradient starting opacity (transparent -> solid)"); Settings.StartAlpha = listingStandard.Slider(Settings.StartAlpha, 0f, 1.0f); listingStandard.Label("Gradient final opacity (transparent -> solid)"); Settings.EndAlpha = listingStandard.Slider(Settings.EndAlpha, 0f, 1.0f); listingStandard.Label("Border color. (Red, Green, Blue)"); Settings.Color_R = listingStandard.Slider(Settings.Color_R, 0f, 1.0f); Settings.Color_G = listingStandard.Slider(Settings.Color_G, 0f, 1.0f); Settings.Color_B = listingStandard.Slider(Settings.Color_B, 0f, 1.0f); var buttonText = listingStandard.ButtonText("Reset to default"); if (buttonText) { Settings.BorderSize = 25f; Settings.StartAlpha = 0.25f; Settings.EndAlpha = 0.25f; Settings.Color_R = 1.0f; Settings.Color_G = 0.0f; Settings.Color_B = 0.0f; } listingStandard.End(); base.DoSettingsWindowContents(inRect); }
public static void DrawTerrainCard(Rect rect) { Listing_Standard listing = new Listing_Standard(); listing.Begin(rect); listing.Label("ZMD_terrainTabInfo".Translate()); listing.GapLine(); settings.terrainFert = InterfaceUtility.LabeledSlider(listing, settings.terrainFert, 0.30f, 2f, String.Format("ZMD_terrainFertAmt".Translate(), Math.Round(100 * settings.terrainFert))); settings.terrainWater = InterfaceUtility.LabeledSlider(listing, settings.terrainWater, 0.30f, 2f, String.Format("ZMD_terrainWaterAmt".Translate(), Math.Round(100 * settings.terrainWater)), null, null, null, "ZMD_terrainWaterTooltip".Translate()); listing.CheckboxLabeled("ZMD_flagTerrainWater".Translate(), ref settings.flagCaves, "ZMD_flagTerrainWater".Translate()); // Rocks listing.GapLine(); List <ThingDef> rockList = HelperMethods.GetRockList(); int maxRocks = Math.Min(15, rockList.Count); //InterfaceUtility.LabeledIntRange(listing, ref settings.rockTypeRange, 1, 5, "ZMD_rockTypeRange".Translate()); InterfaceUtility.LabeledIntRange(listing, ref settings.rockTypeRange, 1, maxRocks, "ZMD_rockTypeRange".Translate()); listing.CheckboxLabeled("ZMD_flagBiomeRocks".Translate(), ref settings.flagBiomeRocks, "ZMD_flagBiomeRocksTooltip".Translate()); if (InterfaceUtility.SizedTextButton(listing, "ZMD_chooseRockTypes".Translate())) { Find.WindowStack.Add(new RockSelectionDialog()); } // reset listing.GapLine(); if (listing.ButtonText("ZMD_resetTerrain".Translate())) { ResetTerrainSettings(); } listing.End(); }