diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-07 09:04:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 09:04:36 +0200 |
commit | 112884deee0508f953a1d982fc6503a0c69e0545 (patch) | |
tree | 638e1d8b5c219b6a1ecd24c40040a5da816dbb2c /scene/gui/popup_menu.cpp | |
parent | 1ff97485dfc5bc74ea7a81038a57693cd77593eb (diff) | |
parent | 35f30086de7069df2854949948ae26642c5a1452 (diff) |
Merge pull request #38520 from nobuyukinyuu/popupmenu-current-index
PopupMenu.get_current_index() bound to ClassDB
Diffstat (limited to 'scene/gui/popup_menu.cpp')
-rw-r--r-- | scene/gui/popup_menu.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index a247863298..9c48801ec1 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -1079,6 +1079,11 @@ bool PopupMenu::is_item_shortcut_disabled(int p_idx) const { return items[p_idx].shortcut_is_disabled; } +int PopupMenu::get_current_index() const { + + return mouse_over; +} + int PopupMenu::get_item_count() const { return items.size(); @@ -1457,6 +1462,7 @@ void PopupMenu::_bind_methods() { ClassDB::bind_method(D_METHOD("get_item_tooltip", "idx"), &PopupMenu::get_item_tooltip); ClassDB::bind_method(D_METHOD("get_item_shortcut", "idx"), &PopupMenu::get_item_shortcut); + ClassDB::bind_method(D_METHOD("get_current_index"), &PopupMenu::get_current_index); ClassDB::bind_method(D_METHOD("get_item_count"), &PopupMenu::get_item_count); ClassDB::bind_method(D_METHOD("remove_item", "idx"), &PopupMenu::remove_item); |