feat(client): hair highlight swatch + manifest JSON for exports (#719, #720)

#719: Add display-only hair highlight swatch (Option B) — auto-derived
from primary tint, non-interactive (MOUSE_FILTER_IGNORE).

#720: Remove DirAccess.open() fallback scanning (breaks in PCK exports).
Fully populate manifest.json (11 body types, 14 hair, 4 heads, 4
eyebrows, 8 clothing). Add tooling/generate-character-manifest script
and make manifest target for regeneration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 23:34:23 +02:00
co-authored by Claude Opus 4.6
parent 4c1e0e9c85
commit bc168c861a
4 changed files with 195 additions and 48 deletions
+5 -39
View File
@@ -669,6 +669,11 @@ func _build_hair_color_dock() -> Control:
func(c): _on_hair_primary_changed(c))
row.add_child(_hair_primary_swatch)
# #719 (Option B): highlight is auto-derived from primary — display-only, not editable.
_hair_highlight_swatch = _make_display_swatch(
_derive_hair_highlight(_descriptor.hair_tint), "Highlight")
row.add_child(_hair_highlight_swatch)
_eyebrow_tint_swatch = _make_color_swatch(_descriptor.hair_tint, "Brows ●",
func(c): _on_eyebrow_tint_changed(c))
row.add_child(_eyebrow_tint_swatch)
@@ -1840,45 +1845,6 @@ func _apply_search_filter(grid: GridContainer, query: String) -> void:
child.visible = lower_q.is_empty() or (child as Button).text.to_lower().contains(lower_q)
# =============================================================================
# Asset scanning helpers
# =============================================================================
## Scan a directory for subdirectory names (item_id directories like clothing/coveralls_basic/).
## Returns fallback list if the directory is absent or empty.
## TODO: replace with manifest JSON for export builds (DirAccess won't list res:// in PCK).
static func _scan_subdirs(dir_path: String, fallback: Array) -> Array:
var dir := DirAccess.open(dir_path)
if dir == null:
return fallback
var ids: Array = []
dir.list_dir_begin()
var name := dir.get_next()
while name != "":
if dir.current_is_dir() and not name.begins_with("."):
ids.append(name)
name = dir.get_next()
dir.list_dir_end()
return ids if not ids.is_empty() else fallback
## Scan a directory for .glb asset IDs. Returns fallback list if directory absent.
## TODO: replace with manifest JSON for export builds (DirAccess won't list res:// in PCK).
static func _scan_asset_ids(dir_path: String, ext: String, fallback: Array) -> Array:
var dir := DirAccess.open(dir_path)
if dir == null:
return fallback
var ids: Array = []
dir.list_dir_begin()
var name := dir.get_next()
while name != "":
if not dir.current_is_dir() and name.ends_with(ext):
ids.append(name.get_basename())
name = dir.get_next()
dir.list_dir_end()
return ids if not ids.is_empty() else fallback
func _get_clothing_ids_for_slot(slot: String) -> Array:
# Clothing items from manifest — slot assignment is explicit, not prefix-based.
var clothing_data: Variant = _manifest.get("clothing", {})