Merge pull request #85150 from KoBeWi/savasavas
Add Save As... option to EditorResourcePicker
This commit is contained in:
commit
0e33036d19
@ -233,6 +233,7 @@ void EditorResourcePicker::_update_menu_items() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
edit_menu->add_icon_item(get_editor_theme_icon(SNAME("Save")), TTR("Save"), OBJ_MENU_SAVE);
|
edit_menu->add_icon_item(get_editor_theme_icon(SNAME("Save")), TTR("Save"), OBJ_MENU_SAVE);
|
||||||
|
edit_menu->add_icon_item(get_editor_theme_icon(SNAME("Save")), TTR("Save As..."), OBJ_MENU_SAVE_AS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edited_resource->get_path().is_resource_file()) {
|
if (edited_resource->get_path().is_resource_file()) {
|
||||||
@ -400,6 +401,13 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
|
|||||||
EditorNode::get_singleton()->save_resource(edited_resource);
|
EditorNode::get_singleton()->save_resource(edited_resource);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case OBJ_MENU_SAVE_AS: {
|
||||||
|
if (edited_resource.is_null()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
EditorNode::get_singleton()->save_resource_as(edited_resource);
|
||||||
|
} break;
|
||||||
|
|
||||||
case OBJ_MENU_COPY: {
|
case OBJ_MENU_COPY: {
|
||||||
EditorSettings::get_singleton()->set_resource_clipboard(edited_resource);
|
EditorSettings::get_singleton()->set_resource_clipboard(edited_resource);
|
||||||
} break;
|
} break;
|
||||||
|
@ -72,6 +72,7 @@ class EditorResourcePicker : public HBoxContainer {
|
|||||||
OBJ_MENU_MAKE_UNIQUE,
|
OBJ_MENU_MAKE_UNIQUE,
|
||||||
OBJ_MENU_MAKE_UNIQUE_RECURSIVE,
|
OBJ_MENU_MAKE_UNIQUE_RECURSIVE,
|
||||||
OBJ_MENU_SAVE,
|
OBJ_MENU_SAVE,
|
||||||
|
OBJ_MENU_SAVE_AS,
|
||||||
OBJ_MENU_COPY,
|
OBJ_MENU_COPY,
|
||||||
OBJ_MENU_PASTE,
|
OBJ_MENU_PASTE,
|
||||||
OBJ_MENU_SHOW_IN_FILE_SYSTEM,
|
OBJ_MENU_SHOW_IN_FILE_SYSTEM,
|
||||||
|
Loading…
Reference in New Issue
Block a user