diff options
| author | Juan Linietsky | 2015-12-13 01:08:36 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-12-13 01:08:36 -0300 |
| commit | 709de124c17988ab05f606c09d0f6414fbbd2ca9 (patch) | |
| tree | 4b529eac4c976340f68e42941693969c1ed6af3c /scene/gui/option_button.cpp | |
| parent | 11eaf019b35b185ff0631551629e63edd661ae50 (diff) | |
| download | godot-709de124c17988ab05f606c09d0f6414fbbd2ca9.tar.gz godot-709de124c17988ab05f606c09d0f6414fbbd2ca9.tar.zst godot-709de124c17988ab05f606c09d0f6414fbbd2ca9.zip | |
Diffstat (limited to 'scene/gui/option_button.cpp')
| -rw-r--r-- | scene/gui/option_button.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index ff94a37be..3cc5acc1a 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -77,9 +77,14 @@ void OptionButton::_selected(int p_which) { } } - ERR_FAIL_COND(selid==-1); + if (selid==-1 && p_which>=0 && p_which<popup->get_item_count()) { + _select(p_which,true); + } else { - _select(selid,true); + ERR_FAIL_COND(selid==-1); + + _select(selid,true); + } } |
