diff --git a/data/gui/racesetup.stkgui b/data/gui/racesetup.stkgui index fe940123f..83a619741 100644 --- a/data/gui/racesetup.stkgui +++ b/data/gui/racesetup.stkgui @@ -6,18 +6,6 @@ -
- - - - - -
- - - diff --git a/sources.cmake b/sources.cmake index d4f28ae4d..ba4868d71 100644 --- a/sources.cmake +++ b/sources.cmake @@ -1,5 +1,5 @@ # Modify this file to change the last-modified date when you add/remove a file. -# This will then trigger a new cmake run automatically. +# This will then trigger a new cmake run automatically. file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp") file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp") file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*") diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index 45a038b11..180eab769 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -45,6 +45,7 @@ #include "states_screens/online_screen.hpp" #include "states_screens/options_screen_video.hpp" #include "states_screens/state_manager.hpp" +#include "states_screens/track_info_screen.hpp" #include "states_screens/user_screen.hpp" #if DEBUG_MENU_ITEM #include "states_screens/feature_unlocked.hpp" @@ -332,10 +333,18 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name, #endif if (selection == "new") { +#undef XX +#ifdef XX + Track *track = track_manager->getTrack("olivermath"); + TrackInfoScreen *tis = TrackInfoScreen::getInstance(); + tis->setTrack(track); + StateManager::get()->pushScreen(tis); +#else KartSelectionScreen* s = OfflineKartSelectionScreen::getInstance(); //FIXME : that was for tests s->setMultiplayer(false); s->setFromOverworld(false); StateManager::get()->pushScreen( s ); +#endif } else if (selection == "multiplayer") { diff --git a/src/states_screens/race_setup_screen.cpp b/src/states_screens/race_setup_screen.cpp index 9e4a415ae..1553c6d42 100644 --- a/src/states_screens/race_setup_screen.cpp +++ b/src/states_screens/race_setup_screen.cpp @@ -142,12 +142,6 @@ void RaceSetupScreen::eventCallback(Widget* widget, const std::string& name, con unlock_manager->playLockSound(); } } - else if (name == "aikartamount") - { - SpinnerWidget* w = dynamic_cast(widget); - race_manager->setNumKarts( race_manager->getNumLocalPlayers() + w->getValue() ); - UserConfigParams::m_num_karts = race_manager->getNumLocalPlayers() + w->getValue(); - } else if (name == "back") { StateManager::get()->escapePressed(); @@ -209,16 +203,6 @@ void RaceSetupScreen::onGameModeChanged() RaceManager::MinorRaceModeType gamemode = RaceManager::getModeIDFromInternalName(gamemode_str); - // deactivate the AI karts count widget for modes for which we have no AI - SpinnerWidget* kartamount = getWidget("aikartamount"); - if (!RaceManager::hasAI(gamemode)) - { - kartamount->setDeactivated(); - } - else - { - kartamount->setActivated(); - } } // onGameModeChanged // ----------------------------------------------------------------------------- @@ -240,17 +224,6 @@ void RaceSetupScreen::init() w->setSelection( UserConfigParams::m_difficulty, PLAYER_ID_GAME_MASTER ); } - SpinnerWidget* kartamount = getWidget("aikartamount"); - kartamount->setActivated(); - - // Avoid negative numbers (which can happen if e.g. the number of karts - // in a previous race was lower than the number of players now. - int num_ai = UserConfigParams::m_num_karts-race_manager->getNumLocalPlayers(); - if(num_ai<0) num_ai = 0; - kartamount->setValue(num_ai); - kartamount->setMax(stk_config->m_max_karts - race_manager->getNumLocalPlayers() ); - race_manager->setNumKarts(num_ai + race_manager->getNumLocalPlayers()); - DynamicRibbonWidget* w2 = getWidget("gamemode"); assert( w2 != NULL ); w2->clearItems(); diff --git a/src/states_screens/tracks_screen.cpp b/src/states_screens/tracks_screen.cpp index 94f715553..8832a6902 100644 --- a/src/states_screens/tracks_screen.cpp +++ b/src/states_screens/tracks_screen.cpp @@ -28,9 +28,9 @@ #include "race/grand_prix_data.hpp" #include "race/grand_prix_manager.hpp" #include "states_screens/state_manager.hpp" +#include "states_screens/track_info_screen.hpp" #include "states_screens/dialogs/gp_info_dialog.hpp" #include "states_screens/dialogs/random_gp_dialog.hpp" -#include "states_screens/dialogs/track_info_dialog.hpp" #include "tracks/track.hpp" #include "tracks/track_manager.hpp" #include "utils/translation.hpp" @@ -81,14 +81,8 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name, if (clicked_track) { - ITexture* screenshot = - irr_driver->getTexture(clicked_track->getScreenshotFile(), - "While loading screenshot for track '%s':", - clicked_track->getFilename() ); - - new TrackInfoDialog(selection, clicked_track->getIdent(), - translations->fribidize(clicked_track->getName()), - screenshot, 0.8f, 0.7f); + TrackInfoScreen::getInstance()->setTrack(clicked_track); + StateManager::get()->pushScreen(TrackInfoScreen::getInstance()); } // if clicked_track } // selection=="random_track" @@ -104,14 +98,8 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name, Track* clicked_track = track_manager->getTrack(selection); if (clicked_track) { - ITexture* screenshot = - irr_driver->getTexture(clicked_track->getScreenshotFile(), - "While loading screenshot for track '%s'", - clicked_track->getFilename()); - - new TrackInfoDialog(selection, clicked_track->getIdent(), - translations->fribidize(clicked_track->getName()), - screenshot, 0.8f, 0.7f); + TrackInfoScreen::getInstance()->setTrack(clicked_track); + StateManager::get()->pushScreen(TrackInfoScreen::getInstance()); } } } // name=="tracks" diff --git a/src/tracks/track.hpp b/src/tracks/track.hpp index f3249be23..424598de4 100644 --- a/src/tracks/track.hpp +++ b/src/tracks/track.hpp @@ -401,6 +401,7 @@ private: /** The number of laps the track will be raced in a random GP. * m_actual_number_of_laps is initialised with this value.*/ int m_default_number_of_laps; + /** The number of laps that is predefined in a track info dialog. */ int m_actual_number_of_laps; @@ -419,7 +420,7 @@ private: public: - bool reverseAvailable() { return m_reverse_available; } + bool reverseAvailable() const { return m_reverse_available; } void handleAnimatedTextures(scene::ISceneNode *node, const XMLNode &xml); static const float NOHIT;