From 7d23dd95f6d516e92f36427cbae3cf39049cc39c Mon Sep 17 00:00:00 2001 From: auria Date: Sat, 1 May 2010 23:52:19 +0000 Subject: [PATCH] Make sure the 'standard' group is listed before the 'add-ons' group, and is selected by default. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5339 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/states_screens/arenas_screen.cpp | 21 ++++++++++++++++++--- src/states_screens/kart_selection.cpp | 20 +++++++++++++++++--- src/states_screens/tracks_screen.cpp | 21 ++++++++++++++++++--- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/states_screens/arenas_screen.cpp b/src/states_screens/arenas_screen.cpp index 273c5cf7d..838d2a60c 100644 --- a/src/states_screens/arenas_screen.cpp +++ b/src/states_screens/arenas_screen.cpp @@ -56,12 +56,27 @@ void ArenasScreen::loadedFromFile() //FIXME: this returns groups for arenas but tracks too. this means that some of them // may contain only tracks, no arenas, and thus add an empty tab here... const std::vector& groups = track_manager->getAllGroups(); - const int group_amount = groups.size(); + + // add standard group first for (int n=0; naddTextChild( stringw(groups[n].c_str()).c_str(), groups[n]); + if (groups[n] == DEFAULT_GROUP_NAME) + { + //FIXME: group name not translated + tabs->addTextChild( stringw(groups[n].c_str()).c_str(), groups[n]); + break; + } + } + + // add others after + for (int n=0; naddTextChild( stringw(groups[n].c_str()).c_str(), groups[n]); + } } if (group_amount > 1) diff --git a/src/states_screens/kart_selection.cpp b/src/states_screens/kart_selection.cpp index b524fed1c..863360e04 100644 --- a/src/states_screens/kart_selection.cpp +++ b/src/states_screens/kart_selection.cpp @@ -726,13 +726,27 @@ void KartSelectionScreen::loadedFromFile() tabs->clearAllChildren(); const std::vector& groups = kart_properties_manager->getAllGroups(); - const int group_amount = groups.size(); + // add default group first for (int n=0; naddTextChild( stringw(groups[n].c_str()).c_str() , groups[n]); + if (groups[n] == DEFAULT_GROUP_NAME) + { + //FIXME: group name not translated + tabs->addTextChild( stringw(groups[n].c_str()).c_str() , groups[n]); + break; + } + } + + // add others after + for (int n=0; naddTextChild( stringw(groups[n].c_str()).c_str() , groups[n]); + } } if (group_amount > 1) diff --git a/src/states_screens/tracks_screen.cpp b/src/states_screens/tracks_screen.cpp index b95586411..ceb13afa9 100644 --- a/src/states_screens/tracks_screen.cpp +++ b/src/states_screens/tracks_screen.cpp @@ -56,12 +56,27 @@ void TracksScreen::loadedFromFile() tabs->clearAllChildren(); const std::vector& groups = track_manager->getAllGroups(); - const int group_amount = groups.size(); + + // add standard group first for (int n=0; naddTextChild( stringw(groups[n].c_str()).c_str(), groups[n] ); + if (groups[n] == DEFAULT_GROUP_NAME) + { + // FIXME: group name is not translated + tabs->addTextChild( stringw(groups[n].c_str()).c_str(), groups[n] ); + break; + } + } + + // add others after + for (int n=0; naddTextChild( stringw(groups[n].c_str()).c_str(), groups[n] ); + } } if (group_amount > 1)