Skip to content

Commit 87c31b0

Browse files
committed
Warn when Block Code overrides parent script
Add a warning when the parent node of a BlockCoding node already has a script. To inform the user. #356
1 parent 3dc22a2 commit 87c31b0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

addons/block_code/block_code_node/block_code.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ func _get_configuration_warnings():
8484
warnings.append("A BlockCode must not be a root node.")
8585
if get_parent() is BlockCode:
8686
warnings.append("The parent must not be a BlockCode.")
87+
if get_parent().script:
88+
warnings.append("This BlockCode will override the existing script in the parent node.")
8789
if get_parent().find_children("*", "BlockCode", false).size() > 1:
8890
warnings.append("The parent should only contain one BlockCode.")
8991
if block_script and _get_custom_or_native_class(get_parent()) != block_script.script_inherits:

0 commit comments

Comments
 (0)