From 3defc9da95c93f290a2234076209f7c7fbb80d2e Mon Sep 17 00:00:00 2001 From: Richard Aasa Date: Thu, 30 Jul 2026 13:52:50 +0300 Subject: [PATCH] UI theme --- ui_theme.gd | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ ui_theme.gd.uid | 1 + 2 files changed, 68 insertions(+) create mode 100644 ui_theme.gd create mode 100644 ui_theme.gd.uid diff --git a/ui_theme.gd b/ui_theme.gd new file mode 100644 index 0000000..d39dec3 --- /dev/null +++ b/ui_theme.gd @@ -0,0 +1,67 @@ +class_name UiTheme +extends RefCounted +## Shared "engraved bronze plaque" look for every box in the game — aged gold on +## dark leather, a chiselled heavier bottom edge and a warm drop shadow, so the HUD +## and the menus read as the same arena furniture instead of a stack of generic +## rounded panels. Pair with UiFonts (Cinzel) for the full Colosseum feel. + +# ── Arena palette ─────────────────────────────────────────────────────────────── +const GOLD := Color(1.00, 0.78, 0.22) # aged gold — trim, key text +const CREAM := Color(0.93, 0.88, 0.72) # warm highlight — hover / active +const MUTED := Color(0.66, 0.60, 0.46) # faded bronze — secondary text +const LEATHER := Color(0.12, 0.08, 0.03, 0.90) # panel fill +const LEATHER_DARK := Color(0.06, 0.04, 0.02, 0.88) # deeper fill — inset badges +const BORDER := Color(0.72, 0.54, 0.18, 0.90) # default gold-bronze trim +const SHADOW := Color(0.00, 0.00, 0.00, 0.55) + + +## The signature plaque: leather fill, gold-bronze trim with a heavier chiselled +## bottom edge (weight sinks to the base like an engraved tablet), crisp corners and +## a soft drop shadow. `accent` recolours the trim — pass a per-ability colour for +## HUD tiles or CREAM for a hot/hover state; a transparent accent draws a frameless +## plate (still shadowed). +static func plaque(bg: Color, accent: Color = BORDER, + corner: int = 3, h_margin: float = 16.0, v_margin: float = 8.0, + shadow: bool = true) -> StyleBoxFlat: + var s := StyleBoxFlat.new() + s.bg_color = bg + s.set_corner_radius_all(corner) + s.corner_detail = 6 + if accent.a > 0.0: + s.set_border_width_all(2) + s.border_width_bottom = 5 + s.border_color = accent + s.content_margin_left = h_margin + s.content_margin_right = h_margin + s.content_margin_top = v_margin + s.content_margin_bottom = v_margin + if shadow: + s.shadow_color = SHADOW + s.shadow_size = 5 + s.shadow_offset = Vector2(0.0, 3.0) + return s + + +## Small inset key-cap / badge: deep fill with a thin gold underline instead of a +## full frame and no shadow, so it reads as pressed-in rather than raised. +static func badge(h_margin: float = 8.0, v_margin: float = 2.0) -> StyleBoxFlat: + var s := StyleBoxFlat.new() + s.bg_color = LEATHER_DARK + s.set_corner_radius_all(3) + s.border_width_bottom = 2 + s.border_color = Color(GOLD.r, GOLD.g, GOLD.b, 0.55) + s.content_margin_left = h_margin + s.content_margin_right = h_margin + s.content_margin_top = v_margin + s.content_margin_bottom = v_margin + return s + + +## Thin gold rule for separating rows inside a plaque — brighter at the centre than +## the surrounding trim so it reads as an inlaid line. +static func rule() -> StyleBoxFlat: + var s := StyleBoxFlat.new() + s.bg_color = Color(GOLD.r, GOLD.g, GOLD.b, 0.35) + s.content_margin_top = 5.0 + s.content_margin_bottom = 5.0 + return s diff --git a/ui_theme.gd.uid b/ui_theme.gd.uid new file mode 100644 index 0000000..ae7b563 --- /dev/null +++ b/ui_theme.gd.uid @@ -0,0 +1 @@ +uid://bpi5bsauh1wie