diff options
author | Marc Gilleron <marc.gilleron@gmail.com> | 2018-12-13 21:24:25 +0000 |
---|---|---|
committer | Marc Gilleron <marc.gilleron@gmail.com> | 2018-12-13 21:24:25 +0000 |
commit | 1f1ab997b63cb6c91415b3b76c3cbed8926d2560 (patch) | |
tree | 984a2635e443486cedb08736e0868cae540ec6ce /editor/inspector_dock.cpp | |
parent | 01fa0673a4165d3245d6b22e99b0e4ea99d19c5b (diff) |
Re-add missing save resource button in the inspector
Diffstat (limited to 'editor/inspector_dock.cpp')
-rw-r--r-- | editor/inspector_dock.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp index 750fca2852..d201087ecf 100644 --- a/editor/inspector_dock.cpp +++ b/editor/inspector_dock.cpp @@ -334,6 +334,7 @@ void InspectorDock::_notification(int p_what) { set_theme(editor->get_gui_base()->get_theme()); resource_new_button->set_icon(get_icon("New", "EditorIcons")); resource_load_button->set_icon(get_icon("Load", "EditorIcons")); + resource_save_button->set_icon(get_icon("Save", "EditorIcons")); backward_button->set_icon(get_icon("Back", "EditorIcons")); forward_button->set_icon(get_icon("Forward", "EditorIcons")); history_menu->set_icon(get_icon("History", "EditorIcons")); @@ -416,6 +417,7 @@ void InspectorDock::update(Object *p_object) { object_menu->set_disabled(false); search->set_editable(true); + resource_save_button->set_disabled(!is_resource); PopupMenu *p = object_menu->get_popup(); @@ -515,6 +517,16 @@ InspectorDock::InspectorDock(EditorNode *p_editor, EditorData &p_editor_data) { resource_load_button->connect("pressed", this, "_open_resource_selector"); resource_load_button->set_focus_mode(Control::FOCUS_NONE); + resource_save_button = memnew(MenuButton); + resource_save_button->set_tooltip(TTR("Save the currently edited resource.")); + resource_save_button->set_icon(get_icon("Save", "EditorIcons")); + general_options_hb->add_child(resource_save_button); + resource_save_button->get_popup()->add_item(TTR("Save"), RESOURCE_SAVE); + resource_save_button->get_popup()->add_item(TTR("Save As..."), RESOURCE_SAVE_AS); + resource_save_button->get_popup()->connect("id_pressed", this, "_menu_option"); + resource_save_button->set_focus_mode(Control::FOCUS_NONE); + resource_save_button->set_disabled(true); + general_options_hb->add_spacer(); backward_button = memnew(ToolButton); |