Merge pull request #2317 from MiroslavR/fix-supertux-btn
Fix SuperTux difficulty button state not updating correctly
This commit is contained in:
commit
5d9805b8ab
@ -281,15 +281,23 @@ void RaceSetupScreen::init()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PlayerManager::getCurrentPlayer()->isLocked("difficulty_best"))
|
|
||||||
{
|
{
|
||||||
RibbonWidget* w = getWidget<RibbonWidget>("difficulty");
|
RibbonWidget* w = getWidget<RibbonWidget>("difficulty");
|
||||||
assert(w != NULL);
|
assert(w != NULL);
|
||||||
|
|
||||||
int index = w->findItemNamed("best");
|
int index = w->findItemNamed("best");
|
||||||
Widget* hardestWidget = &w->getChildren()[index];
|
Widget* hardestWidget = &w->getChildren()[index];
|
||||||
hardestWidget->setBadge(LOCKED_BADGE);
|
|
||||||
hardestWidget->setActive(false);
|
if (PlayerManager::getCurrentPlayer()->isLocked("difficulty_best"))
|
||||||
|
{
|
||||||
|
hardestWidget->setBadge(LOCKED_BADGE);
|
||||||
|
hardestWidget->setActive(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hardestWidget->unsetBadge(LOCKED_BADGE);
|
||||||
|
hardestWidget->setActive(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user