public static void CheckFontChange() { GUIPlus.SetFont(GameFont.Small); var isChanged = _baseFont != Text.CurFontStyle.font; GUIPlus.ResetFont(); if (!isChanged) { return; } _baseFont = Text.CurFontStyle.font; RegularTextStyle.UpdateStyle(); }
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)); }
private Dialog_Alert(string message, Buttons buttons = Buttons.Ok, Action onAccept = null, Action onCancel = null) { doCloseButton = false; closeOnAccept = true; closeOnClickedOutside = false; absorbInputAroundWindow = true; draggable = true; _message = message; _buttons = buttons; _onAccept = onAccept; _onCancel = onCancel; var wrap = Text.WordWrap; Text.WordWrap = true; GUIPlus.SetFont(GameFont.Small); InitialSize = new Vector2(400f, 80f + Text.CalcHeight(_message, 364f)); GUIPlus.ResetFont(); Text.WordWrap = wrap; }