You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-02 16:48:55 +00:00
Merge pull request #107652 from vaner-org/set-tab-as-main-scene
Add "Set as Main Scene" option to EditorSceneTabs context menu
This commit is contained in:
@@ -2612,6 +2612,11 @@ void EditorNode::_dialog_action(String p_file) {
|
||||
}
|
||||
} break;
|
||||
|
||||
case SAVE_AND_SET_MAIN_SCENE: {
|
||||
_save_scene(p_file);
|
||||
_menu_option_confirm(SCENE_SET_MAIN_SCENE, true);
|
||||
} break;
|
||||
|
||||
case FILE_EXPORT_MESH_LIBRARY: {
|
||||
const Dictionary &fd_options = file_export_lib->get_selected_options();
|
||||
bool merge_with_existing_library = fd_options.get(TTR("Merge With Existing"), true);
|
||||
@@ -3344,6 +3349,19 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
||||
|
||||
} break;
|
||||
|
||||
case SCENE_SET_MAIN_SCENE: {
|
||||
const String scene_path = editor_data.get_scene_path(editor_data.get_edited_scene());
|
||||
if (scene_path.is_empty()) {
|
||||
current_menu_option = SAVE_AND_SET_MAIN_SCENE;
|
||||
_menu_option_confirm(SCENE_SAVE_AS_SCENE, true);
|
||||
file->set_title(TTR("Save new main scene..."));
|
||||
} else {
|
||||
ProjectSettings::get_singleton()->set("application/run/main_scene", ResourceUID::path_to_uid(scene_path));
|
||||
ProjectSettings::get_singleton()->save();
|
||||
FileSystemDock::get_singleton()->update_all();
|
||||
}
|
||||
} break;
|
||||
|
||||
case SCENE_SAVE_ALL_SCENES: {
|
||||
_save_all_scenes();
|
||||
} break;
|
||||
|
||||
Reference in New Issue
Block a user