Skip to content

Commit b7cbac1

Browse files
authored
Merge pull request #119 from endlessm/add-blockcode-warnings
Add blockcode warnings
2 parents 4e75147 + 7a9ee11 commit b7cbac1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

addons/block_code/block_code_node/block_code.gd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ func _update_parent_script():
6767

6868
func _get_configuration_warnings():
6969
var warnings = []
70+
if self.owner == null:
71+
warnings.append("A BlockCode must not be a root node.")
72+
if get_parent() is BlockCode:
73+
warnings.append("The parent must not be a BlockCode.")
74+
if get_parent().find_children("*", "BlockCode", false).size() > 1:
75+
warnings.append("The parent should only contain one BlockCode.")
7076
if block_script and _get_custom_or_native_class(get_parent()) != block_script.script_inherits:
7177
var warning = "The parent is not a %s. Create a new BlockCode node and reattach." % block_script.script_inherits
7278
warnings.append(warning)

0 commit comments

Comments
 (0)