Lua: fix assert when assigning a selected index to a menu button or toggle button

This commit is contained in:
Celtic Minstrel 2022-06-14 20:14:01 -04:00 committed by GitHub
parent b823dc3c6d
commit 557738dd49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -240,7 +240,7 @@ WIDGET_SETTER("selected_index", int, gui2::selectable_item)
if(value > int(w.num_states())) {
throw std::invalid_argument("invalid index");
}
w.set_value(value + 1);
w.set_value(value - 1);
}
WIDGET_GETTER("value_compat,selected", bool, gui2::selectable_item)