Fix the bug where you see settings for the wrong game if you switch games during the game prompt.

This commit is contained in:
giantpune 2009-07-27 01:52:31 +00:00
parent c6fd33eeb1
commit 84e3d18533
2 changed files with 43 additions and 40 deletions

View File

@ -1219,49 +1219,49 @@ int MenuDiscList()
if(choice == 1) if(choice == 1)
{ {
if (alternatedol == on){ if (alternatedol == on){
/* Open dol File and check exist */ /* Open dol File and check exist */
sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull); sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull);
exeFile = fopen (nipple ,"rb"); exeFile = fopen (nipple ,"rb");
if (exeFile==NULL) if (exeFile==NULL)
{ {
sprintf(nipple, "%s %s",nipple,tr("does not exist! You Messed something up, Idiot.")); sprintf(nipple, "%s %s",nipple,tr("does not exist! You Messed something up, Idiot."));
WindowPrompt(tr("Error"),nipple,tr("OK")); WindowPrompt(tr("Error"),nipple,tr("OK"));
menu = MENU_CHECK; menu = MENU_CHECK;
wiilight(0); wiilight(0);
break; break;
} }
} }
if (ocarinaChoice != off){ if (ocarinaChoice != off){
/* Open gct File and check exist */ /* Open gct File and check exist */
sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull);
exeFile = fopen (nipple ,"rb"); exeFile = fopen (nipple ,"rb");
if (exeFile==NULL) if (exeFile==NULL)
{ {
sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats.")); sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats."));
WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
} }
else else
{ {
fseek (exeFile, 0, SEEK_END); fseek (exeFile, 0, SEEK_END);
long size=ftell (exeFile); long size=ftell (exeFile);
rewind (exeFile); rewind (exeFile);
fclose(exeFile); fclose(exeFile);
if (size>2056){ if (size>2056){
sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results.")); sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results."));
WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
} }
} }
} }
SDCard_deInit(); SDCard_deInit();
wiilight(0); wiilight(0);
returnHere = false; returnHere = false;
menu = MENU_EXIT; menu = MENU_EXIT;
} }
else if (choice == 2) else if (choice == 2)
{ {
wiilight(0); wiilight(0);
@ -1271,6 +1271,9 @@ int MenuDiscList()
else if (Settings.gameDisplay==carousel) mainWindow->Remove(gameCarousel); else if (Settings.gameDisplay==carousel) mainWindow->Remove(gameCarousel);
mainWindow->Remove(&w); mainWindow->Remove(&w);
ResumeGui(); ResumeGui();
//re-evaluate header now in case they changed games while on the game prompt
header = &gameList[gameSelected];
int settret = GameSettings(header); int settret = GameSettings(header);
menu = MENU_DISCLIST; // refresh titles (needed if the language setting has changed) menu = MENU_DISCLIST; // refresh titles (needed if the language setting has changed)
HaltGui(); HaltGui();

View File

@ -1,4 +1,4 @@
#define SVN_REV "653M" #define SVN_REV "653:654M"
const char *GetRev() const char *GetRev()
{ {