Beispiel #1
0
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 3f);

            if (Widgets.ButtonText(scenPartRect.TopPart(0.333f), trait.DataAtDegree(degree).label.CapitalizeFirst()))
            {
                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
                        {
                            trait  = localDef;
                            degree = localDeg.degree;
                        }));
                    }
                }
                Find.WindowStack.Add(new FloatMenu(list));
            }
            DoPawnModifierEditInterface(scenPartRect.BottomPart(0.666f));
        }
 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 current in this.PossibleAnimals())
         {
             PawnKindDef localKind = current;
             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)
        {
            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)
        {
            base.DoEditInterface(listing);
            Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight);

            Widgets.TextFieldNumeric <int>(scenPartRect, ref this.slaveCount, ref this.pawnCountBuffer, 1f, 10f);
        }
Beispiel #5
0
 public static void DrawScenarioEditInterface(Rect rect, Scenario scen, ref Vector2 infoScrollPosition)
 {
     Widgets.DrawMenuSection(rect);
     rect = rect.GetInnerRect();
     if (scen != null)
     {
         Rect viewRect = new Rect(0f, 0f, rect.width - 16f, editViewHeight);
         Widgets.BeginScrollView(rect, ref infoScrollPosition, viewRect);
         Rect             rect2            = new Rect(0f, 0f, viewRect.width, 99999f);
         Listing_ScenEdit listing_ScenEdit = new Listing_ScenEdit(scen);
         listing_ScenEdit.ColumnWidth = rect2.width;
         listing_ScenEdit.Begin(rect2);
         listing_ScenEdit.Label("Title".Translate());
         scen.name = listing_ScenEdit.TextEntry(scen.name).TrimmedToLength(55);
         listing_ScenEdit.Label("Summary".Translate());
         scen.summary = listing_ScenEdit.TextEntry(scen.summary, 2).TrimmedToLength(300);
         listing_ScenEdit.Label("Description".Translate());
         scen.description = listing_ScenEdit.TextEntry(scen.description, 4).TrimmedToLength(1000);
         listing_ScenEdit.Gap();
         foreach (ScenPart allPart in scen.AllParts)
         {
             allPart.DoEditInterface(listing_ScenEdit);
         }
         listing_ScenEdit.End();
         editViewHeight = listing_ScenEdit.CurHeight + 100f;
         Widgets.EndScrollView();
     }
 }
Beispiel #6
0
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 3f + 31f);

            if (Widgets.ButtonText(scenPartRect.TopPartPixels(ScenPart.RowHeight), hediff.LabelCap))
            {
                FloatMenuUtility.MakeMenu(PossibleHediffs(), (HediffDef hd) => hd.LabelCap, delegate(HediffDef hd)
                {
                    ScenPart_ForcedHediff scenPart_ForcedHediff = this;
                    return(delegate
                    {
                        scenPart_ForcedHediff.hediff = hd;
                        if (scenPart_ForcedHediff.severityRange.max > scenPart_ForcedHediff.MaxSeverity)
                        {
                            scenPart_ForcedHediff.severityRange.max = scenPart_ForcedHediff.MaxSeverity;
                        }
                        if (scenPart_ForcedHediff.severityRange.min > scenPart_ForcedHediff.MaxSeverity)
                        {
                            scenPart_ForcedHediff.severityRange.min = scenPart_ForcedHediff.MaxSeverity;
                        }
                    });
                });
            }
            Widgets.FloatRange(new Rect(scenPartRect.x, scenPartRect.y + ScenPart.RowHeight, scenPartRect.width, 31f), listing.CurHeight.GetHashCode(), ref severityRange, 0f, MaxSeverity, "ConfigurableSeverity");
            DoPawnModifierEditInterface(scenPartRect.BottomPartPixels(ScenPart.RowHeight * 2f));
        }
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 3f);

            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 current in from td in DefDatabase <TraitDef> .AllDefs
                         orderby td.label
                         select td)
                {
                    foreach (TraitDegreeData current2 in current.degreeDatas)
                    {
                        TraitDef        localDef = current;
                        TraitDegreeData localDeg = current2;
                        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));
        }
Beispiel #8
0
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 2f);
            Rect rect         = scenPartRect.TopHalf();

            if (Widgets.ButtonText(rect, stat.LabelCap))
            {
                List <FloatMenuOption> list = new List <FloatMenuOption>();
                foreach (StatDef allDef in DefDatabase <StatDef> .AllDefs)
                {
                    StatDef localSd = allDef;
                    list.Add(new FloatMenuOption(localSd.LabelCap, delegate
                    {
                        stat = localSd;
                    }));
                }
                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 factor, ref factorBuf, 0f, 100f);
        }
Beispiel #9
0
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            phase += Time.deltaTime * step;

            float r = (Mathf.Sin(phase * 0.75f + 0 * offset) + 1) / 2f;
            float g = (Mathf.Sin(phase * 1.00f + 1 * offset) + 1) / 2f;
            float b = (Mathf.Sin(phase * 1.25f + 2 * offset) + 1) / 2f;

            r = hairColorR.LerpThroughRange(r);
            g = hairColorG.LerpThroughRange(g);
            b = hairColorB.LerpThroughRange(b);

            curCol = new Color(r, g, b);

            Rect rect = listing.GetScenPartRect(this, RowHeight * 4 + 3 * 31f);

            Rect[] rows = rect.SplitRows(31f * 3, 4 * RowHeight);

            Rect[] cols = rows[0].SplitCols(rows[0].width - rows[0].height, rows[0].height);
            Rect   prev = cols[1].ContractedBy(8);

            Rect[] sliders = cols[0].SplitRows(1, 1, 1);

            Widgets.FloatRange(sliders[0], listing.CurHeight.GetHashCode() + 0, ref hairColorR);
            Widgets.FloatRange(sliders[1], listing.CurHeight.GetHashCode() + 1, ref hairColorG);
            Widgets.FloatRange(sliders[2], listing.CurHeight.GetHashCode() + 2, ref hairColorB);

            Widgets.DrawBoxSolid(prev, curCol);

            Log.Message(curCol.ToStringSafe());

            DoContextEditInterface(rows[1]);
        }
        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], hediff.LabelCap, true, false, true))
            {
                FloatMenuUtility.MakeMenu(DefDatabase <HediffDef> .AllDefs.Where((HediffDef x) => x.scenarioCanAdd), (x) => x.LabelCap, (x) => () =>
                {
                    hediff          = x;
                    var maxSeverity = getMaxSeverity(x);
                    if (severityRange.max > maxSeverity)
                    {
                        severityRange.max = maxSeverity;
                    }

                    if (severityRange.min > maxSeverity)
                    {
                        severityRange.min = maxSeverity;
                    }
                });
            }

            Widgets.FloatRange(rows[1], listing.CurHeight.GetHashCode(), ref severityRange, 0, getMaxSeverity(hediff), R.String.Keys.MSP_HediffSeverity);
            DoContextEditInterface(rows[2]);

            if (context == PawnModifierContext.PlayerStarter)
            {
                Rect r = rows[2].BottomPart(0.25f);
                Widgets.CheckboxLabeled(r, "on map only (defered)", ref hideOffMap);
            }
        }
        /// <summary>
        /// Do the ui elements for this scenario part.
        /// </summary>
        /// <param name="listing"></param>
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, RowHeight * 3f + 31f);

            if (Widgets.ButtonText(scenPartRect.TopPartPixels(RowHeight), aspectDef.LabelCap))
            {
                FloatMenuUtility.MakeMenu(PossibleAspects(), (AspectDef ad) => ad.LabelCap, (AspectDef ad) => delegate()
                {
                    aspectDef = ad;
                    if (stageIndex >= aspectDef.stages.Count())
                    {
                        stageIndex = aspectDef.stages.Count() - 1;
                    }
                    if (stageIndex < 0)
                    {
                        stageIndex = 0;
                    }
                });
            }
            if (Widgets.ButtonText(new Rect(scenPartRect.x, scenPartRect.y + RowHeight, scenPartRect.width, 31f), aspectDef.stages[stageIndex].LabelCap ?? aspectDef.LabelCap))
            {
                FloatMenuUtility.MakeMenu(aspectDef.stages, (AspectStage stage) => stage.LabelCap ?? aspectDef.LabelCap, (AspectStage stage) => delegate()
                {
                    stageIndex = aspectDef.stages.IndexOf(stage);
                });
            }
            DoPawnModifierEditInterface(scenPartRect.BottomPartPixels(RowHeight * 2f));
        }
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight);

            if (Widgets.ButtonText(scenPartRect, this.method.ToStringHuman(), true, false, true))
            {
                List <FloatMenuOption> list       = new List <FloatMenuOption>();
                IEnumerator            enumerator = Enum.GetValues(typeof(PlayerPawnsArriveMethod)).GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        PlayerPawnsArriveMethod playerPawnsArriveMethod = (PlayerPawnsArriveMethod)enumerator.Current;
                        PlayerPawnsArriveMethod localM = playerPawnsArriveMethod;
                        list.Add(new FloatMenuOption(localM.ToStringHuman(), delegate
                        {
                            this.method = localM;
                        }, MenuOptionPriority.Default, null, null, 0f, null, null));
                    }
                }
                finally
                {
                    IDisposable disposable;
                    if ((disposable = (enumerator as IDisposable)) != null)
                    {
                        disposable.Dispose();
                    }
                }
                Find.WindowStack.Add(new FloatMenu(list));
            }
        }
        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(ref count, ref countBuf, 1f);
            listing_Standard.End();
            if (Widgets.ButtonText(scenPartRect.BottomHalf(), CurrentAnimalLabel().CapitalizeFirst()))
            {
                List <FloatMenuOption> list = new List <FloatMenuOption>();
                list.Add(new FloatMenuOption("RandomPet".Translate().CapitalizeFirst(), delegate
                {
                    animalKind = null;
                }));
                foreach (PawnKindDef item in PossibleAnimals(checkForTamer: false))
                {
                    PawnKindDef localKind = item;
                    list.Add(new FloatMenuOption(localKind.LabelCap, delegate
                    {
                        animalKind = localKind;
                    }));
                }
                Find.WindowStack.Add(new FloatMenu(list));
            }
        }
Beispiel #14
0
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, RowHeight * 5f);
            Rect rect         = scenPartRect.TopPartPixels(RowHeight);

            Text.Anchor = TextAnchor.LowerRight;
            Widgets.Label(rect.LeftHalf().Rounded(), "knownFriendlyFactions".Translate());
            Text.Anchor = TextAnchor.UpperLeft;
            Widgets.TextFieldNumeric(rect.RightHalf().Rounded(), ref factionsFriendly, ref bufFriendly);

            rect.y     += RowHeight;
            Text.Anchor = TextAnchor.LowerRight;
            Widgets.Label(rect.LeftHalf().Rounded(), "knownHostileFactions".Translate());
            Text.Anchor = TextAnchor.UpperLeft;
            Widgets.TextFieldNumeric(rect.RightHalf().Rounded(), ref factionsHostile, ref bufHostile, 1);


            rect.y     += RowHeight;
            Text.Anchor = TextAnchor.LowerRight;
            Widgets.Label(rect.LeftHalf().Rounded(), "factionCap".Translate());
            Text.Anchor = TextAnchor.UpperLeft;
            Widgets.TextFieldNumeric(rect.RightHalf().Rounded(), ref factionCap, ref bufFactionCap, 2, 50);

            Text.Anchor = TextAnchor.UpperLeft;
            GUI.enabled = false;
            var hintRect = listing.GetRect(RowHeight * 2);

            hintRect.y = rect.y + RowHeight;
            listing.GetRect(RowHeight * -2); // Gah, getting this to work -.-
            Widgets.TextArea(hintRect, "knownFactionsRecommendation".Translate());
            GUI.enabled = true;
        }
        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);
        }
Beispiel #17
0
        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]);
        }
Beispiel #18
0
 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;
     });
 }
Beispiel #19
0
        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 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)
 {
     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)
        {
            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)
        {
            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;
                });
            }
        }
Beispiel #25
0
        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, 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);
        }
Beispiel #27
0
        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 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;
            });
        }
Beispiel #29
0
        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));
        }
Beispiel #30
0
        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]);
        }