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:
auria 2009-09-03 01:06:32 +00:00
parent 86743991ae
commit a18c750e1b
3 changed files with 13 additions and 7 deletions

View File

@ -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)
{

View File

@ -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;

View File

@ -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;