From 87c31b05c9f720cc2512285340117b86afc94e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Fri, 24 Jan 2025 08:29:27 -0300 Subject: [PATCH] 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. https://github.com/endlessm/godot-block-coding/issues/356 --- addons/block_code/block_code_node/block_code.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/block_code/block_code_node/block_code.gd b/addons/block_code/block_code_node/block_code.gd index 6ea295ba..2fd3a89f 100644 --- a/addons/block_code/block_code_node/block_code.gd +++ b/addons/block_code/block_code_node/block_code.gd @@ -84,6 +84,8 @@ func _get_configuration_warnings(): warnings.append("A BlockCode must not be a root node.") if get_parent() is BlockCode: warnings.append("The parent must not be a BlockCode.") + if get_parent().script: + warnings.append("This BlockCode will override the existing script in the parent node.") if get_parent().find_children("*", "BlockCode", false).size() > 1: warnings.append("The parent should only contain one BlockCode.") if block_script and _get_custom_or_native_class(get_parent()) != block_script.script_inherits: