summaryrefslogtreecommitdiff
path: root/editor/editor_resource_picker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_resource_picker.cpp')
-rw-r--r--editor/editor_resource_picker.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index fc1e466e9b..a7b2a4cfa6 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -149,7 +149,7 @@ void EditorResourcePicker::_update_menu() {
_update_menu_items();
Rect2 gt = edit_button->get_screen_rect();
- edit_menu->set_as_minsize();
+ edit_menu->reset_size();
int ms = edit_menu->get_contents_minimum_size().width;
Vector2 popup_pos = gt.get_end() - Vector2(ms, 0);
edit_menu->set_position(popup_pos);
@@ -476,7 +476,7 @@ void EditorResourcePicker::_button_input(const Ref<InputEvent> &p_event) {
_update_menu_items();
Vector2 pos = get_screen_position() + mb->get_position();
- edit_menu->set_as_minsize();
+ edit_menu->reset_size();
edit_menu->set_position(pos);
edit_menu->popup();
}
@@ -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();
}