mirror of
https://github.com/Relintai/regression-test-project.git
synced 2024-11-14 10:27:53 +01:00
Add reparenting
This commit is contained in:
parent
92c907211d
commit
a2b88e8b86
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@ logs/
|
||||
TEMP/
|
||||
#export_presets.cfg
|
||||
logs/
|
||||
.godot/editor
|
||||
|
@ -30,7 +30,7 @@ const alone_steps : Array = [
|
||||
# This should be put regression scripts which needs to run only once
|
||||
const all_in_one : Array = [
|
||||
"res://AIO/Operators/Operators.tscn",
|
||||
"res://AIO/AllNodes/ALL.tscn",
|
||||
#"res://AIO/AllNodes/ALL.tscn",
|
||||
]
|
||||
|
||||
func _init():
|
||||
|
@ -223,14 +223,15 @@ func _process(delta: float) -> void:
|
||||
var random_node = find_node("Special Node " + str(randi() % number_of_nodes),true,false)
|
||||
parent_of_node.remove_child(choosen_node)
|
||||
|
||||
if randi() % 6 == 0: # 16% chance to remove node with children
|
||||
var names_to_remove : Array = find_all_special_children_names(choosen_node)
|
||||
for name_to_remove in names_to_remove:
|
||||
var node : Node = node_to_handle_others.get_child(randi() % node_to_handle_others.get_child_count()).duplicate(0)
|
||||
node.set_name(name_to_remove)
|
||||
add_child(node)
|
||||
choosen_node.queue_free()
|
||||
continue
|
||||
# # Do not delete for now due https://github.com/godotengine/godot/issues/45471
|
||||
# if randi() % 6 == 0: # 16% chance to remove node with children
|
||||
# var names_to_remove : Array = find_all_special_children_names(choosen_node)
|
||||
# for name_to_remove in names_to_remove:
|
||||
# var node : Node = node_to_handle_others.get_child(randi() % node_to_handle_others.get_child_count()).duplicate(0)
|
||||
# node.set_name(name_to_remove)
|
||||
# add_child(node)
|
||||
# choosen_node.queue_free()
|
||||
# continue
|
||||
|
||||
|
||||
if choosen_node.find_node(random_node.get_name(),true,false) != null: # Cannot set as node parent one of its child
|
||||
|
Loading…
Reference in New Issue
Block a user