Bugfix for bugfix: when the enter key was used to select a widget,
the widget the mouse cursor was on was selected, not the currently highlighted widget (i.e. you couldn't select with arrow up/down anymore). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2598 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
9838b490f3
commit
65f7a8db93
@ -80,10 +80,6 @@ BaseGUI::handle(GameAction action, int value)
|
||||
widget_manager->decreaseScrollSpeed(true);
|
||||
break;
|
||||
case GA_ENTER:
|
||||
int x, y;
|
||||
SDL_GetMouseState( &x, &y );
|
||||
y = SDL_GetVideoSurface()->h - y;
|
||||
inputPointer( x, y );
|
||||
select();
|
||||
break;
|
||||
case GA_LEAVE:
|
||||
|
@ -401,8 +401,19 @@ void SDLDriver::input(InputType type, int id0, int id1, int id2, int value)
|
||||
}
|
||||
else if (ga != GA_NULL)
|
||||
{
|
||||
if(type==IT_MOUSEBUTTON)
|
||||
{
|
||||
// If a mouse button is pressed, make sure that the
|
||||
// widget the mouse is on is actually highlighted (since
|
||||
// the highlighted widget is selected!)
|
||||
int x, y;
|
||||
SDL_GetMouseState( &x, &y );
|
||||
y = SDL_GetVideoSurface()->h - y;
|
||||
menu->inputPointer( x, y );
|
||||
}
|
||||
|
||||
// Lets the currently active menu handle the GameAction.
|
||||
menu->handle(ga, value);
|
||||
menu->handle(ga, value);
|
||||
}
|
||||
} // menu!=NULL
|
||||
} // input
|
||||
|
Loading…
Reference in New Issue
Block a user