public void ColorOptionSelect(ColorOption colorOption, ref ColorOption selected, bool enabled = true) { GUIPlus.SetColor(colorOption.Value); if (RadioButton(colorOption.Label, selected == colorOption, tooltip: colorOption.Tooltip)) { selected = colorOption; } GUIPlus.ResetColor(); }
public bool Label(string label, TipSignal?tooltip = null, GameFont?font = null, Color?color = null, bool highlight = false) { GUIPlus.SetFont(font); GUIPlus.SetColor(color); var rect = GetRect(Text.CalcHeight(label, ColumnWidth)); Widgets.Label(rect, label); GUIPlus.DrawTooltip(rect, tooltip, highlight); Gap(verticalSpacing); GUIPlus.ResetColor(); GUIPlus.ResetFont(); return(Widgets.ButtonInvisible(rect)); }
public static void OnGUI(Rect inRect, IInspectPane pane) { Theme.CheckFontChange(); var model = PawnModel.Selected; pane.RecentHeight = Theme.InspectPaneHeight.Value - 35f; if (model == null) { return; } if (!pane.AnythingSelected) { return; } var rect = inRect.ContractedBy(12f); rect.yMin -= 4f; rect.yMax += 6f; try { GUI.BeginGroup(rect.ExpandedBy(1f)); var lineEndWidth = 0f; if (pane.ShouldShowSelectNextInCellButton) { var selectOverlappingNextRect = new Rect(rect.width - ButtonSize, 0f, ButtonSize, ButtonSize); if (Widgets.ButtonImage(selectOverlappingNextRect, Textures.SelectOverlappingNext)) { pane.SelectNextInCell(); } lineEndWidth += ButtonSize; TooltipHandler.TipRegion(selectOverlappingNextRect, "SelectNextInSquareTip".Translate(KeyBindingDefOf.SelectNextInCell.MainKeyLabel)); } DrawButtons(rect, ref lineEndWidth); var previousAnchor = Text.Anchor; Text.Anchor = TextAnchor.UpperLeft; GUIPlus.SetFont(GameFont.Medium); GUIPlus.SetColor(model.FactionRelationColor); var labelRect = new Rect(0f, 0f, rect.width - lineEndWidth, Text.LineHeight); var label = model.Name; Widgets.Label(labelRect, label); if (Widgets.ButtonInvisible(labelRect)) { ToggleSocialTab(); } GUIPlus.ResetFont(); GUIPlus.ResetColor(); Text.Anchor = previousAnchor; GUIPlus.DrawTooltip(labelRect, model.BioTooltip, false); if (!pane.ShouldShowPaneContents) { return; } var contentRect = rect.AtZero(); contentRect.yMin += 26f; DrawContent(contentRect, model, null); } catch (Exception exception) { Mod.HandleError(exception); } finally { GUI.EndGroup(); } }