diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 284e2887dfb..28c3ef6de6c 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -302,9 +302,9 @@ void DependencyEditorOwners::_list_rmb_clicked(int p_item, const Vector2 &p_pos, } if (only_scenes_selected) { - file_options->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRN("Open Scene", "Open Scenes", selected_items.size()), FILE_OPEN_); + file_options->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRN("Open Scene", "Open Scenes", selected_items.size()), FILE_MENU_OPEN); } else if (selected_items.size() == 1) { - file_options->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTR("Open"), FILE_OPEN_); + file_options->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTR("Open"), FILE_MENU_OPEN); } else { return; } @@ -333,7 +333,7 @@ void DependencyEditorOwners::_empty_clicked(const Vector2 &p_pos, MouseButton p_ void DependencyEditorOwners::_file_option(int p_option) { switch (p_option) { - case FILE_OPEN_: { + case FILE_MENU_OPEN: { PackedInt32Array selected_items = owners->get_selected_items(); for (int i = 0; i < selected_items.size(); i++) { int item_idx = selected_items[i]; diff --git a/editor/dependency_editor.h b/editor/dependency_editor.h index 413b8ce8477..d542d9f8928 100644 --- a/editor/dependency_editor.h +++ b/editor/dependency_editor.h @@ -80,7 +80,7 @@ class DependencyEditorOwners : public AcceptDialog { private: enum FileMenu { - FILE_OPEN_, + FILE_MENU_OPEN, }; public: diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index cf729bc9a5d..f3931147c5b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -859,7 +859,7 @@ void EditorNode::_notification(int p_what) { } break; case NOTIFICATION_WM_CLOSE_REQUEST: { - _menu_option_confirm(FILE_QUIT, false); + _menu_option_confirm(SCENE_QUIT, false); } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { @@ -1393,8 +1393,8 @@ void EditorNode::_titlebar_resized() { void EditorNode::_update_undo_redo_allowed() { EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); - file_menu->set_item_disabled(file_menu->get_item_index(FILE_UNDO), !undo_redo->has_undo()); - file_menu->set_item_disabled(file_menu->get_item_index(FILE_REDO), !undo_redo->has_redo()); + file_menu->set_item_disabled(file_menu->get_item_index(SCENE_UNDO), !undo_redo->has_undo()); + file_menu->set_item_disabled(file_menu->get_item_index(SCENE_REDO), !undo_redo->has_redo()); } void EditorNode::_node_renamed() { @@ -2114,8 +2114,8 @@ void EditorNode::save_scene_list(const HashSet &p_scene_paths) { } void EditorNode::save_before_run() { - current_menu_option = FILE_SAVE_AND_RUN; - _menu_option_confirm(FILE_SAVE_AS_SCENE, true); + current_menu_option = SAVE_AND_RUN; + _menu_option_confirm(SCENE_SAVE_AS_SCENE, true); file->set_title(TTR("Save scene before running...")); } @@ -2131,7 +2131,7 @@ void EditorNode::try_autosave() { _save_scene_with_preview(scene->get_scene_file_path()); } } - _menu_option(FILE_SAVE_ALL_SCENES); + _menu_option(SCENE_SAVE_ALL_SCENES); editor_data.save_editor_external_data(); } @@ -2210,16 +2210,16 @@ bool EditorNode::_is_scene_unsaved(int p_idx) { void EditorNode::_dialog_action(String p_file) { switch (current_menu_option) { - case FILE_NEW_INHERITED_SCENE: { + case SCENE_NEW_INHERITED_SCENE: { Node *scene = editor_data.get_edited_scene_root(); // If the previous scene is rootless, just close it in favor of the new one. if (!scene) { - _menu_option_confirm(FILE_CLOSE, true); + _menu_option_confirm(SCENE_CLOSE, true); } load_scene(p_file, false, true); } break; - case FILE_OPEN_SCENE: { + case SCENE_OPEN_SCENE: { load_scene(p_file); } break; case SETTINGS_PICK_MAIN_SCENE: { @@ -2229,12 +2229,12 @@ void EditorNode::_dialog_action(String p_file) { project_run_bar->play_main_scene((bool)pick_main_scene->get_meta("from_native", false)); } break; - case FILE_CLOSE: + case SCENE_CLOSE: case SCENE_TAB_CLOSE: - case FILE_SAVE_SCENE: - case FILE_MULTI_SAVE_AS_SCENE: - case FILE_SAVE_AS_SCENE: { - int scene_idx = (current_menu_option == FILE_SAVE_SCENE || current_menu_option == FILE_SAVE_AS_SCENE || current_menu_option == FILE_MULTI_SAVE_AS_SCENE) ? -1 : tab_closing_idx; + case SCENE_SAVE_SCENE: + case SCENE_MULTI_SAVE_AS_SCENE: + case SCENE_SAVE_AS_SCENE: { + int scene_idx = (current_menu_option == SCENE_SAVE_SCENE || current_menu_option == SCENE_SAVE_AS_SCENE || current_menu_option == SCENE_MULTI_SAVE_AS_SCENE) ? -1 : tab_closing_idx; if (file->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) { bool same_open_scene = false; @@ -2262,13 +2262,13 @@ void EditorNode::_dialog_action(String p_file) { } } - if (current_menu_option == FILE_MULTI_SAVE_AS_SCENE) { + if (current_menu_option == SCENE_MULTI_SAVE_AS_SCENE) { _proceed_save_asing_scene_tabs(); } } break; - case FILE_SAVE_AND_RUN: { + case SAVE_AND_RUN: { if (file->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) { save_default_environment(); _save_scene_with_preview(p_file); @@ -2276,7 +2276,7 @@ void EditorNode::_dialog_action(String p_file) { } } break; - case FILE_SAVE_AND_RUN_MAIN_SCENE: { + case SAVE_AND_RUN_MAIN_SCENE: { ProjectSettings::get_singleton()->set("application/run/main_scene", ResourceUID::path_to_uid(p_file)); ProjectSettings::get_singleton()->save(); @@ -2874,12 +2874,12 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } switch (p_option) { - case FILE_NEW_SCENE: { + case SCENE_NEW_SCENE: { new_scene(); } break; - case FILE_NEW_INHERITED_SCENE: - case FILE_OPEN_SCENE: { + case SCENE_NEW_INHERITED_SCENE: + case SCENE_OPEN_SCENE: { file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); List extensions; ResourceLoader::get_recognized_extensions_for_type("PackedScene", &extensions); @@ -2892,20 +2892,20 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { if (scene) { file->set_current_path(scene->get_scene_file_path()); }; - file->set_title(p_option == FILE_OPEN_SCENE ? TTR("Open Scene") : TTR("Open Base Scene")); + file->set_title(p_option == SCENE_OPEN_SCENE ? TTR("Open Scene") : TTR("Open Base Scene")); file->popup_file_dialog(); } break; - case FILE_QUICK_OPEN: { + case SCENE_QUICK_OPEN: { quick_open_dialog->popup_dialog({ "Resource" }, callable_mp(this, &EditorNode::_quick_opened)); } break; - case FILE_QUICK_OPEN_SCENE: { + case SCENE_QUICK_OPEN_SCENE: { quick_open_dialog->popup_dialog({ "PackedScene" }, callable_mp(this, &EditorNode::_quick_opened)); } break; - case FILE_QUICK_OPEN_SCRIPT: { + case SCENE_QUICK_OPEN_SCRIPT: { quick_open_dialog->popup_dialog({ "Script" }, callable_mp(this, &EditorNode::_quick_opened)); } break; - case FILE_OPEN_PREV: { + case SCENE_OPEN_PREV: { if (!prev_closed_scenes.is_empty()) { load_scene(prev_closed_scenes.back()->get()); } @@ -2934,12 +2934,12 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } _proceed_closing_scene_tabs(); } break; - case FILE_CLOSE: { + case SCENE_CLOSE: { _scene_tab_closed(editor_data.get_edited_scene()); } break; case SCENE_TAB_CLOSE: - case FILE_SAVE_SCENE: { - int scene_idx = (p_option == FILE_SAVE_SCENE) ? -1 : tab_closing_idx; + case SCENE_SAVE_SCENE: { + int scene_idx = (p_option == SCENE_SAVE_SCENE) ? -1 : tab_closing_idx; Node *scene = editor_data.get_edited_scene_root(scene_idx); if (scene && !scene->get_scene_file_path().is_empty()) { if (DirAccess::exists(scene->get_scene_file_path().get_base_dir())) { @@ -2960,14 +2960,14 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } [[fallthrough]]; } - case FILE_MULTI_SAVE_AS_SCENE: - case FILE_SAVE_AS_SCENE: { - int scene_idx = (p_option == FILE_SAVE_SCENE || p_option == FILE_SAVE_AS_SCENE || p_option == FILE_MULTI_SAVE_AS_SCENE) ? -1 : tab_closing_idx; + case SCENE_MULTI_SAVE_AS_SCENE: + case SCENE_SAVE_AS_SCENE: { + int scene_idx = (p_option == SCENE_SAVE_SCENE || p_option == SCENE_SAVE_AS_SCENE || p_option == SCENE_MULTI_SAVE_AS_SCENE) ? -1 : tab_closing_idx; Node *scene = editor_data.get_edited_scene_root(scene_idx); if (!scene) { - if (p_option == FILE_SAVE_SCENE) { + if (p_option == SCENE_SAVE_SCENE) { // Pressing Ctrl + S saves the current script if a scene is currently open, but it won't if the scene has no root node. // Work around this by explicitly saving the script in this case (similar to pressing Ctrl + Alt + S). ScriptEditor::get_singleton()->save_current_script(); @@ -2976,7 +2976,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { const int saved = _save_external_resources(true); if (saved > 0) { EditorToaster::get_singleton()->popup_str(vformat(TTR("The current scene has no root node, but %d modified external resource(s) and/or plugin data were saved anyway."), saved), EditorToaster::SEVERITY_INFO); - } else if (p_option == FILE_SAVE_AS_SCENE) { + } else if (p_option == SCENE_SAVE_AS_SCENE) { // Don't show this dialog when pressing Ctrl + S to avoid interfering with script saving. show_accept( TTR("A root node is required to save the scene. You can add a root node using the Scene tree dock."), @@ -3018,7 +3018,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } break; - case FILE_SAVE_ALL_SCENES: { + case SCENE_SAVE_ALL_SCENES: { _save_all_scenes(); } break; @@ -3039,7 +3039,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { file_pack_zip->popup_file_dialog(); } break; - case FILE_UNDO: { + case SCENE_UNDO: { if ((int)Input::get_singleton()->get_mouse_button_mask() & 0x7) { log->add_message(TTR("Can't undo while mouse buttons are pressed."), EditorLog::MSG_TYPE_EDITOR); } else { @@ -3062,7 +3062,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } } } break; - case FILE_REDO: { + case SCENE_REDO: { EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); if ((int)Input::get_singleton()->get_mouse_button_mask() & 0x7) { log->add_message(TTR("Can't redo while mouse buttons are pressed."), EditorLog::MSG_TYPE_EDITOR); @@ -3089,7 +3089,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { } } break; - case FILE_RELOAD_SAVED_SCENE: { + case SCENE_RELOAD_SAVED_SCENE: { Node *scene = get_edited_scene(); if (!scene) { @@ -3180,7 +3180,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { OS::get_singleton()->ensure_user_data_dir(); OS::get_singleton()->shell_show_in_file_manager(OS::get_singleton()->get_user_data_dir(), true); } break; - case FILE_QUIT: + case SCENE_QUIT: case PROJECT_QUIT_TO_PROJECT_MANAGER: case PROJECT_RELOAD_CURRENT_PROJECT: { if (p_confirmed && plugin_to_save) { @@ -3261,7 +3261,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { save_confirmation->set_text(TTR("Save changes to the following scene(s) before reloading?") + unsaved_scenes); } else { save_confirmation->set_ok_button_text(TTR("Save & Quit")); - save_confirmation->set_text((p_option == FILE_QUIT ? TTR("Save changes to the following scene(s) before quitting?") : TTR("Save changes to the following scene(s) before opening Project Manager?")) + unsaved_scenes); + save_confirmation->set_text((p_option == SCENE_QUIT ? TTR("Save changes to the following scene(s) before quitting?") : TTR("Save changes to the following scene(s) before opening Project Manager?")) + unsaved_scenes); } save_confirmation->reset_size(); save_confirmation->popup_centered(); @@ -3591,7 +3591,7 @@ void EditorNode::unload_editor_addons() { void EditorNode::_discard_changes(const String &p_str) { switch (current_menu_option) { - case FILE_CLOSE: + case SCENE_CLOSE: case SCENE_TAB_CLOSE: { Node *scene = editor_data.get_edited_scene_root(tab_closing_idx); if (scene != nullptr) { @@ -3605,7 +3605,7 @@ void EditorNode::_discard_changes(const String &p_str) { } _proceed_closing_scene_tabs(); } break; - case FILE_RELOAD_SAVED_SCENE: { + case SCENE_RELOAD_SAVED_SCENE: { Node *scene = get_edited_scene(); String scene_filename = scene->get_scene_file_path(); @@ -3624,7 +3624,7 @@ void EditorNode::_discard_changes(const String &p_str) { confirmation->hide(); } break; - case FILE_QUIT: { + case SCENE_QUIT: { project_run_bar->stop_playing(); _exit_editor(EXIT_SUCCESS); @@ -3647,11 +3647,11 @@ void EditorNode::_update_file_menu_opened() { } } if (has_unsaved) { - file_menu->set_item_disabled(file_menu->get_item_index(FILE_SAVE_ALL_SCENES), false); - file_menu->set_item_tooltip(file_menu->get_item_index(FILE_SAVE_ALL_SCENES), String()); + file_menu->set_item_disabled(file_menu->get_item_index(SCENE_SAVE_ALL_SCENES), false); + file_menu->set_item_tooltip(file_menu->get_item_index(SCENE_SAVE_ALL_SCENES), String()); } else { - file_menu->set_item_disabled(file_menu->get_item_index(FILE_SAVE_ALL_SCENES), true); - file_menu->set_item_tooltip(file_menu->get_item_index(FILE_SAVE_ALL_SCENES), TTR("All scenes are already saved.")); + file_menu->set_item_disabled(file_menu->get_item_index(SCENE_SAVE_ALL_SCENES), true); + file_menu->set_item_tooltip(file_menu->get_item_index(SCENE_SAVE_ALL_SCENES), TTR("All scenes are already saved.")); } _update_undo_redo_allowed(); } @@ -4745,7 +4745,7 @@ String EditorNode::get_multiwindow_support_tooltip_text() const { } void EditorNode::_inherit_request(String p_file) { - current_menu_option = FILE_NEW_INHERITED_SCENE; + current_menu_option = SCENE_NEW_INHERITED_SCENE; _dialog_action(p_file); } @@ -4769,7 +4769,7 @@ void EditorNode::_update_prev_closed_scenes(const String &p_scene_path, bool p_a } else { prev_closed_scenes.erase(p_scene_path); } - file_menu->set_item_disabled(file_menu->get_item_index(FILE_OPEN_PREV), prev_closed_scenes.is_empty()); + file_menu->set_item_disabled(file_menu->get_item_index(SCENE_OPEN_PREV), prev_closed_scenes.is_empty()); } } @@ -4985,8 +4985,8 @@ void EditorNode::_pick_main_scene_custom_action(const String &p_custom_action_na pick_main_scene->hide(); if (!FileAccess::exists(scene->get_scene_file_path())) { - current_menu_option = FILE_SAVE_AND_RUN_MAIN_SCENE; - _menu_option_confirm(FILE_SAVE_AS_SCENE, true); + current_menu_option = SAVE_AND_RUN_MAIN_SCENE; + _menu_option_confirm(SCENE_SAVE_AS_SCENE, true); file->set_title(TTR("Save scene before running...")); } else { current_menu_option = SETTINGS_PICK_MAIN_SCENE; @@ -5663,11 +5663,11 @@ bool EditorNode::has_scenes_in_session() { } void EditorNode::undo() { - _menu_option_confirm(FILE_UNDO, true); + _menu_option_confirm(SCENE_UNDO, true); } void EditorNode::redo() { - _menu_option_confirm(FILE_REDO, true); + _menu_option_confirm(SCENE_REDO, true); } bool EditorNode::ensure_main_scene(bool p_from_native) { @@ -5857,11 +5857,11 @@ void EditorNode::_proceed_save_asing_scene_tabs() { int scene_idx = scenes_to_save_as.front()->get(); scenes_to_save_as.pop_front(); _set_current_scene(scene_idx); - _menu_option_confirm(FILE_MULTI_SAVE_AS_SCENE, false); + _menu_option_confirm(SCENE_MULTI_SAVE_AS_SCENE, false); } bool EditorNode::_is_closing_editor() const { - return tab_closing_menu_option == FILE_QUIT || tab_closing_menu_option == PROJECT_QUIT_TO_PROJECT_MANAGER || tab_closing_menu_option == PROJECT_RELOAD_CURRENT_PROJECT; + return tab_closing_menu_option == SCENE_QUIT || tab_closing_menu_option == PROJECT_QUIT_TO_PROJECT_MANAGER || tab_closing_menu_option == PROJECT_RELOAD_CURRENT_PROJECT; } void EditorNode::_restart_editor(bool p_goto_project_manager) { @@ -7597,7 +7597,7 @@ EditorNode::EditorNode() { save_accept = memnew(AcceptDialog); save_accept->set_unparent_when_invisible(true); - save_accept->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_option).bind((int)MenuOptions::FILE_SAVE_AS_SCENE)); + save_accept->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_option).bind((int)MenuOptions::SCENE_SAVE_AS_SCENE)); project_export = memnew(ProjectExportDialog); gui_base->add_child(project_export); @@ -7654,27 +7654,27 @@ EditorNode::EditorNode() { command_palette->set_title(TTR("Command Palette")); gui_base->add_child(command_palette); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/new_scene", TTRC("New Scene"), KeyModifierMask::CMD_OR_CTRL + Key::N), FILE_NEW_SCENE); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/new_inherited_scene", TTRC("New Inherited Scene..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::N), FILE_NEW_INHERITED_SCENE); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/open_scene", TTRC("Open Scene..."), KeyModifierMask::CMD_OR_CTRL + Key::O), FILE_OPEN_SCENE); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/reopen_closed_scene", TTRC("Reopen Closed Scene"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::T), FILE_OPEN_PREV); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/new_scene", TTRC("New Scene"), KeyModifierMask::CMD_OR_CTRL + Key::N), SCENE_NEW_SCENE); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/new_inherited_scene", TTRC("New Inherited Scene..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::N), SCENE_NEW_INHERITED_SCENE); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/open_scene", TTRC("Open Scene..."), KeyModifierMask::CMD_OR_CTRL + Key::O), SCENE_OPEN_SCENE); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/reopen_closed_scene", TTRC("Reopen Closed Scene"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::T), SCENE_OPEN_PREV); recent_scenes = memnew(PopupMenu); recent_scenes->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); - file_menu->add_submenu_node_item(TTR("Open Recent"), recent_scenes, FILE_OPEN_RECENT); + file_menu->add_submenu_node_item(TTR("Open Recent"), recent_scenes, SCENE_OPEN_RECENT); recent_scenes->connect(SceneStringName(id_pressed), callable_mp(this, &EditorNode::_open_recent_scene)); file_menu->add_separator(); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/save_scene", TTRC("Save Scene"), KeyModifierMask::CMD_OR_CTRL + Key::S), FILE_SAVE_SCENE); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/save_scene_as", TTRC("Save Scene As..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::S), FILE_SAVE_AS_SCENE); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/save_all_scenes", TTRC("Save All Scenes"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::S), FILE_SAVE_ALL_SCENES); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/save_scene", TTRC("Save Scene"), KeyModifierMask::CMD_OR_CTRL + Key::S), SCENE_SAVE_SCENE); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/save_scene_as", TTRC("Save Scene As..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::S), SCENE_SAVE_AS_SCENE); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/save_all_scenes", TTRC("Save All Scenes"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::S), SCENE_SAVE_ALL_SCENES); file_menu->add_separator(); - file_menu->add_shortcut(ED_SHORTCUT_ARRAY_AND_COMMAND("editor/quick_open", TTRC("Quick Open..."), { int32_t(KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::O), int32_t(KeyModifierMask::CMD_OR_CTRL + Key::P) }), FILE_QUICK_OPEN); + file_menu->add_shortcut(ED_SHORTCUT_ARRAY_AND_COMMAND("editor/quick_open", TTRC("Quick Open..."), { int32_t(KeyModifierMask::SHIFT + KeyModifierMask::ALT + Key::O), int32_t(KeyModifierMask::CMD_OR_CTRL + Key::P) }), SCENE_QUICK_OPEN); ED_SHORTCUT_OVERRIDE_ARRAY("editor/quick_open", "macos", { int32_t(KeyModifierMask::META + KeyModifierMask::CTRL + Key::O), int32_t(KeyModifierMask::CMD_OR_CTRL + Key::P) }); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open_scene", TTRC("Quick Open Scene..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::O), FILE_QUICK_OPEN_SCENE); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open_script", TTRC("Quick Open Script..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::ALT + Key::O), FILE_QUICK_OPEN_SCRIPT); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open_scene", TTRC("Quick Open Scene..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::O), SCENE_QUICK_OPEN_SCENE); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/quick_open_script", TTRC("Quick Open Script..."), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::ALT + Key::O), SCENE_QUICK_OPEN_SCRIPT); file_menu->add_separator(); export_as_menu = memnew(PopupMenu); @@ -7683,18 +7683,18 @@ EditorNode::EditorNode() { export_as_menu->connect("index_pressed", callable_mp(this, &EditorNode::_export_as_menu_option)); file_menu->add_separator(); - file_menu->add_shortcut(ED_GET_SHORTCUT("ui_undo"), FILE_UNDO, false, true); - file_menu->add_shortcut(ED_GET_SHORTCUT("ui_redo"), FILE_REDO, false, true); + file_menu->add_shortcut(ED_GET_SHORTCUT("ui_undo"), SCENE_UNDO, false, true); + file_menu->add_shortcut(ED_GET_SHORTCUT("ui_redo"), SCENE_REDO, false, true); file_menu->add_separator(); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/reload_saved_scene", TTRC("Reload Saved Scene")), FILE_RELOAD_SAVED_SCENE); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/close_scene", TTRC("Close Scene"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::W), FILE_CLOSE); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/reload_saved_scene", TTRC("Reload Saved Scene")), SCENE_RELOAD_SAVED_SCENE); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/close_scene", TTRC("Close Scene"), KeyModifierMask::CMD_OR_CTRL + KeyModifierMask::SHIFT + Key::W), SCENE_CLOSE); ED_SHORTCUT_OVERRIDE("editor/close_scene", "macos", KeyModifierMask::CMD_OR_CTRL + Key::W); if (!global_menu || !OS::get_singleton()->has_feature("macos")) { // On macOS "Quit" and "About" options are in the "app" menu. file_menu->add_separator(); - file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/file_quit", TTRC("Quit"), KeyModifierMask::CMD_OR_CTRL + Key::Q), FILE_QUIT, true); + file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/file_quit", TTRC("Quit"), KeyModifierMask::CMD_OR_CTRL + Key::Q), SCENE_QUIT, true); } ED_SHORTCUT_AND_COMMAND("editor/editor_settings", TTRC("Editor Settings...")); diff --git a/editor/editor_node.h b/editor/editor_node.h index 895a8d5d0c1..a120d9b95da 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -138,23 +138,23 @@ public: enum MenuOptions { // Scene menu. - FILE_NEW_SCENE, - FILE_NEW_INHERITED_SCENE, - FILE_OPEN_SCENE, - FILE_OPEN_PREV, - FILE_OPEN_RECENT, - FILE_SAVE_SCENE, - FILE_SAVE_AS_SCENE, - FILE_SAVE_ALL_SCENES, - FILE_MULTI_SAVE_AS_SCENE, - FILE_QUICK_OPEN, - FILE_QUICK_OPEN_SCENE, - FILE_QUICK_OPEN_SCRIPT, - FILE_UNDO, - FILE_REDO, - FILE_RELOAD_SAVED_SCENE, - FILE_CLOSE, - FILE_QUIT, + SCENE_NEW_SCENE, + SCENE_NEW_INHERITED_SCENE, + SCENE_OPEN_SCENE, + SCENE_OPEN_PREV, + SCENE_OPEN_RECENT, + SCENE_SAVE_SCENE, + SCENE_SAVE_AS_SCENE, + SCENE_SAVE_ALL_SCENES, + SCENE_MULTI_SAVE_AS_SCENE, + SCENE_QUICK_OPEN, + SCENE_QUICK_OPEN_SCENE, + SCENE_QUICK_OPEN_SCRIPT, + SCENE_UNDO, + SCENE_REDO, + SCENE_RELOAD_SAVED_SCENE, + SCENE_CLOSE, + SCENE_QUIT, FILE_EXPORT_MESH_LIBRARY, @@ -210,8 +210,8 @@ public: // Non-menu options. SCENE_TAB_CLOSE, - FILE_SAVE_AND_RUN, - FILE_SAVE_AND_RUN_MAIN_SCENE, + SAVE_AND_RUN, + SAVE_AND_RUN_MAIN_SCENE, RESOURCE_SAVE, RESOURCE_SAVE_AS, SETTINGS_PICK_MAIN_SCENE, @@ -756,7 +756,7 @@ public: void trigger_menu_option(int p_option, bool p_confirmed); bool has_previous_closed_scenes() const; - void new_inherited_scene() { _menu_option_confirm(FILE_NEW_INHERITED_SCENE, false); } + void new_inherited_scene() { _menu_option_confirm(SCENE_NEW_INHERITED_SCENE, false); } void update_distraction_free_mode(); void set_distraction_free_mode(bool p_enter); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 991595f0c24..ed8a0e6d114 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2100,14 +2100,14 @@ void FileSystemDock::_tree_rmb_option(int p_option) { // Execute the current option. switch (p_option) { - case FOLDER_EXPAND_ALL: - case FOLDER_COLLAPSE_ALL: { + case FILE_MENU_EXPAND_ALL: + case FILE_MENU_COLLAPSE_ALL: { // Expand or collapse the folder if (selected_strings.size() == 1) { - tree->get_selected()->set_collapsed_recursive(p_option == FOLDER_COLLAPSE_ALL); + tree->get_selected()->set_collapsed_recursive(p_option == FILE_MENU_COLLAPSE_ALL); } } break; - case FILE_RENAME: { + case FILE_MENU_RENAME: { selected_strings = _tree_get_selected(false, true); [[fallthrough]]; } @@ -2140,7 +2140,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected // The first one should be the active item. switch (p_option) { - case FILE_SHOW_IN_EXPLORER: { + case FILE_MENU_SHOW_IN_EXPLORER: { // Show the file/folder in the OS explorer. String fpath = current_path; if (current_path == "Favorites") { @@ -2151,7 +2151,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected OS::get_singleton()->shell_show_in_file_manager(dir, true); } break; - case FILE_OPEN_EXTERNAL: { + case FILE_MENU_OPEN_EXTERNAL: { String fpath = current_path; if (current_path == "Favorites") { fpath = p_selected[0]; @@ -2188,7 +2188,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_OPEN_IN_TERMINAL: { + case FILE_MENU_OPEN_IN_TERMINAL: { String fpath = current_path; if (current_path == "Favorites") { fpath = p_selected[0]; @@ -2323,7 +2323,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_OPEN_: { + case FILE_MENU_OPEN: { // Open folders. TreeItem *selected = tree->get_root(); selected = tree->get_next_selected(selected); @@ -2339,14 +2339,14 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_INHERIT: { + case FILE_MENU_INHERIT: { // Create a new scene inherited from the selected one. if (p_selected.size() == 1) { emit_signal(SNAME("inherit"), p_selected[0]); } } break; - case FILE_MAIN_SCENE: { + case FILE_MENU_MAIN_SCENE: { // Set as main scene with selected scene file. if (p_selected.size() == 1) { ProjectSettings::get_singleton()->set("application/run/main_scene", ResourceUID::path_to_uid(p_selected[0])); @@ -2356,7 +2356,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_INSTANTIATE: { + case FILE_MENU_INSTANTIATE: { // Instantiate all selected scenes. Vector paths; for (int i = 0; i < p_selected.size(); i++) { @@ -2370,7 +2370,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_ADD_FAVORITE: { + case FILE_MENU_ADD_FAVORITE: { // Add the files from favorites. Vector favorites_list = EditorSettings::get_singleton()->get_favorites(); for (int i = 0; i < p_selected.size(); i++) { @@ -2382,7 +2382,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected _update_tree(get_uncollapsed_paths()); } break; - case FILE_REMOVE_FAVORITE: { + case FILE_MENU_REMOVE_FAVORITE: { // Remove the files from favorites. Vector favorites_list = EditorSettings::get_singleton()->get_favorites(); for (int i = 0; i < p_selected.size(); i++) { @@ -2395,13 +2395,13 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_SHOW_IN_FILESYSTEM: { + case FILE_MENU_SHOW_IN_FILESYSTEM: { if (!p_selected.is_empty()) { navigate_to_path(p_selected[0]); } } break; - case FILE_DEPENDENCIES: { + case FILE_MENU_DEPENDENCIES: { // Checkout the file dependencies. if (!p_selected.is_empty()) { const String &fpath = p_selected[0]; @@ -2409,7 +2409,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_OWNERS: { + case FILE_MENU_OWNERS: { // Checkout the file owners. if (!p_selected.is_empty()) { const String &fpath = p_selected[0]; @@ -2417,7 +2417,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_MOVE: { + case FILE_MENU_MOVE: { // Move or copy the files to a given location. to_move.clear(); Vector collapsed_paths = _remove_self_included_paths(p_selected); @@ -2433,7 +2433,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_RENAME: { + case FILE_MENU_RENAME: { if (!p_selected.is_empty()) { // Set to_rename variable for callback execution. to_rename.path = p_selected[0]; @@ -2463,7 +2463,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_REMOVE: { + case FILE_MENU_REMOVE: { // Remove the selected files. Vector remove_files; Vector remove_folders; @@ -2485,7 +2485,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_DUPLICATE: { + case FILE_MENU_DUPLICATE: { if (p_selected.size() != 1) { return; } @@ -2504,11 +2504,11 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected make_dir_dialog->popup_centered(); } break; - case FILE_REIMPORT: { + case FILE_MENU_REIMPORT: { ImportDock::get_singleton()->reimport_resources(p_selected); } break; - case FILE_NEW_FOLDER: { + case FILE_MENU_NEW_FOLDER: { String directory = current_path; if (!directory.ends_with("/")) { directory = directory.get_base_dir(); @@ -2518,7 +2518,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected make_dir_dialog->popup_centered(); } break; - case FILE_NEW_SCENE: { + case FILE_MENU_NEW_SCENE: { String directory = current_path; if (!directory.ends_with("/")) { directory = directory.get_base_dir(); @@ -2527,7 +2527,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected make_scene_dialog->popup_centered(); } break; - case FILE_NEW_SCRIPT: { + case FILE_MENU_NEW_SCRIPT: { String fpath = current_path; if (!fpath.ends_with("/")) { fpath = fpath.get_base_dir(); @@ -2536,14 +2536,14 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected make_script_dialog->popup_centered(); } break; - case FILE_COPY_PATH: { + case FILE_MENU_COPY_PATH: { if (!p_selected.is_empty()) { const String &fpath = p_selected[0]; DisplayServer::get_singleton()->clipboard_set(fpath); } } break; - case FILE_COPY_ABSOLUTE_PATH: { + case FILE_MENU_COPY_ABSOLUTE_PATH: { if (!p_selected.is_empty()) { const String &fpath = p_selected[0]; const String absolute_path = ProjectSettings::get_singleton()->globalize_path(fpath); @@ -2551,7 +2551,7 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_COPY_UID: { + case FILE_MENU_COPY_UID: { if (!p_selected.is_empty()) { ResourceUID::ID uid = ResourceLoader::get_resource_uid(p_selected[0]); if (uid != ResourceUID::INVALID_ID) { @@ -2561,10 +2561,10 @@ void FileSystemDock::_file_option(int p_option, const Vector &p_selected } } break; - case FILE_NEW_RESOURCE: { + case FILE_MENU_NEW_RESOURCE: { new_resource_dialog->popup_create(true); } break; - case FILE_NEW_TEXTFILE: { + case FILE_MENU_NEW_TEXTFILE: { String fpath = current_path; if (!fpath.ends_with("/")) { fpath = fpath.get_base_dir(); @@ -3211,24 +3211,24 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect if (all_files) { if (all_files_scenes) { if (filenames.size() == 1) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Open Scene"), FILE_OPEN_); - p_popup->add_icon_item(get_editor_theme_icon(SNAME("CreateNewSceneFrom")), TTRC("New Inherited Scene"), FILE_INHERIT); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Open Scene"), FILE_MENU_OPEN); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("CreateNewSceneFrom")), TTRC("New Inherited Scene"), FILE_MENU_INHERIT); if (GLOBAL_GET("application/run/main_scene") != filenames[0]) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("PlayScene")), TTRC("Set as Main Scene"), FILE_MAIN_SCENE); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("PlayScene")), TTRC("Set as Main Scene"), FILE_MENU_MAIN_SCENE); } } else { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Open Scenes"), FILE_OPEN_); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Open Scenes"), FILE_MENU_OPEN); } - p_popup->add_icon_item(get_editor_theme_icon(SNAME("Instance")), TTRC("Instantiate"), FILE_INSTANTIATE); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("Instance")), TTRC("Instantiate"), FILE_MENU_INSTANTIATE); p_popup->add_separator(); } else if (filenames.size() == 1) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Open"), FILE_OPEN_); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Open"), FILE_MENU_OPEN); p_popup->add_separator(); } if (filenames.size() == 1) { - p_popup->add_item(TTRC("Edit Dependencies..."), FILE_DEPENDENCIES); - p_popup->add_item(TTRC("View Owners..."), FILE_OWNERS); + p_popup->add_item(TTRC("Edit Dependencies..."), FILE_MENU_DEPENDENCIES); + p_popup->add_item(TTRC("View Owners..."), FILE_MENU_OWNERS); p_popup->add_separator(); } } @@ -3237,14 +3237,14 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect PopupMenu *new_menu = memnew(PopupMenu); new_menu->connect(SceneStringName(id_pressed), callable_mp(this, &FileSystemDock::_generic_rmb_option_selected)); - p_popup->add_submenu_node_item(TTRC("Create New"), new_menu, FILE_NEW); - p_popup->set_item_icon(p_popup->get_item_index(FILE_NEW), get_editor_theme_icon(SNAME("Add"))); + p_popup->add_submenu_node_item(TTRC("Create New"), new_menu, FILE_MENU_NEW); + p_popup->set_item_icon(p_popup->get_item_index(FILE_MENU_NEW), get_editor_theme_icon(SNAME("Add"))); - new_menu->add_icon_item(get_editor_theme_icon(SNAME("Folder")), TTRC("Folder..."), FILE_NEW_FOLDER); - new_menu->add_icon_item(get_editor_theme_icon(SNAME("PackedScene")), TTRC("Scene..."), FILE_NEW_SCENE); - new_menu->add_icon_item(get_editor_theme_icon(SNAME("Script")), TTRC("Script..."), FILE_NEW_SCRIPT); - new_menu->add_icon_item(get_editor_theme_icon(SNAME("Object")), TTRC("Resource..."), FILE_NEW_RESOURCE); - new_menu->add_icon_item(get_editor_theme_icon(SNAME("TextFile")), TTRC("TextFile..."), FILE_NEW_TEXTFILE); + new_menu->add_icon_item(get_editor_theme_icon(SNAME("Folder")), TTRC("Folder..."), FILE_MENU_NEW_FOLDER); + new_menu->add_icon_item(get_editor_theme_icon(SNAME("PackedScene")), TTRC("Scene..."), FILE_MENU_NEW_SCENE); + new_menu->add_icon_item(get_editor_theme_icon(SNAME("Script")), TTRC("Script..."), FILE_MENU_NEW_SCRIPT); + new_menu->add_icon_item(get_editor_theme_icon(SNAME("Object")), TTRC("Resource..."), FILE_MENU_NEW_RESOURCE); + new_menu->add_icon_item(get_editor_theme_icon(SNAME("TextFile")), TTRC("TextFile..."), FILE_MENU_NEW_TEXTFILE); EditorContextMenuPluginManager::get_singleton()->add_options_from_plugins(new_menu, EditorContextMenuPlugin::CONTEXT_SLOT_FILESYSTEM_CREATE, p_paths); p_popup->add_separator(); @@ -3255,11 +3255,11 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect bool root_path_not_selected = p_paths[0] != "res://" && (p_paths.size() <= 1 || p_paths[1] != "res://"); if (all_folders && foldernames.size() > 0) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Expand Folder"), FILE_OPEN_); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Expand Folder"), FILE_MENU_OPEN); if (foldernames.size() == 1) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("GuiTreeArrowDown")), TTRC("Expand Hierarchy"), FOLDER_EXPAND_ALL); - p_popup->add_icon_item(get_editor_theme_icon(SNAME("GuiTreeArrowRight")), TTRC("Collapse Hierarchy"), FOLDER_COLLAPSE_ALL); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("GuiTreeArrowDown")), TTRC("Expand Hierarchy"), FILE_MENU_EXPAND_ALL); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("GuiTreeArrowRight")), TTRC("Collapse Hierarchy"), FILE_MENU_COLLAPSE_ALL); } p_popup->add_separator(); @@ -3287,21 +3287,21 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect // Add the options that are only available when a single item is selected. if (p_paths.size() == 1) { - p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("ActionCopy")), ED_GET_SHORTCUT("filesystem_dock/copy_path"), FILE_COPY_PATH); - p_popup->add_shortcut(ED_GET_SHORTCUT("filesystem_dock/copy_absolute_path"), FILE_COPY_ABSOLUTE_PATH); + p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("ActionCopy")), ED_GET_SHORTCUT("filesystem_dock/copy_path"), FILE_MENU_COPY_PATH); + p_popup->add_shortcut(ED_GET_SHORTCUT("filesystem_dock/copy_absolute_path"), FILE_MENU_COPY_ABSOLUTE_PATH); if (ResourceLoader::get_resource_uid(p_paths[0]) != ResourceUID::INVALID_ID) { - p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Instance")), ED_GET_SHORTCUT("filesystem_dock/copy_uid"), FILE_COPY_UID); + p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Instance")), ED_GET_SHORTCUT("filesystem_dock/copy_uid"), FILE_MENU_COPY_UID); } if (root_path_not_selected) { - p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Rename")), ED_GET_SHORTCUT("filesystem_dock/rename"), FILE_RENAME); - p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Duplicate")), ED_GET_SHORTCUT("filesystem_dock/duplicate"), FILE_DUPLICATE); + p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Rename")), ED_GET_SHORTCUT("filesystem_dock/rename"), FILE_MENU_RENAME); + p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Duplicate")), ED_GET_SHORTCUT("filesystem_dock/duplicate"), FILE_MENU_DUPLICATE); } } // Add the options that are only available when the root path is not selected. if (root_path_not_selected) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("MoveUp")), TTRC("Move/Duplicate To..."), FILE_MOVE); - p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Remove")), ED_GET_SHORTCUT("filesystem_dock/delete"), FILE_REMOVE); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("MoveUp")), TTRC("Move/Duplicate To..."), FILE_MENU_MOVE); + p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Remove")), ED_GET_SHORTCUT("filesystem_dock/delete"), FILE_MENU_REMOVE); } // Only add a separator if we have actually placed any options in the menu since the last separator. @@ -3312,10 +3312,10 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect // Add the options that are available when one or more items are selected. if (p_paths.size() >= 1) { if (!all_favorites) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("Favorites")), TTRC("Add to Favorites"), FILE_ADD_FAVORITE); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("Favorites")), TTRC("Add to Favorites"), FILE_MENU_ADD_FAVORITE); } if (!all_not_favorites) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("NonFavorite")), TTRC("Remove from Favorites"), FILE_REMOVE_FAVORITE); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("NonFavorite")), TTRC("Remove from Favorites"), FILE_MENU_REMOVE_FAVORITE); } if (root_path_not_selected) { @@ -3335,7 +3335,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect container_menu = memnew(PopupMenu); container_menu->connect(SceneStringName(id_pressed), callable_mp(this, &FileSystemDock::_generic_rmb_option_selected)); - p_popup->add_submenu_node_item(TTRC("Convert to..."), container_menu, FILE_NEW); + p_popup->add_submenu_node_item(TTRC("Convert to..."), container_menu, FILE_MENU_NEW); conversion_string_template = "%s"; } @@ -3380,7 +3380,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect } if (resource_valid) { - p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Reimport"), FILE_REIMPORT); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("Load")), TTRC("Reimport"), FILE_MENU_REIMPORT); } } } @@ -3405,7 +3405,7 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect if (is_item_in_favorites) { p_popup->add_separator(); added_separator = true; - p_popup->add_icon_item(get_editor_theme_icon(SNAME("ShowInFileSystem")), TTRC("Show in FileSystem"), FILE_SHOW_IN_FILESYSTEM); + p_popup->add_icon_item(get_editor_theme_icon(SNAME("ShowInFileSystem")), TTRC("Show in FileSystem"), FILE_MENU_SHOW_IN_FILESYSTEM); } } @@ -3418,15 +3418,15 @@ void FileSystemDock::_file_and_folders_fill_popup(PopupMenu *p_popup, const Vect // Opening the system file manager is not supported on the Android and web editors. const bool is_directory = fpath.ends_with("/"); - p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Terminal")), ED_GET_SHORTCUT("filesystem_dock/open_in_terminal"), FILE_OPEN_IN_TERMINAL); - p_popup->set_item_text(p_popup->get_item_index(FILE_OPEN_IN_TERMINAL), is_directory ? TTRC("Open in Terminal") : TTRC("Open Folder in Terminal")); + p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Terminal")), ED_GET_SHORTCUT("filesystem_dock/open_in_terminal"), FILE_MENU_OPEN_IN_TERMINAL); + p_popup->set_item_text(p_popup->get_item_index(FILE_MENU_OPEN_IN_TERMINAL), is_directory ? TTRC("Open in Terminal") : TTRC("Open Folder in Terminal")); if (!is_directory) { - p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("ExternalLink")), ED_GET_SHORTCUT("filesystem_dock/open_in_external_program"), FILE_OPEN_EXTERNAL); + p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("ExternalLink")), ED_GET_SHORTCUT("filesystem_dock/open_in_external_program"), FILE_MENU_OPEN_EXTERNAL); } - p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Filesystem")), ED_GET_SHORTCUT("filesystem_dock/show_in_explorer"), FILE_SHOW_IN_EXPLORER); - p_popup->set_item_text(p_popup->get_item_index(FILE_SHOW_IN_EXPLORER), is_directory ? TTRC("Open in File Manager") : TTRC("Show in File Manager")); + p_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Filesystem")), ED_GET_SHORTCUT("filesystem_dock/show_in_explorer"), FILE_MENU_SHOW_IN_EXPLORER); + p_popup->set_item_text(p_popup->get_item_index(FILE_MENU_SHOW_IN_EXPLORER), is_directory ? TTRC("Open in File Manager") : TTRC("Show in File Manager")); #endif current_path = fpath; @@ -3463,16 +3463,16 @@ void FileSystemDock::_tree_empty_click(const Vector2 &p_pos, MouseButton p_butto current_path = "res://"; tree_popup->clear(); tree_popup->reset_size(); - tree_popup->add_icon_item(get_editor_theme_icon(SNAME("Folder")), TTRC("New Folder..."), FILE_NEW_FOLDER); - tree_popup->add_icon_item(get_editor_theme_icon(SNAME("PackedScene")), TTRC("New Scene..."), FILE_NEW_SCENE); - tree_popup->add_icon_item(get_editor_theme_icon(SNAME("Script")), TTRC("New Script..."), FILE_NEW_SCRIPT); - tree_popup->add_icon_item(get_editor_theme_icon(SNAME("Object")), TTRC("New Resource..."), FILE_NEW_RESOURCE); - tree_popup->add_icon_item(get_editor_theme_icon(SNAME("TextFile")), TTRC("New TextFile..."), FILE_NEW_TEXTFILE); + tree_popup->add_icon_item(get_editor_theme_icon(SNAME("Folder")), TTRC("New Folder..."), FILE_MENU_NEW_FOLDER); + tree_popup->add_icon_item(get_editor_theme_icon(SNAME("PackedScene")), TTRC("New Scene..."), FILE_MENU_NEW_SCENE); + tree_popup->add_icon_item(get_editor_theme_icon(SNAME("Script")), TTRC("New Script..."), FILE_MENU_NEW_SCRIPT); + tree_popup->add_icon_item(get_editor_theme_icon(SNAME("Object")), TTRC("New Resource..."), FILE_MENU_NEW_RESOURCE); + tree_popup->add_icon_item(get_editor_theme_icon(SNAME("TextFile")), TTRC("New TextFile..."), FILE_MENU_NEW_TEXTFILE); #if !defined(ANDROID_ENABLED) && !defined(WEB_ENABLED) // Opening the system file manager is not supported on the Android and web editors. tree_popup->add_separator(); - tree_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Terminal")), ED_GET_SHORTCUT("filesystem_dock/open_in_terminal"), FILE_OPEN_IN_TERMINAL); - tree_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Filesystem")), ED_GET_SHORTCUT("filesystem_dock/show_in_explorer"), FILE_SHOW_IN_EXPLORER); + tree_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Terminal")), ED_GET_SHORTCUT("filesystem_dock/open_in_terminal"), FILE_MENU_OPEN_IN_TERMINAL); + tree_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Filesystem")), ED_GET_SHORTCUT("filesystem_dock/show_in_explorer"), FILE_MENU_SHOW_IN_EXPLORER); #endif tree_popup->set_position(tree->get_screen_position() + p_pos); @@ -3533,14 +3533,14 @@ void FileSystemDock::_file_list_empty_clicked(const Vector2 &p_pos, MouseButton file_list_popup->clear(); file_list_popup->reset_size(); - file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("Folder")), TTRC("New Folder..."), FILE_NEW_FOLDER); - file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("PackedScene")), TTRC("New Scene..."), FILE_NEW_SCENE); - file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("Script")), TTRC("New Script..."), FILE_NEW_SCRIPT); - file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("Object")), TTRC("New Resource..."), FILE_NEW_RESOURCE); - file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("TextFile")), TTRC("New TextFile..."), FILE_NEW_TEXTFILE); + file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("Folder")), TTRC("New Folder..."), FILE_MENU_NEW_FOLDER); + file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("PackedScene")), TTRC("New Scene..."), FILE_MENU_NEW_SCENE); + file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("Script")), TTRC("New Script..."), FILE_MENU_NEW_SCRIPT); + file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("Object")), TTRC("New Resource..."), FILE_MENU_NEW_RESOURCE); + file_list_popup->add_icon_item(get_editor_theme_icon(SNAME("TextFile")), TTRC("New TextFile..."), FILE_MENU_NEW_TEXTFILE); file_list_popup->add_separator(); - file_list_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Terminal")), ED_GET_SHORTCUT("filesystem_dock/open_in_terminal"), FILE_OPEN_IN_TERMINAL); - file_list_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Filesystem")), ED_GET_SHORTCUT("filesystem_dock/show_in_explorer"), FILE_SHOW_IN_EXPLORER); + file_list_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Terminal")), ED_GET_SHORTCUT("filesystem_dock/open_in_terminal"), FILE_MENU_OPEN_IN_TERMINAL); + file_list_popup->add_icon_shortcut(get_editor_theme_icon(SNAME("Filesystem")), ED_GET_SHORTCUT("filesystem_dock/show_in_explorer"), FILE_MENU_SHOW_IN_EXPLORER); file_list_popup->set_position(files->get_screen_position() + p_pos); file_list_popup->reset_size(); @@ -3641,23 +3641,23 @@ void FileSystemDock::_tree_gui_input(Ref p_event) { if (key.is_valid() && key->is_pressed() && !key->is_echo()) { if (ED_IS_SHORTCUT("filesystem_dock/duplicate", p_event)) { - _tree_rmb_option(FILE_DUPLICATE); + _tree_rmb_option(FILE_MENU_DUPLICATE); } else if (ED_IS_SHORTCUT("filesystem_dock/copy_path", p_event)) { - _tree_rmb_option(FILE_COPY_PATH); + _tree_rmb_option(FILE_MENU_COPY_PATH); } else if (ED_IS_SHORTCUT("filesystem_dock/copy_absolute_path", p_event)) { - _tree_rmb_option(FILE_COPY_ABSOLUTE_PATH); + _tree_rmb_option(FILE_MENU_COPY_ABSOLUTE_PATH); } else if (ED_IS_SHORTCUT("filesystem_dock/copy_uid", p_event)) { - _tree_rmb_option(FILE_COPY_UID); + _tree_rmb_option(FILE_MENU_COPY_UID); } else if (ED_IS_SHORTCUT("filesystem_dock/delete", p_event)) { - _tree_rmb_option(FILE_REMOVE); + _tree_rmb_option(FILE_MENU_REMOVE); } else if (ED_IS_SHORTCUT("filesystem_dock/rename", p_event)) { - _tree_rmb_option(FILE_RENAME); + _tree_rmb_option(FILE_MENU_RENAME); } else if (ED_IS_SHORTCUT("filesystem_dock/show_in_explorer", p_event)) { - _tree_rmb_option(FILE_SHOW_IN_EXPLORER); + _tree_rmb_option(FILE_MENU_SHOW_IN_EXPLORER); } else if (ED_IS_SHORTCUT("filesystem_dock/open_in_external_program", p_event)) { - _tree_rmb_option(FILE_OPEN_EXTERNAL); + _tree_rmb_option(FILE_MENU_OPEN_EXTERNAL); } else if (ED_IS_SHORTCUT("filesystem_dock/open_in_terminal", p_event)) { - _tree_rmb_option(FILE_OPEN_IN_TERMINAL); + _tree_rmb_option(FILE_MENU_OPEN_IN_TERMINAL); } else if (ED_IS_SHORTCUT("file_dialog/focus_path", p_event)) { focus_on_path(); } else if (ED_IS_SHORTCUT("editor/open_search", p_event)) { @@ -3724,19 +3724,19 @@ void FileSystemDock::_file_list_gui_input(Ref p_event) { Ref key = p_event; if (key.is_valid() && key->is_pressed() && !key->is_echo()) { if (ED_IS_SHORTCUT("filesystem_dock/duplicate", p_event)) { - _file_list_rmb_option(FILE_DUPLICATE); + _file_list_rmb_option(FILE_MENU_DUPLICATE); } else if (ED_IS_SHORTCUT("filesystem_dock/copy_path", p_event)) { - _file_list_rmb_option(FILE_COPY_PATH); + _file_list_rmb_option(FILE_MENU_COPY_PATH); } else if (ED_IS_SHORTCUT("filesystem_dock/copy_absolute_path", p_event)) { - _file_list_rmb_option(FILE_COPY_ABSOLUTE_PATH); + _file_list_rmb_option(FILE_MENU_COPY_ABSOLUTE_PATH); } else if (ED_IS_SHORTCUT("filesystem_dock/delete", p_event)) { - _file_list_rmb_option(FILE_REMOVE); + _file_list_rmb_option(FILE_MENU_REMOVE); } else if (ED_IS_SHORTCUT("filesystem_dock/rename", p_event)) { - _file_list_rmb_option(FILE_RENAME); + _file_list_rmb_option(FILE_MENU_RENAME); } else if (ED_IS_SHORTCUT("filesystem_dock/show_in_explorer", p_event)) { - _file_list_rmb_option(FILE_SHOW_IN_EXPLORER); + _file_list_rmb_option(FILE_MENU_SHOW_IN_EXPLORER); } else if (ED_IS_SHORTCUT("filesystem_dock/open_in_terminal", p_event)) { - _file_list_rmb_option(FILE_OPEN_IN_TERMINAL); + _file_list_rmb_option(FILE_MENU_OPEN_IN_TERMINAL); } else if (ED_IS_SHORTCUT("editor/open_search", p_event)) { focus_on_filter(); } else { diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 25644546bbc..bfa3560b84d 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -101,34 +101,34 @@ public: private: enum FileMenu { - FILE_OPEN_, // Conflict with WinAPI. - FILE_INHERIT, - FILE_MAIN_SCENE, - FILE_INSTANTIATE, - FILE_ADD_FAVORITE, - FILE_REMOVE_FAVORITE, - FILE_SHOW_IN_FILESYSTEM, - FILE_DEPENDENCIES, - FILE_OWNERS, - FILE_MOVE, - FILE_RENAME, - FILE_REMOVE, - FILE_DUPLICATE, - FILE_REIMPORT, - FILE_NEW, - FILE_SHOW_IN_EXPLORER, - FILE_OPEN_EXTERNAL, - FILE_OPEN_IN_TERMINAL, - FILE_COPY_PATH, - FILE_COPY_ABSOLUTE_PATH, - FILE_COPY_UID, - FOLDER_EXPAND_ALL, - FOLDER_COLLAPSE_ALL, - FILE_NEW_RESOURCE, - FILE_NEW_TEXTFILE, - FILE_NEW_FOLDER, - FILE_NEW_SCRIPT, - FILE_NEW_SCENE, + FILE_MENU_OPEN, + FILE_MENU_INHERIT, + FILE_MENU_MAIN_SCENE, + FILE_MENU_INSTANTIATE, + FILE_MENU_ADD_FAVORITE, + FILE_MENU_REMOVE_FAVORITE, + FILE_MENU_SHOW_IN_FILESYSTEM, + FILE_MENU_DEPENDENCIES, + FILE_MENU_OWNERS, + FILE_MENU_MOVE, + FILE_MENU_RENAME, + FILE_MENU_REMOVE, + FILE_MENU_DUPLICATE, + FILE_MENU_REIMPORT, + FILE_MENU_NEW, + FILE_MENU_SHOW_IN_EXPLORER, + FILE_MENU_OPEN_EXTERNAL, + FILE_MENU_OPEN_IN_TERMINAL, + FILE_MENU_COPY_PATH, + FILE_MENU_COPY_ABSOLUTE_PATH, + FILE_MENU_COPY_UID, + FILE_MENU_EXPAND_ALL, + FILE_MENU_COLLAPSE_ALL, + FILE_MENU_NEW_RESOURCE, + FILE_MENU_NEW_TEXTFILE, + FILE_MENU_NEW_FOLDER, + FILE_MENU_NEW_SCRIPT, + FILE_MENU_NEW_SCENE, CONVERT_BASE_ID = 1000, }; diff --git a/editor/gui/editor_scene_tabs.cpp b/editor/gui/editor_scene_tabs.cpp index 9393d5311d0..504e96e0906 100644 --- a/editor/gui/editor_scene_tabs.cpp +++ b/editor/gui/editor_scene_tabs.cpp @@ -131,7 +131,7 @@ void EditorSceneTabs::_scene_tab_input(const Ref &p_input) { } if ((is_layout_rtl() && mb->get_position().x > tab_buttons) || (!is_layout_rtl() && mb->get_position().x < scene_tabs->get_size().width - tab_buttons)) { - EditorNode::get_singleton()->trigger_menu_option(EditorNode::FILE_NEW_SCENE, true); + EditorNode::get_singleton()->trigger_menu_option(EditorNode::SCENE_NEW_SCENE, true); } } if (mb->get_button_index() == MouseButton::RIGHT && mb->is_pressed()) { @@ -173,11 +173,11 @@ void EditorSceneTabs::_update_context_menu() { int tab_id = scene_tabs->get_hovered_tab(); bool no_root_node = !EditorNode::get_editor_data().get_edited_scene_root(tab_id); - scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/new_scene"), EditorNode::FILE_NEW_SCENE); + scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/new_scene"), EditorNode::SCENE_NEW_SCENE); if (tab_id >= 0) { - scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/save_scene"), EditorNode::FILE_SAVE_SCENE); + scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/save_scene"), EditorNode::SCENE_SAVE_SCENE); DISABLE_LAST_OPTION_IF(no_root_node); - scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/save_scene_as"), EditorNode::FILE_SAVE_AS_SCENE); + scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/save_scene_as"), EditorNode::SCENE_SAVE_AS_SCENE); DISABLE_LAST_OPTION_IF(no_root_node); } @@ -188,7 +188,7 @@ void EditorSceneTabs::_update_context_menu() { break; } } - scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/save_all_scenes"), EditorNode::FILE_SAVE_ALL_SCENES); + scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/save_all_scenes"), EditorNode::SCENE_SAVE_ALL_SCENES); DISABLE_LAST_OPTION_IF(!can_save_all_scenes); if (tab_id >= 0) { @@ -199,9 +199,9 @@ void EditorSceneTabs::_update_context_menu() { DISABLE_LAST_OPTION_IF(no_root_node); scene_tabs_context_menu->add_separator(); - scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/close_scene"), EditorNode::FILE_CLOSE); + scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/close_scene"), EditorNode::SCENE_CLOSE); scene_tabs_context_menu->set_item_text(-1, TTR("Close Tab")); - scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/reopen_closed_scene"), EditorNode::FILE_OPEN_PREV); + scene_tabs_context_menu->add_shortcut(ED_GET_SHORTCUT("editor/reopen_closed_scene"), EditorNode::SCENE_OPEN_PREV); scene_tabs_context_menu->set_item_text(-1, TTR("Undo Close Tab")); DISABLE_LAST_OPTION_IF(!EditorNode::get_singleton()->has_previous_closed_scenes()); scene_tabs_context_menu->add_item(TTR("Close Other Tabs"), SCENE_CLOSE_OTHERS); @@ -439,7 +439,7 @@ EditorSceneTabs::EditorSceneTabs() { scene_tab_add->set_tooltip_text(TTR("Add a new scene.")); scene_tab_add->set_accessibility_name(TTRC("Add Scene")); scene_tabs->add_child(scene_tab_add); - scene_tab_add->connect(SceneStringName(pressed), callable_mp(EditorNode::get_singleton(), &EditorNode::trigger_menu_option).bind(EditorNode::FILE_NEW_SCENE, false)); + scene_tab_add->connect(SceneStringName(pressed), callable_mp(EditorNode::get_singleton(), &EditorNode::trigger_menu_option).bind(EditorNode::SCENE_NEW_SCENE, false)); scene_tab_add_ph = memnew(Control); scene_tab_add_ph->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 23a1de5cef7..1c3d3a0d28a 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1175,7 +1175,7 @@ bool ScriptEditor::_test_script_times_on_disk(Ref p_for_script) { void ScriptEditor::_file_dialog_action(const String &p_file) { switch (file_dialog_option) { - case FILE_NEW_TEXTFILE: { + case FILE_MENU_NEW_TEXTFILE: { Error err; { Ref file = FileAccess::open(p_file, FileAccess::WRITE, &err); @@ -1196,11 +1196,11 @@ void ScriptEditor::_file_dialog_action(const String &p_file) { } [[fallthrough]]; } - case FILE_OPEN_: { + case FILE_MENU_OPEN: { open_file(p_file); file_dialog_option = -1; } break; - case FILE_SAVE_AS: { + case FILE_MENU_SAVE_AS: { ScriptEditorBase *current = _get_current_editor(); if (current) { Ref resource = current->get_edited_resource(); @@ -1264,14 +1264,14 @@ bool ScriptEditor::is_files_panel_toggled() { void ScriptEditor::_menu_option(int p_option) { ScriptEditorBase *current = _get_current_editor(); switch (p_option) { - case FILE_NEW: { + case FILE_MENU_NEW: { script_create_dialog->config("Node", "new_script", false, false); script_create_dialog->popup_centered(); } break; - case FILE_NEW_TEXTFILE: { + case FILE_MENU_NEW_TEXTFILE: { file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file_dialog_option = FILE_NEW_TEXTFILE; + file_dialog_option = FILE_MENU_NEW_TEXTFILE; file_dialog->clear_filters(); for (const String &E : textfile_extensions) { @@ -1281,10 +1281,10 @@ void ScriptEditor::_menu_option(int p_option) { file_dialog->popup_file_dialog(); open_textfile_after_create = true; } break; - case FILE_OPEN_: { + case FILE_MENU_OPEN: { file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file_dialog_option = FILE_OPEN_; + file_dialog_option = FILE_MENU_OPEN; List extensions; ResourceLoader::get_recognized_extensions_for_type("Script", &extensions); @@ -1301,7 +1301,7 @@ void ScriptEditor::_menu_option(int p_option) { file_dialog->popup_file_dialog(); return; } break; - case FILE_REOPEN_CLOSED: { + case FILE_MENU_REOPEN_CLOSED: { if (previous_scripts.is_empty()) { return; } @@ -1342,7 +1342,7 @@ void ScriptEditor::_menu_option(int p_option) { } } } break; - case FILE_SAVE_ALL: { + case FILE_MENU_SAVE_ALL: { if (_test_script_times_on_disk()) { return; } @@ -1375,17 +1375,17 @@ void ScriptEditor::_menu_option(int p_option) { OS::get_singleton()->shell_open(GODOT_VERSION_DOCS_URL "/"); } } break; - case WINDOW_NEXT: { + case FILE_MENU_HISTORY_NEXT: { _history_forward(); } break; - case WINDOW_PREV: { + case FILE_MENU_HISTORY_PREV: { _history_back(); } break; - case WINDOW_SORT: { + case FILE_MENU_SORT: { _sort_list_on_update = true; _update_script_names(); } break; - case TOGGLE_FILES_PANEL: { + case FILE_MENU_TOGGLE_FILES_PANEL: { toggle_files_panel(); if (current) { current->update_toggle_files_button(); @@ -1410,10 +1410,10 @@ void ScriptEditor::_menu_option(int p_option) { if (current) { switch (p_option) { - case FILE_SAVE: { + case FILE_MENU_SAVE: { save_current_script(); } break; - case FILE_SAVE_AS: { + case FILE_MENU_SAVE_AS: { if (trim_trailing_whitespace_on_save) { current->trim_trailing_whitespace(); } @@ -1433,7 +1433,7 @@ void ScriptEditor::_menu_option(int p_option) { if (text_file.is_valid()) { file_dialog->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE); file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file_dialog_option = FILE_SAVE_AS; + file_dialog_option = FILE_MENU_SAVE_AS; List extensions; ResourceLoader::get_recognized_extensions_for_type("Script", &extensions); @@ -1457,7 +1457,7 @@ void ScriptEditor::_menu_option(int p_option) { } } break; - case FILE_TOOL_RELOAD_SOFT: { + case FILE_MENU_SOFT_RELOAD_TOOL: { Ref