Merge pull request #58821 from IgorKordiukiewicz/extend-script-popup-without-script

Fixed issue where Extend Script option would show up even without script attached to the node
This commit is contained in:
Rémi Verschelde 2022-03-06 10:17:31 +01:00 committed by GitHub
commit 5dd0b02f60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -905,7 +905,12 @@ void EditorScriptPicker::set_create_options(Object *p_menu_node) {
}
menu_node->add_icon_item(get_theme_icon(SNAME("ScriptCreate"), SNAME("EditorIcons")), TTR("New Script"), OBJ_MENU_NEW_SCRIPT);
menu_node->add_icon_item(get_theme_icon(SNAME("ScriptExtend"), SNAME("EditorIcons")), TTR("Extend Script"), OBJ_MENU_EXTEND_SCRIPT);
if (script_owner) {
Ref<Script> script = script_owner->get_script();
if (script.is_valid()) {
menu_node->add_icon_item(get_theme_icon(SNAME("ScriptExtend"), SNAME("EditorIcons")), TTR("Extend Script"), OBJ_MENU_EXTEND_SCRIPT);
}
}
menu_node->add_separator();
}