// Token: 0x06002239 RID: 8761 RVA: 0x00101BEC File Offset: 0x000FFFEC public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 2f); Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(scenPartRect.TopHalf()); listing_Standard.ColumnWidth = scenPartRect.width; listing_Standard.TextFieldNumeric <int>(ref this.count, ref this.countBuf, 1f, 1E+09f); listing_Standard.End(); if (Widgets.ButtonText(scenPartRect.BottomHalf(), this.CurrentAnimalLabel().CapitalizeFirst(), true, false, true)) { List <FloatMenuOption> list = new List <FloatMenuOption>(); list.Add(new FloatMenuOption("RandomPet".Translate().CapitalizeFirst(), delegate() { this.animalKind = null; }, MenuOptionPriority.Default, null, null, 0f, null, null)); foreach (PawnKindDef localKind2 in this.PossibleAnimals()) { PawnKindDef localKind = localKind2; list.Add(new FloatMenuOption(localKind.LabelCap, delegate() { this.animalKind = localKind; }, MenuOptionPriority.Default, null, null, 0f, null, null)); } Find.WindowStack.Add(new FloatMenu(list)); } }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 2f); Rect rect = scenPartRect.TopHalf(); if (Widgets.ButtonText(rect, this.stat.LabelCap, true, false, true)) { List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (StatDef current in DefDatabase <StatDef> .AllDefs) { StatDef localSd = current; list.Add(new FloatMenuOption(localSd.LabelCap, delegate { this.stat = localSd; }, MenuOptionPriority.Default, null, null, 0f, null, null)); } Find.WindowStack.Add(new FloatMenu(list)); } Rect rect2 = scenPartRect.BottomHalf(); Rect rect3 = rect2.LeftHalf().Rounded(); Rect rect4 = rect2.RightHalf().Rounded(); Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(rect3, "multiplier".Translate()); Text.Anchor = TextAnchor.UpperLeft; Widgets.TextFieldPercent(rect4, ref this.factor, ref this.factorBuf, 0f, 100f); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 2f); if (Widgets.ButtonText(scenPartRect.TopHalf(), stat.LabelCap)) { List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (StatDef allDef in DefDatabase <StatDef> .AllDefs) { if (!allDef.forInformationOnly) { StatDef localSd = allDef; list.Add(new FloatMenuOption(localSd.LabelForFullStatListCap, delegate { stat = localSd; })); } } Find.WindowStack.Add(new FloatMenu(list)); } Rect rect = scenPartRect.BottomHalf(); Rect rect2 = rect.LeftHalf().Rounded(); Rect rect3 = rect.RightHalf().Rounded(); Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(rect2, "multiplier".Translate()); Text.Anchor = TextAnchor.UpperLeft; Widgets.TextFieldPercent(rect3, ref factor, ref factorBuf, 0f, 100f); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, (float)(ScenPart.RowHeight * 3.0)); if (Widgets.ButtonText(scenPartRect.TopPart(0.333f), this.trait.DataAtDegree(this.degree).label.CapitalizeFirst(), true, false, true)) { List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (TraitDef item in from td in DefDatabase <TraitDef> .AllDefs orderby td.label select td) { foreach (TraitDegreeData degreeData in item.degreeDatas) { TraitDef localDef = item; TraitDegreeData localDeg = degreeData; list.Add(new FloatMenuOption(localDeg.label.CapitalizeFirst(), delegate { this.trait = localDef; this.degree = localDeg.degree; }, MenuOptionPriority.Default, null, null, 0f, null, null)); } } Find.WindowStack.Add(new FloatMenu(list)); } base.DoPawnModifierEditInterface(scenPartRect.BottomPart(0.666f)); }
public override void DoEditInterface(Listing_ScenEdit listing) { base.DoEditInterface(listing); var scenPartRect = listing.GetScenPartRect(this, RowHeight); Widgets.TextFieldNumeric(scenPartRect, ref count, ref countBuf, 1f, 10f); }
public override void DoEditInterface(Listing_ScenEdit listing) { var scenPartRect = listing.GetScenPartRect(this, RowHeight * 3 + 31); if (Widgets.ButtonText(scenPartRect.TopPartPixels(RowHeight), inhabitantKind.ToString())) { FloatMenuUtility.MakeMenu(System.Enum.GetNames(typeof(InhabitantKind)), s => (s + "CityKind").Translate(), s => { return(() => inhabitantKind = (InhabitantKind)System.Enum.Parse(typeof(InhabitantKind), s)); }); } }
public override void DoEditInterface(Listing_ScenEdit listing) { var scenPartRect = listing.GetScenPartRect(this, RowHeight * 6); var labelRect = new Rect(scenPartRect.x, scenPartRect.y, scenPartRect.width, RowHeight); structureLabel = Widgets.TextField(labelRect, structureLabel); var addRect = new Rect(scenPartRect.x, scenPartRect.y + RowHeight, scenPartRect.width, RowHeight); if (Widgets.ButtonText(addRect, "KCSG.Add".Translate())) { var floatMenuOptions = new List <FloatMenuOption>(); if (DefDatabase <StructureLayoutDef> .AllDefs.Count() > 0) { foreach (var item in DefDatabase <StructureLayoutDef> .AllDefs) { floatMenuOptions.Add(new FloatMenuOption(item.defName, () => chooseFrom.Add(item))); } } else { floatMenuOptions.Add(new FloatMenuOption("No structure available", null)); } Find.WindowStack.Add(new FloatMenu(floatMenuOptions)); } var removeRect = new Rect(scenPartRect.x, scenPartRect.y + RowHeight * 2, scenPartRect.width, RowHeight); if (Widgets.ButtonText(removeRect, "KCSG.Remove".Translate())) { var floatMenuOptions = new List <FloatMenuOption>(); if (chooseFrom.Count > 0) { foreach (var item in chooseFrom) { floatMenuOptions.Add(new FloatMenuOption(item.defName, () => chooseFrom.Remove(item))); } } else { floatMenuOptions.Add(new FloatMenuOption("Nothing to remove", null)); } Find.WindowStack.Add(new FloatMenu(floatMenuOptions)); } // Generation options var nearCenterRect = new Rect(scenPartRect.x, scenPartRect.y + RowHeight * 3, scenPartRect.width, RowHeight); Widgets.CheckboxLabeled(nearCenterRect, "KCSG.SpawnNearCenter".Translate(), ref nearMapCenter); var foogedRect = new Rect(scenPartRect.x, scenPartRect.y + RowHeight * 4, scenPartRect.width, RowHeight); Widgets.CheckboxLabeled(foogedRect, "KCSG.AllowFoggedPosition".Translate(), ref allowFoggedPosition); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 3f); Rect rect = new Rect(scenPartRect.x, scenPartRect.y, scenPartRect.width, scenPartRect.height / 3f); Rect rect2 = new Rect(scenPartRect.x, scenPartRect.y + scenPartRect.height / 3f, scenPartRect.width, scenPartRect.height / 3f); Rect rect3 = new Rect(scenPartRect.x, scenPartRect.y + scenPartRect.height * 2f / 3f, scenPartRect.width, scenPartRect.height / 3f); base.DoIncidentEditInterface(rect); Widgets.TextFieldNumericLabeled <float>(rect2, "intervalDays".Translate(), ref this.intervalDays, ref this.intervalDaysBuffer, 0f, 1E+09f); Widgets.CheckboxLabeled(rect3, "repeat".Translate(), ref this.repeat, false, null, null, false); }
public override void DoEditInterface(Listing_ScenEdit listing) { if (!Widgets.ButtonText(listing.GetScenPartRect(this, ScenPart.RowHeight), gameCondition.LabelCap)) { return; } FloatMenuUtility.MakeMenu(AllowedGameConditions(), (GameConditionDef d) => d.LabelCap, (GameConditionDef d) => delegate { gameCondition = d; }); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect rect = listing.GetScenPartRect(this, ScenPart.RowHeight); Rect rectL = rect.LeftHalf().Rounded(); Rect rectR = rect.RightHalf().Rounded(); Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(rectL, "TD.BlindUntilProgess".Translate()); Text.Anchor = TextAnchor.UpperLeft; Widgets.TextFieldPercent(rectR, ref blindThreshold, ref blindBuf, 0f, 100f); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect rect = listing.GetScenPartRect(this, RowHeight * 4); Rect[] rows = rect.SplitRows(1, 3); Widgets.IntRange(rows[0], listing.CurHeight.GetHashCode(), ref allowedAgeRange, 15, 120); FixAgeRange(); DoContextEditInterface(rows[1]); }
public override void DoEditInterface(Listing_ScenEdit listing) { if (!Widgets.ButtonText(listing.GetScenPartRect(this, ScenPart.RowHeight), project.LabelCap)) { return; } FloatMenuUtility.MakeMenu(NonRedundantResearchProjects(), (ResearchProjectDef d) => d.LabelCap, (ResearchProjectDef d) => delegate { project = d; }); }
public override void DoEditInterface(Listing_ScenEdit listing) { var scenPartRect = listing.GetScenPartRect(this, RowHeight * 6); Widgets.TextFieldNumericLabeled(new Rect(scenPartRect.x, scenPartRect.y, scenPartRect.width, RowHeight), "Resource yield % ", ref resourceReturn, ref resourceReturnBuf, 0, 100); Widgets.CheckboxLabeled(new Rect(scenPartRect.x, scenPartRect.y + RowHeight, scenPartRect.width, RowHeight), "Keep bodies", ref keepBodies); Widgets.CheckboxLabeled(new Rect(scenPartRect.x, scenPartRect.y + RowHeight * 2, scenPartRect.width, RowHeight), "Kill plants", ref killPlants); Widgets.CheckboxLabeled(new Rect(scenPartRect.x, scenPartRect.y + RowHeight * 3, scenPartRect.width, RowHeight), "Stone terrain only", ref stoneTerrainOnly); Widgets.CheckboxLabeled(new Rect(scenPartRect.x, scenPartRect.y + RowHeight * 4, scenPartRect.width, RowHeight), "Forbid everything", ref forbidEverything); Widgets.CheckboxLabeled(new Rect(scenPartRect.x, scenPartRect.y + RowHeight * 5, scenPartRect.width, RowHeight), "Trees leave wood", ref treesDropWood); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight); if (Widgets.ButtonText(scenPartRect, this.project.LabelCap, true, false, true)) { FloatMenuUtility.MakeMenu <ResearchProjectDef>(this.NonRedundantResearchProjects(), (ResearchProjectDef d) => d.LabelCap, (ResearchProjectDef d) => delegate() { this.project = d; }); } }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight); if (Widgets.ButtonText(scenPartRect, this.gameCondition.LabelCap, true, false, true)) { FloatMenuUtility.MakeMenu <GameConditionDef>(this.AllowedGameConditions(), (GameConditionDef d) => d.LabelCap, (GameConditionDef d) => delegate() { this.gameCondition = d; }); } }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 2f); Widgets.TextFieldNumericLabeled <float>(scenPartRect.TopHalf(), "radius".Translate(), ref this.radius, ref this.radiusBuf, 0f, 1E+09f); if (Widgets.ButtonText(scenPartRect.BottomHalf(), this.damage.LabelCap, true, false, true)) { FloatMenuUtility.MakeMenu <DamageDef>(this.PossibleDamageDefs(), (DamageDef d) => d.LabelCap, (DamageDef d) => delegate { this.damage = d; }); } }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 2f); Widgets.TextFieldNumericLabeled(scenPartRect.TopHalf(), "radius".Translate(), ref radius, ref radiusBuf); if (!Widgets.ButtonText(scenPartRect.BottomHalf(), damage.LabelCap)) { return; } FloatMenuUtility.MakeMenu(PossibleDamageDefs(), (DamageDef d) => d.LabelCap, (DamageDef d) => delegate { damage = d; }); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 3f + 31f); if (Widgets.ButtonText(scenPartRect.TopPartPixels(ScenPart.RowHeight), this.need.LabelCap, true, false, true)) { FloatMenuUtility.MakeMenu <NeedDef>(this.PossibleNeeds(), (NeedDef hd) => hd.LabelCap, (NeedDef n) => delegate { this.need = n; }); } Widgets.FloatRange(new Rect(scenPartRect.x, scenPartRect.y + ScenPart.RowHeight, scenPartRect.width, 31f), listing.CurHeight.GetHashCode(), ref this.levelRange, 0f, 1f, "ConfigurableLevel", ToStringStyle.FloatTwo); base.DoPawnModifierEditInterface(scenPartRect.BottomPartPixels(ScenPart.RowHeight * 2f)); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect rect = listing.GetScenPartRect(this, RowHeight * 5 + 31f); Rect[] rows = rect.SplitRows(RowHeight, 31f, 4 * RowHeight); if (Widgets.ButtonText(rows[0], need.LabelCap, true, false, true)) { FloatMenuUtility.MakeMenu(DefDatabase <NeedDef> .AllDefs.Where((NeedDef x) => x.major), (x) => x.LabelCap, (x) => () => need = x); } Widgets.FloatRange(rows[1], listing.CurHeight.GetHashCode(), ref levelRange, 0, 1, R.String.Keys.MSP_NeedLevel.CapitalizeFirst()); DoContextEditInterface(rows[2]); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, RowHeight * 4f + 31f); if (Widgets.ButtonText(scenPartRect.TopPartPixels(RowHeight), this?.bloodline?.LabelCap ?? "ROMV_UnknownBloodline".Translate())) { FloatMenuUtility.MakeMenu(PossibleBloodlines(), (BloodlineDef bl) => bl.LabelCap, (BloodlineDef bl) => delegate { bloodline = bl; }); } //Widgets.IntRange(new Rect(scenPartRect.x, scenPartRect.y + ScenPart.RowHeight, scenPartRect.width, 31f), listing.CurHeight.GetHashCode(), ref this.generationRange, 4, this.maxGeneration, "ROMV_VampireGeneration"); DoVampModifierEditInterface(new Rect(scenPartRect.x, scenPartRect.y, scenPartRect.width, 31f)); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, RowHeight * 3f); if (Widgets.ButtonText(scenPartRect.TopPart(0.45f), this.kindDef.label.CapitalizeFirst(), true, false, true)) { List <FloatMenuOption> list = new List <FloatMenuOption>(); list.AddRange(DefDatabase <ThingDef_AlienRace> .AllDefsListForReading.Where(ar => ar.alienRace.pawnKindSettings.startingColonists != null).SelectMany(ar => ar.alienRace.pawnKindSettings.startingColonists.SelectMany(ste => ste.pawnKindEntries.SelectMany(pke => pke.kindDefs))).Where(s => DefDatabase <PawnKindDef> .GetNamedSilentFail(s) != null).Select(pkd => DefDatabase <PawnKindDef> .GetNamedSilentFail(pkd)).Select(pkd => new FloatMenuOption(pkd.label.CapitalizeFirst(), () => this.kindDef = pkd))); list.Add(new FloatMenuOption("Villager", () => this.kindDef = PawnKindDefOf.Villager)); list.Add(new FloatMenuOption("Slave", () => this.kindDef = PawnKindDefOf.Slave)); Find.WindowStack.Add(new FloatMenu(list)); } Widgets.TextFieldNumeric(scenPartRect.BottomPart(0.45f), ref this.pawnCount, ref this.buffer, 0); }
public override void DoEditInterface(Listing_ScenEdit listing) { var scenPartRect = listing.GetScenPartRect(this, RowHeight * 4); // Faction selection var selectionRect = new Rect(scenPartRect.x, scenPartRect.y, scenPartRect.width, scenPartRect.height / 4); if (Widgets.ButtonText(selectionRect, LabelText)) { var floatMenuOptions = new List <FloatMenuOption>(); floatMenuOptions.Add(new FloatMenuOption("VanillaFactionsExpanded.AllFactions".Translate(), () => factionDef = null)); var eligibleFactions = EligibleFactionDefs.ToList(); for (int i = 0; i < eligibleFactions.Count; i++) { var faction = eligibleFactions[i]; floatMenuOptions.Add(new FloatMenuOption(faction.LabelCap, () => factionDef = faction)); } Find.WindowStack.Add(new FloatMenu(floatMenuOptions)); } // Faction options var optionsRect = new Rect(scenPartRect.x, scenPartRect.y + (scenPartRect.height / 4), scenPartRect.width, scenPartRect.height / 4); Widgets.CheckboxLabeled(optionsRect.LeftPart(OptionRectPartWidth), "VanillaFactionsExpanded.AlwaysHostile".Translate(), ref alwaysHostile); Widgets.CheckboxLabeled(optionsRect.RightPart(OptionRectPartWidth), "VanillaFactionsExpanded.AffectHiddenFactions".Translate(), ref affectHiddenFactions); // No point showing these if the faction is set to always be hostile if (!alwaysHostile) { // Starting goodwill range var startingRangeRect = new Rect(scenPartRect.x, scenPartRect.y + (scenPartRect.height * 2 / 4), scenPartRect.width, scenPartRect.height / 4); var startingRangeLeftPart = startingRangeRect.LeftPart(1 - GoodwillRangeSliderWidth); Widgets.CheckboxLabeled(startingRangeLeftPart, "VanillaFactionsExpanded.StartingGoodwill".Translate().Truncate(startingRangeLeftPart.width), ref affectStartingGoodwill); if (affectStartingGoodwill) { Widgets.IntRange(startingRangeRect.RightPart(GoodwillRangeSliderWidth), 76823, ref startingGoodwillRange, DiplomacyTuning.MinGoodwill, DiplomacyTuning.MaxGoodwill); } // Natural goodwill range var naturalRangeRect = new Rect(scenPartRect.x, scenPartRect.y + (scenPartRect.height * 3 / 4), scenPartRect.width, scenPartRect.height / 4); var naturalRangeLeftPart = naturalRangeRect.LeftPart(1 - GoodwillRangeSliderWidth); Widgets.CheckboxLabeled(naturalRangeLeftPart, "VanillaFactionsExpanded.NaturalGoodwill".Translate().Truncate(naturalRangeLeftPart.width), ref affectNaturalGoodwill); if (affectNaturalGoodwill) { Widgets.IntRange(naturalRangeRect.RightPart(GoodwillRangeSliderWidth), -238948923, ref naturalGoodwillRange, DiplomacyTuning.MinGoodwill, DiplomacyTuning.MaxGoodwill); } } }
public override void DoEditInterface(Listing_ScenEdit listing) { if (Widgets.ButtonText(listing.GetScenPartRect(this, ScenPart.RowHeight), method.ToStringHuman())) { List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (PlayerPawnsArriveMethod value in Enum.GetValues(typeof(PlayerPawnsArriveMethod))) { PlayerPawnsArriveMethod localM = value; list.Add(new FloatMenuOption(localM.ToStringHuman(), delegate { method = localM; })); } Find.WindowStack.Add(new FloatMenu(list)); } }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight); if (Widgets.ButtonText(scenPartRect, gameCondition.LabelCap)) { FloatMenuUtility.MakeMenu(AllowedGameConditions(), (GameConditionDef d) => d.LabelCap, delegate(GameConditionDef d) { ScenPart_PermaGameCondition scenPart_PermaGameCondition = this; return(delegate { scenPart_PermaGameCondition.gameCondition = d; }); }); } }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight); if (Widgets.ButtonText(scenPartRect, project.LabelCap)) { FloatMenuUtility.MakeMenu(NonRedundantResearchProjects(), (ResearchProjectDef d) => d.LabelCap, delegate(ResearchProjectDef d) { ScenPart_StartingResearch scenPart_StartingResearch = this; return(delegate { scenPart_StartingResearch.project = d; }); }); } }
public override void DoEditInterface(Listing_ScenEdit listing) { base.DoEditInterface(listing); Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 2f); scenPartRect.height = ScenPart.RowHeight; Text.Anchor = TextAnchor.UpperRight; Rect rect = new Rect(scenPartRect.x - 200f, scenPartRect.y + ScenPart.RowHeight, 200f, ScenPart.RowHeight); rect.xMax -= 4f; Widgets.Label(rect, "ScenPart_StartWithPawns_OutOf".Translate()); Text.Anchor = TextAnchor.UpperLeft; Widgets.TextFieldNumeric <int>(scenPartRect, ref this.pawnCount, ref this.pawnCountBuffer, 1f, 10f); scenPartRect.y += ScenPart.RowHeight; Widgets.TextFieldNumeric <int>(scenPartRect, ref this.pawnChoiceCount, ref this.pawnCountChoiceBuffer, (float)this.pawnCount, 10f); }
public override void DoEditInterface(Listing_ScenEdit listing) { if (Widgets.ButtonText(listing.GetScenPartRect(this, ScenPart.RowHeight), factionDef.LabelCap)) { List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (FactionDef item in DefDatabase <FactionDef> .AllDefs.Where((FactionDef d) => d.isPlayer)) { FactionDef localFd = item; list.Add(new FloatMenuOption(localFd.LabelCap, delegate { factionDef = localFd; })); } Find.WindowStack.Add(new FloatMenu(list)); } }
// Token: 0x060047C4 RID: 18372 RVA: 0x00180E40 File Offset: 0x0017F040 public override void DoEditInterface(Listing_ScenEdit listing) { if (Widgets.ButtonText(listing.GetScenPartRect(this, ScenPart.RowHeight), this.method.ToStringHuman(), true, true, true)) { List <FloatMenuOption> list = new List <FloatMenuOption>(); foreach (object obj in Enum.GetValues(typeof(PlayerPawnsArriveMethod))) { PlayerPawnsArriveMethod localM2 = (PlayerPawnsArriveMethod)obj; PlayerPawnsArriveMethod localM = localM2; list.Add(new FloatMenuOption(localM.ToStringHuman(), delegate() { this.method = (PlayerPawnsArriveMethod)localM; }, MenuOptionPriority.Default, null, null, 0f, null, null)); } Find.WindowStack.Add(new FloatMenu(list)); } }
public override void DoEditInterface(Listing_ScenEdit listing) { if (!Widgets.ButtonText(listing.GetScenPartRect(this, RowHeight), shipFactionName, true, false, true)) { return; } List <FloatMenuOption> floatMenuOptionList = new List <FloatMenuOption>(); List <string> stringList = new List <string>(); stringList.AddRange(Directory.GetFiles(Path.Combine(GenFilePaths.SaveDataFolderPath, "Ships"))); foreach (string str in stringList) { string ship = str; floatMenuOptionList.Add(new FloatMenuOption(Path.GetFileNameWithoutExtension(ship), (Action)(() => this.shipFactionName = Path.GetFileNameWithoutExtension(ship)), (MenuOptionPriority)4, (Action)null, (Thing)null, 0.0f, (Func <Rect, bool>)null, (WorldObject)null)); } Find.WindowStack.Add(new FloatMenu(floatMenuOptionList)); }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect rect = listing.GetScenPartRect(this, RowHeight * 4); bool isFaction = context == PawnModifierContext.Faction; Rect[] rows = rect.SplitRows(1, 1, 1, 1); Rect[] rect_gender = rows[0].SplitCols(1, 2); Rect[] rect_chance = rows[1].SplitCols(1, 2); Rect[] rect_context = rows[2].SplitCols(1, 2); Rect[] rect_faction = rows[3].SplitCols(1, 2); //Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(rect_chance[0], R.String.MSP_Chance.CapitalizeFirst()); //Text.Anchor = TextAnchor.UpperLeft; Widgets.TextFieldPercent(rect_chance[1], ref chance, ref chanceBuf, 0f, 1f); //Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(rect_gender[0], R.String.MSP_Gender.CapitalizeFirst()); //Text.Anchor = TextAnchor.UpperLeft; if (Widgets.ButtonText(rect_gender[1], gender.Translate())) { FloatMenuUtility.MakeMenu(Extensions.GetEnumValues <PawnModifierGender>(), Extensions.Translate, (g) => () => gender = g); } //Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(rect_context[0], R.String.MSP_Context.CapitalizeFirst()); //Text.Anchor = TextAnchor.UpperLeft; if (Widgets.ButtonText(rect_context[1], context.Translate(), true, false, true)) { FloatMenuUtility.MakeMenu(Extensions.GetEnumValues <PawnModifierContext>(), Extensions.Translate, (c) => () => context = c); } if (isFaction) { //Text.Anchor = TextAnchor.MiddleRight; Widgets.Label(rect_faction[0], R.String.MSP_Faction.CapitalizeFirst()); //Text.Anchor = TextAnchor.UpperLeft; if (Widgets.ButtonText(rect_faction[1], faction.LabelCap, true, false, true)) { FloatMenuUtility.MakeMenu(DefDatabase <FactionDef> .AllDefs.Where((d) => !d.isPlayer), (f) => f.LabelCap, (f) => () => faction = f); } } }