68 lines
2.9 KiB
GDScript
68 lines
2.9 KiB
GDScript
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
|