Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Remove script editor move keybinds and rename them

Aman Kujur4463590e3496
diff --git a/editor/script/script_editor_plugin.cpp b/editor/script/script_editor_plugin.cpp
index d3bc40769ca..4d09606a1cd 100644
--- a/editor/script/script_editor_plugin.cpp
+++ b/editor/script/script_editor_plugin.cpp
@@ -3145,11 +3145,11 @@ void ScriptEditor::shortcut_input(const Ref<InputEvent> &p_event) {
}
accept_event();
}
- if (ED_IS_SHORTCUT("script_editor/window_move_up", p_event)) {
+ if (ED_IS_SHORTCUT("script_editor/move_document_up", p_event)) {
_menu_option(FILE_MENU_MOVE_UP);
accept_event();
}
- if (ED_IS_SHORTCUT("script_editor/window_move_down", p_event)) {
+ if (ED_IS_SHORTCUT("script_editor/move_document_down", p_event)) {
_menu_option(FILE_MENU_MOVE_DOWN);
accept_event();
}
@@ -3248,9 +3248,9 @@ void ScriptEditor::_setup_popup_menu(PopupMenu *p_menu, bool p_is_context_menu)
}
if (p_is_context_menu) {
- p_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_move_up"), FILE_MENU_MOVE_UP);
- p_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_move_down"), FILE_MENU_MOVE_DOWN);
- p_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_sort"), FILE_MENU_SORT);
+ p_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/move_document_up"), FILE_MENU_MOVE_UP);
+ p_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/move_document_down"), FILE_MENU_MOVE_DOWN);
+ p_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/sort_documents"), FILE_MENU_SORT);
}
p_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/toggle_files_panel"), FILE_MENU_TOGGLE_FILES_PANEL);
@@ -4094,9 +4094,9 @@ ScriptEditor::ScriptEditor(const String &p_config_section, const String &p_cache
code_editor_container->add_child(find_replace_bar);
find_replace_bar->hide();
- ED_SHORTCUT("script_editor/window_sort", TTRC("Sort"));
- ED_SHORTCUT("script_editor/window_move_up", TTRC("Move Up"), KeyModifierMask::SHIFT | KeyModifierMask::ALT | Key::UP);
- ED_SHORTCUT("script_editor/window_move_down", TTRC("Move Down"), KeyModifierMask::SHIFT | KeyModifierMask::ALT | Key::DOWN);
+ ED_SHORTCUT("script_editor/sort_documents", TTRC("Sort Documents"));
+ ED_SHORTCUT("script_editor/move_document_up", TTRC("Move Document Up"));
+ ED_SHORTCUT("script_editor/move_document_down", TTRC("Move Document Down"));
// FIXME: These should be `Key::GREATER` and `Key::LESS` but those don't work.
ED_SHORTCUT("script_editor/next_script", TTRC("Next Script"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::PERIOD);
ED_SHORTCUT("script_editor/prev_script", TTRC("Previous Script"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::COMMA);
diff --git a/editor/settings/editor_settings.cpp b/editor/settings/editor_settings.cpp
index 87357df74ab..8d3ac0f5133 100644
--- a/editor/settings/editor_settings.cpp
+++ b/editor/settings/editor_settings.cpp
@@ -1353,6 +1353,9 @@ void EditorSettings::_handle_setting_compatibility() {
// Handle renamed shortcuts.
_rename_shortcut("editor/editor_assetlib", "editor/editor_asset_store");
+ _rename_shortcut("script_editor/window_move_up", "script_editor/move_document_up");
+ _rename_shortcut("script_editor/window_move_down", "script_editor/move_document_down");
+ _rename_shortcut("script_editor/window_sort", "script_editor/sort_documents");
}
void EditorSettings::_rename_setting(const String &p_old_name, const String &p_new_name) {