WIP checkpoint: Implement avatar loader and customization UI in Godot
This commit is contained in:
@@ -27,6 +27,27 @@ var validation_errors: Array[String] = []
|
|||||||
var skin_tone: Color = Color.TRANSPARENT
|
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:
|
func _init() -> void:
|
||||||
validation_errors = []
|
validation_errors = []
|
||||||
|
|
||||||
@@ -132,14 +153,14 @@ func validate() -> bool:
|
|||||||
slot_id, typeof(value)
|
slot_id, typeof(value)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
elif value is Array:
|
elif value is Array:
|
||||||
if slot_id == "accessory":
|
if slot_id == "accessory":
|
||||||
if value.size() > MAX_ACCESSORIES:
|
if value.size() > MAX_ACCESSORIES:
|
||||||
validation_errors.append(
|
validation_errors.append(
|
||||||
"Accessory count (%d) exceeds maximum (%d)" % [
|
"Accessory count (%d) exceeds maximum (%d)" % [
|
||||||
value.size(), MAX_ACCESSORIES
|
value.size(), MAX_ACCESSORIES
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check for duplicate accessories
|
# Check for duplicate accessories
|
||||||
if slots.has("accessory") and slots["accessory"] is Array:
|
if slots.has("accessory") and slots["accessory"] is Array:
|
||||||
|
|||||||
Reference in New Issue
Block a user