Stopped hard coding 3 as the number of arenas in 3 strikes menu. See previous commit for more.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9140 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
computerfreak97
2011-07-03 01:48:47 +00:00
parent 641c9633e9
commit 487a45eb17

View File

@@ -55,7 +55,17 @@ void ArenasScreen::loadedFromFile()
tabs->clearAllChildren();
DynamicRibbonWidget* w = this->getWidget<DynamicRibbonWidget>("tracks");
w->setItemCountHint(3);
int num_of_arenas=0;
for (int n=0; n<track_manager->getNumberOfTracks(); n++) //iterate through tracks to find how many are arenas
{
Track* temp = track_manager->getTrack(n);
if (temp->isArena()){
num_of_arenas++;
}
}
w->setItemCountHint(num_of_arenas); //set the item hint to that number to prevent weird formatting
const std::vector<std::string>& groups = track_manager->getAllArenaGroups();
const int group_amount = groups.size();