Display continue button only if next track isn't first available in GP.
Fixed a crash.
This commit is contained in:
parent
b726b59427
commit
2d9e38f7f6
@ -376,6 +376,7 @@ void RaceManager::startNew(bool from_overworld)
|
||||
init_gp_rank ++;
|
||||
}
|
||||
|
||||
m_track_number = 0;
|
||||
if (m_major_mode == MAJOR_MODE_GRAND_PRIX)
|
||||
{
|
||||
if (m_continue_saved_gp)
|
||||
@ -385,7 +386,6 @@ void RaceManager::startNew(bool from_overworld)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_track_number = 0;
|
||||
while (m_saved_gp != NULL)
|
||||
{
|
||||
m_saved_gp->remove();
|
||||
@ -538,7 +538,7 @@ void RaceManager::next()
|
||||
void RaceManager::saveGP()
|
||||
{
|
||||
// If Player 1 has already saved a GP, we adapt it
|
||||
if(m_saved_gp != NULL)
|
||||
if (m_saved_gp != NULL)
|
||||
{
|
||||
m_saved_gp->setKarts(m_kart_status);
|
||||
m_saved_gp->setNextTrack(m_track_number);
|
||||
|
@ -136,9 +136,11 @@ void GPInfoScreen::beforeAddingWidget()
|
||||
m_gp.getId(),
|
||||
race_manager->getNumLocalPlayers());
|
||||
|
||||
bool continue_visible = saved_gp && saved_gp->getNextTrack() > 0;
|
||||
|
||||
RibbonWidget* ribbonButtons = getWidget<RibbonWidget>("buttons");
|
||||
int id_continue_button = ribbonButtons->findItemNamed("continue");
|
||||
ribbonButtons->setItemVisible(id_continue_button, saved_gp != NULL);
|
||||
ribbonButtons->setItemVisible(id_continue_button, continue_visible);
|
||||
ribbonButtons->setLabel(id_continue_button, _("Continue saved GP"));
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user