mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
- added some range checks to PgUp(PgDown code for option menus.
This commit is contained in:
parent
c4377b7039
commit
0dabaca7df
1 changed files with 16 additions and 2 deletions
|
@ -274,7 +274,14 @@ bool DOptionMenu::MenuEvent (int mkey, bool fromcontroller)
|
||||||
mDesc->mSelectedItem = mDesc->mScrollTop + mDesc->mScrollPos + 1;
|
mDesc->mSelectedItem = mDesc->mScrollTop + mDesc->mScrollPos + 1;
|
||||||
while (!mDesc->mItems[mDesc->mSelectedItem]->Selectable())
|
while (!mDesc->mItems[mDesc->mSelectedItem]->Selectable())
|
||||||
{
|
{
|
||||||
++mDesc->mSelectedItem;
|
if (++mDesc->mSelectedItem >= (int)mDesc->mItems.Size())
|
||||||
|
{
|
||||||
|
mDesc->mSelectedItem = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mDesc->mScrollPos > mDesc->mSelectedItem)
|
||||||
|
{
|
||||||
|
mDesc->mScrollPos = mDesc->mSelectedItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -294,7 +301,14 @@ bool DOptionMenu::MenuEvent (int mkey, bool fromcontroller)
|
||||||
mDesc->mSelectedItem = mDesc->mScrollTop + mDesc->mScrollPos;
|
mDesc->mSelectedItem = mDesc->mScrollTop + mDesc->mScrollPos;
|
||||||
while (!mDesc->mItems[mDesc->mSelectedItem]->Selectable())
|
while (!mDesc->mItems[mDesc->mSelectedItem]->Selectable())
|
||||||
{
|
{
|
||||||
++mDesc->mSelectedItem;
|
if (++mDesc->mSelectedItem >= (int)mDesc->mItems.Size())
|
||||||
|
{
|
||||||
|
mDesc->mSelectedItem = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mDesc->mScrollPos > mDesc->mSelectedItem)
|
||||||
|
{
|
||||||
|
mDesc->mScrollPos = mDesc->mSelectedItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue