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
+70 -8
View File
@@ -1,13 +1,75 @@
{
"body_types": ["average_m", "average_f", "muscular_m", "muscular_f", "teen_m", "teen_f"],
"heads": [],
"hair": ["bob", "buns", "buzzed", "long", "ponytail", "bald"],
"facial_hair": ["beard", "moustache", "mutton_chops"],
"eyebrows": [],
"body_types": [
"average_f",
"average_m",
"child",
"heavy_f",
"heavy_m",
"muscular_f",
"muscular_m",
"teen_f",
"teen_m",
"thin_f",
"thin_m"
],
"heads": [
"head_001",
"head_002",
"head_003",
"head_004"
],
"hair": [
"bald",
"balding",
"bob",
"buns",
"buzzed",
"buzzed_female",
"dreads",
"long",
"long_dreads",
"mohawk",
"ponytail",
"ponytail_f",
"simple_parted",
"slick_back"
],
"facial_hair": [
"beard",
"moustache",
"mutton_chops"
],
"eyebrows": [
"female",
"regular",
"teen",
"thick"
],
"clothing": {
"peasant_tunic": {"slot": "torso"},
"peasant_pants": {"slot": "legs"},
"peasant_shoes": {"slot": "feet"}
"boots_work": {
"slot": "feet"
},
"coveralls_basic": {
"slot": "torso"
},
"jacket_utility": {
"slot": "torso"
},
"pants_cargo": {
"slot": "legs"
},
"peasant_pants": {
"slot": "legs"
},
"peasant_shoes": {
"slot": "feet"
},
"peasant_tunic": {
"slot": "torso"
},
"shirt_henley": {
"slot": "torso"
}
},
"accessories": []
}
+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", {})