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,16 +281,24 @@ void RaceSetupScreen::init()
|
||||
break;
|
||||
}
|
||||
|
||||
if (PlayerManager::getCurrentPlayer()->isLocked("difficulty_best"))
|
||||
{
|
||||
RibbonWidget* w = getWidget<RibbonWidget>("difficulty");
|
||||
assert(w != NULL);
|
||||
|
||||
int index = w->findItemNamed("best");
|
||||
Widget* hardestWidget = &w->getChildren()[index];
|
||||
|
||||
if (PlayerManager::getCurrentPlayer()->isLocked("difficulty_best"))
|
||||
{
|
||||
hardestWidget->setBadge(LOCKED_BADGE);
|
||||
hardestWidget->setActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
hardestWidget->unsetBadge(LOCKED_BADGE);
|
||||
hardestWidget->setActive(true);
|
||||
}
|
||||
}
|
||||
} // init
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user