fix: use correct SOR.Database.Enums.Affinity values throughout client

Replace placeholder Fire/Water/Earth/Air/Lightning/Dark/Light affinities
with the actual enum values: Void, Aether, Lake, Hill, Forest, Field (basics)
plus their non-basic combos (Ocean, Island, Marsh, Swamp, Mountain, Steppe,
Fort, Plains, Grove, Jungle, PerfectAether, PureVoid).

- Rename 7 wrong SVG icons → 6 correct ones (Void/Aether/Lake/Hill/Forest/Field)
- card_widget.gd: rewrite AFFINITY_BORDER, AFFINITY_BG for all 18 card affinities;
  add static affinity_icon() helper that maps non-basics to their primary basic icon
- card_detail_popup.gd: use affinity_icon() instead of direct dict lookup
- cars_view.gd: affinity filter now lists all 18 card-valid affinities

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-02 07:34:07 -05:00
co-authored by Claude Happy
parent 8da0172563
commit 56027e0f47
17 changed files with 114 additions and 59 deletions
@@ -48,7 +48,7 @@ func show_card(dto: Dictionary, def: Dictionary) -> void:
# Header
name_label.text = str(dto.get("name", "Unknown"))
affinity_icon.texture = _CardWidget.AFFINITY_ICONS.get(affinity, null)
affinity_icon.texture = _CardWidget.affinity_icon(affinity)
affinity_icon.modulate = _CardWidget.AFFINITY_BORDER.get(affinity, Color.WHITE)
foil_badge.visible = is_foil
@@ -0,0 +1 @@
uid://bbs4g6f1ax4er
@@ -9,37 +9,86 @@ extends PanelContainer
## Call set_selected(true/false) to highlight the card (used by the arch-spirit picker).
# ── Colour tables ─────────────────────────────────────────────────────────────
# Affinities match SOR.Database.Enums.Affinity.
# Basic: Void, Aether, Lake, Hill, Forest, Field.
# Non-basics are two-basic combos; tile-only affinities never appear on cards.
const AFFINITY_BORDER := {
"Fire": Color(0.91, 0.33, 0.13),
"Water": Color(0.20, 0.53, 1.00),
"Earth": Color(0.45, 0.69, 0.20),
"Air": Color(0.53, 0.80, 0.93),
"Lightning": Color(0.94, 0.88, 0.19),
"Dark": Color(0.60, 0.25, 0.93),
"Light": Color(0.97, 0.84, 0.25),
# ── Basic ──────────────────────────────────────────────────────────────
"Void": Color(0.45, 0.18, 0.65),
"Aether": Color(0.35, 0.72, 1.00),
"Lake": Color(0.22, 0.52, 0.92),
"Hill": Color(0.70, 0.55, 0.30),
"Forest": Color(0.28, 0.68, 0.25),
"Field": Color(0.82, 0.72, 0.18),
# ── Non-basic ──────────────────────────────────────────────────────────
"Ocean": Color(0.12, 0.38, 0.82),
"Island": Color(0.22, 0.65, 0.72),
"Marsh": Color(0.35, 0.60, 0.38),
"Swamp": Color(0.50, 0.58, 0.22),
"Mountain": Color(0.55, 0.55, 0.62),
"Steppe": Color(0.55, 0.58, 0.25),
"Fort": Color(0.78, 0.65, 0.35),
"Plains": Color(0.55, 0.78, 0.35),
"Grove": Color(0.18, 0.52, 0.20),
"Jungle": Color(0.32, 0.72, 0.18),
"PerfectAether": Color(0.70, 0.88, 1.00),
"PureVoid": Color(0.30, 0.08, 0.48),
}
const AFFINITY_BG := {
"Fire": Color(0.54, 0.15, 0.08),
"Water": Color(0.06, 0.23, 0.43),
"Earth": Color(0.19, 0.26, 0.08),
"Air": Color(0.18, 0.34, 0.44),
"Lightning": Color(0.42, 0.36, 0.03),
"Dark": Color(0.23, 0.06, 0.38),
"Light": Color(0.47, 0.38, 0.04),
# ── Basic ──────────────────────────────────────────────────────────────
"Void": Color(0.15, 0.04, 0.22),
"Aether": Color(0.06, 0.18, 0.38),
"Lake": Color(0.05, 0.15, 0.40),
"Hill": Color(0.28, 0.20, 0.08),
"Forest": Color(0.08, 0.24, 0.08),
"Field": Color(0.25, 0.20, 0.03),
# ── Non-basic ──────────────────────────────────────────────────────────
"Ocean": Color(0.03, 0.10, 0.32),
"Island": Color(0.05, 0.22, 0.28),
"Marsh": Color(0.08, 0.18, 0.10),
"Swamp": Color(0.14, 0.18, 0.05),
"Mountain": Color(0.15, 0.15, 0.18),
"Steppe": Color(0.18, 0.20, 0.06),
"Fort": Color(0.25, 0.20, 0.08),
"Plains": Color(0.15, 0.26, 0.08),
"Grove": Color(0.04, 0.16, 0.05),
"Jungle": Color(0.08, 0.24, 0.04),
"PerfectAether": Color(0.12, 0.22, 0.42),
"PureVoid": Color(0.08, 0.02, 0.14),
}
# One icon per basic affinity. Non-basics share their primary component's icon
# via _affinity_icon() below.
const AFFINITY_ICONS := {
"Fire": preload("res://icons/affinity_fire.svg"),
"Water": preload("res://icons/affinity_water.svg"),
"Earth": preload("res://icons/affinity_earth.svg"),
"Air": preload("res://icons/affinity_air.svg"),
"Lightning": preload("res://icons/affinity_lightning.svg"),
"Dark": preload("res://icons/affinity_dark.svg"),
"Light": preload("res://icons/affinity_light.svg"),
"Void": preload("res://icons/affinity_void.svg"),
"Aether": preload("res://icons/affinity_aether.svg"),
"Lake": preload("res://icons/affinity_lake.svg"),
"Hill": preload("res://icons/affinity_hill.svg"),
"Forest": preload("res://icons/affinity_forest.svg"),
"Field": preload("res://icons/affinity_field.svg"),
}
## Returns the icon texture for any affinity, mapping non-basics to their
## primary basic component.
static func affinity_icon(affinity: String) -> Texture2D:
match affinity:
"Lake", "Ocean", "Island", "Marsh", "Swamp":
return AFFINITY_ICONS["Lake"]
"Hill", "Mountain", "Steppe", "Fort":
return AFFINITY_ICONS["Hill"]
"Forest", "Plains", "Grove":
return AFFINITY_ICONS["Forest"]
"Field", "Jungle":
return AFFINITY_ICONS["Field"]
"Aether", "PerfectAether":
return AFFINITY_ICONS["Aether"]
"Void", "PureVoid":
return AFFINITY_ICONS["Void"]
_:
return null
const RARITY_COLOR := {
"Common": Color(0.67, 0.67, 0.67),
"Uncommon": Color(0.27, 0.85, 0.27),
@@ -84,8 +133,8 @@ func setup(dto: Dictionary, def: Dictionary = {}) -> void:
_apply_style()
art_rect.color = AFFINITY_BG.get(_affinity, Color(0.18, 0.18, 0.24))
art_symbol.texture = AFFINITY_ICONS.get(_affinity, null)
art_rect.color = AFFINITY_BG.get(_affinity, Color(0.18, 0.18, 0.24))
art_symbol.texture = affinity_icon(_affinity)
foil_label.visible = is_foil
name_label.text = str(dto.get("name", "—"))