diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-27 21:55:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-27 21:55:17 +0200 |
commit | 0595ad79da021a62ca797f897c563ee0e5b56573 (patch) | |
tree | 3d6090fc015b6ced2961638dcca12f10e820bd06 | |
parent | 19e2f30a55b2b549b023ff8a18f088a349e74b11 (diff) | |
parent | da808d4fd3a0dbcca487ca7898fd278dd3bf361d (diff) |
Merge pull request #64521 from bruvzg/sh_over_fix
Fix editor shortcuts overrides overwriting user configured shortcuts.
-rw-r--r-- | editor/editor_settings.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index dd4adbb28f..f5d3b4842d 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1477,8 +1477,11 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c } } - // Directly override the existing shortcut. - sc->set_events(events); + // Override the existing shortcut only if it wasn't customized by the user (i.e. still "original"). + if (Shortcut::is_event_array_equal(sc->get_events(), sc->get_meta("original"))) { + sc->set_events(events); + } + sc->set_meta("original", events.duplicate(true)); } |