From 1e4ede71ff44eb184a515963baf878d9e85a5c09 Mon Sep 17 00:00:00 2001 From: auria Date: Sun, 6 Dec 2009 15:48:04 +0000 Subject: [PATCH] Fixed focus orb problem when master player uses gamepad git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4252 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- data/gui/License.txt | 1 + src/guiengine/widgets/ribbon_widget.cpp | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/data/gui/License.txt b/data/gui/License.txt index 9d6496e49..6127f7c29 100644 --- a/data/gui/License.txt +++ b/data/gui/License.txt @@ -13,6 +13,7 @@ difficulty_*.png icons, released under Creative-Commons BY-SA 3, By Conso (Const Okolaks font by Gluk, released under Open Font License +title_font, by Marianne Gagnon (Auria), released under CC-BY-SA 3+ ==== diff --git a/src/guiengine/widgets/ribbon_widget.cpp b/src/guiengine/widgets/ribbon_widget.cpp index 80ad0c7b7..89f3246fe 100644 --- a/src/guiengine/widgets/ribbon_widget.cpp +++ b/src/guiengine/widgets/ribbon_widget.cpp @@ -240,9 +240,10 @@ EventPropagation RibbonWidget::rightPressed(const int playerID) if (m_ribbon_type == RIBBON_COMBO) { const int mousePlayerID = input_manager->getPlayerKeyboardID(); - if (playerID == mousePlayerID) + const int MASTER_PLAYER = 0; // FIXME: unclean + if (playerID == mousePlayerID || playerID == MASTER_PLAYER) { - m_mouse_focus = m_children.get(m_selection[mousePlayerID]); + m_mouse_focus = m_children.get(m_selection[playerID]); } } @@ -274,9 +275,10 @@ EventPropagation RibbonWidget::leftPressed(const int playerID) if (m_ribbon_type == RIBBON_COMBO) { const int mousePlayerID = input_manager->getPlayerKeyboardID(); - if (playerID == mousePlayerID) + const int MASTER_PLAYER = 0; // FIXME: unclean + if (playerID == mousePlayerID || playerID == MASTER_PLAYER) { - m_mouse_focus = m_children.get(m_selection[mousePlayerID]); + m_mouse_focus = m_children.get(m_selection[playerID]); } } @@ -300,7 +302,8 @@ EventPropagation RibbonWidget::focused(const int playerID) if (m_ribbon_type == RIBBON_COMBO) { const int mousePlayerID = input_manager->getPlayerKeyboardID(); - if (m_mouse_focus == NULL && m_selection[playerID] != -1 && playerID == mousePlayerID) + const int MASTER_PLAYER = 0; // FIXME: unclean + if (m_mouse_focus == NULL && m_selection[playerID] != -1 && (playerID == mousePlayerID || playerID == MASTER_PLAYER)) { m_mouse_focus = m_children.get(m_selection[playerID]); }