public void Draw() { float cursor = 0; DrawHeader(); GUI.color = Page_ConfigureStartingPawnsCarefully.PortraitTabInactiveColor; Widgets.DrawBox(RectBorder, 1); GUI.color = Color.white; GUI.BeginGroup(RectContent); scrollView.Begin(RectScroll); cursor = DrawCustomBodyParts(cursor); scrollView.End(cursor); GUI.EndGroup(); DrawRandomOption(); CustomPawn customPawn = PrepareCarefully.Instance.State.CurrentPawn; if (partRemovalList.Count > 0) { foreach (var x in partRemovalList) { customPawn.RemoveCustomBodyParts(x); } partRemovalList.Clear(); } }
protected override void DrawPanelContent(State state) { base.DrawPanelContent(state); CustomPawn customPawn = state.CurrentPawn; float cursor = 0; GUI.BeginGroup(RectScrollFrame); if (customPawn.BodyParts.Count == 0) { GUI.color = Style.ColorText; Widgets.Label(RectScrollView.InsetBy(1, 0, 0, 0), "EdB.PC.Panel.Health.None".Translate()); } GUI.color = Color.white; scrollView.Begin(RectScrollView); cursor = DrawCustomBodyParts(cursor); scrollView.End(cursor); GUI.EndGroup(); DrawAddButton(); if (partRemovalList.Count > 0) { foreach (var x in partRemovalList) { customPawn.RemoveCustomBodyParts(x); } partRemovalList.Clear(); } }
protected override void DrawPanelContent(State state) { base.DrawPanelContent(state); CustomPawn customPawn = state.CurrentPawn; bool wasScrolling = scrollView.ScrollbarsVisible; float cursor = 0; GUI.BeginGroup(RectScrollFrame); if (customPawn.BodyParts.Count == 0) { GUI.color = Style.ColorText; Widgets.Label(RectScrollView.InsetBy(1, 0, 0, 0), "EdB.PC.Panel.Health.None".Translate()); } GUI.color = Color.white; scrollView.Begin(RectScrollView); cursor = DrawCustomBodyParts(cursor); scrollView.End(cursor); GUI.EndGroup(); DrawAddButton(); if (partRemovalList.Count > 0) { foreach (var x in partRemovalList) { customPawn.RemoveCustomBodyParts(x); } partRemovalList.Clear(); } // If the addition or removal of an item changed whether or not the scrollbars are visible, then we // need to resize the label trimmer. if (wasScrolling && !scrollView.ScrollbarsVisible) { labelTrimmer.Width += 16; } else if (!wasScrolling && scrollView.ScrollbarsVisible) { labelTrimmer.Width -= 16; } }