public override void ModOptions(ref Listing_Standard listing_Standard, Rect rect, Rect inRect, float num, float num2) { listing_Standard.CheckboxLabeled("AMA_ShowSpecialRules".Translate(), ref settings.ShowSpecialRules, "AMA_ShowSpecialRulesDesc".Translate()); Rect rectShowSpecialRules = new Rect(rect.x, rect.y + 10, num, 120f); if (settings.ShowSpecialRules) { listing_Standard.BeginSection(30f * 1f); CheckboxLabeled(rectShowSpecialRules.TopHalf().TopHalf().LeftHalf().ContractedBy(4), "AMA_AllowDeepStrike".Translate(), ref settings.AllowDeepStrike, "AMA_AllowDeepStrikeDesc".Translate()); CheckboxLabeled(rectShowSpecialRules.TopHalf().TopHalf().RightHalf().ContractedBy(4), "AMA_AllowInfiltrate".Translate(), ref settings.AllowInfiltrate, "AMA_AllowInfiltrateDesc".Translate()); listing_Standard.EndSection(listing_Standard); } listing_Standard.CheckboxLabeled("AMA_ShowWeaponSpecialRules".Translate(), ref settings.ShowWeaponSpecialRules, "AMA_ShowWeaponSpecialRulesDesc".Translate()); Rect rectShowWeaponSpecialRules = new Rect(rect.x, rect.y + 10, num, 120f); if (settings.ShowWeaponSpecialRules) { listing_Standard.BeginSection(30f * 4f); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().TopHalf().LeftHalf().ContractedBy(4), "AMA_AllowRapidFire".Translate(), ref settings.AllowRapidFire, "AMA_AllowRapidFireDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().BottomHalf().LeftHalf().ContractedBy(4), "AMA_AllowGetsHot".Translate(), ref settings.AllowGetsHot, "AMA_AllowGetsHotDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().TopHalf().RightHalf().ContractedBy(4), "AMA_AllowJams".Translate(), ref settings.AllowJams, "AMA_AllowJamsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().BottomHalf().RightHalf().ContractedBy(4), "AMA_AllowMultiShot".Translate(), ref settings.AllowMultiShot, "AMA_AllowMultiShotDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.BottomHalf().TopHalf().LeftHalf().ContractedBy(4), "AMA_AllowUserEffects".Translate(), ref settings.AllowUserEffects, "AMA_AllowUserEffectsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.BottomHalf().BottomHalf().LeftHalf().ContractedBy(4), "AMA_AllowForceWeaponEffect".Translate(), ref settings.AllowForceWeaponEffect, "AMA_AllowForceWeaponEffectDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.BottomHalf().TopHalf().RightHalf().ContractedBy(4), "AMA_AllowRendingMeleeEffect".Translate(), ref settings.AllowUserEffects, "AMA_AllowUserEffectsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.BottomHalf().BottomHalf().RightHalf().ContractedBy(4), "AMA_AllowRendingRangedEffect".Translate(), ref settings.AllowForceWeaponEffect, "AMA_AllowForceWeaponEffectDesc".Translate()); listing_Standard.EndSection(listing_Standard); } listing_Standard.CheckboxLabeled("AMA_ShowAllowedWeapons".Translate(), ref settings.ShowAllowedWeapons, "AMA_ShowAllowedWeaponsDesc".Translate()); Rect rectShowAllowedWeapons = new Rect(rect.x, rect.y + 10, num, 120f); if (settings.ShowAllowedWeapons) { listing_Standard.BeginSection(30f * 4f); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().TopHalf().LeftHalf().LeftHalf().ContractedBy(4), "AMA_AllowImperialWeapons".Translate(), ref settings.AllowImperialWeapons, "AMA_AllowImperialWeaponsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().TopHalf().LeftHalf().RightHalf().ContractedBy(4), "AMA_AllowMechanicusWeapons".Translate(), ref settings.AllowMechanicusWeapons, "AMA_AllowMechanicusWeaponsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().BottomHalf().LeftHalf().ContractedBy(4), "AMA_AllowChaosWeapons".Translate(), ref settings.AllowChaosWeapons, "AMA_AllowChaosWeaponsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().TopHalf().RightHalf().ContractedBy(4), "AMA_AllowEldarWeapons".Translate(), ref settings.AllowEldarWeapons, "AMA_AllowEldarWeaponsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.TopHalf().BottomHalf().RightHalf().ContractedBy(4), "AMA_AllowDarkEldarWeapons".Translate(), ref settings.AllowDarkEldarWeapons, "AMA_AllowDarkEldarWeaponsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.BottomHalf().TopHalf().LeftHalf().ContractedBy(4), "AMA_AllowTauWeapons".Translate(), ref settings.AllowTauWeapons, "AMA_AllowTauWeaponsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.BottomHalf().BottomHalf().LeftHalf().ContractedBy(4), "AMA_AllowOrkWeapons".Translate(), ref settings.AllowOrkWeapons, "AMA_AllowOrkWeaponsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.BottomHalf().TopHalf().RightHalf().ContractedBy(4), "AMA_AllowNecronWeapons".Translate(), ref settings.AllowNecronWeapons, "AMA_AllowNecronWeaponsDesc".Translate()); CheckboxLabeled(rectShowWeaponSpecialRules.BottomHalf().BottomHalf().RightHalf().ContractedBy(4), "AMA_AllowTyranidWeapons".Translate(), ref settings.AllowTyranidWeapons, "AMA_AllowTyranidWeaponsDesc".Translate()); listing_Standard.EndSection(listing_Standard); } XenobiologisSettings(ref listing_Standard, rect, inRect, num, num2); ImperialSettings(ref listing_Standard, rect, inRect, num, num2); ChaosSettings(ref listing_Standard, rect, inRect, num, num2); EldarSettings(ref listing_Standard, rect, inRect, num, num2); OrkSettings(ref listing_Standard, rect, inRect, num, num2); TauSettings(ref listing_Standard, rect, inRect, num, num2); NecronSettings(ref listing_Standard, rect, inRect, num, num2); TyranidSettings(ref listing_Standard, rect, inRect, num, num2); }
private void RenderConsumer(Listing_Standard list, IPowerConsumer consumer) { var section = list.BeginSection(ConsumerHeight); DrawIcon(section, 32); DrawLabel(section, consumer); if (!consumer.Essential && SelPawn.Faction == Faction.OfPlayer) { var enableWhileDrafted = consumer.EnableWhileDrafted; var enableWhileNotDrafted = consumer.EnabledWhileNotDrafted; var enableInCombat = consumer.EnabledInCombat; var enableOutOfCombat = consumer.EnabledOutOfCombat; section.CheckboxLabeled("Cyberization.ITab.Power.WhileDrafted".Translate(), ref enableWhileDrafted); section.CheckboxLabeled("Cyberization.ITab.Power.WhileNotDrafted".Translate(), ref enableWhileNotDrafted); section.CheckboxLabeled("Cyberization.ITab.Power.InCombat".Translate(), ref enableInCombat); section.CheckboxLabeled("Cyberization.ITab.Power.OutOfCombat".Translate(), ref enableOutOfCombat); consumer.EnableWhileDrafted = enableWhileDrafted; consumer.EnabledWhileNotDrafted = enableWhileNotDrafted; consumer.EnabledInCombat = enableInCombat; consumer.EnabledOutOfCombat = enableOutOfCombat; } else { section.Label("Cyberization.ITab.Power.CantDisable".Translate()); } DrawPowerSlider(section, consumer); list.EndSection(section); list.Gap(); }
public static Listing_Standard BeginSection_OnePointOne(this Listing_Standard listing_Main, float f) { #pragma warning disable CS0612 // Type or member is obsolete return(listing_Main.BeginSection(f)); #pragma warning restore CS0612 // Type or member is obsolete }
static void ShowTyranid(ref Listing_Standard listing_Standard, Rect rect2, AMXBSettings settings) { listing_Standard.BeginSection(60f); Widgets.CheckboxLabeled(rect2.TopHalf().LeftHalf().ContractedBy(4), "AMXB_AllowTyranid".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tyranid")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowTyranid, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tyranid"))); Widgets.CheckboxLabeled(rect2.TopHalf().RightHalf().ContractedBy(4), "AMXB_AllowTyranidInfestation".Translate(), ref settings.AllowTyranidInfestation, !DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Tyranid_Infestation"))); listing_Standard.EndSection(listing_Standard); }
private void DrawInfo(Listing_Standard holder) { Listing_Standard listing_Standard = holder.BeginSection(100f); if (this.task.Suspended) { if (listing_Standard.ButtonText("Suspended".Translate(), (string)null)) { this.task.Suspended = false; SoundDefOf.Click.PlayOneShotOnCamera((Map)null); } } else if (listing_Standard.ButtonText("NotSuspended".Translate(), (string)null)) { this.task.Suspended = true; SoundDefOf.Click.PlayOneShotOnCamera((Map)null); } StringBuilder stringBuilder = new StringBuilder(); if (this.task.Description != null) { stringBuilder.AppendLine(this.task.Description); stringBuilder.AppendLine(); } Verse.Text.Font = GameFont.Small; string str4 = stringBuilder.ToString(); listing_Standard.Label(str4, -1f, (string)null); Verse.Text.Font = GameFont.Small; holder.EndSection(listing_Standard); }
protected override void FillTab() { var components = SelShield.UiComponents.ToList(); const float buttonHeight = 30f; const float sectionBorder = 4f; const float gapHeight = 12f; var viewHeight = components.Aggregate(buttonHeight, (total, component) => total + component.Height + sectionBorder * 2 + gapHeight); var outRect = new Rect(ViewMargin, ViewMargin, size.x - ViewMargin, size.y - ViewMargin); var viewRect = new Rect(0, 0, size.x - ViewMargin * 2, viewHeight); Widgets.BeginScrollView(outRect, ref _scrollPosition, viewRect, true); var list = new Listing_Standard(); list.Begin(viewRect); ResetButton(list); foreach (var component in components) { var section = list.BeginSection(component.Height, sectionBorder, sectionBorder); component.Draw(section.GetRect(component.Height)); list.EndSection(section); list.Gap(gapHeight); } list.End(); Widgets.EndScrollView(); }
static void ShowOrk(ref Listing_Standard listing_Standard, Rect rect2, AMXBSettings settings) { listing_Standard.BeginSection(60f); Widgets.CheckboxLabeled(rect2.TopHalf().LeftHalf().ContractedBy(4), "AMXB_AllowOrkTek".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowOrkTek, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Tek"))); Widgets.CheckboxLabeled(rect2.BottomHalf().LeftHalf().ContractedBy(4), "AMXB_AllowOrkFeral".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Feral")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowOrkFeral, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Ork_Feral"))); Widgets.CheckboxLabeled(rect2.TopHalf().RightHalf().ContractedBy(4), "AMXB_AllowOrkRok".Translate(), ref settings.AllowOrkRok, false); listing_Standard.EndSection(listing_Standard); }
static void ShowNecron(ref Listing_Standard listing_Standard, Rect rect2, AMXBSettings settings) { listing_Standard.BeginSection(60f); Widgets.CheckboxLabeled(rect2.TopHalf().LeftHalf().ContractedBy(4), "AMXB_AllowNecron".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Necron")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowNecron, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Necron"))); Widgets.CheckboxLabeled(rect2.BottomHalf().LeftHalf().ContractedBy(4), "AMXB_AllowNecronWellBeBack".Translate(), ref settings.AllowNecronWellBeBack, false); Widgets.CheckboxLabeled(rect2.TopHalf().RightHalf().ContractedBy(4), "AMXB_AllowNecronMonolith".Translate(), ref settings.AllowNecronMonolith, false); listing_Standard.EndSection(listing_Standard); }
private void PawnRestriction(Listing_Standard holder) { Listing_Standard listing_Standard = holder.BeginSection(100f); listing_Standard.Label("ReligionInfo_ActivityPawnRestriction".Translate()); Widgets.Dropdown <ActivityTask, Pawn>(listing_Standard.GetRect(30f), this.task, (ActivityTask b) => b.PawnRestriction, (ActivityTask b) => this.GeneratePawnRestrictionOptions(), (this.task.PawnRestriction != null) ? this.task.PawnRestriction.LabelShortCap : "AnyWorker".Translate(), null, null, null, null, false); holder.EndSection(listing_Standard); }
public void DoWindowContents(Rect wrect) { Listing_Standard options = new Listing_Standard(); Color defaultColor = GUI.color; options.Begin(wrect); Rect rect0 = new Rect(0f, 0f, wrect.width - 30f, wrect.height); GUI.color = defaultColor; Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; options.Gap(); float lineHeight = Text.LineHeight; Rect rect1a = options.GetRect(lineHeight); Rect rect1b = new Rect(rect1a.x + options.ColumnWidth - 275f, rect1a.y, 198f, 24f); Rect rect1c = new Rect(rect1a.x + options.ColumnWidth - 75f, rect1b.y, 73f, 24f); Widgets.Label(rect1a, "AP_PatchTreeDebug".Translate()); Widgets.Dropdown(rect1b, patchTree, t => t, PatchTreeDebugElements, patchTree?.defName); if (patchTree != null) { var val = patchTreeDebug.TryGetValue(patchTree, int.MinValue); Widgets.Dropdown(rect1c, patchTree, t => patchTreeDebug.TryGetValue(t, int.MinValue), PatchTreeDebugValues, val == int.MinValue ? "Default".Translate().ToString() : val.ToString()); } options.Gap(); Filter = options.TextEntryLabeled("Filter".Translate(), Filter, 1); #if V11 var itemsWindow = options.BeginSection(340f); #else var itemsWindow = options.BeginSection_NewTemp(340f); #endif itemsWindow.ColumnWidth = ((rect0.width - 50f) / 3f); if (patchTree != null) { foreach (var node in patchTree?.Nodes) { string text = node.ToString(); if (text.ToLower().Contains(Filter?.ToLower())) { Rect rect3 = itemsWindow.GetRect(lineHeight); TextAnchor anchor = Text.Anchor; // Text.Anchor = TextAnchor.MiddleLeft; var val = nodeDebug.TryGetValue(node, int.MinValue); var valText = val == int.MinValue ? "Default".Translate().ToString() : val.ToString(); Widgets.Label(rect3, text); Rect rect4 = new Rect(rect3.x + itemsWindow.ColumnWidth - 75f, rect3.y, 73f, 24f); Widgets.Dropdown(rect4, node, t => nodeDebug.TryGetValue(t, int.MinValue), NodeDebugValues, valText, paintable: true); } } } itemsWindow.End(); options.End(); if (flagChanged) { Mod.GetSettings <Settings>().Write(); flagChanged = false; } }
static void ShowImperium(ref Listing_Standard listing_Standard, Rect rect2, AMXBSettings settings) { listing_Standard.BeginSection(60f); Widgets.CheckboxLabeled(rect2.TopHalf().LeftHalf().ContractedBy(4), "AMXB_AllowAdeptusAstartes".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Astartes")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowAdeptusAstartes, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Astartes")) || !AMASettings.Instance.AllowImperialWeapons); Widgets.CheckboxLabeled(rect2.BottomHalf().LeftHalf().ContractedBy(4), "AMXB_AllowAdeptusMechanicus".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Mechanicus")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowAdeptusMechanicus, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Mechanicus")) || !AMASettings.Instance.AllowMechanicusWeapons); Widgets.CheckboxLabeled(rect2.TopHalf().RightHalf().ContractedBy(4), "AMXB_AllowAdeptusMilitarum".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Militarum")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowAdeptusMilitarum, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Militarum")) || !AMASettings.Instance.AllowImperialWeapons); Widgets.CheckboxLabeled(rect2.BottomHalf().RightHalf().ContractedBy(4), "AMXB_AllowAdeptusSororitas".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Sororitas")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowAdeptusSororitas, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Sororitas")) || !AMASettings.Instance.AllowImperialWeapons); listing_Standard.EndSection(listing_Standard); }
static void ShowEldar(ref Listing_Standard listing_Standard, Rect rect2, AMXBSettings settings) { listing_Standard.BeginSection(60f); Widgets.CheckboxLabeled(rect2.TopHalf().LeftHalf().ContractedBy(4), "AMXB_AllowEldarCraftworld".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Craftworld")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowEldarCraftworld, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Craftworld"))); Widgets.CheckboxLabeled(rect2.TopHalf().RightHalf().ContractedBy(4), "AMXB_AllowEldarWraithguard".Translate(), ref settings.AllowEldarWraithguard, !DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("Wraithguard"))); Widgets.CheckboxLabeled(rect2.BottomHalf().LeftHalf().ContractedBy(4), "AMXB_AllowEldarExodite".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Exodite")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowEldarExodite, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Exodite"))); Widgets.CheckboxLabeled(rect2.BottomHalf().RightHalf().ContractedBy(4), "AMXB_AllowEldarHarlequinn".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Harlequin")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowEldarHarlequinn, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Eldar_Harlequin"))); listing_Standard.EndSection(listing_Standard); }
private void DrawHourSelector(Listing_Standard holder) { Listing_Standard listing_Standard = holder.BeginSection(40f); int value = task.StartHour; listing_Standard.TextFieldNumericLabeled("ReligionInfo_ActivityStartHour".Translate(), ref value, ref buffer, 0, 23); task.StartHour = value; holder.EndSection(listing_Standard); }
static void ShowChaos(ref Listing_Standard listing_Standard, Rect rect2, AMXBSettings settings) { listing_Standard.BeginSection(120f); Widgets.CheckboxLabeled(rect2.TopHalf().TopHalf().LeftHalf().ContractedBy(4), "AMXB_AllowChaosMarine".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Marine")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowChaosMarine, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Marine"))); Widgets.CheckboxLabeled(rect2.TopHalf().BottomHalf().LeftHalf().ContractedBy(4), "AMXB_AllowChaosGuard".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Guard")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowChaosGuard, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Guard"))); Widgets.CheckboxLabeled(rect2.TopHalf().TopHalf().RightHalf().ContractedBy(4), "AMXB_AllowChaosMechanicus".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Mechanicus")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowChaosMechanicus, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Mechanicus"))); Widgets.CheckboxLabeled(rect2.TopHalf().BottomHalf().RightHalf().ContractedBy(4), "AMXB_AllowChaosDeamons".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_HiddenFaction".Translate()), ref settings.AllowChaosDeamons, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon"))); Widgets.CheckboxLabeled(rect2.BottomHalf().TopHalf().LeftHalf().ContractedBy(4), "AMXB_AllowChaosDeamonicIncursion".Translate(), ref settings.AllowChaosDeamonicIncursion, !DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon_Deamonic_Incursion"))); Widgets.CheckboxLabeled(rect2.BottomHalf().BottomHalf().LeftHalf().ContractedBy(4), "AMXB_AllowChaosDeamonicInfestation".Translate(), ref settings.AllowChaosDeamonicInfestation, !DefDatabase <IncidentDef> .AllDefs.Any(x => x.defName.Contains("OG_Chaos_Deamon_Daemonic_Infestation"))); listing_Standard.EndSection(listing_Standard); }
static void ShowTau(ref Listing_Standard listing_Standard, Rect rect2, AMXBSettings settings) { listing_Standard.BeginSection(60f); Widgets.CheckboxLabeled(rect2.TopHalf().LeftHalf().ContractedBy(4), "AMXB_AllowTau".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tau")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowTau, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Tau"))); Widgets.CheckboxLabeled(rect2.BottomHalf().RightHalf().LeftHalf().ContractedBy(4), "AMXB_AllowKroot".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Kroot")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Auxiliaries".Translate()), ref settings.AllowKrootAuxiliaries, !DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Kroot"))); Widgets.CheckboxLabeled(rect2.BottomHalf().RightHalf().RightHalf().ContractedBy(4), "AMXB_AllowKroot".Translate() + (!DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Kroot")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowKroot, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Kroot"))); Widgets.CheckboxLabeled(rect2.BottomHalf().LeftHalf().ContractedBy(4), "AMXB_AllowGueVesa".Translate() + (!DefDatabase <PawnKindDef> .AllDefs.Any(x => x.defName.Contains("OG_Guevesa")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Auxiliaries".Translate()), ref settings.AllowGueVesaAuxiliaries, !DefDatabase <PawnKindDef> .AllDefs.Any(x => x.defName.Contains("OG_Guevesa"))); Widgets.CheckboxLabeled(rect2.TopHalf().RightHalf().LeftHalf().ContractedBy(4), "AMXB_AllowVespid".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Auxiliaries".Translate()), ref settings.AllowVespidAuxiliaries, !DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid"))); Widgets.CheckboxLabeled(rect2.TopHalf().RightHalf().RightHalf().ContractedBy(4), "AMXB_AllowVespid".Translate() + (!DefDatabase <ThingDef> .AllDefs.Any(x => x.defName.Contains("OG_Alien_Vespid")) ? "AMXB_NotYetAvailable".Translate() : "AMXB_Faction".Translate()), ref settings.AllowVespid, !DefDatabase <FactionDef> .AllDefs.Any(x => x.defName.Contains("OG_Vespid"))); listing_Standard.EndSection(listing_Standard); }
private void RenderProvider(Listing_Standard list, IPowerProvider provider) { var section = list.BeginSection(ProviderHeight); DrawIcon(section, 32); DrawLabel(section, provider); section.Label(FormatDischarge(provider)); section.Label(FormatCapacity(provider)); list.EndSection(section); list.Gap(); }
private void DrawIngridientRadius(Listing_Standard holder) { Listing_Standard listingStandard = holder.BeginSection(70f); string str1 = "IngredientSearchRadius".Translate(); string str2 = (double)this.task.IngredientSearchRadius != 999.0 ? this.task.IngredientSearchRadius.ToString("F0") : "Unlimited".Translate(); listingStandard.Label(str1 + ": " + str2, -1f, (string)null); this.task.IngredientSearchRadius = listingStandard.Slider(this.task.IngredientSearchRadius, 3f, 100f); if ((double)this.task.IngredientSearchRadius >= 100.0) { this.task.IngredientSearchRadius = 999f; } holder.EndSection(listingStandard); }
public override void DoSettingsWindowContents(Rect rect) { Listing_Standard list = new Listing_Standard() { ColumnWidth = rect.width }; float lineheight = (Text.LineHeight + list.verticalSpacing); list.Begin(rect); Listing_Standard listing_FungalLabel = list.BeginSection(lineheight); listing_FungalLabel.ColumnWidth *= 0.488f; listing_FungalLabel.TextFieldNumericLabeled <float>("AMO_FungusOptions".Translate(), ref settings.FungusSpawnChance, ref settings.FungusSpawnChanceBuffer, 0f, 1f, "AMO_FungusOptionsToolTip".Translate(), 0.75f, 0.25f); listing_FungalLabel.NewColumn(); listing_FungalLabel.TextFieldNumericLabeled <float>("AMO_CocoonOptions".Translate(), ref settings.CocoonSpawnChance, ref settings.CocoonSpawnChanceBuffer, 0f, 1f, "AMO_CocoonOptionsToolTip".Translate(), 0.75f, 0.25f); list.EndSection(listing_FungalLabel); Listing_Standard listing_Fungus = list.BeginSection(lineheight * 4); listing_Fungus.ColumnWidth *= 0.488f; listing_Fungus.TextFieldNumericLabeled <float>("AMO_Squig".Translate(), ref settings.FungusSquigChance, ref settings.FungusSquigChanceBuffer, 0f, 1f, "AMO_SquigToolTip".Translate(), 0.75f, 0.25f); listing_Fungus.TextFieldNumericLabeled <float>("AMO_Snot".Translate(), ref settings.FungusSnotChance, ref settings.FungusSnotChanceBuffer, 0f, 1f, "AMO_SnotToolTip".Translate(), 0.75f, 0.25f); // listing_Fungus.NewColumn(); listing_Fungus.TextFieldNumericLabeled <float>("AMO_Grot".Translate(), ref settings.FungusGrotChance, ref settings.FungusGrotChanceBuffer, 0f, 1f, "AMO_GrotToolTip".Translate(), 0.75f, 0.25f); listing_Fungus.TextFieldNumericLabeled <float>("AMO_Ork".Translate(), ref settings.FungusOrkChance, ref settings.FungusOrkChanceBuffer, 0f, 1f, "AMO_OrkToolTip".Translate(), 0.75f, 0.25f); listing_Fungus.NewColumn(); listing_Fungus.TextFieldNumericLabeled <float>("AMO_Squig".Translate(), ref settings.CocoonSquigChance, ref settings.CocoonSquigChanceBuffer, 0f, 1f, "AMO_SquigToolTip".Translate(), 0.75f, 0.25f); listing_Fungus.TextFieldNumericLabeled <float>("AMO_Snot".Translate(), ref settings.CocoonSnotChance, ref settings.CocoonSnotChanceBuffer, 0f, 1f, "AMO_SnotToolTip".Translate(), 0.75f, 0.25f); // listing_Fungus.NewColumn(); listing_Fungus.TextFieldNumericLabeled <float>("AMO_Grot".Translate(), ref settings.CocoonGrotChance, ref settings.CocoonGrotChanceBuffer, 0f, 1f, "AMO_GrotToolTip".Translate(), 0.75f, 0.25f); listing_Fungus.TextFieldNumericLabeled <float>("AMO_Ork".Translate(), ref settings.CocoonOrkChance, ref settings.CocoonOrkChanceBuffer, 0f, 1f, "AMO_OrkToolTip".Translate(), 0.75f, 0.25f); list.EndSection(listing_Fungus); list.End(); }
public override void DoSettingsWindowContents(Rect rect) { Listing_Standard list = new Listing_Standard() { ColumnWidth = rect.width }; float lineheight = (Text.LineHeight + list.verticalSpacing); list.Begin(rect); Listing_Standard listing_PGI = list.BeginSection(lineheight); listing_PGI.ColumnWidth *= 0.488f; listing_PGI.CheckboxLabeled("PGI_RemoveOption".Translate(), ref settings.removePGI, "PGI_RemoveOptionToolTip".Translate()); // listing_FungalLabel.CheckboxLabeled("PGI_replaceFactionsOption".Translate(), ref settings.removePGI, "PGI_replaceFactionsOptionToolTip".Translate()); list.EndSection(listing_PGI); list.End(); }
private void DrawThingsFilter(Listing_Standard holder) { Listing_Standard listing_Standard = holder.BeginSection(400f); DrawThingsList(listing_Standard); listing_Standard.Gap(); if (listing_Standard.ButtonText("ClearAll".Translate())) { task.ThingFilter.DisallowAll(); SoundDefOf.Checkbox_TurnedOff.PlayOneShotOnCamera((Map)null); } if (listing_Standard.ButtonText("AllowAll".Translate())) { task.ThingFilter.AllowAll(); SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera((Map)null); } holder.EndSection(listing_Standard); }
private void IngredientPawnRestriction(Listing_Standard holder, IngredientPawn ingredientPawn, bool isHumanlike) { Listing_Standard listing_Standard = holder.BeginSection(100f); string label = null; string context = null; if (isHumanlike) { label = "ReligionInfo_ActivityPawnHumanlike".Translate(); context = "ReligionInfo_IsPrisonerOfColony".Translate(); } else { label = "ReligionInfo_ActivityPawnAnimal".Translate(); context = "ReligionInfo_IsTamed".Translate(); } listing_Standard.Label(label); listing_Standard.Label("ReligionInfo_PawnIngredientWarning".Translate()); //Widgets.Dropdown<IngredientPawn, bool>(listing_Standard.GetRect(30f), ingredientPawn, (IngredientPawn b) => b.PartOfColony, (IngredientPawn b) => this.GenerateBoolOptions(ingredientPawn), context + " " + ingredientPawn.PartOfColony.ToString().Translate(), null, null, null, null, false); Widgets.Dropdown <IngredientPawn, Pawn>(listing_Standard.GetRect(30f), ingredientPawn, (IngredientPawn b) => b.ConcretePawn, (IngredientPawn b) => this.GenerateIngredientPawnRestrictionOptions(ingredientPawn, isHumanlike), (ingredientPawn.ConcretePawn != null) ? ingredientPawn.ConcretePawn.LabelShortCap : "None".Translate(), null, null, null, null, false); holder.EndSection(listing_Standard); }
public override void DoWindowContents(Rect inRect) { Text.Font = GameFont.Medium; Widgets.Label(new Rect(0f, 0f, 400f, 50f), bill.LabelCap); float width = (int)((inRect.width - 34f) / 3f); Rect rect = new Rect(0f, 80f, width, inRect.height - 80f); Rect rect2 = new Rect(rect.xMax + 17f, 50f, width, inRect.height - 50f - CloseButSize.y); Rect rect3 = new Rect(rect2.xMax + 17f, 50f, 0f, inRect.height - 50f - CloseButSize.y); rect3.xMax = inRect.xMax; Text.Font = GameFont.Small; Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(rect2); Listing_Standard listing_Standard2 = listing_Standard.BeginSection(RepeatModeSubdialogHeight); if (listing_Standard2.ButtonText(bill.repeatMode.LabelCap)) { BillRepeatModeUtility.MakeConfigFloatMenu(bill); } listing_Standard2.Gap(); if (bill.repeatMode == BillRepeatModeDefOf.RepeatCount) { listing_Standard2.Label("RepeatCount".Translate(bill.repeatCount)); listing_Standard2.IntEntry(ref bill.repeatCount, ref repeatCountEditBuffer); } else if (bill.repeatMode == BillRepeatModeDefOf.TargetCount) { string arg = "CurrentlyHave".Translate() + ": "; arg += bill.recipe.WorkerCounter.CountProducts(bill); arg += " / "; arg += ((bill.targetCount < 999999) ? bill.targetCount.ToString() : "Infinite".Translate().ToLower().ToString()); string str = bill.recipe.WorkerCounter.ProductsDescription(bill); if (!str.NullOrEmpty()) { arg += "\n" + "CountingProducts".Translate() + ": " + str.CapitalizeFirst(); } listing_Standard2.Label(arg); int targetCount = bill.targetCount; listing_Standard2.IntEntry(ref bill.targetCount, ref targetCountEditBuffer, bill.recipe.targetCountAdjustment); bill.unpauseWhenYouHave = Mathf.Max(0, bill.unpauseWhenYouHave + (bill.targetCount - targetCount)); ThingDef producedThingDef = bill.recipe.ProducedThingDef; if (producedThingDef != null) { if (producedThingDef.IsWeapon || producedThingDef.IsApparel) { listing_Standard2.CheckboxLabeled("IncludeEquipped".Translate(), ref bill.includeEquipped); } if (producedThingDef.IsApparel && producedThingDef.apparel.careIfWornByCorpse) { listing_Standard2.CheckboxLabeled("IncludeTainted".Translate(), ref bill.includeTainted); } Widgets.Dropdown(listing_Standard2.GetRect(30f), bill, (Bill_Production b) => b.includeFromZone, (Bill_Production b) => GenerateStockpileInclusion(), (bill.includeFromZone == null) ? "IncludeFromAll".Translate() : "IncludeSpecific".Translate(bill.includeFromZone.label)); if (bill.recipe.products.Any((ThingDefCountClass prod) => prod.thingDef.useHitPoints)) { Widgets.FloatRange(listing_Standard2.GetRect(28f), 975643279, ref bill.hpRange, 0f, 1f, "HitPoints", ToStringStyle.PercentZero); bill.hpRange.min = Mathf.Round(bill.hpRange.min * 100f) / 100f; bill.hpRange.max = Mathf.Round(bill.hpRange.max * 100f) / 100f; } if (producedThingDef.HasComp(typeof(CompQuality))) { Widgets.QualityRange(listing_Standard2.GetRect(28f), 1098906561, ref bill.qualityRange); } if (producedThingDef.MadeFromStuff) { listing_Standard2.CheckboxLabeled("LimitToAllowedStuff".Translate(), ref bill.limitToAllowedStuff); } } } if (bill.repeatMode == BillRepeatModeDefOf.TargetCount) { listing_Standard2.CheckboxLabeled("PauseWhenSatisfied".Translate(), ref bill.pauseWhenSatisfied); if (bill.pauseWhenSatisfied) { listing_Standard2.Label("UnpauseWhenYouHave".Translate() + ": " + bill.unpauseWhenYouHave.ToString("F0")); listing_Standard2.IntEntry(ref bill.unpauseWhenYouHave, ref unpauseCountEditBuffer, bill.recipe.targetCountAdjustment); if (bill.unpauseWhenYouHave >= bill.targetCount) { bill.unpauseWhenYouHave = bill.targetCount - 1; unpauseCountEditBuffer = bill.unpauseWhenYouHave.ToStringCached(); } } } listing_Standard.EndSection(listing_Standard2); listing_Standard.Gap(); Listing_Standard listing_Standard3 = listing_Standard.BeginSection(StoreModeSubdialogHeight); string text = string.Format(bill.GetStoreMode().LabelCap, (bill.GetStoreZone() != null) ? bill.GetStoreZone().SlotYielderLabel() : ""); if (bill.GetStoreZone() != null && !bill.recipe.WorkerCounter.CanPossiblyStoreInStockpile(bill, bill.GetStoreZone())) { text += string.Format(" ({0})", "IncompatibleLower".Translate()); Text.Font = GameFont.Tiny; } if (listing_Standard3.ButtonText(text)) { Text.Font = GameFont.Small; List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (BillStoreModeDef item in DefDatabase <BillStoreModeDef> .AllDefs.OrderBy((BillStoreModeDef bsm) => bsm.listOrder)) { if (item == BillStoreModeDefOf.SpecificStockpile) { List <SlotGroup> allGroupsListInPriorityOrder = bill.billStack.billGiver.Map.haulDestinationManager.AllGroupsListInPriorityOrder; int count = allGroupsListInPriorityOrder.Count; for (int i = 0; i < count; i++) { SlotGroup group = allGroupsListInPriorityOrder[i]; Zone_Stockpile zone_Stockpile = group.parent as Zone_Stockpile; if (zone_Stockpile != null) { if (!bill.recipe.WorkerCounter.CanPossiblyStoreInStockpile(bill, zone_Stockpile)) { list.Add(new FloatMenuOption(string.Format("{0} ({1})", string.Format(item.LabelCap, group.parent.SlotYielderLabel()), "IncompatibleLower".Translate()), null)); } else { list.Add(new FloatMenuOption(string.Format(item.LabelCap, group.parent.SlotYielderLabel()), delegate { bill.SetStoreMode(BillStoreModeDefOf.SpecificStockpile, (Zone_Stockpile)group.parent); })); } } } } else { BillStoreModeDef smLocal = item; list.Add(new FloatMenuOption(smLocal.LabelCap, delegate { bill.SetStoreMode(smLocal); })); } } Find.WindowStack.Add(new FloatMenu(list)); } Text.Font = GameFont.Small; listing_Standard.EndSection(listing_Standard3); listing_Standard.Gap(); Listing_Standard listing_Standard4 = listing_Standard.BeginSection(WorkerSelectionSubdialogHeight); Widgets.Dropdown(listing_Standard4.GetRect(30f), bill, (Bill_Production b) => b.pawnRestriction, (Bill_Production b) => GeneratePawnRestrictionOptions(), (bill.pawnRestriction == null) ? "AnyWorker".TranslateSimple() : bill.pawnRestriction.LabelShortCap); if (bill.pawnRestriction == null && bill.recipe.workSkill != null) { listing_Standard4.Label("AllowedSkillRange".Translate(bill.recipe.workSkill.label)); listing_Standard4.IntRange(ref bill.allowedSkillRange, 0, 20); } listing_Standard.EndSection(listing_Standard4); listing_Standard.End(); Rect rect4 = rect3; bool flag = true; for (int j = 0; j < bill.recipe.ingredients.Count; j++) { if (!bill.recipe.ingredients[j].IsFixedIngredient) { flag = false; break; } } if (!flag) { rect4.yMin = rect4.yMax - (float)IngredientRadiusSubdialogHeight; rect3.yMax = rect4.yMin - 17f; bool num = bill.GetStoreZone() == null || bill.recipe.WorkerCounter.CanPossiblyStoreInStockpile(bill, bill.GetStoreZone()); ThingFilterUI.DoThingFilterConfigWindow(rect3, ref thingFilterScrollPosition, bill.ingredientFilter, bill.recipe.fixedIngredientFilter, 4, null, bill.recipe.forceHiddenSpecialFilters, forceHideHitPointsConfig: false, bill.recipe.GetPremultipliedSmallIngredients(), bill.Map); bool flag2 = bill.GetStoreZone() == null || bill.recipe.WorkerCounter.CanPossiblyStoreInStockpile(bill, bill.GetStoreZone()); if (num && !flag2) { Messages.Message("MessageBillValidationStoreZoneInsufficient".Translate(bill.LabelCap, bill.billStack.billGiver.LabelShort.CapitalizeFirst(), bill.GetStoreZone().label), bill.billStack.billGiver as Thing, MessageTypeDefOf.RejectInput, historical: false); } } else { rect4.yMin = 50f; } Listing_Standard listing_Standard5 = new Listing_Standard(); listing_Standard5.Begin(rect4); string str2 = "IngredientSearchRadius".Translate().Truncate(rect4.width * 0.6f); string str3 = (bill.ingredientSearchRadius == 999f) ? "Unlimited".TranslateSimple().Truncate(rect4.width * 0.3f) : bill.ingredientSearchRadius.ToString("F0"); listing_Standard5.Label(str2 + ": " + str3); bill.ingredientSearchRadius = listing_Standard5.Slider((bill.ingredientSearchRadius > 100f) ? 100f : bill.ingredientSearchRadius, 3f, 100f); if (bill.ingredientSearchRadius >= 100f) { bill.ingredientSearchRadius = 999f; } listing_Standard5.End(); Listing_Standard listing_Standard6 = new Listing_Standard(); listing_Standard6.Begin(rect); if (bill.suspended) { if (listing_Standard6.ButtonText("Suspended".Translate())) { bill.suspended = false; SoundDefOf.Click.PlayOneShotOnCamera(); } } else if (listing_Standard6.ButtonText("NotSuspended".Translate())) { bill.suspended = true; SoundDefOf.Click.PlayOneShotOnCamera(); } StringBuilder stringBuilder = new StringBuilder(); if (bill.recipe.description != null) { stringBuilder.AppendLine(bill.recipe.description); stringBuilder.AppendLine(); } stringBuilder.AppendLine("WorkAmount".Translate() + ": " + bill.recipe.WorkAmountTotal(null).ToStringWorkAmount()); for (int k = 0; k < bill.recipe.ingredients.Count; k++) { IngredientCount ingredientCount = bill.recipe.ingredients[k]; if (!ingredientCount.filter.Summary.NullOrEmpty()) { stringBuilder.AppendLine(bill.recipe.IngredientValueGetter.BillRequirementsDescription(bill.recipe, ingredientCount)); } } stringBuilder.AppendLine(); string text2 = bill.recipe.IngredientValueGetter.ExtraDescriptionLine(bill.recipe); if (text2 != null) { stringBuilder.AppendLine(text2); stringBuilder.AppendLine(); } if (!bill.recipe.skillRequirements.NullOrEmpty()) { stringBuilder.AppendLine("MinimumSkills".Translate()); stringBuilder.AppendLine(bill.recipe.MinSkillString); } Text.Font = GameFont.Small; string text3 = stringBuilder.ToString(); if (Text.CalcHeight(text3, rect.width) > rect.height) { Text.Font = GameFont.Tiny; } listing_Standard6.Label(text3); Text.Font = GameFont.Small; listing_Standard6.End(); if (bill.recipe.products.Count == 1) { ThingDef thingDef = bill.recipe.products[0].thingDef; Widgets.InfoCardButton(rect.x, rect3.y, thingDef, GenStuff.DefaultStuffFor(thingDef)); } }
public static Listing_Standard BeginSection_OnePointTwo(this Listing_Standard listing_Main, float f, float sectionBorder = 4f, float bottomBorder = 4f) { return(listing_Main.BeginSection(f, sectionBorder, bottomBorder)); }
public override void DoSettingsWindowContents(Rect inRect) { Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f); Rect mainRect = new Rect(0f, 0f, inRect.width - 30f, inRect.height + 596f); int Adjust; Listing_Standard listmain = new Listing_Standard(); listmain.maxOneColumn = true; Widgets.BeginScrollView(outRect, ref scroll, mainRect); listmain.Begin(mainRect); listmain.Gap(20f); Rect optionrect1 = listmain.GetRect(30f); Widgets.CheckboxLabeled(optionrect1.LeftHalf(), Translations.Option1_Label_1, ref Configurations.EnableWombIcon, false, null, null, true); Widgets.CheckboxLabeled(optionrect1.RightHalf(), Translations.Option1_Label_2, ref Configurations.EnableButtonInHT, false, null, null, true); //listmain.CheckboxLabeled(Translations.Option1_Label, ref Configurations.EnableWombIcon, Translations.Option1_Desc); if (Configurations.EnableWombIcon || Configurations.EnableButtonInHT) { Listing_Standard wombsection = listmain.BeginSection(400); wombsection.CheckboxLabeled(Translations.Option9_Label, ref Configurations.DrawWombStatus, Translations.Option9_Desc); if (Configurations.DrawWombStatus) { wombsection.CheckboxLabeled(Translations.Option18_Label, ref Configurations.DrawEggOverlay, Translations.Option18_Desc); } wombsection.CheckboxLabeled(Translations.Option10_Label, ref Configurations.DrawVaginaStatus, Translations.Option10_Desc); wombsection.CheckboxLabeled(Translations.Option29_Label, ref Configurations.AllowShrinkIcon, Translations.Option29_Desc); if (wombsection.ButtonText(Translations.Option11_Label + ": " + Configurations.LevelString(Configurations.InfoDetail))) { if (Configurations.InfoDetail == Configurations.DetailLevel.Hide) { Configurations.InfoDetail = Configurations.DetailLevel.All; } else { Configurations.InfoDetail++; } } switch (Configurations.InfoDetail) { case Configurations.DetailLevel.All: wombsection.Label(Translations.Option11_Desc_1); break; case Configurations.DetailLevel.OnReveal: wombsection.Label(Translations.Option11_Desc_2); break; case Configurations.DetailLevel.HideFetusInfo: wombsection.Label(Translations.Option11_Desc_3); break; case Configurations.DetailLevel.Hide: wombsection.Label(Translations.Option11_Desc_4); break; } wombsection.Label(Translations.Option21_Label + " " + Configurations.ShowFlag, -1, Translations.Option21_Desc); Rect flagrect = wombsection.GetRect(30f); Rect[] flagrects = new Rect[5]; for (int i = 0; i < 5; i++) { flagrects[i] = new Rect(flagrect.x + (flagrect.width / 5) * i, flagrect.y, flagrect.width / 5, flagrect.height); } if (Widgets.ButtonText(flagrects[0], Translations.Option20_Label_1 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Colonist))) { Configurations.ShowFlag ^= Configurations.PawnFlags.Colonist; } if (Widgets.ButtonText(flagrects[1], Translations.Option20_Label_2 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Prisoner))) { Configurations.ShowFlag ^= Configurations.PawnFlags.Prisoner; } if (Widgets.ButtonText(flagrects[2], Translations.Option20_Label_3 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Ally))) { Configurations.ShowFlag ^= Configurations.PawnFlags.Ally; } if (Widgets.ButtonText(flagrects[3], Translations.Option20_Label_4 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Neutral))) { Configurations.ShowFlag ^= Configurations.PawnFlags.Neutral; } if (Widgets.ButtonText(flagrects[4], Translations.Option20_Label_5 + ": " + Configurations.ShowFlag.HasFlag(Configurations.PawnFlags.Hostile))) { Configurations.ShowFlag ^= Configurations.PawnFlags.Hostile; } Adjust = (int)(Configurations.NippleTransitionVariance * 1000); wombsection.Label(Translations.Option24_Label + " " + Configurations.NippleTransitionVariance * 100 + " / 100", -1, Translations.Option24_Desc); Adjust = (int)wombsection.Slider(Adjust, 0, 1000); Configurations.NippleTransitionVariance = (float)Adjust / 1000; Adjust = (int)(Configurations.NipplePermanentTransitionVariance * 1000); wombsection.Label(Translations.Option25_Label + " " + Configurations.NipplePermanentTransitionVariance * 100 + " / 100", -1, Translations.Option25_Desc); Adjust = (int)wombsection.Slider(Adjust, 0, 1000); Configurations.NipplePermanentTransitionVariance = (float)Adjust / 1000; Adjust = (int)(Configurations.NippleMaximumTransition * 1000); wombsection.Label(Translations.Option26_Label + " " + Configurations.NippleMaximumTransition * 100 + " / 100", -1, Translations.Option26_Desc); Adjust = (int)wombsection.Slider(Adjust, 0, 1000); Configurations.NippleMaximumTransition = (float)Adjust / 1000; Adjust = (int)(Configurations.NippleTransitionSpeed * 1000); wombsection.Label(Translations.Option27_Label + " " + Configurations.NippleTransitionSpeed, -1, Translations.Option27_Desc); Adjust = (int)wombsection.Slider(Adjust, 0, 1000); Configurations.NippleTransitionSpeed = (float)Adjust / 1000; listmain.EndSection(wombsection); } listmain.CheckboxLabeled(Translations.Option2_Label, ref Configurations.EnableAnimalCycle, Translations.Option2_Desc); listmain.CheckboxLabeled(Translations.Option12_Label, ref Configurations.EnableMenopause, Translations.Option12_Desc); listmain.Label(Translations.Option3_Label + " " + Configurations.ImplantationChance * 100 + "%", -1, Translations.Option3_Desc); Configurations.ImplantationChanceAdjust = (int)listmain.Slider(Configurations.ImplantationChanceAdjust, 0, 1000); Configurations.ImplantationChance = (float)Configurations.ImplantationChanceAdjust / 100; listmain.Label(Translations.Option4_Label + " " + Configurations.FertilizeChance * 100 + "%", -1, Translations.Option4_Desc); Configurations.FertilizeChanceAdjust = (int)listmain.Slider(Configurations.FertilizeChanceAdjust, 0, 1000); Configurations.FertilizeChance = (float)Configurations.FertilizeChanceAdjust / 1000; listmain.Label(Translations.Option5_Label + " " + Configurations.CumDecayRatio * 100 + "%", -1, Translations.Option5_Desc); Configurations.CumDecayRatioAdjust = (int)listmain.Slider(Configurations.CumDecayRatioAdjust, 0, 1000); Configurations.CumDecayRatio = (float)Configurations.CumDecayRatioAdjust / 1000; Adjust = (int)(Configurations.EggLifespanMultiplier * 20); float lifespan = (24f / Configurations.CycleAcceleration * Configurations.EggLifespanMultiplier); listmain.LabelDouble(Translations.Option30_Label + " x" + Configurations.EggLifespanMultiplier, Translations.EstimatedEggLifespan + String.Format(": {0:0}h {1:0}h {2:0}h", (int)lifespan, (int)(lifespan * 2), (int)(lifespan * 3)), Translations.Option30_Desc); Adjust = (int)listmain.Slider(Adjust, 20, 1000); Configurations.EggLifespanMultiplier = (float)Adjust / 20; int semenlifespan = (int)(-5 / ((float)Math.Log10((1 - Configurations.CumFertilityDecayRatio) * 10) - 1)) + 1; string estimatedlifespan; if (semenlifespan < 0) { estimatedlifespan = String.Format(": Infinite", semenlifespan); } else { estimatedlifespan = String.Format(": {0:0}h", semenlifespan); } listmain.LabelDouble(Translations.Option6_Label + " " + Configurations.CumFertilityDecayRatio * 100 + "%", Translations.EstimatedCumLifespan + estimatedlifespan, Translations.Option6_Desc); Configurations.CumFertilityDecayRatioAdjust = (int)listmain.Slider(Configurations.CumFertilityDecayRatioAdjust, 0, 1000); Configurations.CumFertilityDecayRatio = (float)Configurations.CumFertilityDecayRatioAdjust / 1000; listmain.Label(Translations.Option7_Label + " x" + Configurations.CycleAcceleration, -1, Translations.Option7_Desc); Configurations.CycleAcceleration = (int)listmain.Slider(Configurations.CycleAcceleration, 1, 50); float var2 = EstimatedBleedingAmountPerHour; float var1 = Math.Max(EstimatedBleedingAmount, var2); listmain.LabelDouble(Translations.Option19_Label_1, Translations.Option19_Label_2 + ": " + var1 + "ml, " + var2 + "ml/h", Translations.Option19_Desc); Configurations.BleedingAmount = (int)listmain.Slider(Configurations.BleedingAmount, 0, 200); listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc); if (Configurations.UseMultiplePregnancy) { float sectionheight = 75f; if (Configurations.EnableEnzygoticTwins) { sectionheight += 100; } Listing_Standard twinsection = listmain.BeginSection(sectionheight); Rect hybridrect = twinsection.GetRect(25); Widgets.CheckboxLabeled(hybridrect.LeftHalf(), Translations.Option22_Label, ref Configurations.UseHybridExtention, false, null, null, true); if (Widgets.ButtonText(hybridrect.RightHalf(), Translations.Option28_Label)) { Dialog_HybridCustom.ToggleWindow(); //Configurations.MotherFirst = !Configurations.MotherFirst; } TooltipHandler.TipRegion(hybridrect, Translations.Option28_Tooltip); twinsection.CheckboxLabeled(Translations.Option14_Label, ref Configurations.EnableHeteroOvularTwins, Translations.Option14_Desc); twinsection.CheckboxLabeled(Translations.Option15_Label, ref Configurations.EnableEnzygoticTwins, Translations.Option15_Desc); if (Configurations.EnableEnzygoticTwins) { twinsection.Label(Translations.Option16_Label + " " + Configurations.EnzygoticTwinsChance * 100 + "%", -1, Translations.Option16_Desc); Configurations.EnzygoticTwinsChanceAdjust = (int)twinsection.Slider(Configurations.EnzygoticTwinsChanceAdjust, 0, 1000); Configurations.EnzygoticTwinsChance = (float)Configurations.EnzygoticTwinsChanceAdjust / 1000; twinsection.Label(Translations.Option17_Label + " " + Configurations.MaxEnzygoticTwins, -1, Translations.Option17_Desc); Configurations.MaxEnzygoticTwins = (int)twinsection.Slider(Configurations.MaxEnzygoticTwins, 2, 100); } listmain.EndSection(twinsection); } listmain.CheckboxLabeled(Translations.Option31_Label, ref Configurations.EnableBirthVaginaMorph, Translations.Option31_Desc); if (Configurations.EnableBirthVaginaMorph) { float sectionheight = 48f; Listing_Standard vmsection = listmain.BeginSection(sectionheight); LabelwithTextfield(vmsection.GetRect(24f), Translations.Option32_Label, Translations.Option32_Desc, ref Configurations.VaginaMorphPower, 0, 100f); Adjust = (int)(Configurations.VaginaMorphPower * 1000); Adjust = (int)vmsection.Slider(Adjust, 0, 1000); Configurations.VaginaMorphPower = Adjust / 1000f; listmain.EndSection(vmsection); } Widgets.EndScrollView(); listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc); if (listmain.ButtonText("reset to default")) { Configurations.SettoDefault(); } listmain.End(); }
protected override void FillTab() { if (this.SelThing is Building_ShellfishTrap trap) { float y = 20; Rect label1 = new Rect(xLeft, y, width, 32f).ContractedBy(4f); y += 32; Rect storage = new Rect(xLeft, y, width, 40f); y += 60; Rect label2 = new Rect(xLeft, y, width, 32f).ContractedBy(4f); y += 32; Rect slider = new Rect(xLeft, y, width, 32f).ContractedBy(4f); Rect rectPaste = new Rect(size.x - PasteX, PasteY, PasteSize, PasteSize); Rect rectCopy = new Rect(size.x - CopyX, CopyY, CopySize, CopySize); if (HasCopy) { if (Widgets.ButtonImageFitted(rectPaste, ResourceBank.Paste, Color.white)) { trap.StoreMode = StoreModeCopy; trap.OpenFrequency = OpenDelayCopy; SoundDefOf.Tick_Low.PlayOneShotOnCamera(); } } else { GUI.color = Color.gray; Widgets.DrawTextureFitted(rectPaste, ResourceBank.Paste, 1f); GUI.color = Color.white; } TooltipHandler.TipRegionByKey(rectPaste, ResourceBank.Strings.PasteTip); if (Widgets.ButtonImageFitted(rectCopy, ResourceBank.Copy, Color.white)) { HasCopy = true; StoreModeCopy = trap.StoreMode; OpenDelayCopy = trap.OpenFrequency; SoundDefOf.Tick_Low.PlayOneShotOnCamera(); } TooltipHandler.TipRegionByKey(rectCopy, ResourceBank.Strings.CopyTip); Text.Font = GameFont.Small; //stockpile setting Widgets.Label(label1, StockpileString.Translate()); Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(storage); Listing_Standard listing_Standard2 = listing_Standard.BeginSection(StoreModeSubdialogHeight); string text = trap.StoreMode.LabelCap; if (listing_Standard2.ButtonText(text)) { Text.Font = GameFont.Small; List <FloatMenuOption> list = new List <FloatMenuOption>(); list.Add(new FloatMenuOption(BillStoreModeDefOf.BestStockpile.LabelCap, delegate { trap.StoreMode = BillStoreModeDefOf.BestStockpile; })); list.Add(new FloatMenuOption(BillStoreModeDefOf.DropOnFloor.LabelCap, delegate { trap.StoreMode = BillStoreModeDefOf.DropOnFloor; })); Find.WindowStack.Add(new FloatMenu(list)); } Text.Font = GameFont.Small; listing_Standard.EndSection(listing_Standard2); listing_Standard.End(); Text.Font = GameFont.Small; //delay setting Widgets.Label(label2, ResourceBank.Strings.UnloadFrequency.Translate()); Text.Font = GameFont.Small; trap.OpenFrequency = Widgets.FrequencyHorizontalSlider(slider, trap.OpenFrequency, 0.1f, 25f, roundToInt: true); } else { DrawTabNothing(); } }
public override void DoSettingsWindowContents(Rect inRect) { inRect.yMin += 20; inRect.yMax -= 20; Listing_Standard list = new Listing_Standard(); Rect rect = new Rect(inRect.x, inRect.y, inRect.width, inRect.height); Rect rect2 = new Rect(0f, 0f, inRect.width - 30f, inRect.height * 2 + ammunitionSettings.WeaponViewHeight); Rect rect3 = new Rect(0f, 0f, inRect.width - 30f, ammunitionSettings.WeaponViewHeight); Widgets.BeginScrollView(rect, ref scrollPosition, rect2, true); list.Begin(rect2); if (list.ButtonText("Default Settings")) { ammunitionSettings.Reset(); } ; list.CheckboxLabeled("Is ammo required to fire weapons?", ref ammunitionSettings.NeedAmmo); list.Label(string.Format("Desired carried ammo. {0}", ammunitionSettings.DesiredAmmo)); ammunitionSettings.DesiredAmmo = (int)Mathf.Round(list.Slider(ammunitionSettings.DesiredAmmo, 1, 100)); list.Label(string.Format("Least ammo to fetch. {0}", ammunitionSettings.LeastAmmoFetch)); ammunitionSettings.LeastAmmoFetch = (int)Mathf.Round(list.Slider(ammunitionSettings.LeastAmmoFetch, 1, 10)); list.CheckboxLabeled("NPC needs ammo.", ref ammunitionSettings.NPCNeedAmmo); if (ammunitionSettings.NPCNeedAmmo) { list.Label(string.Format("NPC's spawn if appliable with a minumum of {0} ammo up to the maximum set in the following option.", ammunitionSettings.NPCMinAmmo)); ammunitionSettings.NPCMinAmmo = (int)Mathf.Round(list.Slider(ammunitionSettings.NPCMinAmmo, 1, 100)); list.Label(string.Format("NPC's spawn/respawn if appliable with maxmimum {0} of extra ammo.", ammunitionSettings.NPCMaxAmmo)); ammunitionSettings.NPCMaxAmmo = (int)Mathf.Round(list.Slider(ammunitionSettings.NPCMaxAmmo, ammunitionSettings.NPCMinAmmo, 200)); } list.GapLine(); if (ammunitionSettings.AssociationDictionary != null) { list.Label(string.Format("Ammunition used for weapons.")); list.Label(string.Format("({0}) Height.", ammunitionSettings.WeaponViewHeight)); ammunitionSettings.WeaponViewHeight = (int)Mathf.Round(list.Slider(ammunitionSettings.WeaponViewHeight, 1, 2500)); ammunitionSettings.Filter = list.TextEntryLabeled("Filter:", ammunitionSettings.Filter, 1); Listing_Standard list2 = list.BeginSection(ammunitionSettings.WeaponViewHeight); list2.ColumnWidth = (rect2.width - 50) / 3; foreach (ThingDef weapon in Utility.AvailableWeapons) { if (SettingsHelper.LatestVersion.AssociationDictionary.ContainsKey(weapon.defName) && weapon.defName.ToUpper().Contains(ammunitionSettings.Filter.ToUpper())) { float lineHeight = Text.LineHeight; Rect innerRect = list2.GetRect(lineHeight); TextAnchor anchor = Text.Anchor; Text.Anchor = TextAnchor.MiddleLeft; Widgets.Label(innerRect, weapon.label); if (Widgets.ButtonInvisible(innerRect)) { SettingsHelper.LatestVersion.AssociationDictionary[weapon.defName]++; if (SettingsHelper.LatestVersion.AssociationDictionary[weapon.defName] > ammoType.battery) { SettingsHelper.LatestVersion.AssociationDictionary[weapon.defName] = 0; } } Rect position = new Rect(innerRect.x + list2.ColumnWidth - 24f, innerRect.y, 24f, 24f); Widgets.DrawTextureFitted(position, Utility.ImageAssociation(SettingsHelper.LatestVersion.AssociationDictionary[weapon.defName]), 1); Text.Anchor = anchor; } } list.EndSection(list2); } list.End(); Widgets.EndScrollView(); ammunitionSettings.Write(); }
public override void DoWindowContents(Rect inRect) { Text.Font = GameFont.Medium; Rect rect = new Rect(0f, 0f, 400f, 50f); Widgets.Label(rect, this.bill.LabelCap); float width = (float)((int)((inRect.width - 34f) / 3f)); Rect rect2 = new Rect(0f, 80f, width, inRect.height - 80f); Rect rect3 = new Rect(rect2.xMax + 17f, 50f, width, inRect.height - 50f - this.CloseButSize.y); Rect rect4 = new Rect(rect3.xMax + 17f, 50f, 0f, inRect.height - 50f - this.CloseButSize.y); rect4.xMax = inRect.xMax; Text.Font = GameFont.Small; Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(rect3); Listing_Standard listing_Standard2 = listing_Standard.BeginSection((float)Dialog_BillConfig.RepeatModeSubdialogHeight); if (listing_Standard2.ButtonText(this.bill.repeatMode.LabelCap, null)) { BillRepeatModeUtility.MakeConfigFloatMenu(this.bill); } listing_Standard2.Gap(12f); if (this.bill.repeatMode == BillRepeatModeDefOf.RepeatCount) { listing_Standard2.Label("RepeatCount".Translate(new object[] { this.bill.repeatCount }), -1f, null); listing_Standard2.IntEntry(ref this.bill.repeatCount, ref this.repeatCountEditBuffer, 1); } else if (this.bill.repeatMode == BillRepeatModeDefOf.TargetCount) { string text = "CurrentlyHave".Translate() + ": "; text += this.bill.recipe.WorkerCounter.CountProducts(this.bill); text += " / "; text += ((this.bill.targetCount >= 999999) ? "Infinite".Translate().ToLower() : this.bill.targetCount.ToString()); string text2 = this.bill.recipe.WorkerCounter.ProductsDescription(this.bill); if (!text2.NullOrEmpty()) { string text3 = text; text = string.Concat(new string[] { text3, "\n", "CountingProducts".Translate(), ": ", text2 }); } listing_Standard2.Label(text, -1f, null); int targetCount = this.bill.targetCount; listing_Standard2.IntEntry(ref this.bill.targetCount, ref this.targetCountEditBuffer, this.bill.recipe.targetCountAdjustment); this.bill.unpauseWhenYouHave = Mathf.Max(0, this.bill.unpauseWhenYouHave + (this.bill.targetCount - targetCount)); ThingDef producedThingDef = this.bill.recipe.ProducedThingDef; if (producedThingDef != null) { if (producedThingDef.IsWeapon || producedThingDef.IsApparel) { listing_Standard2.CheckboxLabeled("IncludeEquipped".Translate(), ref this.bill.includeEquipped, null); } if (producedThingDef.IsApparel && producedThingDef.apparel.careIfWornByCorpse) { listing_Standard2.CheckboxLabeled("IncludeTainted".Translate(), ref this.bill.includeTainted, null); } Widgets.Dropdown <Bill_Production, Zone_Stockpile>(listing_Standard2.GetRect(30f), this.bill, (Bill_Production b) => b.includeFromZone, (Bill_Production b) => this.GenerateStockpileInclusion(), (this.bill.includeFromZone != null) ? "IncludeSpecific".Translate(new object[] { this.bill.includeFromZone.label }) : "IncludeFromAll".Translate(), null, null, null, null, false); Widgets.FloatRange(listing_Standard2.GetRect(28f), 10, ref this.bill.hpRange, 0f, 1f, "HitPoints", ToStringStyle.PercentZero); if (producedThingDef.HasComp(typeof(CompQuality))) { Widgets.QualityRange(listing_Standard2.GetRect(28f), 2, ref this.bill.qualityRange); } if (producedThingDef.MadeFromStuff) { listing_Standard2.CheckboxLabeled("LimitToAllowedStuff".Translate(), ref this.bill.limitToAllowedStuff, null); } } } if (this.bill.repeatMode == BillRepeatModeDefOf.TargetCount) { listing_Standard2.Gap(12f); listing_Standard2.Gap(12f); listing_Standard2.CheckboxLabeled("PauseWhenSatisfied".Translate(), ref this.bill.pauseWhenSatisfied, null); if (this.bill.pauseWhenSatisfied) { listing_Standard2.Label("UnpauseWhenYouHave".Translate() + ": " + this.bill.unpauseWhenYouHave.ToString("F0"), -1f, null); listing_Standard2.IntEntry(ref this.bill.unpauseWhenYouHave, ref this.unpauseCountEditBuffer, this.bill.recipe.targetCountAdjustment); if (this.bill.unpauseWhenYouHave >= this.bill.targetCount) { this.bill.unpauseWhenYouHave = this.bill.targetCount - 1; this.unpauseCountEditBuffer = this.bill.unpauseWhenYouHave.ToStringCached(); } } } listing_Standard.EndSection(listing_Standard2); listing_Standard.Gap(12f); Listing_Standard listing_Standard3 = listing_Standard.BeginSection((float)Dialog_BillConfig.StoreModeSubdialogHeight); string text4 = string.Format(this.bill.GetStoreMode().LabelCap, (this.bill.GetStoreZone() == null) ? "" : this.bill.GetStoreZone().SlotYielderLabel()); if (this.bill.GetStoreZone() != null && !this.bill.recipe.WorkerCounter.CanPossiblyStoreInStockpile(this.bill, this.bill.GetStoreZone())) { text4 += string.Format(" ({0})", "IncompatibleLower".Translate()); Text.Font = GameFont.Tiny; } if (listing_Standard3.ButtonText(text4, null)) { Text.Font = GameFont.Small; List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (BillStoreModeDef billStoreModeDef in from bsm in DefDatabase <BillStoreModeDef> .AllDefs orderby bsm.listOrder select bsm) { if (billStoreModeDef == BillStoreModeDefOf.SpecificStockpile) { List <SlotGroup> allGroupsListInPriorityOrder = this.bill.billStack.billGiver.Map.haulDestinationManager.AllGroupsListInPriorityOrder; int count = allGroupsListInPriorityOrder.Count; for (int i = 0; i < count; i++) { SlotGroup group = allGroupsListInPriorityOrder[i]; Zone_Stockpile zone_Stockpile = group.parent as Zone_Stockpile; if (zone_Stockpile != null) { if (!this.bill.recipe.WorkerCounter.CanPossiblyStoreInStockpile(this.bill, zone_Stockpile)) { list.Add(new FloatMenuOption(string.Format("{0} ({1})", string.Format(billStoreModeDef.LabelCap, group.parent.SlotYielderLabel()), "IncompatibleLower".Translate()), null, MenuOptionPriority.Default, null, null, 0f, null, null)); } else { list.Add(new FloatMenuOption(string.Format(billStoreModeDef.LabelCap, group.parent.SlotYielderLabel()), delegate() { this.bill.SetStoreMode(BillStoreModeDefOf.SpecificStockpile, (Zone_Stockpile)group.parent); }, MenuOptionPriority.Default, null, null, 0f, null, null)); } } } } else { BillStoreModeDef smLocal = billStoreModeDef; list.Add(new FloatMenuOption(smLocal.LabelCap, delegate() { this.bill.SetStoreMode(smLocal, null); }, MenuOptionPriority.Default, null, null, 0f, null, null)); } } Find.WindowStack.Add(new FloatMenu(list)); } Text.Font = GameFont.Small; listing_Standard.EndSection(listing_Standard3); listing_Standard.Gap(12f); Listing_Standard listing_Standard4 = listing_Standard.BeginSection((float)Dialog_BillConfig.WorkerSelectionSubdialogHeight); Widgets.Dropdown <Bill_Production, Pawn>(listing_Standard4.GetRect(30f), this.bill, (Bill_Production b) => b.pawnRestriction, (Bill_Production b) => this.GeneratePawnRestrictionOptions(), (this.bill.pawnRestriction != null) ? this.bill.pawnRestriction.LabelShortCap : "AnyWorker".Translate(), null, null, null, null, false); if (this.bill.pawnRestriction == null && this.bill.recipe.workSkill != null) { listing_Standard4.Label("AllowedSkillRange".Translate(new object[] { this.bill.recipe.workSkill.label }), -1f, null); listing_Standard4.IntRange(ref this.bill.allowedSkillRange, 0, 20); } listing_Standard.EndSection(listing_Standard4); listing_Standard.End(); Rect rect5 = rect4; rect5.yMin = rect5.yMax - (float)Dialog_BillConfig.IngredientRadiusSubdialogHeight; rect4.yMax = rect5.yMin - 17f; bool flag = this.bill.GetStoreZone() == null || this.bill.recipe.WorkerCounter.CanPossiblyStoreInStockpile(this.bill, this.bill.GetStoreZone()); ThingFilterUI.DoThingFilterConfigWindow(rect4, ref this.thingFilterScrollPosition, this.bill.ingredientFilter, this.bill.recipe.fixedIngredientFilter, 4, null, this.bill.recipe.forceHiddenSpecialFilters, this.bill.recipe.GetPremultipliedSmallIngredients(), this.bill.Map); bool flag2 = this.bill.GetStoreZone() == null || this.bill.recipe.WorkerCounter.CanPossiblyStoreInStockpile(this.bill, this.bill.GetStoreZone()); if (flag && !flag2) { Messages.Message("MessageBillValidationStoreZoneInsufficient".Translate(new object[] { this.bill.LabelCap, this.bill.billStack.billGiver.LabelShort.CapitalizeFirst(), this.bill.GetStoreZone().label }), this.bill.billStack.billGiver as Thing, MessageTypeDefOf.RejectInput, false); } Listing_Standard listing_Standard5 = new Listing_Standard(); listing_Standard5.Begin(rect5); listing_Standard5.Label("IngredientSearchRadius".Translate() + ": " + ((this.bill.ingredientSearchRadius != 999f) ? this.bill.ingredientSearchRadius.ToString("F0") : "Unlimited".Translate()), -1f, null); this.bill.ingredientSearchRadius = listing_Standard5.Slider(this.bill.ingredientSearchRadius, 3f, 100f); if (this.bill.ingredientSearchRadius >= 100f) { this.bill.ingredientSearchRadius = 999f; } listing_Standard5.End(); Listing_Standard listing_Standard6 = new Listing_Standard(); listing_Standard6.Begin(rect2); if (this.bill.suspended) { if (listing_Standard6.ButtonText("Suspended".Translate(), null)) { this.bill.suspended = false; SoundDefOf.Click.PlayOneShotOnCamera(null); } } else if (listing_Standard6.ButtonText("NotSuspended".Translate(), null)) { this.bill.suspended = true; SoundDefOf.Click.PlayOneShotOnCamera(null); } StringBuilder stringBuilder = new StringBuilder(); if (this.bill.recipe.description != null) { stringBuilder.AppendLine(this.bill.recipe.description); stringBuilder.AppendLine(); } stringBuilder.AppendLine("WorkAmount".Translate() + ": " + this.bill.recipe.WorkAmountTotal(null).ToStringWorkAmount()); for (int j = 0; j < this.bill.recipe.ingredients.Count; j++) { IngredientCount ingredientCount = this.bill.recipe.ingredients[j]; if (!ingredientCount.filter.Summary.NullOrEmpty()) { stringBuilder.AppendLine(this.bill.recipe.IngredientValueGetter.BillRequirementsDescription(this.bill.recipe, ingredientCount)); } } stringBuilder.AppendLine(); string text5 = this.bill.recipe.IngredientValueGetter.ExtraDescriptionLine(this.bill.recipe); if (text5 != null) { stringBuilder.AppendLine(text5); stringBuilder.AppendLine(); } if (!this.bill.recipe.skillRequirements.NullOrEmpty <SkillRequirement>()) { stringBuilder.AppendLine("MinimumSkills".Translate()); stringBuilder.AppendLine(this.bill.recipe.MinSkillString); } Text.Font = GameFont.Small; string text6 = stringBuilder.ToString(); if (Text.CalcHeight(text6, rect2.width) > rect2.height) { Text.Font = GameFont.Tiny; } listing_Standard6.Label(text6, -1f, null); Text.Font = GameFont.Small; listing_Standard6.End(); if (this.bill.recipe.products.Count == 1) { ThingDef thingDef = this.bill.recipe.products[0].thingDef; Widgets.InfoCardButton(rect2.x, rect4.y, thingDef, GenStuff.DefaultStuffFor(thingDef)); } }
public override void DoSettingsWindowContents(Rect inRect) { try { inRect.yMin += 20; inRect.yMax -= 20; Listing_Standard list = new Listing_Standard(); Rect rect = new Rect(inRect.x, inRect.y, inRect.width, inRect.height); Rect rect2 = new Rect(0f, 0f, inRect.width - 30f, inRect.height * 2 + settings.RaceViewHeight); Widgets.BeginScrollView(rect, ref scrollPosition, rect2, true); list.Begin(rect2); if (list.ButtonText("Default Settings")) { settings.Reset(); } ; list.Label(string.Format("Minimum daily tenant contract payment ({0}).", settings.MinDailyCost)); settings.MinDailyCost = (int)Mathf.Round(list.Slider(settings.MinDailyCost, 0, 100)); list.Label(string.Format("Maximum daily tenant contract payment ({0}).", settings.MaxDailyCost)); settings.MaxDailyCost = (int)Mathf.Round(list.Slider(settings.MaxDailyCost, settings.MinDailyCost, 1000)); list.Label(string.Format("Minimum contracted days ({0}).", settings.MinContractTime)); settings.MinContractTime = (int)Mathf.Round(list.Slider(settings.MinContractTime, 1, 100)); list.Label(string.Format("Maximum contracted days ({0}).", settings.MaxContractTime)); settings.MaxContractTime = (int)Mathf.Round(list.Slider(settings.MaxContractTime, 1, 100)); list.Label(string.Format("({0}) Chance of contract extension when the tenant is satisfied.", settings.StayChanceHappy)); settings.StayChanceHappy = (int)Mathf.Round(list.Slider(settings.StayChanceHappy, settings.StayChanceNeutral, 100f)); list.Label(string.Format("({0}) Chance of contract extension when the tenant is okay.", settings.StayChanceNeutral)); settings.StayChanceNeutral = (int)Mathf.Round(list.Slider(settings.StayChanceNeutral, settings.StayChanceSad, 100f)); list.Label(string.Format("({0}) Chance of contract extension when the tenant is dissatisfied.", settings.StayChanceSad)); settings.StayChanceSad = (int)Mathf.Round(list.Slider(settings.StayChanceSad, 0f, 100f)); list.Label(string.Format("Faction penalty to relations for harboring fugitives. ({0})", settings.HarborPenalty)); settings.HarborPenalty = (int)Mathf.Round(list.Slider(settings.HarborPenalty, 1f, 100f)); list.Label(string.Format("Faction penalty to relations for tenancy accidents. ({0})", settings.OutragePenalty)); settings.OutragePenalty = (int)Mathf.Round(list.Slider(settings.OutragePenalty, 5f, 100f)); list.Label(string.Format("Needed level of tenancy happiness to do labor: ({0}).", settings.LevelOfHappinessToWork)); settings.LevelOfHappinessToWork = (byte)Mathf.Round(list.Slider(settings.LevelOfHappinessToWork, 0f, 100f)); list.Label(string.Format("Basic courier cost: ({0}).", settings.CourierCost)); settings.CourierCost = (byte)Mathf.Round(list.Slider(settings.CourierCost, 10f, 100f)); list.Gap(); list.CheckboxLabeled("Should tenants spawn without weapons?", ref settings.Weapons, "Keep in mind that this removes any weapon when a tenant spawns. Have you given a weapon to a tenant once before, it'll be removed should they leave the map and spawn again somewhere."); list.Gap(); list.CheckboxLabeled("Should tenants spawn simpler clothing?", ref settings.SimpleClothing, "Upon tenant creation, tenants will spawn with simpler clothing within the selected value range."); if (settings.SimpleClothing) { list.Gap(); list.Label(string.Format("Min total apparel value ({0}).", settings.SimpleClothingMin)); settings.SimpleClothingMin = Mathf.Round(list.Slider(settings.SimpleClothingMin, 0f, 500f)); list.Label(string.Format("Max total apparel value ({0}).", settings.SimpleClothingMax)); settings.SimpleClothingMax = Mathf.Round(list.Slider(settings.SimpleClothingMax, 0f, 1000f)); } list.Gap(); list.GapLine(); float R = settings.R, G = settings.G, B = settings.B; string buffer1 = R.ToString(), buffer2 = G.ToString(), buffer3 = B.ToString(); list.Label("RGB value for tenants name: <color=#" + ColorUtility.ToHtmlStringRGB(settings.Color) + ">" + "Color" + "</color>"); list.TextFieldNumericLabeled("R", ref R, ref buffer1, 0, 255); list.TextFieldNumericLabeled("G", ref G, ref buffer2, 0, 255); list.TextFieldNumericLabeled("B", ref B, ref buffer3, 0, 255); settings.R = R; settings.G = G; settings.B = B; list.Gap(); list.GapLine(); if (settings.Races != null && settings.Races.Count() > 0) { list.Label(string.Format("Available races")); settings.Filter = list.TextEntryLabeled("Filter:", settings.Filter, 1); Listing_Standard list2 = list.BeginSection(settings.RaceViewHeight); list2.ColumnWidth = (rect2.width - 50) / 4; foreach (ThingDef def in settings.Races) { if (def.defName.ToUpper().Contains(settings.Filter.ToUpper())) { bool contains = settings.AvailableRaces.Contains(def.defName); list2.CheckboxLabeled(def.defName, ref contains, ""); if (contains == false && settings.AvailableRaces.Contains(def.defName)) { settings.AvailableRaces.Remove(def.defName); } else if (contains == true && !settings.AvailableRaces.Contains(def.defName)) { settings.AvailableRaces.Add(def.defName); } } } list.EndSection(list2); } list.End(); Widgets.EndScrollView(); settings.Write(); } catch (Exception ex) { Log.Message(ex.Message); } }
public override void DoSettingsWindowContents(Rect rect) { Listing_Standard list = new Listing_Standard() { ColumnWidth = rect.width }; Rect topRect = rect.TopPart(0.25f); Rect bottomRect = rect.BottomPart(0.75f); Rect fullRect = list.GetRect(Text.LineHeight).ContractedBy(4); Rect leftRect = fullRect.LeftHalf().Rounded(); Rect rightRect = fullRect.RightHalf().Rounded(); list.Begin(rect); list.QuarryHealthSetting(); Listing_Standard listtop = list.BeginSection(topRect.height, true); { listtop.ColumnWidth = rect.width / 2; listtop.CheckboxLabeled(Static.LetterSent, ref QuarrySettings.letterSent, Static.ToolTipLetter); listtop.CheckboxLabeled(Static.AllowRottable, ref QuarrySettings.allowRottable, Static.ToolTipAllowRottable); listtop.NewColumn(); listtop.LabeledScrollbarSetting("QRY_SettingsJunkChance".Translate(QuarrySettings.junkChance), ref QuarrySettings.junkChance, Static.ToolTipJunkChance); listtop.LabeledScrollbarSetting("QRY_SettingsChunkChance".Translate(QuarrySettings.chunkChance), ref QuarrySettings.chunkChance, Static.ToolTipChunkChance); listtop.LabeledScrollbarSetting("QRY_SettingsResourceModifier".Translate(QuarrySettings.resourceModifer * 100), ref QuarrySettings.resourceModifer, Static.ToolTipResourceModifier); } list.EndSection(listtop); /* * Listing_Standard listbottom = list.BeginSection(bottomRect.height, true); * { * * } * list.EndSection(listbottom); */ list.End(); { Rect DictInterfaceRect = bottomRect.TopPart(0.25f).Rounded(); { Rect labelRect = DictInterfaceRect.TopPart(0.75f).Rounded(); Text.Font = GameFont.Medium; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(labelRect, Static.LabelDictionary); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.UpperLeft; } { Rect buttonsRect = DictInterfaceRect.BottomPart(0.25f).Rounded(); Rect addRect = buttonsRect.LeftThird(); Rect rmvRect = buttonsRect.MiddleThird(); Rect resRect = buttonsRect.RightThird(); // Add an entry to the dictionary if (Widgets.ButtonText(addRect, Static.LabelAddThing)) { List <FloatMenuOption> thingList = new List <FloatMenuOption>(); foreach (ThingDef current in from t in QuarryUtility.PossibleThingDefs() orderby t.label select t) { bool skip = false; for (int i = 0; i < QuarrySettings.oreDictionary.Count; i++) { if (QuarrySettings.oreDictionary[i].thingDef == current) { skip = true; break; } } ; if (skip) { continue; } thingList.Add(new FloatMenuOption(current.LabelCap, delegate { QuarrySettings.oreDictionary.Add(new ThingCountExposable(current, 1)); })); } FloatMenu menu = new FloatMenu(thingList); Find.WindowStack.Add(menu); } // Remove an entry from the dictionary if (Widgets.ButtonText(rmvRect, Static.LabelRemoveThing) && QuarrySettings.oreDictionary.Count >= 2) { List <FloatMenuOption> thingList = new List <FloatMenuOption>(); foreach (ThingCountExposable current in from t in QuarrySettings.oreDictionary orderby t.thingDef.label select t) { ThingDef localTd = current.thingDef; thingList.Add(new FloatMenuOption(localTd.LabelCap, delegate { for (int i = 0; i < QuarrySettings.oreDictionary.Count; i++) { if (QuarrySettings.oreDictionary[i].thingDef == localTd) { QuarrySettings.oreDictionary.Remove(QuarrySettings.oreDictionary[i]); break; } } ; })); } FloatMenu menu = new FloatMenu(thingList); Find.WindowStack.Add(menu); } // Reset the dictionary if (Widgets.ButtonText(resRect, Static.LabelResetList)) { OreDictionary.Build(); } } { Rect listRect = bottomRect.BottomPart(0.75f).Rounded(); Rect cRect = listRect.ContractedBy(10f); Rect position = listRect; Rect outRect = new Rect(0f, 0f, position.width, position.height); Rect viewRect = new Rect(0f, 0f, position.width - 16f, scrollViewHeight); float num = 0f; List <ThingCountExposable> dict = new List <ThingCountExposable>(QuarrySettings.oreDictionary); GUI.BeginGroup(position); Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect, true); foreach (var tc in dict.Select((value, index) => new { index, value })) { Rect entryRect = new Rect(0f, num, viewRect.width, 32); Rect iconRect = entryRect.LeftPartPixels(32); Rect labelRect = new Rect(entryRect.LeftThird().x + 33f, entryRect.y, entryRect.LeftThird().width - 33f, entryRect.height); Rect texEntryRect = new Rect(entryRect.LeftHalf().RightPartPixels(103).x, entryRect.y, 60f, entryRect.height); Rect pctRect = new Rect(entryRect.LeftHalf().RightPartPixels(41).x, entryRect.y, 40f, entryRect.height); Rect sliderRect = new Rect(entryRect.RightHalf().x, entryRect.y, entryRect.RightHalf().width, entryRect.height); Widgets.ThingIcon(iconRect, tc.value.thingDef); Widgets.Label(labelRect, tc.value.thingDef.LabelCap); Widgets.Label(pctRect, $"{QuarrySettings.oreDictionary.WeightAsPercentageOf(tc.value.count).ToStringDecimal()}%"); int val = tc.value.count; string nullString = null; Widgets.TextFieldNumeric( texEntryRect, ref QuarrySettings.oreDictionary[tc.index].count, ref nullString, 0, OreDictionary.MaxWeight); val = Widgets.HorizontalSlider( sliderRect, QuarrySettings.oreDictionary[tc.index].count, 0f, OreDictionary.MaxWeight, true ).RoundToAsInt(1); if (val != QuarrySettings.oreDictionary[tc.index].count) { QuarrySettings.oreDictionary[tc.index].count = val; } if (Mouse.IsOver(entryRect)) { Widgets.DrawHighlight(entryRect); } TooltipHandler.TipRegion(entryRect.LeftThird(), tc.value.thingDef.description); num += 32f; scrollViewHeight = num; } Widgets.EndScrollView(); GUI.EndGroup(); } } }
public void DoWindowContents(Rect wrect) { float days; float hours; // wrect.yMin += 15f; // wrect.yMax -= 15f; var options = new Listing_Standard(); // var outRect = new Rect(wrect.x, wrect.y, wrect.width, wrect.height); // Size of viewed area var scrollRect = new Rect(0f, 0f, wrect.width - 16f, wrect.height * 1.5f); // Size of content data var rect2 = new Rect(0f, 0f, wrect.width - 30f, 340f); // Size of item list data Widgets.BeginScrollView(outRect, ref scrollPosition, scrollRect, true); options.Begin(scrollRect); Header(options, "Performance_Settings".Translate(), false); options.CheckboxLabeled("ST_alertColonistNeedsSurvivalTool".Translate(), ref alertColonistNeedsSurvivalTool, "ST_alertColonistNeedsSurvivalTool_tooltip".Translate()); if (alertColonistNeedsSurvivalTool) { options.Gap(); days = Mathf.FloorToInt((float)alertColonistNeedsSurvivalTool_Delay / GenDate.TicksPerDay); hours = ((float)alertColonistNeedsSurvivalTool_Delay - days * GenDate.TicksPerDay) / GenDate.TicksPerHour; options.Label("ST_alertColonistNeedsSurvivalTool_Delay".Translate() + $"\t{days} " + "DaysLower".Translate() + $" {hours.ToString("F02")} " + "HoursLower".Translate(), tooltip: "ST_alertColonistNeedsSurvivalTool_Delay_tooltip".Translate()); alertColonistNeedsSurvivalTool_Delay = Mathf.RoundToInt(options.Slider(alertColonistNeedsSurvivalTool_Delay, 1, GenDate.TicksPerDay)); } Header(options, "Gameplay_Settings".Translate()); options.CheckboxLabeled("ST_noToolWorkPenalty".Translate(), ref noToolWorkPenalty, "ST_noToolWorkPenalty_tooltip".Translate()); if (noToolWorkPenalty) { options.Gap(); options.CheckboxLabeled("ST_disableNoToolWork".Translate(), ref disableNoToolWork, "ST_disableNoToolWork_tooltip".Translate()); if (!disableNoToolWork) { options.Gap(); options.Label("ST_noToolWorkFactor".Translate() + $"\tx{noToolWorkFactor.ToString("F02")}", tooltip: "ST_noToolWorkFactor_tooltip".Translate()); noToolWorkFactor = options.Slider(noToolWorkFactor, 0.3f, 1.0f); options.Gap(); options.Label("ST_noToolWorkOffset".Translate() + $"\tx{noToolWorkOffset.ToString("F02")}", tooltip: "ST_noToolWorkOffset_tooltip".Translate()); noToolWorkOffset = options.Slider(noToolWorkOffset, -0.5f, 0.0f); } } options.GapLine(12f); var toolTypes = DefDatabase <ToolType> .AllDefsListForReading; options.Label("ST_ToolTypes".Translate(toolTypes.Count)); Filter = options.TextEntryLabeled("Filter".Translate(), Filter, 1); #if V11 var itemsWindow = options.BeginSection(340f); #else var itemsWindow = options.BeginSection_NewTemp(340f); #endif itemsWindow.ColumnWidth = ((rect2.width - 50f) / 3f); foreach (var toolType in toolTypes) { string text = toolType.label.ToLower(); ThingDef val4 = null; if (text.Contains(Filter.ToLower())) { float lineHeight = Text.LineHeight; Rect rect3 = itemsWindow.GetRect(lineHeight); TextAnchor anchor = Text.Anchor; // Text.Anchor = TextAnchor.MiddleLeft; var toolType_Type = Dictionaries.SurvivalToolTypes[toolType] ? "ST_SurvivalTool".Translate() : "ST_NormalTool".Translate(); Widgets.Label(rect3, toolType.label); Rect rect4 = new Rect(rect3.x + itemsWindow.ColumnWidth - 100f, rect3.y, 98f, 24f); Widgets.Dropdown(rect4, toolType, t => Dictionaries.SurvivalToolTypes[t], SurvivalToolType_GenerateMenu, toolType_Type); } } options.EndSection(itemsWindow); options.End(); Widgets.EndScrollView(); // Mod.GetSettings<Settings>().Write(); }