Re #197 (D31 : Save and restore Quick Race) Fixed broken load result file (immediate return to the Raceman menu)

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3323 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 9fa05268836b21e2f8ddde877cab8286d499218b
Former-commit-id: 348f66873188aa8f2361252c956825ccc9534fc6
This commit is contained in:
pouillot 2011-02-06 18:28:36 +00:00
parent 07ff011f9f
commit 2bfa87668b
2 changed files with 11 additions and 3 deletions

View file

@ -261,7 +261,6 @@ reOnLoadRaceFromFile(void *pPrevMenu)
const GfRaceManager* pRaceMan = ReGetRace()->getManager();
fs.title = pRaceMan->getName();
fs.prevScreen = pPrevMenu;
fs.mode = RmFSModeLoad;
std::string strDirPath = reGetLoadFileDir();
@ -270,11 +269,17 @@ reOnLoadRaceFromFile(void *pPrevMenu)
// For race types with more than 1 event (= 1 race on 1 track), load a race result file,
// as the previous race standings has an influence on the next race starting grid.
if (pRaceMan->getEventCount() > 1)
{
fs.select = reLoadRaceFromResultsFile;
fs.prevScreen = 0;
}
// But for race types with only 1 event (= 1 race on 1 track), load a race config file.
else
{
fs.select = reLoadRaceFromConfigFile;
fs.prevScreen = pPrevMenu;
}
// Fire the file selection menu.
GfuiScreenActivate(RmFileSelect(&fs));
@ -303,6 +308,8 @@ reOnSaveRaceToFile(void *pPrevMenu)
static void
reOnActivate(void * /* dummy */)
{
GfLogTrace("Entering Race Manager menu\n");
// Update GUI.
reOnRaceDataChanged();
}

View file

@ -97,8 +97,9 @@ rmOnDeactivate(void * /* dummy */ )
FileList = NULL;
}
// Fire the return screen
GfuiScreenActivate(RmFs->prevScreen);
// Fire the return screen if any.
if (RmFs->prevScreen)
GfuiScreenActivate(RmFs->prevScreen);
}
static void