public override bool TryMerge(ScenPart other) { ScenPart_ForcedSapience scenPart_SetSapience = other as ScenPart_ForcedSapience; if (scenPart_SetSapience != null && need == scenPart_SetSapience.need) { chance = GenMath.ChanceEitherHappens(chance, scenPart_SetSapience.chance); return(true); } return(false); }
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_ForcedSapience scenPart_ForcedSapience = this; return(delegate { scenPart_ForcedSapience.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)); }