This commit is contained in:
Benau 2019-11-23 12:31:55 +08:00
parent 2c22dadddf
commit dd9c91be0c
4 changed files with 15 additions and 2 deletions

View File

@ -166,4 +166,6 @@ void StandardRace::endRaceEarly()
setPhase(RESULT_DISPLAY_PHASE);
if (!isNetworkWorld() || NetworkConfig::get()->isServer())
terminateRace();
if (!isNetworkWorld())
m_ended_early = true;
} // endRaceEarly

View File

@ -154,6 +154,7 @@ World::World() : WorldStatus()
*/
void World::init()
{
m_ended_early = false;
m_faster_music_active = false;
m_fastest_kart = 0;
m_eliminated_karts = 0;
@ -334,6 +335,7 @@ void World::reset(bool restart)
m_saved_race_gui = NULL;
}
m_ended_early = false;
m_schedule_pause = false;
m_schedule_unpause = false;

View File

@ -179,7 +179,9 @@ protected:
/** Set when the world is online and counts network players. */
bool m_is_network_world;
bool m_ended_early;
virtual void onGo() OVERRIDE;
/** Returns true if the race is over. Must be defined by all modes. */
virtual bool isRaceOver() = 0;
@ -271,6 +273,8 @@ public:
// ------------------------------------------------------------------------
virtual void endRaceEarly() { return; }
// ------------------------------------------------------------------------
virtual bool hasRaceEndedEarly() const { return m_ended_early; }
// ------------------------------------------------------------------------
/** Called to determine whether this race mode uses bonus boxes. */
virtual bool haveBonusBoxes() { return true; }
// ------------------------------------------------------------------------

View File

@ -252,10 +252,15 @@ void RaceResultGUI::enableAllButtons()
{
middle->setImage("gui/icons/main_race.png");
if (race_manager->isRecordingRace())
{
middle->setLabel(_("Race against the new ghost replay"));
middle->setVisible(!World::getWorld()->hasRaceEndedEarly());
}
else
{
middle->setLabel(_("Setup New Race"));
middle->setVisible(true);
middle->setVisible(true);
}
right->setLabel(_("Back to the menu"));
right->setImage("gui/icons/back.png");
}