diff --git a/src/race/grand_prix_data.cpp b/src/race/grand_prix_data.cpp index 2c0f01ac6..f7fac4613 100644 --- a/src/race/grand_prix_data.cpp +++ b/src/race/grand_prix_data.cpp @@ -158,14 +158,20 @@ void GrandPrixData::changeReverse(const GrandPrixData::GPReverseType use_reverse for (unsigned int i = 0; i < m_tracks.size(); i++) { if (use_reverse == GP_NO_REVERSE) + { m_reversed[i] = false; + } + else if (use_reverse == GP_ALL_REVERSE) // all reversed + { + m_reversed[i] = track_manager->getTrack(m_tracks[i])->reverseAvailable(); + } else if (use_reverse == GP_RANDOM_REVERSE) + { if (track_manager->getTrack(m_tracks[i])->reverseAvailable()) m_reversed[i] = (rand() % 2 != 0); else m_reversed[i] = false; - else // all reversed - m_reversed[i] = track_manager->getTrack(m_tracks[i])->reverseAvailable(); + } } // for i < m_tracks.size() } // changeReverse diff --git a/src/race/grand_prix_data.hpp b/src/race/grand_prix_data.hpp index 47ceb268e..81f9d7726 100644 --- a/src/race/grand_prix_data.hpp +++ b/src/race/grand_prix_data.hpp @@ -90,7 +90,8 @@ public: { GP_NO_REVERSE = 0, GP_ALL_REVERSE = 1, - GP_RANDOM_REVERSE = 2 + GP_RANDOM_REVERSE = 2, + GP_DEFAULT_REVERSE = 3 }; // GPReverseType public: diff --git a/src/states_screens/gp_info_screen.cpp b/src/states_screens/gp_info_screen.cpp index 967d7f1e5..abef60921 100644 --- a/src/states_screens/gp_info_screen.cpp +++ b/src/states_screens/gp_info_screen.cpp @@ -71,8 +71,9 @@ void GPInfoScreen::loadedFromFile() // (since the groups can change if addons are added/deleted). m_group_spinner = getWidget("group-spinner"); m_reverse_spinner = getWidget("reverse-spinner"); - m_reverse_spinner->addLabel(_("No")); - m_reverse_spinner->addLabel(_("Yes")); + m_reverse_spinner->addLabel(_("Default")); + m_reverse_spinner->addLabel(_("None")); + m_reverse_spinner->addLabel(_("All")); m_reverse_spinner->addLabel(_("Random")); m_reverse_spinner->setValue(0); @@ -108,13 +109,14 @@ GrandPrixData::GPReverseType GPInfoScreen::getReverse() const { switch (m_reverse_spinner->getValue()) { - case 0: return GrandPrixData::GP_NO_REVERSE; break; - case 1: return GrandPrixData::GP_ALL_REVERSE; break; - case 2: return GrandPrixData::GP_RANDOM_REVERSE; break; - default: assert(false); + case 0: return GrandPrixData::GP_DEFAULT_REVERSE; break; + case 1: return GrandPrixData::GP_NO_REVERSE; break; + case 2: return GrandPrixData::GP_ALL_REVERSE; break; + case 3: return GrandPrixData::GP_RANDOM_REVERSE; break; + default: assert(false); } // switch // Avoid compiler warning - return GrandPrixData::GP_NO_REVERSE; + return GrandPrixData::GP_DEFAULT_REVERSE; } // getReverse // ---------------------------------------------------------------------------- void GPInfoScreen::beforeAddingWidget() @@ -296,6 +298,7 @@ void GPInfoScreen::eventCallback(Widget *, const std::string &name, // Normal GP: start/continue a saved GP int n = getWidget("ai-spinner")->getValue(); + m_gp.changeReverse(getReverse()); race_manager->setNumKarts(race_manager->getNumLocalPlayers() + n); race_manager->startGP(m_gp, false, (name == "continue")); } @@ -326,10 +329,6 @@ void GPInfoScreen::eventCallback(Widget *, const std::string &name, m_gp.changeTrackNumber(m_num_tracks_spinner->getValue(), m_group_name); addTracks(); } - else if (name=="reverse-spinner") - { - m_gp.changeReverse(getReverse()); - } else if(name=="back") { StateManager::get()->escapePressed();