Fixed focus navigation bug
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8682 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
f83cbe28bb
commit
da6742d7b1
@ -373,14 +373,21 @@ void EventHandler::navigateUp(const int playerID, Input::InputType type, const b
|
||||
{
|
||||
if (NAVIGATION_DEBUG) std::cout << "Navigating up to " << closest->getID() << std::endl;
|
||||
Widget* closestWidget = GUIEngine::getWidget( closest->getID() );
|
||||
|
||||
if (playerID != PLAYER_ID_GAME_MASTER && !closestWidget->m_supports_multiplayer) return;
|
||||
|
||||
//FIXME: something's wrong here, I use 'closestWidget', THEN verify it's not NULL xD
|
||||
// if a dialog is shown, restrict to items in the dialog
|
||||
if (ModalDialog::isADialogActive() && !ModalDialog::getCurrent()->isMyChild(closestWidget))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// when focusing a list by going up, select the last item of the list
|
||||
assert (closestWidget != NULL);
|
||||
|
||||
closestWidget->setFocusForPlayer(playerID);
|
||||
|
||||
// when focusing a list by going up, select the last item of the list
|
||||
if (closestWidget != NULL && closestWidget->m_type == WTYPE_LIST)
|
||||
if (closestWidget->m_type == WTYPE_LIST)
|
||||
{
|
||||
IGUIListBox* list = (IGUIListBox*)(closestWidget->m_element);
|
||||
assert(list != NULL);
|
||||
@ -389,6 +396,7 @@ void EventHandler::navigateUp(const int playerID, Input::InputType type, const b
|
||||
return;
|
||||
}
|
||||
found = true;
|
||||
|
||||
}
|
||||
} // end for
|
||||
|
||||
@ -487,9 +495,16 @@ void EventHandler::navigateDown(const int playerID, Input::InputType type, const
|
||||
|
||||
if (closest != NULL && Widget::isFocusableId(closest->getID()))
|
||||
{
|
||||
|
||||
Widget* closestWidget = GUIEngine::getWidget( closest->getID() );
|
||||
if (playerID != PLAYER_ID_GAME_MASTER && !closestWidget->m_supports_multiplayer) return;
|
||||
|
||||
// if a dialog is shown, restrict to items in the dialog
|
||||
if (ModalDialog::isADialogActive() && !ModalDialog::getCurrent()->isMyChild(closestWidget))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NAVIGATION_DEBUG)
|
||||
{
|
||||
std::cout << "Navigating down to " << closestWidget->getID() << "\n";
|
||||
|
Loading…
Reference in New Issue
Block a user