Fixed a few bugs
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3986 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
86743991ae
commit
a18c750e1b
@ -260,7 +260,10 @@ void RibbonWidget::focused(const int playerID)
|
||||
|
||||
if (m_children.size() < 1) return; // empty ribbon
|
||||
|
||||
if (m_focus == NULL) m_focus = m_children.get(m_selection[playerID]);
|
||||
if (m_focus == NULL && m_selection[playerID] != -1)
|
||||
{
|
||||
m_focus = m_children.get(m_selection[playerID]);
|
||||
}
|
||||
|
||||
if (m_event_handler != NULL)
|
||||
{
|
||||
|
@ -179,20 +179,22 @@ void SpinnerWidget::move(const int x, const int y, const int w, const int h)
|
||||
// -----------------------------------------------------------------------------
|
||||
bool SpinnerWidget::rightPressed(const int playerID)
|
||||
{
|
||||
if(m_value+1 <= m_max) setValue(m_value+1);
|
||||
std::cout << "Right pressed\n";
|
||||
if (m_value+1 <= m_max) setValue(m_value+1);
|
||||
return true;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
bool SpinnerWidget::leftPressed(const int playerID)
|
||||
{
|
||||
if(m_value-1 >= m_min) setValue(m_value-1);
|
||||
std::cout << "Left pressed\n";
|
||||
if (m_value-1 >= m_min) setValue(m_value-1);
|
||||
return true;
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
bool SpinnerWidget::transmitEvent(Widget* w, std::string& originator, const int playerID)
|
||||
{
|
||||
if(originator == "left") leftPressed(playerID);
|
||||
else if(originator == "right") rightPressed(playerID);
|
||||
if (originator == "left") leftPressed(playerID);
|
||||
else if (originator == "right") rightPressed(playerID);
|
||||
|
||||
GUIEngine::getGUIEnv()->setFocus(m_element);
|
||||
return true;
|
||||
|
@ -319,7 +319,8 @@ namespace KartSelectionScreen
|
||||
kart_name_h);
|
||||
|
||||
}
|
||||
|
||||
// disabled but some events were disptached twice (e.g. spinner clicks)
|
||||
#if 0
|
||||
virtual bool transmitEvent(Widget* w, std::string& originator, const int playerID)
|
||||
{
|
||||
std::cout << "= kart selection :: transmitEvent " << originator << "=\n";
|
||||
@ -352,7 +353,7 @@ namespace KartSelectionScreen
|
||||
|
||||
return true; // continue propagating the event
|
||||
}
|
||||
|
||||
#endif
|
||||
void setSize(const int x, const int y, const int w, const int h)
|
||||
{
|
||||
this->x = x;
|
||||
|
Loading…
x
Reference in New Issue
Block a user