Skip to content

Commit e065d71

Browse files
committed
Remove duplicate shortcut definitions
1 parent aaa4560 commit e065d71

12 files changed

+68
-49
lines changed

editor/animation_track_editor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7312,17 +7312,19 @@ AnimationTrackEditor::AnimationTrackEditor() {
73127312
bottom_hb->add_child(zoom);
73137313
timeline->set_zoom(zoom);
73147314

7315+
ED_SHORTCUT("animation_editor/auto_fit", TTR("Fit to panel"), KeyModifierMask::ALT | Key::F);
7316+
73157317
auto_fit = memnew(Button);
73167318
auto_fit->set_flat(true);
73177319
auto_fit->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_auto_fit));
7318-
auto_fit->set_shortcut(ED_SHORTCUT("animation_editor/auto_fit", TTR("Fit to panel"), KeyModifierMask::ALT | Key::F));
7320+
auto_fit->set_shortcut(ED_GET_SHORTCUT("animation_editor/auto_fit"));
73197321
bottom_hb->add_child(auto_fit);
73207322

73217323
auto_fit_bezier = memnew(Button);
73227324
auto_fit_bezier->set_flat(true);
73237325
auto_fit_bezier->set_visible(false);
73247326
auto_fit_bezier->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_auto_fit_bezier));
7325-
auto_fit_bezier->set_shortcut(ED_SHORTCUT("animation_editor/auto_fit", TTR("Fit to panel"), KeyModifierMask::ALT | Key::F));
7327+
auto_fit_bezier->set_shortcut(ED_GET_SHORTCUT("animation_editor/auto_fit"));
73267328
bottom_hb->add_child(auto_fit_bezier);
73277329

73287330
edit = memnew(MenuButton);

editor/editor_node.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6297,6 +6297,11 @@ EditorNode::EditorNode() {
62976297
EditorSettings::create();
62986298
}
62996299

6300+
ED_SHORTCUT("editor/lock_selected_nodes", TTR("Lock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::L);
6301+
ED_SHORTCUT("editor/unlock_selected_nodes", TTR("Unlock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::L);
6302+
ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G);
6303+
ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G);
6304+
63006305
FileAccess::set_backup_save(EDITOR_GET("filesystem/on_save/safe_save_on_backup_then_rename"));
63016306

63026307
_update_vsync_mode();

editor/plugins/canvas_item_editor_plugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5419,31 +5419,31 @@ CanvasItemEditor::CanvasItemEditor() {
54195419
lock_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(LOCK_SELECTED));
54205420
lock_button->set_tooltip_text(TTR("Lock selected node, preventing selection and movement."));
54215421
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
5422-
lock_button->set_shortcut(ED_SHORTCUT("editor/lock_selected_nodes", TTR("Lock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::L));
5422+
lock_button->set_shortcut(ED_GET_SHORTCUT("editor/lock_selected_nodes"));
54235423

54245424
unlock_button = memnew(Button);
54255425
unlock_button->set_theme_type_variation("FlatButton");
54265426
main_menu_hbox->add_child(unlock_button);
54275427
unlock_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNLOCK_SELECTED));
54285428
unlock_button->set_tooltip_text(TTR("Unlock selected node, allowing selection and movement."));
54295429
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
5430-
unlock_button->set_shortcut(ED_SHORTCUT("editor/unlock_selected_nodes", TTR("Unlock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::L));
5430+
unlock_button->set_shortcut(ED_GET_SHORTCUT("editor/unlock_selected_nodes"));
54315431

54325432
group_button = memnew(Button);
54335433
group_button->set_theme_type_variation("FlatButton");
54345434
main_menu_hbox->add_child(group_button);
54355435
group_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(GROUP_SELECTED));
54365436
group_button->set_tooltip_text(TTR("Groups the selected node with its children. This causes the parent to be selected when any child node is clicked in 2D and 3D view."));
54375437
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
5438-
group_button->set_shortcut(ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G));
5438+
group_button->set_shortcut(ED_GET_SHORTCUT("editor/group_selected_nodes"));
54395439

54405440
ungroup_button = memnew(Button);
54415441
ungroup_button->set_theme_type_variation("FlatButton");
54425442
main_menu_hbox->add_child(ungroup_button);
54435443
ungroup_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNGROUP_SELECTED));
54445444
ungroup_button->set_tooltip_text(TTR("Ungroups the selected node from its children. Child nodes will be individual items in 2D and 3D view."));
54455445
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
5446-
ungroup_button->set_shortcut(ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G));
5446+
ungroup_button->set_shortcut(ED_GET_SHORTCUT("editor/ungroup_selected_nodes"));
54475447

54485448
main_menu_hbox->add_child(memnew(VSeparator));
54495449

editor/plugins/node_3d_editor_plugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8476,31 +8476,31 @@ Node3DEditor::Node3DEditor() {
84768476
tool_button[TOOL_LOCK_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_LOCK_SELECTED));
84778477
tool_button[TOOL_LOCK_SELECTED]->set_tooltip_text(TTR("Lock selected node, preventing selection and movement."));
84788478
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
8479-
tool_button[TOOL_LOCK_SELECTED]->set_shortcut(ED_SHORTCUT("editor/lock_selected_nodes", TTR("Lock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::L));
8479+
tool_button[TOOL_LOCK_SELECTED]->set_shortcut(ED_GET_SHORTCUT("editor/lock_selected_nodes"));
84808480

84818481
tool_button[TOOL_UNLOCK_SELECTED] = memnew(Button);
84828482
main_menu_hbox->add_child(tool_button[TOOL_UNLOCK_SELECTED]);
84838483
tool_button[TOOL_UNLOCK_SELECTED]->set_theme_type_variation("FlatButton");
84848484
tool_button[TOOL_UNLOCK_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNLOCK_SELECTED));
84858485
tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip_text(TTR("Unlock selected node, allowing selection and movement."));
84868486
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
8487-
tool_button[TOOL_UNLOCK_SELECTED]->set_shortcut(ED_SHORTCUT("editor/unlock_selected_nodes", TTR("Unlock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::L));
8487+
tool_button[TOOL_UNLOCK_SELECTED]->set_shortcut(ED_GET_SHORTCUT("editor/unlock_selected_nodes"));
84888488

84898489
tool_button[TOOL_GROUP_SELECTED] = memnew(Button);
84908490
main_menu_hbox->add_child(tool_button[TOOL_GROUP_SELECTED]);
84918491
tool_button[TOOL_GROUP_SELECTED]->set_theme_type_variation("FlatButton");
84928492
tool_button[TOOL_GROUP_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_GROUP_SELECTED));
84938493
tool_button[TOOL_GROUP_SELECTED]->set_tooltip_text(TTR("Groups the selected node with its children. This selects the parent when any child node is clicked in 2D and 3D view."));
84948494
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
8495-
tool_button[TOOL_GROUP_SELECTED]->set_shortcut(ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G));
8495+
tool_button[TOOL_GROUP_SELECTED]->set_shortcut(ED_GET_SHORTCUT("editor/group_selected_nodes"));
84968496

84978497
tool_button[TOOL_UNGROUP_SELECTED] = memnew(Button);
84988498
main_menu_hbox->add_child(tool_button[TOOL_UNGROUP_SELECTED]);
84998499
tool_button[TOOL_UNGROUP_SELECTED]->set_theme_type_variation("FlatButton");
85008500
tool_button[TOOL_UNGROUP_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNGROUP_SELECTED));
85018501
tool_button[TOOL_UNGROUP_SELECTED]->set_tooltip_text(TTR("Ungroups the selected node from its children. Child nodes will be individual items in 2D and 3D view."));
85028502
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
8503-
tool_button[TOOL_UNGROUP_SELECTED]->set_shortcut(ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G));
8503+
tool_button[TOOL_UNGROUP_SELECTED]->set_shortcut(ED_GET_SHORTCUT("editor/ungroup_selected_nodes"));
85048504

85058505
main_menu_hbox->add_child(memnew(VSeparator));
85068506

editor/plugins/script_editor_plugin.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ void ScriptEditor::_update_recent_scripts() {
765765
}
766766

767767
recent_scripts->add_separator();
768-
recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files")));
768+
recent_scripts->add_shortcut(ED_GET_SHORTCUT("script_editor/clear_recent"));
769769
recent_scripts->set_item_disabled(recent_scripts->get_item_id(recent_scripts->get_item_count() - 1), rc.is_empty());
770770

771771
recent_scripts->reset_size();
@@ -3591,13 +3591,13 @@ void ScriptEditor::_update_selected_editor_menu() {
35913591
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), Key::F3), HELP_SEARCH_FIND_NEXT);
35923592
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_previous", TTR("Find Previous"), KeyModifierMask::SHIFT | Key::F3), HELP_SEARCH_FIND_PREVIOUS);
35933593
script_search_menu->get_popup()->add_separator();
3594-
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_in_files", TTR("Find in Files"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::F), SEARCH_IN_FILES);
3595-
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/replace_in_files", TTR("Replace in Files"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::R), REPLACE_IN_FILES);
3594+
script_search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_editor/find_in_files"), SEARCH_IN_FILES);
3595+
script_search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_editor/replace_in_files"), REPLACE_IN_FILES);
35963596
script_search_menu->show();
35973597
} else {
35983598
if (tab_container->get_tab_count() == 0) {
3599-
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_in_files", TTR("Find in Files"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::F), SEARCH_IN_FILES);
3600-
script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/replace_in_files", TTR("Replace in Files"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::R), REPLACE_IN_FILES);
3599+
script_search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_editor/find_in_files"), SEARCH_IN_FILES);
3600+
script_search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_editor/replace_in_files"), REPLACE_IN_FILES);
36013601
script_search_menu->show();
36023602
} else {
36033603
script_search_menu->hide();
@@ -4101,7 +4101,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
41014101
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New Script..."), KeyModifierMask::CMD_OR_CTRL | Key::N), FILE_NEW);
41024102
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new_textfile", TTR("New Text File..."), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::N), FILE_NEW_TEXTFILE);
41034103
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open...")), FILE_OPEN);
4104-
file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/reopen_closed_script", TTR("Reopen Closed Script"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::T), FILE_REOPEN_CLOSED);
4104+
file_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_editor/reopen_closed_script"), FILE_REOPEN_CLOSED);
41054105

41064106
recent_scripts = memnew(PopupMenu);
41074107
file_menu->get_popup()->add_submenu_node_item(TTR("Open Recent"), recent_scripts, FILE_OPEN_RECENT);
@@ -4502,6 +4502,15 @@ void ScriptEditorPlugin::edited_scene_changed() {
45024502
}
45034503

45044504
ScriptEditorPlugin::ScriptEditorPlugin() {
4505+
ED_SHORTCUT("script_editor/reopen_closed_script", TTR("Reopen Closed Script"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::T);
4506+
ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Scripts"));
4507+
ED_SHORTCUT("script_editor/find_in_files", TTR("Find in Files"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::F);
4508+
ED_SHORTCUT("script_editor/replace_in_files", TTR("Replace in Files"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::R);
4509+
4510+
ED_SHORTCUT("script_text_editor/convert_to_uppercase", TTR("Uppercase"), KeyModifierMask::SHIFT | Key::F4);
4511+
ED_SHORTCUT("script_text_editor/convert_to_lowercase", TTR("Lowercase"), KeyModifierMask::SHIFT | Key::F5);
4512+
ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize"), KeyModifierMask::SHIFT | Key::F6);
4513+
45054514
window_wrapper = memnew(WindowWrapper);
45064515
window_wrapper->set_window_title(vformat(TTR("%s - Godot Engine"), TTR("Script Editor")));
45074516
window_wrapper->set_margins_enabled(true);
@@ -4530,9 +4539,6 @@ ScriptEditorPlugin::ScriptEditorPlugin() {
45304539
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "text_editor/external/exec_path", PROPERTY_HINT_GLOBAL_FILE));
45314540
EDITOR_DEF("text_editor/external/exec_flags", "{file}");
45324541
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "text_editor/external/exec_flags", PROPERTY_HINT_PLACEHOLDER_TEXT, "Call flags with placeholders: {project}, {file}, {col}, {line}."));
4533-
4534-
ED_SHORTCUT("script_editor/reopen_closed_script", TTR("Reopen Closed Script"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::T);
4535-
ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Scripts"));
45364542
}
45374543

45384544
ScriptEditorPlugin::~ScriptEditorPlugin() {

editor/plugins/script_text_editor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,9 +2311,9 @@ void ScriptTextEditor::_enable_code_editor() {
23112311
edit_menu->get_popup()->add_separator();
23122312
{
23132313
PopupMenu *sub_menu = memnew(PopupMenu);
2314-
sub_menu->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_uppercase", TTR("Uppercase"), KeyModifierMask::SHIFT | Key::F4), EDIT_TO_UPPERCASE);
2315-
sub_menu->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_lowercase", TTR("Lowercase"), KeyModifierMask::SHIFT | Key::F5), EDIT_TO_LOWERCASE);
2316-
sub_menu->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize"), KeyModifierMask::SHIFT | Key::F6), EDIT_CAPITALIZE);
2314+
sub_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_to_uppercase"), EDIT_TO_UPPERCASE);
2315+
sub_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_to_lowercase"), EDIT_TO_LOWERCASE);
2316+
sub_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/capitalize"), EDIT_CAPITALIZE);
23172317
sub_menu->connect("id_pressed", callable_mp(this, &ScriptTextEditor::_edit_option));
23182318
edit_menu->get_popup()->add_submenu_node_item(TTR("Convert Case"), sub_menu);
23192319
}

editor/plugins/text_editor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,9 @@ TextEditor::TextEditor() {
647647
edit_menu->get_popup()->add_separator();
648648
PopupMenu *convert_case = memnew(PopupMenu);
649649
edit_menu->get_popup()->add_submenu_node_item(TTR("Convert Case"), convert_case);
650-
convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_uppercase", TTR("Uppercase")), EDIT_TO_UPPERCASE);
651-
convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/convert_to_lowercase", TTR("Lowercase")), EDIT_TO_LOWERCASE);
652-
convert_case->add_shortcut(ED_SHORTCUT("script_text_editor/capitalize", TTR("Capitalize")), EDIT_CAPITALIZE);
650+
convert_case->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_to_uppercase"), EDIT_TO_UPPERCASE);
651+
convert_case->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_to_lowercase"), EDIT_TO_LOWERCASE);
652+
convert_case->add_shortcut(ED_GET_SHORTCUT("script_text_editor/capitalize"), EDIT_CAPITALIZE);
653653
convert_case->connect("id_pressed", callable_mp(this, &TextEditor::_edit_option));
654654

655655
highlighter_menu = memnew(PopupMenu);

editor/plugins/tiles/tile_data_editors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ TileDataDefaultEditor::TileDataDefaultEditor() {
13251325
picker_button = memnew(Button);
13261326
picker_button->set_theme_type_variation("FlatButton");
13271327
picker_button->set_toggle_mode(true);
1328-
picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P));
1328+
picker_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/picker"));
13291329
toolbar->add_child(picker_button);
13301330
}
13311331

@@ -2812,7 +2812,7 @@ TileDataTerrainsEditor::TileDataTerrainsEditor() {
28122812
picker_button = memnew(Button);
28132813
picker_button->set_theme_type_variation("FlatButton");
28142814
picker_button->set_toggle_mode(true);
2815-
picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P));
2815+
picker_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/picker"));
28162816
toolbar->add_child(picker_button);
28172817

28182818
// Setup

0 commit comments

Comments
 (0)