mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-21 03:11:57 +00:00
Fix spin controls getting applied multiple times.
When a spin control is at min or max value, pressing the arrow key to switch to the next nonexiting value executes the callback function. That is confusing. Example: 'freelook' is set to 'no'. The user presses left arrow, switching to the nonexiting value before no. The code handles the case and resets the current value drom -1 to 0. Nevertheless the callback is executed and switches 'freelook' from no to yes... Fix that by not executing the callback when we're at min or max value. Closes #884.
This commit is contained in:
parent
98a4522b1b
commit
a44de1596d
1 changed files with 2 additions and 0 deletions
|
@ -729,10 +729,12 @@ SpinControl_DoSlide(menulist_s *s, int dir)
|
|||
if (s->curvalue < 0)
|
||||
{
|
||||
s->curvalue = 0;
|
||||
return;
|
||||
}
|
||||
else if (s->itemnames[s->curvalue] == 0)
|
||||
{
|
||||
s->curvalue--;
|
||||
return;
|
||||
}
|
||||
|
||||
if (s->generic.callback)
|
||||
|
|
Loading…
Reference in a new issue