From 5928d801a9855620dddd236725d0680963d9eaf3 Mon Sep 17 00:00:00 2001 From: Nong Van Tinh Date: Fri, 17 Feb 2023 23:18:56 +0700 Subject: [PATCH] Reordering emitted signals in PopupMenu --- scene/gui/popup_menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 1a6adca1217..cf73729c0a1 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -1715,12 +1715,12 @@ void PopupMenu::activate_item(int p_item) { need_hide = false; } + emit_signal(SNAME("id_pressed"), id); + emit_signal(SNAME("index_pressed"), p_item); + if (need_hide) { hide(); } - - emit_signal(SNAME("id_pressed"), id); - emit_signal(SNAME("index_pressed"), p_item); } void PopupMenu::remove_item(int p_idx) {