Skip to content

Commit

Permalink
Move engine build profile editor to Tools submenu
Browse files Browse the repository at this point in the history
- Rename it to Engine Compilation Configuration Editor. This makes
  it clearer that it requires compiling the engine to work ("build"
  can be understood as exporting a project or building C# solutions
  by some).
- Add it to the editor command palette and allow defining a keyboard
  shortcut for it, for consistency with other tools.
  • Loading branch information
Calinou committed Apr 9, 2024
1 parent 9d6bdbc commit 8e924bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions editor/editor_build_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ EditorBuildProfileManager::EditorBuildProfileManager() {
class_list->connect("item_edited", callable_mp(this, &EditorBuildProfileManager::_class_list_item_edited), CONNECT_DEFERRED);
class_list->connect("item_collapsed", callable_mp(this, &EditorBuildProfileManager::_class_list_item_collapsed));
// It will be displayed once the user creates or chooses a profile.
main_vbc->add_margin_child(TTR("Configure Engine Build Profile:"), class_list, true);
main_vbc->add_margin_child(TTR("Configure Engine Compilation Profile:"), class_list, true);

description_bit = memnew(EditorHelpBit);
description_bit->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
Expand All @@ -875,15 +875,15 @@ EditorBuildProfileManager::EditorBuildProfileManager() {
import_profile = memnew(EditorFileDialog);
add_child(import_profile);
import_profile->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE);
import_profile->add_filter("*.build", TTR("Engine Build Profile"));
import_profile->add_filter("*.build", TTR("Engine Compilation Profile"));
import_profile->connect("files_selected", callable_mp(this, &EditorBuildProfileManager::_import_profile));
import_profile->set_title(TTR("Load Profile"));
import_profile->set_access(EditorFileDialog::ACCESS_FILESYSTEM);

export_profile = memnew(EditorFileDialog);
add_child(export_profile);
export_profile->set_file_mode(EditorFileDialog::FILE_MODE_SAVE_FILE);
export_profile->add_filter("*.build", TTR("Engine Build Profile"));
export_profile->add_filter("*.build", TTR("Engine Compilation Profile"));
export_profile->connect("file_selected", callable_mp(this, &EditorBuildProfileManager::_export_profile));
export_profile->set_title(TTR("Export Profile"));
export_profile->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
Expand All @@ -892,7 +892,7 @@ EditorBuildProfileManager::EditorBuildProfileManager() {
main_vbc->add_margin_child(TTR("Forced Classes on Detect:"), force_detect_classes);
force_detect_classes->connect("text_changed", callable_mp(this, &EditorBuildProfileManager::_force_detect_classes_changed));

set_title(TTR("Edit Build Configuration Profile"));
set_title(TTR("Edit Compilation Configuration Profile"));

singleton = this;
}
9 changes: 4 additions & 5 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2896,9 +2896,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
}
}
} break;
case TOOLS_BUILD_PROFILE_MANAGER: {
build_profile_manager->popup_centered_clamped(Size2(700, 800) * EDSCALE, 0.8);
} break;
case RUN_USER_DATA_FOLDER: {
// Ensure_user_data_dir() to prevent the edge case: "Open User Data Folder" won't work after the project was renamed in ProjectSettingsEditor unless the project is saved.
OS::get_singleton()->ensure_user_data_dir();
Expand Down Expand Up @@ -3203,6 +3200,9 @@ void EditorNode::_tool_menu_option(int p_idx) {
case TOOLS_ORPHAN_RESOURCES: {
orphan_resources->show();
} break;
case TOOLS_BUILD_PROFILE_MANAGER: {
build_profile_manager->popup_centered_clamped(Size2(700, 800) * EDSCALE, 0.8);
} break;
case TOOLS_SURFACE_UPGRADE: {
surface_upgrade_dialog->popup_on_demand();
} break;
Expand Down Expand Up @@ -6783,13 +6783,12 @@ EditorNode::EditorNode() {
#endif

project_menu->add_separator();
project_menu->add_item(TTR("Customize Engine Build Configuration..."), TOOLS_BUILD_PROFILE_MANAGER);
project_menu->add_separator();

tool_menu = memnew(PopupMenu);
tool_menu->connect("index_pressed", callable_mp(this, &EditorNode::_tool_menu_option));
project_menu->add_submenu_node_item(TTR("Tools"), tool_menu);
tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/orphan_resource_explorer", TTR("Orphan Resource Explorer...")), TOOLS_ORPHAN_RESOURCES);
tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/engine_compilation_configuration_editor", TTR("Engine Compilation Configuration Editor...")), TOOLS_BUILD_PROFILE_MANAGER);
tool_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/upgrade_mesh_surfaces", TTR("Upgrade Mesh Surfaces...")), TOOLS_SURFACE_UPGRADE);

project_menu->add_separator();
Expand Down

0 comments on commit 8e924bc

Please sign in to comment.