Exemple #1
0
        public override bool TryMerge(ScenPart other)
        {
            ScenPart_SetNeedLevel scenPart_SetNeedLevel = other as ScenPart_SetNeedLevel;

            if (scenPart_SetNeedLevel != null && this.need == scenPart_SetNeedLevel.need)
            {
                this.chance = GenMath.ChanceEitherHappens(this.chance, scenPart_SetNeedLevel.chance);
                return(true);
            }
            return(false);
        }
Exemple #2
0
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, ScenPart.RowHeight * 3f + 31f);

            if (Widgets.ButtonText(scenPartRect.TopPartPixels(ScenPart.RowHeight), need.LabelCap))
            {
                FloatMenuUtility.MakeMenu(PossibleNeeds(), (NeedDef hd) => hd.LabelCap, delegate(NeedDef n)
                {
                    ScenPart_SetNeedLevel scenPart_SetNeedLevel = this;
                    return(delegate
                    {
                        scenPart_SetNeedLevel.need = n;
                    });
                });
            }
            Widgets.FloatRange(new Rect(scenPartRect.x, scenPartRect.y + ScenPart.RowHeight, scenPartRect.width, 31f), listing.CurHeight.GetHashCode(), ref levelRange, 0f, 1f, "ConfigurableLevel");
            DoPawnModifierEditInterface(scenPartRect.BottomPartPixels(ScenPart.RowHeight * 2f));
        }
Exemple #3
0
        public override void DoEditInterface(Listing_ScenEdit listing)
        {
            Rect scenPartRect = listing.GetScenPartRect(this, (float)(ScenPart.RowHeight * 3.0 + 31.0));

            if (Widgets.ButtonText(scenPartRect.TopPartPixels(ScenPart.RowHeight), this.need.LabelCap, true, false, true))
            {
                FloatMenuUtility.MakeMenu(this.PossibleNeeds(), (NeedDef hd) => hd.LabelCap, delegate(NeedDef n)
                {
                    ScenPart_SetNeedLevel scenPart_SetNeedLevel = this;
                    return(delegate
                    {
                        scenPart_SetNeedLevel.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((float)(ScenPart.RowHeight * 2.0)));
        }