diff options
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/editor_settings.cpp | 23 | ||||
-rw-r--r-- | tools/editor/editor_settings.h | 3 | ||||
-rw-r--r-- | tools/editor/plugins/shader_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | tools/editor/project_manager.cpp | 3 |
4 files changed, 25 insertions, 8 deletions
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index b89863289a..2ce9502293 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -104,12 +104,18 @@ bool EditorSettings::_get(const StringName& p_name,Variant &r_ret) const { for (const Map<String,Ref<ShortCut> >::Element *E=shortcuts.front();E;E=E->next()) { Ref<ShortCut> sc=E->get(); - if (!sc->has_meta("original")) - continue; //this came from settings but is not any longer used - InputEvent original = sc->get_meta("original"); - if (sc->is_shortcut(original) || (original.type==InputEvent::NONE && sc->get_shortcut().type==InputEvent::NONE)) - continue; //not changed from default, don't save + if (optimize_save) { + if (!sc->has_meta("original")) { + continue; //this came from settings but is not any longer used + } + + InputEvent original = sc->get_meta("original"); + if (sc->is_shortcut(original) || (original.type==InputEvent::NONE && sc->get_shortcut().type==InputEvent::NONE)) + continue; //not changed from default, don't save + } + + print_line("SAVING: "+E->key()); arr.push_back(E->key()); arr.push_back(sc->get_shortcut()); } @@ -161,7 +167,7 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const { for(Set<_EVCSort>::Element *E=vclist.front();E;E=E->next()) { int pinfo = 0; - if (E->get().save) { + if (E->get().save || !optimize_save) { pinfo|=PROPERTY_USAGE_STORAGE; } @@ -976,6 +982,10 @@ void EditorSettings::get_shortcut_list(List<String> *r_shortcuts) { } } +void EditorSettings::set_optimize_save(bool p_optimize) { + + optimize_save=p_optimize; +} void EditorSettings::_bind_methods() { @@ -998,6 +1008,7 @@ EditorSettings::EditorSettings() { //singleton=this; last_order=0; + optimize_save=true; save_changed_setting=true; EditorTranslationList *etl=_editor_translations; diff --git a/tools/editor/editor_settings.h b/tools/editor/editor_settings.h index d975a7ef86..937956a366 100644 --- a/tools/editor/editor_settings.h +++ b/tools/editor/editor_settings.h @@ -88,6 +88,7 @@ private: bool save_changed_setting; + bool optimize_save; //do not save stuff that came from config but was not set from engine void _load_defaults(Ref<ConfigFile> p_extra_config = NULL); void _load_default_text_editor_theme(); @@ -155,6 +156,8 @@ public: Ref<ShortCut> get_shortcut(const String&p_name) const; void get_shortcut_list(List<String> *r_shortcuts); + void set_optimize_save(bool p_optimize); + EditorSettings(); ~EditorSettings(); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 76042c3028..0086f76b9c 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -499,7 +499,7 @@ ShaderEditor::ShaderEditor() { edit_menu->set_pos(Point2(5,-1)); edit_menu->set_text(TTR("Edit")); edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/undo", TTR("Undo"), KEY_MASK_CMD|KEY_Z), EDIT_UNDO); - edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/redo", TTR("Redo"), KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_Z), EDIT_REDO); + edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/redo", TTR("Redo"), KEY_MASK_CMD|KEY_Y), EDIT_REDO); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/cut", TTR("Cut"), KEY_MASK_CMD|KEY_X), EDIT_CUT); edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/copy", TTR("Copy"), KEY_MASK_CMD|KEY_C), EDIT_COPY); @@ -519,7 +519,7 @@ ShaderEditor::ShaderEditor() { search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/replace", TTR("Replace.."), KEY_MASK_CMD|KEY_R), SEARCH_REPLACE); search_menu->get_popup()->add_separator(); // search_menu->get_popup()->add_item("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K); - search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_line", TTR("Goto Line.."), KEY_MASK_CMD|KEY_G), SEARCH_GOTO_LINE); + search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_line", TTR("Goto Line.."), KEY_MASK_CMD|KEY_L), SEARCH_GOTO_LINE); search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index dafec397c5..860af4888b 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -830,6 +830,9 @@ ProjectManager::ProjectManager() { if (!EditorSettings::get_singleton()) EditorSettings::create(); + + EditorSettings::get_singleton()->set_optimize_save(false); //just write settings as they came + { int dpi_mode = EditorSettings::get_singleton()->get("global/hidpi_mode"); if (dpi_mode==0) { |