Large update with mostly rewritten character subsystem

This commit is contained in:
Segey Lapin
2019-10-17 08:48:21 +03:00
parent 6e18c898b4
commit 0945ef76ee
224 changed files with 77854 additions and 13113 deletions

View File

@@ -62,18 +62,18 @@ func toggle_clothes(mi: MeshInstance, cloth_name: String):
mi.visible = !mi.visible
func find_mesh(base: Node, mesh_name: String) -> MeshInstance:
assert base
assert(base)
var queue = [base]
var mi: MeshInstance
while queue.size() > 0:
var item = queue[0]
assert item
assert(item)
queue.pop_front()
if item is MeshInstance && item.name == mesh_name:
mi = item
break
for c in item.get_children():
assert c
assert(c)
queue.push_back(c)
return mi
#func modify_mesh(orig_mesh: ArrayMesh, mi: MeshInstance, v_indices: Dictionary):
@@ -192,7 +192,7 @@ func prepare_character(x: int) -> void:
var cloth_mi : = find_mesh(ch, cloth)
if !cloth_mi:
continue
cloth_mi.mesh = dna.add_cloth_mesh(cloth, clothes[cloth].helper, cloth_mi.mesh)
dna.add_cloth_mesh(cloth, clothes[cloth].helper, cloth_mi.mesh)
cloth_mis[cloth] = cloth_mi
# prepare_cloth(body_mi, cloth_mi)
# cloth_meshes.push_back(cloth_mi.mesh)
@@ -266,7 +266,7 @@ func _process(delta):
state = 1
1:
# $Panel.hide()
assert body_mi.mesh
assert(body_mi.mesh)
build_contols()
$s/VBoxContainer/button_female.connect("pressed", self, "button_female")
$s/VBoxContainer/button_male.connect("pressed", self, "button_male")