WIP checkpoint: Implement avatar loader and customization UI in Godot

This commit is contained in:
2026-08-20 22:05:30 +00:00
parent 38d97a3051
commit 1be947f9ef
+29 -8
View File
@@ -27,6 +27,27 @@ var validation_errors: Array[String] = []
var skin_tone: Color = Color.TRANSPARENT
# ---------------------------------------------------------------------------
# Inner class: SlotItem
# ---------------------------------------------------------------------------
## Represents a single equipped slot item in a loadout.
## Used by AvatarVisualizer to access slot data.
class SlotItem:
## The asset ID of the equipped item.
var asset_id: String = ""
## The slot key this item belongs to.
var slot_key: String = ""
func _init(p_asset_id: String = "", p_slot_key: String = "") -> void:
asset_id = p_asset_id
slot_key = p_slot_key
# ---------------------------------------------------------------------------
# Lifecycle
# ---------------------------------------------------------------------------
func _init() -> void:
validation_errors = []
@@ -132,14 +153,14 @@ func validate() -> bool:
slot_id, typeof(value)
]
)
elif value is Array:
if slot_id == "accessory":
if value.size() > MAX_ACCESSORIES:
validation_errors.append(
"Accessory count (%d) exceeds maximum (%d)" % [
value.size(), MAX_ACCESSORIES
]
)
elif value is Array:
if slot_id == "accessory":
if value.size() > MAX_ACCESSORIES:
validation_errors.append(
"Accessory count (%d) exceeds maximum (%d)" % [
value.size(), MAX_ACCESSORIES
]
)
# Check for duplicate accessories
if slots.has("accessory") and slots["accessory"] is Array: