From 5526436d8331b15e28eaf2d7a47f2c0b0281a9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Mon, 28 Nov 2022 10:48:11 +0100 Subject: [PATCH] Remove disabled classes from CreatingAllThings --- CreatingAllThings/CreatingAllThings.gd | 18 +++++------------- Start.tscn | 2 ++ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/CreatingAllThings/CreatingAllThings.gd b/CreatingAllThings/CreatingAllThings.gd index b1a9ee3..9ea347c 100644 --- a/CreatingAllThings/CreatingAllThings.gd +++ b/CreatingAllThings/CreatingAllThings.gd @@ -5,25 +5,17 @@ var exceptions: Array = [] func _ready(): - exceptions = Engine.get_singleton_list() + var classes_to_check = BasicData.get_list_of_available_classes() - var cl: Array = Array(ClassDB.get_class_list()) - cl.sort() - for name_of_class in cl: + for name_of_class in classes_to_check: # Repeat 3 times, to be sure that code don't crash in unreleated function for _i in range(3): - if !ClassDB.can_instantiate(name_of_class): - continue - if name_of_class in exceptions: - continue - if name_of_class.to_lower().find("server") != -1: - continue - print("########### " + name_of_class) print('GDSCRIPT CODE: var thing = ClassDB.instantiate("' + name_of_class + '")') - print("GDSCRIPT CODE: str(" + name_of_class + ")") - var thing = ClassDB.instantiate(name_of_class) + + # Sometimes even printing cause crash + print("GDSCRIPT CODE: str(" + name_of_class + ")") str(thing) if thing is Node: diff --git a/Start.tscn b/Start.tscn index c36c9e7..e59d340 100644 --- a/Start.tscn +++ b/Start.tscn @@ -7,4 +7,6 @@ layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 script = ExtResource("1")