diff --git a/source/cheatmenu.cpp b/source/cheatmenu.cpp index bcbef9e4..2fe9ec62 100644 --- a/source/cheatmenu.cpp +++ b/source/cheatmenu.cpp @@ -65,9 +65,9 @@ int CheatMenu(const char * gameID) int check = c.openTxtfile(txtfilename); switch(check) { - case -1: WindowPrompt(tr("Error"),tr("Cheatfile is blank"),tr("OK"),NULL,NULL,NULL); + case -1: WindowPrompt(tr("Error"),tr("Cheatfile is blank"),tr("OK"),NULL,NULL,NULL,-1); break; - case 0: WindowPrompt(tr("Error"),tr("No Cheatfile found"),tr("OK"),NULL,NULL,NULL); + case 0: WindowPrompt(tr("Error"),tr("No Cheatfile found"),tr("OK"),NULL,NULL,NULL,-1); break; case 1: //WindowPrompt("Opened File","File found for Game","Okay",NULL,NULL,NULL); int cntcheats = c.getCnt()+1; @@ -139,10 +139,10 @@ int CheatMenu(const char * gameID) string chtpath = Settings.Cheatcodespath; string gctfname = chtpath + c.getGameID() + ".gct"; c.createGCT(selectednrs,x,gctfname.c_str()); - WindowPrompt(tr("GCT File created"),NULL,tr("OK"),NULL,NULL,NULL); + WindowPrompt(tr("GCT File created"),NULL,tr("OK"),NULL,NULL,NULL,-1); exit = true; break; - } else WindowPrompt(tr("Error"),tr("Could not create GCT file"),tr("OK"),NULL,NULL,NULL); + } else WindowPrompt(tr("Error"),tr("Could not create GCT file"),tr("OK"),NULL,NULL,NULL,-1); } diff --git a/source/menu.cpp b/source/menu.cpp index 6f772685..6534b561 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -605,7 +605,7 @@ int MenuDiscList() char idiotBuffer[200]; snprintf(idiotBuffer, sizeof(idiotBuffer), "%s (%s). %s",tr("You have attempted to load a bad image"), idiotChar,tr("Most likely it has dimensions that are not evenly divisible by 4. Way to go dipshit.")); - WindowPrompt(0,idiotBuffer,tr("Ok"), 0, 0,0); + WindowPrompt(0,idiotBuffer,tr("Ok"), 0, 0,0,-1); idiotFlag=-1;} //CLOCK @@ -647,7 +647,7 @@ int MenuDiscList() if(poweroffBtn.GetState() == STATE_CLICKED) { - choice = WindowPrompt(tr("How to Shutdown?"),0,tr("Full Shutdown"), tr("Shutdown to Idle"), tr("Cancel"),0); + choice = WindowPrompt(tr("How to Shutdown?"),0,tr("Full Shutdown"), tr("Shutdown to Idle"), tr("Cancel"),0,-1); if(choice == 2) { Sys_ShutdownToIdel(); @@ -698,7 +698,7 @@ int MenuDiscList() } else if(installBtn.GetState() == STATE_CLICKED) { - choice = WindowPrompt(tr("Install a game"),0,tr("Yes"),tr("No"),0,0); + choice = WindowPrompt(tr("Install a game"),0,tr("Yes"),tr("No"),0,0,-1); if (choice == 1) { menu = MENU_INSTALL; @@ -740,7 +740,7 @@ int MenuDiscList() { //if(isSdInserted()) { if(isInserted(bootDevice)) { - choice = WindowPrompt(tr("Cover Download"), 0, tr("Normal Covers"), tr("3D Covers"), tr("Disc Images"), tr("Back")); // ask for download choice + choice = WindowPrompt(tr("Cover Download"), 0, tr("Normal Covers"), tr("3D Covers"), tr("Disc Images"), tr("Back"),-1); // ask for download choice if (choice != 0) { @@ -750,7 +750,7 @@ int MenuDiscList() if(IsNetworkInit() == false) { - WindowPrompt(tr("Network init error"), 0, tr("OK"),0,0,0); + WindowPrompt(tr("Network init error"), 0, tr("OK"),0,0,0,-1); } else { @@ -760,26 +760,26 @@ int MenuDiscList() char tempCnt[40]; sprintf(tempCnt,"%i %s",cntMissFiles,tr("Missing files")); - choice = WindowPrompt(tr("Download Boxart image?"),tempCnt,tr("Yes"),tr("No"),0,0); + choice = WindowPrompt(tr("Download Boxart image?"),tempCnt,tr("Yes"),tr("No"),0,0,-1); if (choice == 1) { ret = ProgressDownloadWindow(choice2); if (ret == 0) { - WindowPrompt(tr("Download finished"),0,tr("OK"),0,0,0); + WindowPrompt(tr("Download finished"),0,tr("OK"),0,0,0,-1); } else { sprintf(tempCnt,"%i %s",ret,tr("files not found on the server!")); - WindowPrompt(tr("Download finished"),tempCnt,tr("OK"),0,0,0); + WindowPrompt(tr("Download finished"),tempCnt,tr("OK"),0,0,0,-1); } } } else { - WindowPrompt(tr("No file missing!"),0,tr("OK"),0,0,0); + WindowPrompt(tr("No file missing!"),0,tr("OK"),0,0,0,-1); } } } } else { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to download images."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to download images."), tr("OK"), 0,0,0,-1); } DownloadBtn.ResetState(); if (Settings.gameDisplay==list){gameBrowser->SetFocus(1);} @@ -1043,34 +1043,48 @@ int MenuDiscList() text[MAX_CHARACTERS] = '\0'; strncat(text, "...", 3); } + + //check if alt Dol and gct file is present + FILE *exeFile = NULL; + char nipple[100]; + header = &gameList[gameSelected]; //reset header + snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); + struct Game_CFG* game_cfg = CFG_get_game_opt(header->id); + if (game_cfg) { + ocarinaChoice = game_cfg->ocarina; + alternatedol = game_cfg->loadalternatedol; + } else { + alternatedol = off; + ocarinaChoice = Settings.ocarina; + } + if (Settings.qboot == yes)//quickboot game - { //check if alt Dol is on present - struct Game_CFG* game_cfg = CFG_get_game_opt(header->id); - if (game_cfg) { - alternatedol = game_cfg->loadalternatedol; - } else { - alternatedol = off; - } - if (alternatedol != off){ - SDCard_Init(); - USBDevice_Init(); - FILE *exeFile = NULL; - char nipple[100]; + { if (alternatedol != off){ /* Open dol File and check exist */ - snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); - sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull); + sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull); exeFile = fopen (nipple ,"rb"); if (exeFile==NULL) { sprintf(nipple, "%s %s",nipple,tr("does not exist! You Messed something up, Idiot.")); - WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL); + WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,-1); menu = MENU_CHECK; wiilight(0); break; } } + if (ocarinaChoice != off){ + /* Open gct File and check exist */ + sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); + exeFile = fopen (nipple ,"rb"); + if (exeFile==NULL) + { + sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats.")); + WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,170); + } + } + SDCard_deInit(); wiilight(0); if(isInserted(bootDevice)) { //////////save game play count//////////////// @@ -1098,37 +1112,34 @@ int MenuDiscList() returnHere = false; if(Settings.wiilight != 2) wiilight(1); choice = GameWindowPrompt(); - header = &gameList[gameSelected]; //reset header + // header = &gameList[gameSelected]; //reset header if(choice == 1) { - //check if alt Dol is on present - struct Game_CFG* game_cfg = CFG_get_game_opt(header->id); - if (game_cfg) { - alternatedol = game_cfg->loadalternatedol; - } else { - alternatedol = off; - } if (alternatedol != off){ - SDCard_Init(); - USBDevice_Init(); - FILE *exeFile = NULL; - char nipple[100]; /* Open dol File and check exist */ - snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); - sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull); + sprintf(nipple, "%s%s.dol",Settings.dolpath,IDfull); exeFile = fopen (nipple ,"rb"); if (exeFile==NULL) - { //alt dol is not there, so make them feel bad for wasting our time. and boot the game anyways, just for spite + { sprintf(nipple, "%s %s",nipple,tr("does not exist! You Messed something up, Idiot.")); - WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL); + WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,-1); menu = MENU_CHECK; wiilight(0); break; - - } + } } + if (ocarinaChoice != off){ + /* Open gct File and check exist */ + sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); + exeFile = fopen (nipple ,"rb"); + if (exeFile==NULL) + { + sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats.")); + WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); + } + } SDCard_deInit(); wiilight(0); returnHere = false; menu = MENU_EXIT; @@ -1244,20 +1255,20 @@ static int MenuInstall() ret = DiscWait(tr("Insert Disk"),tr("Waiting..."),tr("Cancel"),0,0); if (ret < 0) { - WindowPrompt (tr("Error reading Disc"),0,tr("Back"),0,0,0); + WindowPrompt (tr("Error reading Disc"),0,tr("Back"),0,0,0,-1); menu = MENU_DISCLIST; break; } ret = Disc_Open(); if (ret < 0) { - WindowPrompt (tr("Could not open Disc"),0,tr("Back"),0,0,0); + WindowPrompt (tr("Could not open Disc"),0,tr("Back"),0,0,0,-1); menu = MENU_DISCLIST; break; } ret = Disc_IsWii(); if (ret < 0) { - choice = WindowPrompt (tr("Not a Wii Disc"),"Insert a Wii Disc!",tr("OK"),tr("Back"),0,0); + choice = WindowPrompt (tr("Not a Wii Disc"),"Insert a Wii Disc!",tr("OK"),tr("Back"),0,0,-1); if (choice == 1) { menu = MENU_INSTALL; @@ -1281,7 +1292,7 @@ static int MenuInstall() ret = WBFS_CheckGame(headerdisc.id); if (ret) { - WindowPrompt (tr("Game is already installed:"),name,tr("Back"),0,0,0); + WindowPrompt (tr("Game is already installed:"),name,tr("Back"),0,0,0,-1); menu = MENU_DISCLIST; break; } @@ -1295,7 +1306,7 @@ static int MenuInstall() sprintf(gametxt, "%s : %.2fGB", name, gamesize); wiilight(1); - choice = WindowPrompt(tr("Continue to install game?"),gametxt,tr("OK"),tr("Cancel"),0,0); + choice = WindowPrompt(tr("Continue to install game?"),gametxt,tr("OK"),tr("Cancel"),0,0,-1); if(choice == 1) { @@ -1304,18 +1315,18 @@ static int MenuInstall() if (gamesize > freespace) { char errortxt[50]; sprintf(errortxt, "%s: %.2fGB, %s: %.2fGB",tr("Game Size"), gamesize, tr("Free Space"), freespace); - choice = WindowPrompt(tr("Not enough free space!"),errortxt,tr("OK"), tr("Return"),0,0); + choice = WindowPrompt(tr("Not enough free space!"),errortxt,tr("OK"), tr("Return"),0,0,-1); if (choice == 1) { ret = ProgressWindow(gametxt, name); wiilight(0); if (ret != 0) { - WindowPrompt (tr("Install Error!"),0,tr("Back"),0,0,0); + WindowPrompt (tr("Install Error!"),0,tr("Back"),0,0,0,-1); menu = MENU_DISCLIST; break; } else { __Menu_GetEntries(); //get the entries again - WindowPrompt (tr("Successfully installed:"),name,tr("OK"),0,0,0); + WindowPrompt (tr("Successfully installed:"),name,tr("OK"),0,0,0,-1); menu = MENU_DISCLIST; break; } @@ -1329,12 +1340,12 @@ static int MenuInstall() ret = ProgressWindow(gametxt, name); wiilight(0); if (ret != 0) { - WindowPrompt (tr("Install Error!"),0,tr("Back"),0,0,0); + WindowPrompt (tr("Install Error!"),0,tr("Back"),0,0,0,-1); menu = MENU_DISCLIST; break; } else { __Menu_GetEntries(); //get the entries again - WindowPrompt (tr("Successfully installed:"),name,tr("OK"),0,0,0); + WindowPrompt (tr("Successfully installed:"),name,tr("OK"),0,0,0,-1); menu = MENU_DISCLIST; break; } @@ -1464,17 +1475,17 @@ static int MenuFormat() tr("Do you want to format:"), text, tr("Yes"), - tr("No"),0,0); + tr("No"),0,0,-1); if(choice == 1) { ret = FormatingPartition(tr("Formatting, please wait..."), entry); if (ret < 0) { - WindowPrompt(tr("Error !"),tr("Failed formating"),tr("Return"),0,0,0); + WindowPrompt(tr("Error !"),tr("Failed formating"),tr("Return"),0,0,0,-1); menu = MENU_SETTINGS; } else { ret = WBFS_Open(); sprintf(text, "%s %s", text,tr("formatted!")); - WindowPrompt(tr("Success:"),text,tr("OK"),0,0,0); + WindowPrompt(tr("Success:"),text,tr("OK"),0,0,0,-1); menu = MENU_DISCLIST; } } @@ -1488,7 +1499,7 @@ static int MenuFormat() if(poweroffBtn.GetState() == STATE_CLICKED) { - choice = WindowPrompt (tr("Shutdown System"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0); + choice = WindowPrompt (tr("Shutdown System"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0,-1); if(choice == 1) { Sys_Shutdown(); @@ -1496,7 +1507,7 @@ static int MenuFormat() } else if(exitBtn.GetState() == STATE_CLICKED) { - choice = WindowPrompt (tr("Return to Wii Menu"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0); + choice = WindowPrompt (tr("Return to Wii Menu"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0,-1); if(choice == 1) { Sys_LoadMenu(); @@ -1535,7 +1546,7 @@ static int MenuCheck() ret2 = WindowPrompt(tr("No USB Device found."), tr("Do you want to retry for 30 secs?"), "cIOS249", "cIOS222", - tr("Back to Wii Menu"), 0); + tr("Back to Wii Menu"), 0,-1); SDCard_deInit(); USBDevice_deInit(); WPAD_Flush(0); @@ -1554,14 +1565,14 @@ static int MenuCheck() WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight); if (ret2 < 0) { - WindowPrompt (tr("Error !"),tr("USB Device not found"), tr("OK"), 0,0,0); + WindowPrompt (tr("Error !"),tr("USB Device not found"), tr("OK"), 0,0,0,-1); Sys_LoadMenu(); } } ret2 = Disc_Init(); if (ret2 < 0) { - WindowPrompt (tr("Error !"),tr("Could not initialize DIP module!"),tr("OK"), 0,0,0); + WindowPrompt (tr("Error !"),tr("Could not initialize DIP module!"),tr("OK"), 0,0,0,-1); Sys_LoadMenu(); } @@ -1570,7 +1581,7 @@ static int MenuCheck() choice = WindowPrompt(tr("No WBFS partition found"), tr("You need to format a partition"), tr("Format"), - tr("Return"),0,0); + tr("Return"),0,0,-1); if(choice == 0) { Sys_LoadMenu(); @@ -1579,7 +1590,7 @@ static int MenuCheck() u32 sector_size; ret2 = Partition_GetEntries(partitions, §or_size); if (ret2 < 0) { - WindowPrompt (tr("No partitions found"),0, tr("Restart"), 0,0,0); + WindowPrompt (tr("No partitions found"),0, tr("Restart"), 0,0,0,-1); Sys_LoadMenu(); } diff --git a/source/network/networkops.cpp b/source/network/networkops.cpp index 4a484bed..f02898a2 100644 --- a/source/network/networkops.cpp +++ b/source/network/networkops.cpp @@ -249,7 +249,7 @@ static void * networkinitcallback(void *arg) if(CheckUpdate() > 0) { /** Here we can enter the update function later ** ** when network problem is solved **/ - WindowPrompt("Update available",0,"OK",0,0,0); + WindowPrompt("Update available",0,"OK",0,0,0,-1); } updatechecked = true; } diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index 4097705e..bcfb3838 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -382,9 +382,10 @@ void WindowScreensaver() int WindowPrompt(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, const char *btn3Label, - const char *btn4Label) + const char *btn4Label, int wait) { int choice = -1; + int count = wait; GuiWindow promptWindow(472,320); promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); @@ -610,6 +611,8 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, else if(btn4.GetState() == STATE_CLICKED) { choice = 0; } + if (count>0)count--; + if (count==0) choice = 1; } promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50); @@ -873,7 +876,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, wiimoteImg.SetPosition(50,165); } else if(btn2.GetState() == STATE_CLICKED) { - ret = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("No"), 0, 0); + ret = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("No"), 0, 0,-1); if (ret == 1) { choice = 2; } @@ -885,7 +888,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, btn2.ResetState(); } else if(btn3.GetState() == STATE_CLICKED) { - ret = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("No"), 0, 0); + ret = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("No"), 0, 0,-1); if (ret == 1) { choice = 3; } @@ -1274,7 +1277,7 @@ int GameWindowPrompt() } choice = 1; - SDCard_deInit(); + //SDCard_deInit();// moved this into menu.cpp after checking for gct file and alt dol } else if(btn2.GetState() == STATE_CLICKED) { //back @@ -2032,13 +2035,13 @@ ProgressDownloadWindow(int choice2) struct stat st; if(stat(Settings.covers_path, &st) != 0) { if(subfoldercreate(Settings.covers_path) != 1) { - WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0); + WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0,-1); cntMissFiles = 0; } } if(stat(Settings.disc_path,&st) != 0) { if(subfoldercreate(Settings.disc_path) != 1) { - WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0); + WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0,-1); cntMissFiles = 0; } } @@ -2257,7 +2260,7 @@ int ProgressUpdateWindow() struct stat st; if(stat(Settings.update_path, &st) != 0) { if(subfoldercreate(Settings.update_path) != 1) { - WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0); + WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"),0,0,0,-1); ret = -1; failed = -1; } @@ -2295,7 +2298,7 @@ int ProgressUpdateWindow() if(newrev > 0) { sprintf(msg, "Rev%i %s.", newrev, tr("available")); - int choice = WindowPrompt(msg, tr("How do you want to update?"), tr("Update DOL"), tr("Update All"), tr("Cancel"), 0); + int choice = WindowPrompt(msg, tr("How do you want to update?"), tr("Update DOL"), tr("Update All"), tr("Cancel"), 0,-1); if(choice == 1 || choice == 2) { titleTxt.SetTextf("%s USB Loader GX", tr("Updating")); msgTxt.SetPosition(0,100); @@ -2380,7 +2383,7 @@ int ProgressUpdateWindow() } } else { - WindowPrompt(tr("No new updates."), 0, tr("OK"), 0, 0, 0); + WindowPrompt(tr("No new updates."), 0, tr("OK"), 0, 0, 0,-1); ret = -1; } @@ -2389,7 +2392,7 @@ int ProgressUpdateWindow() CloseConnection(); if(!failed && ret >= 0) { - WindowPrompt(tr("Successfully Updated") , tr("Restarting..."), tr("OK"), 0, 0, 0); + WindowPrompt(tr("Successfully Updated") , tr("Restarting..."), tr("OK"), 0, 0, 0,-1); Sys_BackToLoader(); } diff --git a/source/prompts/PromptWindows.h b/source/prompts/PromptWindows.h index 271ab9fc..cf371db1 100644 --- a/source/prompts/PromptWindows.h +++ b/source/prompts/PromptWindows.h @@ -12,7 +12,7 @@ void WindowCredits(); int OnScreenKeyboard(char * var, u32 maxlen, int min); -int WindowPrompt(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, const char *btn3Label, const char *btn4Label); +int WindowPrompt(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, const char *btn3Label, const char *btn4Label, int wait); int WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, const char *btn3Label, const char *btn4Label); int GameWindowPrompt(); int DiscWait(const char *title, const char *msg, const char *btn1Label, const char *btn2Label, int IsDeviceWait); diff --git a/source/settings/Settings.cpp b/source/settings/Settings.cpp index d6720740..90d6401e 100644 --- a/source/settings/Settings.cpp +++ b/source/settings/Settings.cpp @@ -641,10 +641,10 @@ int MenuSettings() while(w.GetEffect()>0) usleep(50); } } else { - WindowPrompt(tr("Language change:"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(tr("Language change:"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); } } else { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to use this option."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to use this option."), tr("OK"), 0,0,0,-1); } break; case 1: @@ -974,19 +974,19 @@ int MenuSettings() if (!strcmp(entered, Settings.unlockCode)) //if password correct { if (Settings.godmode == 0) { - WindowPrompt(tr("Correct Password"),tr("All the features of USB Loader GX are unlocked."),tr("OK"),0,0,0); + WindowPrompt(tr("Correct Password"),tr("All the features of USB Loader GX are unlocked."),tr("OK"),0,0,0,-1); Settings.godmode = 1; //__Menu_GetEntries(); menu = MENU_DISCLIST; } } else { - WindowPrompt(tr("Wrong Password"),tr("USB Loader GX is protected"),tr("OK"),0,0,0); + WindowPrompt(tr("Wrong Password"),tr("USB Loader GX is protected"),tr("OK"),0,0,0,-1); } } } else { - int choice = WindowPrompt (tr("Lock Console"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0); + int choice = WindowPrompt (tr("Lock Console"),tr("Are you sure?"),tr("Yes"),tr("No"),0,0,-1); if(choice == 1) { - WindowPrompt(tr("Console Locked"),tr("USB Loader GX is protected"),tr("OK"),0,0,0); + WindowPrompt(tr("Console Locked"),tr("USB Loader GX is protected"),tr("OK"),0,0,0,-1); Settings.godmode = 0; //__Menu_GetEntries(); menu = MENU_DISCLIST; @@ -1005,10 +1005,10 @@ int MenuSettings() w.Append(&backBtn); if ( result == 1 ) { strncpy(Settings.unlockCode, entered, sizeof(Settings.unlockCode)); - WindowPrompt(tr("Password Changed"),tr("Password has been changed"),tr("OK"),0,0,0); + WindowPrompt(tr("Password Changed"),tr("Password has been changed"),tr("OK"),0,0,0,-1); } } else { - WindowPrompt(tr("Password Changed"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(tr("Password Changed"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); } break; case 2: @@ -1138,7 +1138,7 @@ int MenuSettings() while(w.GetEffect()>0) usleep(50); } else - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to use this option."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to use this option."), tr("OK"), 0,0,0,-1); break; case 1: Settings.volume += 10; @@ -1276,14 +1276,14 @@ int MenuSettings() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.covers_path, entered, sizeof(Settings.covers_path)); - WindowPrompt(tr("Coverpath Changed"),0,tr("OK"),0,0,0); + WindowPrompt(tr("Coverpath Changed"),0,tr("OK"),0,0,0,-1); // if(!isSdInserted()) { if(!isInserted(bootDevice)) { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } } } else { - WindowPrompt(tr("Coverpath Changed"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(tr("Coverpath Changed"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); } break; case 1: @@ -1302,14 +1302,14 @@ int MenuSettings() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.disc_path, entered, sizeof(Settings.disc_path)); - WindowPrompt(tr("Discpath Changed"),0,tr("OK"),0,0,0); + WindowPrompt(tr("Discpath Changed"),0,tr("OK"),0,0,0,-1); // if(!isSdInserted()) { if(!isInserted(bootDevice)) { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } } } else { - WindowPrompt(tr("Discpath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(tr("Discpath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); } break; case 2: @@ -1328,10 +1328,10 @@ int MenuSettings() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path)); - WindowPrompt(tr("Themepath Changed"),0,tr("OK"),0,0,0); + WindowPrompt(tr("Themepath Changed"),0,tr("OK"),0,0,0,-1); // if(!isSdInserted()) { if(!isInserted(bootDevice)) { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } else { cfg_save_global(); } @@ -1366,7 +1366,7 @@ int MenuSettings() w.Append(&optionBrowser2); ResumeGui(); } else { - WindowPrompt(tr("Themepath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(tr("Themepath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); } break; case 3: @@ -1385,19 +1385,19 @@ int MenuSettings() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.titlestxt_path, entered, sizeof(Settings.titlestxt_path)); - WindowPrompt(tr("Path of titles.txt changed."),0,tr("OK"),0,0,0); + WindowPrompt(tr("Path of titles.txt changed."),0,tr("OK"),0,0,0,-1); // if(isSdInserted()) { if(isInserted(bootDevice)) { cfg_save_global(); CFG_Load(); } else { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } } } else { - WindowPrompt(tr("Path of titles.txt change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(tr("Path of titles.txt change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); } break; case 4: @@ -1416,11 +1416,11 @@ int MenuSettings() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.update_path, entered, sizeof(Settings.update_path)); - WindowPrompt(tr("Updatepath changed."),0,tr("OK"),0,0,0); + WindowPrompt(tr("Updatepath changed."),0,tr("OK"),0,0,0,-1); } } else - WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); break; case 5: if ( Settings.godmode == 1) @@ -1438,11 +1438,11 @@ int MenuSettings() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.Cheatcodespath, entered, sizeof(Settings.Cheatcodespath)); - WindowPrompt(tr("Cheatcodes Path changed"),0,tr("OK"),0,0,0); + WindowPrompt(tr("Cheatcodes Path changed"),0,tr("OK"),0,0,0,-1); } } else - WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); break; case 6: if ( Settings.godmode == 1) @@ -1460,11 +1460,11 @@ int MenuSettings() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.TxtCheatcodespath, entered, sizeof(Settings.TxtCheatcodespath)); - WindowPrompt("TxtCheatcodespathchanged",0,tr("OK"),0,0,0); + WindowPrompt("TxtCheatcodespathchanged",0,tr("OK"),0,0,0,-1); } } else - WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); break; case 7: if ( Settings.godmode == 1) @@ -1482,14 +1482,14 @@ int MenuSettings() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.dolpath, entered, sizeof(Settings.dolpath)); - WindowPrompt(tr("Dolpath Changed"),0,tr("OK"),0,0,0); + WindowPrompt(tr("Dolpath Changed"),0,tr("OK"),0,0,0,-1); // if(!isSdInserted()) { if(!isInserted(bootDevice)) { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } } } else { - WindowPrompt(tr("Dolpath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0); + WindowPrompt(tr("Dolpath change"),tr("Console should be unlocked to modify it."),tr("OK"),0,0,0,-1); } break; @@ -1497,7 +1497,7 @@ int MenuSettings() } /** If not godmode don't let him inside **/ } else { - WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0, 0, 0); + WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0, 0, 0,-1); } optionBrowser2.SetEffect(EFFECT_FADE, -20); while(optionBrowser2.GetEffect() > 0) usleep(50); @@ -1528,12 +1528,12 @@ int MenuSettings() w.Remove(&backBtn); int ret = ProgressUpdateWindow(); if(ret < 0) { - WindowPrompt(tr("Update failed"),0,tr("OK"),0,0,0); + WindowPrompt(tr("Update failed"),0,tr("OK"),0,0,0,-1); } w.Append(&optionBrowser2); w.Append(&backBtn); } else { - WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0,0,0); + WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0,0,0,-1); } slidedirection = FADE; pageToDisplay = 2; @@ -1558,7 +1558,7 @@ int MenuSettings() w.Remove(&backBtn); w.Remove(&optionBrowser2); if(Settings.godmode) { - int choice = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("Cancel"), 0, 0); + int choice = WindowPrompt(tr("Are you sure?"), 0, tr("Yes"), tr("Cancel"), 0, 0,-1); if(choice == 1) { // if(isSdInserted()) if(isInserted(bootDevice)) @@ -1574,7 +1574,7 @@ int MenuSettings() pageToDisplay = 0; } } else { - WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0, 0, 0); + WindowPrompt(tr("Console Locked"), tr("Unlock console to use this option."), tr("OK"), 0, 0, 0,-1); } w.Append(&backBtn); w.Append(&optionBrowser2); @@ -1815,8 +1815,9 @@ int GameSettings(struct discHdr * header) GuiImage GCTBtnImg(&btnOcarina); if (Settings.wsprompt == yes){ GCTBtnImg.SetWidescreen(CFG.widescreen);} - GuiButton GCTBtn(&GCTBtnImg,&GCTBtnImg, ALIGN_RIGHT, ALIGN_TOP, 0, 80, &trigA, &btnSoundOver, &btnClick,1); - GCTBtn.SetScale(0.5); + GuiButton GCTBtn(&GCTBtnImg,&GCTBtnImg, ALIGN_RIGHT, ALIGN_TOP, -20, 90, &trigA, &btnSoundOver, &btnClick,1); + GCTBtn.SetSize(80,80); + GCTBtnImg.SetScale(0.5); GuiCustomOptionBrowser optionBrowser3(396, 280, &options3, CFG.theme_path, "bg_options_gamesettings.png", bg_options_settings_png, 1, 200); optionBrowser3.SetPosition(0, 90); @@ -1970,7 +1971,7 @@ int GameSettings(struct discHdr * header) break; case 10: int result; - result = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0); + result = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0,-1); if(result == 1) { if(isInserted(bootDevice)) { struct Game_NUM* game_num = CFG_get_game_num(header->id); @@ -1987,7 +1988,7 @@ int GameSettings(struct discHdr * header) } break; case 11: - int choice = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0); + int choice = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel"),0,0,-1); if(choice == 1) { videoChoice = Settings.video; viChoice = Settings.vpatch; @@ -2027,14 +2028,14 @@ int GameSettings(struct discHdr * header) if (Settings.titlesOverride==1 && opt_lang != opt_langnew) OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, true, false); // open file, reload titles, do not keep in memory // titles are refreshed in menu.cpp as soon as this function returns - WindowPrompt(tr("Successfully Saved"), 0, tr("OK"), 0,0,0); + WindowPrompt(tr("Successfully Saved"), 0, tr("OK"), 0,0,0,-1); } else { - WindowPrompt(tr("Save Failed"), 0, tr("OK"), 0,0,0); + WindowPrompt(tr("Save Failed"), 0, tr("OK"), 0,0,0,-1); } } else { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } saveBtn.ResetState(); @@ -2052,7 +2053,7 @@ int GameSettings(struct discHdr * header) int choice = WindowPrompt( tr("Do you really want to delete:"), gameName, - tr("Yes"),tr("Cancel"),0,0); + tr("Yes"),tr("Cancel"),0,0,-1); if (choice == 1) { @@ -2064,14 +2065,14 @@ int GameSettings(struct discHdr * header) WindowPrompt( tr("Can't delete:"), gameName, - tr("OK"),0,0,0); + tr("OK"),0,0,0,-1); } else { //__Menu_GetEntries(); WindowPrompt( tr("Successfully deleted:"), gameName, - tr("OK"),0,0,0); + tr("OK"),0,0,0,-1); retVal = 1; } break; diff --git a/source/settings/SettingsPrompts.cpp b/source/settings/SettingsPrompts.cpp index 52abfbef..b9c1f414 100644 --- a/source/settings/SettingsPrompts.cpp +++ b/source/settings/SettingsPrompts.cpp @@ -198,7 +198,7 @@ bool MenuOGG() } if (defaultBtn.GetState() == STATE_CLICKED) { - choice = WindowPrompt(tr("Loading standard music."),0,tr("OK"), tr("Cancel"),0,0); + choice = WindowPrompt(tr("Loading standard music."),0,tr("OK"), tr("Cancel"),0,0,-1); if (choice == 1) { sprintf(Settings.ogg_path, "notset"); bgMusic->Play(); @@ -230,7 +230,7 @@ bool MenuOGG() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.oggload_path, entered, sizeof(Settings.oggload_path)); - WindowPrompt(tr("Backgroundmusic Path changed."),0,tr("OK"),0,0,0); + WindowPrompt(tr("Backgroundmusic Path changed."),0,tr("OK"),0,0,0,-1); // if(isSdInserted()) { if(isInserted(bootDevice)) { if(!strcmp("", Settings.oggload_path)) { @@ -241,7 +241,7 @@ bool MenuOGG() returnhere = true; break; } else { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } } if(countoggs > 0) { @@ -253,13 +253,13 @@ bool MenuOGG() ret = optionBrowser4.GetClickedOption(); if(ret>=0) { - choice = WindowPrompt(tr("Set as backgroundmusic?"),GetFileName(ret),tr("Yes"),tr("No"),0,0); + choice = WindowPrompt(tr("Set as backgroundmusic?"),GetFileName(ret),tr("Yes"),tr("No"),0,0,-1); if(choice == 1) { StopOgg(); snprintf(fullpath,150,"%s%s",Settings.oggload_path,GetFileName(ret)); choice = bgMusic->PlayOggFile(fullpath); if(choice < 0) { - WindowPrompt(tr("Not supported format!"), tr("Loading standard music."), tr("OK"), 0,0,0); + WindowPrompt(tr("Not supported format!"), tr("Loading standard music."), tr("OK"), 0,0,0,-1); sprintf(Settings.ogg_path, "notset"); bgMusic->Play(); SetVolumeOgg(255*(Settings.volume/100.0)); @@ -279,7 +279,7 @@ bool MenuOGG() snprintf(fullpath, 150,"%s%s", Settings.oggload_path,GetFileName(ret)); choice = bgMusic->PlayOggFile(fullpath); if(choice < 0) { - WindowPrompt(tr("Not supported format!"), tr("Loading standard music."), tr("OK"), 0,0,0); + WindowPrompt(tr("Not supported format!"), tr("Loading standard music."), tr("OK"), 0,0,0,-1); if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { bgMusic->Play(); } else { @@ -449,7 +449,7 @@ int MenuLanguageSelect() } if (defaultBtn.GetState() == STATE_CLICKED) { - choice = WindowPrompt(tr("Loading standard language."),0,tr("OK"), tr("Cancel"),0,0); + choice = WindowPrompt(tr("Loading standard language."),0,tr("OK"), tr("Cancel"),0,0,-1); if (choice == 1) { sprintf(Settings.language_path, "notset"); cfg_save_global(); @@ -479,14 +479,14 @@ int MenuLanguageSelect() if(entered[len] !='/') strncat (entered, "/", 1); strncpy(Settings.languagefiles_path, entered, sizeof(Settings.languagefiles_path)); - WindowPrompt(tr("Languagepath changed."),0,tr("OK"),0,0,0); + WindowPrompt(tr("Languagepath changed."),0,tr("OK"),0,0,0,-1); // if(isSdInserted()) { if(isInserted(bootDevice)) { cfg_save_global(); returnhere = 1; break; } else { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } } if(countfiles > 0) { @@ -498,7 +498,7 @@ int MenuLanguageSelect() ret = optionBrowser4.GetClickedOption(); if(ret>=0) { - choice = WindowPrompt(tr("Do you want to change language?"), 0, tr("Yes"), tr("Cancel"),0,0); + choice = WindowPrompt(tr("Do you want to change language?"), 0, tr("Yes"), tr("Cancel"),0,0,-1); if(choice == 1) { // if(isSdInserted()) { if(isInserted(bootDevice)) { @@ -506,7 +506,7 @@ int MenuLanguageSelect() cfg_save_global(); if(!checkfile(Settings.language_path)) { sprintf(Settings.language_path, tr("not set")); - WindowPrompt(tr("File not found."),tr("Loading standard language."),tr("OK"),0,0,0); + WindowPrompt(tr("File not found."),tr("Loading standard language."),tr("OK"),0,0,0,-1); } gettextCleanUp(); //lang_default(); @@ -514,7 +514,7 @@ int MenuLanguageSelect() returnhere = 2; break; } else { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0); + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"), 0,0,0,-1); } } optionBrowser4.SetFocus(1);