More tutorial work
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12388 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
0435f5106a
commit
4dc3589086
@ -38,6 +38,7 @@
|
||||
#include "karts/controller/skidding_ai.hpp"
|
||||
#include "karts/kart.hpp"
|
||||
#include "karts/kart_properties_manager.hpp"
|
||||
#include "modes/overworld.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "network/race_state.hpp"
|
||||
@ -51,10 +52,11 @@
|
||||
#include "replay/replay_recorder.hpp"
|
||||
#include "states_screens/dialogs/race_paused_dialog.hpp"
|
||||
#include "states_screens/race_gui_base.hpp"
|
||||
#include "states_screens/race_gui.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "states_screens/main_menu_screen.hpp"
|
||||
#include "states_screens/minimal_race_gui.hpp"
|
||||
#include "states_screens/race_gui.hpp"
|
||||
#include "states_screens/race_result_gui.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "tracks/track_manager.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
@ -93,6 +95,7 @@ World::World() : WorldStatus(), m_clear_color(255,100,101,140)
|
||||
m_clear_back_buffer = false;
|
||||
m_schedule_pause = false;
|
||||
m_schedule_unpause = false;
|
||||
m_schedule_exit_race = false;
|
||||
m_self_destruct = false;
|
||||
|
||||
m_stop_music_when_dialog_open = true;
|
||||
@ -624,6 +627,18 @@ void World::updateWorld(float dt)
|
||||
{
|
||||
enterRaceOverState();
|
||||
}
|
||||
|
||||
if (m_schedule_exit_race)
|
||||
{
|
||||
race_manager->exitRace();
|
||||
race_manager->setAIKartOverride("");
|
||||
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
|
||||
|
||||
if (race_manager->raceWasStartedFromOverworld())
|
||||
{
|
||||
OverWorld::enterOverWorld();
|
||||
}
|
||||
}
|
||||
} // updateWorld
|
||||
|
||||
#define MEASURE_FPS 0
|
||||
|
@ -136,6 +136,8 @@ protected:
|
||||
* switch. */
|
||||
bool m_schedule_unpause;
|
||||
|
||||
bool m_schedule_exit_race;
|
||||
|
||||
Phase m_scheduled_pause_phase;
|
||||
|
||||
/** Set when the world needs to be deleted but you can't do it immediately
|
||||
@ -247,6 +249,7 @@ public:
|
||||
Highscores *getHighscores() const;
|
||||
void schedulePause(Phase phase);
|
||||
void scheduleUnpause();
|
||||
void scheduleExitRace() { m_schedule_exit_race = true; }
|
||||
void updateWorld(float dt);
|
||||
void handleExplosion(const Vec3 &xyz, AbstractKart *kart_hit,
|
||||
PhysicalObject *object);
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "modes/world.hpp"
|
||||
#include "states_screens/dialogs/tutorial_message_dialog.hpp"
|
||||
#include "states_screens/dialogs/race_paused_dialog.hpp"
|
||||
#include "states_screens/main_menu_screen.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
|
||||
#include <IMeshSceneNode.h>
|
||||
@ -550,6 +551,19 @@ void TrackObject::onTriggerItemApproached(Item* who)
|
||||
new TutorialMessageDialog(_("Note that if you manage to skid for several seconds, you will receive a bonus speedup as a reward!"),
|
||||
true);
|
||||
}
|
||||
else if (m_action == "tutorial_endmessage")
|
||||
{
|
||||
m_action = "__disabled__";
|
||||
World::getWorld()->getRaceGUI()->clearAllMessages();
|
||||
|
||||
new TutorialMessageDialog(_("You are now ready to race. Good luck!"),
|
||||
true);
|
||||
}
|
||||
else if (m_action == "tutorial_exit")
|
||||
{
|
||||
World::getWorld()->scheduleExitRace();
|
||||
return;
|
||||
}
|
||||
else if (m_action == "__disabled__")
|
||||
{
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user