Make code a bit more robust at detecting problems (not fixed yet though)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9904 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
29453de9fa
commit
480ab1c436
@ -628,9 +628,11 @@ EventPropagation EventHandler::onWidgetActivated(GUIEngine::Widget* w, const int
|
||||
}
|
||||
else
|
||||
{
|
||||
if (w->transmitEvent(w, w->m_properties[PROP_ID], playerID) == EVENT_LET)
|
||||
std::string id = w->m_properties[PROP_ID];
|
||||
if (w->transmitEvent(w, id, playerID) == EVENT_LET)
|
||||
{
|
||||
sendEventToUser(w, w->m_properties[PROP_ID], playerID);
|
||||
assert(w->ok());
|
||||
sendEventToUser(w, id, playerID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,9 @@ void CheckBoxWidget::add()
|
||||
// -----------------------------------------------------------------------------
|
||||
EventPropagation CheckBoxWidget::transmitEvent(Widget* w, std::string& originator, const int playerID)
|
||||
{
|
||||
assert(m_magic_number == 0xCAFEC001);
|
||||
|
||||
|
||||
/* toggle */
|
||||
m_state = !m_state;
|
||||
|
||||
|
@ -630,6 +630,9 @@ EventPropagation DynamicRibbonWidget::leftPressed(const int playerID)
|
||||
// -----------------------------------------------------------------------------
|
||||
EventPropagation DynamicRibbonWidget::transmitEvent(Widget* w, std::string& originator, const int playerID)
|
||||
{
|
||||
assert(m_magic_number == 0xCAFEC001);
|
||||
|
||||
|
||||
if (m_deactivated) return EVENT_LET;
|
||||
|
||||
if (originator=="left")
|
||||
|
@ -361,6 +361,9 @@ void ListWidget::markItemBlue(const int id, bool blue)
|
||||
|
||||
EventPropagation ListWidget::transmitEvent(Widget* w, std::string& originator, const int playerID)
|
||||
{
|
||||
assert(m_magic_number == 0xCAFEC001);
|
||||
|
||||
|
||||
if (originator.find(m_properties[PROP_ID] + "_column_") != std::string::npos)
|
||||
{
|
||||
int col = originator[ (m_properties[PROP_ID] + "_column_").size() ] - '0';
|
||||
|
@ -584,6 +584,9 @@ void RibbonWidget::updateSelection()
|
||||
// -----------------------------------------------------------------------------
|
||||
EventPropagation RibbonWidget::transmitEvent(Widget* w, std::string& originator, const int playerID)
|
||||
{
|
||||
assert(m_magic_number == 0xCAFEC001);
|
||||
|
||||
|
||||
if (!m_deactivated)
|
||||
{
|
||||
const int subbuttons_amount = m_children.size();
|
||||
|
@ -270,6 +270,8 @@ EventPropagation SpinnerWidget::leftPressed(const int playerID)
|
||||
|
||||
EventPropagation SpinnerWidget::transmitEvent(Widget* w, std::string& originator, const int playerID)
|
||||
{
|
||||
assert(m_magic_number == 0xCAFEC001);
|
||||
|
||||
// if widget is deactivated, do nothing
|
||||
if (m_deactivated) return EVENT_BLOCK;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user