From da808d4fd3a0dbcca487ca7898fd278dd3bf361d Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 17 Aug 2022 08:04:38 +0300 Subject: [PATCH] Fix editor shortcuts overrides overwriting user configured shortcuts. --- editor/editor_settings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index dd4adbb28fd..f5d3b4842d2 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)); }