void ListBox_setFocusedItem(entity me, int item)
{
float focusedItem_save = me.focusedItem;
- me.focusedItem = (item < me.nItems) ? item : -1;
+ me.focusedItem = (item >= 0 && item < me.nItems) ? item : -1;
if (focusedItem_save != me.focusedItem)
{
me.focusedItemChangeNotify(me);
METHOD(XonoticRegisteredSettingsList, focusedItemChangeNotify, void(entity this))
{
- if (this.focusedItem == -1 || !this.source)
+ if (this.focusedItem < 0 || !this.source)
{
clearTooltip(this);
return;
ATTRIB(XonoticRegisteredSettingsList, source, DataSource);
ATTRIB(XonoticRegisteredSettingsList, onChange, void(entity, entity));
ATTRIB(XonoticRegisteredSettingsList, onChangeEntity, entity);
- METHOD(XonoticRegisteredSettingsList, focusedItemChangeNotify, void(entity));
METHOD(XonoticRegisteredSettingsList, drawListBoxItem, void(entity this, int i, vector absSize, bool isSelected, bool isFocused));
METHOD(XonoticRegisteredSettingsList, focusedItemChangeNotify, void(entity this));
METHOD(XonoticRegisteredSettingsList, refilter, void(entity this));