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/
|
TEMP/
|
||||||
#export_presets.cfg
|
#export_presets.cfg
|
||||||
logs/
|
logs/
|
||||||
|
.godot/editor
|
||||||
|
@ -30,7 +30,7 @@ const alone_steps : Array = [
|
|||||||
# This should be put regression scripts which needs to run only once
|
# This should be put regression scripts which needs to run only once
|
||||||
const all_in_one : Array = [
|
const all_in_one : Array = [
|
||||||
"res://AIO/Operators/Operators.tscn",
|
"res://AIO/Operators/Operators.tscn",
|
||||||
"res://AIO/AllNodes/ALL.tscn",
|
#"res://AIO/AllNodes/ALL.tscn",
|
||||||
]
|
]
|
||||||
|
|
||||||
func _init():
|
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)
|
var random_node = find_node("Special Node " + str(randi() % number_of_nodes),true,false)
|
||||||
parent_of_node.remove_child(choosen_node)
|
parent_of_node.remove_child(choosen_node)
|
||||||
|
|
||||||
if randi() % 6 == 0: # 16% chance to remove node with children
|
# # Do not delete for now due https://github.com/godotengine/godot/issues/45471
|
||||||
var names_to_remove : Array = find_all_special_children_names(choosen_node)
|
# if randi() % 6 == 0: # 16% chance to remove node with children
|
||||||
for name_to_remove in names_to_remove:
|
# var names_to_remove : Array = find_all_special_children_names(choosen_node)
|
||||||
var node : Node = node_to_handle_others.get_child(randi() % node_to_handle_others.get_child_count()).duplicate(0)
|
# for name_to_remove in names_to_remove:
|
||||||
node.set_name(name_to_remove)
|
# var node : Node = node_to_handle_others.get_child(randi() % node_to_handle_others.get_child_count()).duplicate(0)
|
||||||
add_child(node)
|
# node.set_name(name_to_remove)
|
||||||
choosen_node.queue_free()
|
# add_child(node)
|
||||||
continue
|
# 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
|
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