Skip to content

Commit e071f67

Browse files
committed
Merge pull request #91515 from AThousandShips/shortcut_fix
[Editor] Prevent some shortcut errors when generating docs
2 parents 9ed8399 + fd8a31b commit e071f67

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

editor/editor_settings.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,9 @@ Ref<Shortcut> ED_GET_SHORTCUT(const String &p_path) {
16431643
}
16441644

16451645
void ED_SHORTCUT_OVERRIDE(const String &p_path, const String &p_feature, Key p_keycode, bool p_physical) {
1646-
ERR_FAIL_NULL_MSG(EditorSettings::get_singleton(), "EditorSettings not instantiated yet.");
1646+
if (!EditorSettings::get_singleton()) {
1647+
return;
1648+
}
16471649

16481650
Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_path);
16491651
ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE with invalid shortcut: " + p_path);
@@ -1655,7 +1657,9 @@ void ED_SHORTCUT_OVERRIDE(const String &p_path, const String &p_feature, Key p_k
16551657
}
16561658

16571659
void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, const PackedInt32Array &p_keycodes, bool p_physical) {
1658-
ERR_FAIL_NULL_MSG(EditorSettings::get_singleton(), "EditorSettings not instantiated yet.");
1660+
if (!EditorSettings::get_singleton()) {
1661+
return;
1662+
}
16591663

16601664
Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_path);
16611665
ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE_ARRAY with invalid shortcut: " + p_path);

editor/gui/editor_file_dialog.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,11 +2086,9 @@ EditorFileDialog::EditorFileDialog() {
20862086
ED_SHORTCUT("file_dialog/move_favorite_up", TTR("Move Favorite Up"), KeyModifierMask::CMD_OR_CTRL | Key::UP);
20872087
ED_SHORTCUT("file_dialog/move_favorite_down", TTR("Move Favorite Down"), KeyModifierMask::CMD_OR_CTRL | Key::DOWN);
20882088

2089-
if (EditorSettings::get_singleton()) {
2090-
ED_SHORTCUT_OVERRIDE("file_dialog/toggle_hidden_files", "macos", KeyModifierMask::META | KeyModifierMask::SHIFT | Key::PERIOD);
2091-
ED_SHORTCUT_OVERRIDE("file_dialog/toggle_favorite", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::F);
2092-
ED_SHORTCUT_OVERRIDE("file_dialog/toggle_mode", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::V);
2093-
}
2089+
ED_SHORTCUT_OVERRIDE("file_dialog/toggle_hidden_files", "macos", KeyModifierMask::META | KeyModifierMask::SHIFT | Key::PERIOD);
2090+
ED_SHORTCUT_OVERRIDE("file_dialog/toggle_favorite", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::F);
2091+
ED_SHORTCUT_OVERRIDE("file_dialog/toggle_mode", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::V);
20942092

20952093
pathhb = memnew(HBoxContainer);
20962094
vbc->add_child(pathhb);

0 commit comments

Comments
 (0)