diff --git a/src/states_screens/kart_selection.cpp b/src/states_screens/kart_selection.cpp index 1018a2a6f..9acfb2f2b 100644 --- a/src/states_screens/kart_selection.cpp +++ b/src/states_screens/kart_selection.cpp @@ -1071,6 +1071,15 @@ void KartSelectionScreen::eventCallback(Widget* widget, const std::string& name, } else if (name == "karts") { + DynamicRibbonWidget* w = this->getWidget("karts"); + assert(w != NULL); + const std::string selection = w->getSelectionIDString(playerID); + if (selection == "locked") + { + unlock_manager->playLockSound(); + return; + } + // make sure no other player selected the same identity or kart const int amount = m_kart_widgets.size(); for (int n=0; ngetNumberOfKarts(); - for(int n=0; ngetKartById(n); - std::string icon_path = "/karts/" + prop->getIdent() + "/" + prop->getIconFile(); - w->addItem(prop->getName().c_str(), prop->getIdent().c_str(), icon_path.c_str()); + + if (unlock_manager->isLocked(prop->getIdent())) + { + w->addItem( _("Locked : solve active challenges to gain access to more!"), + "locked", icon_path, LOCKED_BADGE); + } + else + { + w->addItem(prop->getName().c_str(), prop->getIdent().c_str(), icon_path.c_str()); + } } } //FIXME: what does this do there??? @@ -1416,12 +1434,21 @@ void KartSelectionScreen::setKartsFromCurrentGroup() std::vector group = kart_properties_manager->getKartsInGroup(selected_kart_group); const int kart_amount = group.size(); + for (int n=0; ngetKartById(group[n]); - std::string icon_path = "/karts/" + prop->getIdent() + "/" + prop->getIconFile(); - w->addItem(prop->getName().c_str(), prop->getIdent().c_str(), icon_path.c_str()); + + if (unlock_manager->isLocked(prop->getIdent())) + { + w->addItem( _("Locked : solve active challenges to gain access to more!"), + "locked", icon_path, LOCKED_BADGE); + } + else + { + w->addItem(prop->getName().c_str(), prop->getIdent().c_str(), icon_path.c_str()); + } } } // add random