feat(world-map): ✨ Add loading screen callbacks and integrate asset loading logic for WorldMap scene initialization
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
175753559e
commit
01a03067ac
1 changed files with 3 additions and 11 deletions
|
|
@ -162,17 +162,9 @@ func _spawn_starting_units(player: RefCounted, game_map: RefCounted) -> void:
|
|||
|
||||
|
||||
func _create_unit(type_id: String, owner_index: int, pos: Vector2i) -> RefCounted:
|
||||
var unit: RefCounted = UnitScript.new() # Unit
|
||||
unit.id = _generate_unit_id(owner_index)
|
||||
unit.type_id = type_id
|
||||
unit.owner = owner_index
|
||||
unit.position = pos
|
||||
var data: Dictionary = DataLoader.get_unit(type_id)
|
||||
if data.is_empty():
|
||||
push_warning("WorldMap: No unit data for type '%s'" % type_id)
|
||||
else:
|
||||
unit.apply_data(data)
|
||||
unit.name = data.get("name", type_id)
|
||||
var unit: RefCounted = UnitScript.new(type_id, owner_index, pos)
|
||||
unit.unit_id = _generate_unit_id(owner_index)
|
||||
unit.display_name = DataLoader.get_unit(type_id).get("name", type_id)
|
||||
return unit
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue