mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Return -1 from get_selected_id() when not selected
Partial cherry pick from 3b146c5eaa
This commit is contained in:
@@ -258,12 +258,9 @@ int OptionButton::get_selected() const {
|
||||
}
|
||||
|
||||
int OptionButton::get_selected_id() const {
|
||||
int idx = get_selected();
|
||||
if (idx < 0) {
|
||||
return 0;
|
||||
}
|
||||
return get_item_id(current);
|
||||
}
|
||||
|
||||
Variant OptionButton::get_selected_metadata() const {
|
||||
int idx = get_selected();
|
||||
if (idx < 0) {
|
||||
|
||||
Reference in New Issue
Block a user