From c6fd33eeb18b76a15d164052d96ed071c2659b4f Mon Sep 17 00:00:00 2001 From: giantpune Date: Mon, 27 Jul 2009 01:15:16 +0000 Subject: [PATCH] change the per game settings around a bit. made the channel browser read database.txt. The text should be in the config path (because i couldn't think of a better place for it). And the format for the txt is the first 3 chars of the 4 char ID, then any 1 character, then the name (read up to 51 chars. eg. ULN USB Loader GX Full Channel HAX Homebrew Channel HAT Nintendo Channel The database for ATD mod follows this format, so its a great place to start. If people are going to be passing around a database, it would be wise to keep custom channels off this, as my WADD that says WadManager is not the same as somebody else's WADQ which could be a self destruct or something. Commented out the code that loads titles.txt. It was reported that this file is keeping WiiSportsResort from loading on some Wiis. And it isn't needed anymore since there is the xml file with all the names in it. I left the code in though in case somebody thinks that it is actually useful. Added 1 more game to the list of known alt dols. --- Languages/czech.lang | 2 +- Languages/danish.lang | 2 +- Languages/dutch.lang | 2 +- Languages/english.lang | 2 +- Languages/finnish.lang | 2 +- Languages/french.lang | 2 +- Languages/german.lang | 2 +- Languages/hungarian.lang | 2 +- Languages/italian.lang | 2 +- Languages/japanese.lang | 2 +- Languages/korean.lang | 2 +- Languages/norwegian.lang | 2 +- Languages/polish.lang | 2 +- Languages/portuguese_br.lang | 2 +- Languages/portuguese_pt.lang | 2 +- Languages/russian.lang | 2 +- Languages/schinese.lang | 2 +- Languages/spanish.lang | 2 +- Languages/swedish.lang | 2 +- Languages/tchinese.lang | 2 +- Languages/turkish.lang | 2 +- source/cheats/cheatmenu.cpp | 4 +- source/network/networkops.cpp | 2 +- source/prompts/DiscBrowser.cpp | 3 + source/prompts/TitleBrowser.cpp | 100 ++- source/settings/Settings.cpp | 1142 +++++++++++++++++++------------ source/settings/cfg.c | 6 +- source/svnrev.c | 2 +- 28 files changed, 848 insertions(+), 453 deletions(-) diff --git a/Languages/czech.lang b/Languages/czech.lang index fc5a5ef9..ab9ff78d 100644 --- a/Languages/czech.lang +++ b/Languages/czech.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: David Jelinek (djelinek@hotmail.com) \n" "Language-Team: Last version on http://startgolf.tym.cz/czech.lang \n" diff --git a/Languages/danish.lang b/Languages/danish.lang index 4bbebc8f..14d7076a 100644 --- a/Languages/danish.lang +++ b/Languages/danish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/dutch.lang b/Languages/dutch.lang index f5f167ae..8ec6cf6e 100644 --- a/Languages/dutch.lang +++ b/Languages/dutch.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: tj_cool\n" "Language-Team: \n" diff --git a/Languages/english.lang b/Languages/english.lang index 42c1b06e..214c2150 100644 --- a/Languages/english.lang +++ b/Languages/english.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/finnish.lang b/Languages/finnish.lang index 283407b0..a87ed435 100644 --- a/Languages/finnish.lang +++ b/Languages/finnish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/french.lang b/Languages/french.lang index d2cd0a1f..87c94f45 100644 --- a/Languages/french.lang +++ b/Languages/french.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: Kin8\n" "Language-Team: Badablek, Amour, ikya, OuahOuah, dj_skual & Kin8\n" diff --git a/Languages/german.lang b/Languages/german.lang index 5e4f6dea..be2f3dad 100644 --- a/Languages/german.lang +++ b/Languages/german.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/hungarian.lang b/Languages/hungarian.lang index 9cce28a1..d1092572 100644 --- a/Languages/hungarian.lang +++ b/Languages/hungarian.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: Tusk\n" "Language-Team: \n" diff --git a/Languages/italian.lang b/Languages/italian.lang index eee734b9..bd263dc0 100644 --- a/Languages/italian.lang +++ b/Languages/italian.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-24 11:00+0200\n" "Last-Translator: Cambo \n" "Language-Team: FoxeJoe & Cambo\n" diff --git a/Languages/japanese.lang b/Languages/japanese.lang index 1ffa266a..cf19c672 100644 --- a/Languages/japanese.lang +++ b/Languages/japanese.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/korean.lang b/Languages/korean.lang index 7ac62813..c15347fd 100644 --- a/Languages/korean.lang +++ b/Languages/korean.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/norwegian.lang b/Languages/norwegian.lang index acdfa7e1..bc66b930 100644 --- a/Languages/norwegian.lang +++ b/Languages/norwegian.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/polish.lang b/Languages/polish.lang index 6e40e980..b48d2858 100644 --- a/Languages/polish.lang +++ b/Languages/polish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: ziom666 (zadania_prog@vp.pl)\n" "Language-Team: \n" diff --git a/Languages/portuguese_br.lang b/Languages/portuguese_br.lang index 9e458b31..6a894736 100644 --- a/Languages/portuguese_br.lang +++ b/Languages/portuguese_br.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/portuguese_pt.lang b/Languages/portuguese_pt.lang index 118e27f6..2f0f057c 100644 --- a/Languages/portuguese_pt.lang +++ b/Languages/portuguese_pt.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-20 16:40\n" "Last-Translator: Sky8000\n" "Language-Team: \n" diff --git a/Languages/russian.lang b/Languages/russian.lang index 517afd07..52fcbc58 100644 --- a/Languages/russian.lang +++ b/Languages/russian.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: Kir\n" "Language-Team: Kir\n" diff --git a/Languages/schinese.lang b/Languages/schinese.lang index d2b805b8..5bf99132 100644 --- a/Languages/schinese.lang +++ b/Languages/schinese.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/spanish.lang b/Languages/spanish.lang index ebbb0e70..ac96cd06 100644 --- a/Languages/spanish.lang +++ b/Languages/spanish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/swedish.lang b/Languages/swedish.lang index bc1dc3a4..23d8bc17 100644 --- a/Languages/swedish.lang +++ b/Languages/swedish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:36+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-24 16:45+0200\n" "Last-Translator: Katsurou\n" "Language-Team: Katsurou, pirateX\n" diff --git a/Languages/tchinese.lang b/Languages/tchinese.lang index 18019a79..5756e824 100644 --- a/Languages/tchinese.lang +++ b/Languages/tchinese.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/Languages/turkish.lang b/Languages/turkish.lang index 650f8275..d2541432 100644 --- a/Languages/turkish.lang +++ b/Languages/turkish.lang @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: USB Loader GX\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-25 17:16+0200\n" +"POT-Creation-Date: 2009-07-26 19:54-0400\n" "PO-Revision-Date: 2009-07-18 15:18+0200\n" "Last-Translator: \n" "Language-Team: \n" diff --git a/source/cheats/cheatmenu.cpp b/source/cheats/cheatmenu.cpp index 171f77e2..bb7b63f5 100644 --- a/source/cheats/cheatmenu.cpp +++ b/source/cheats/cheatmenu.cpp @@ -47,14 +47,14 @@ int CheatMenu(const char * gameID) GuiText backBtnTxt(tr("Back") , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage backBtnImg(&btnOutline); - GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, 160, 400, &trigA, &btnSoundOver, &btnClick,1); + GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, -140, 400, &trigA, &btnSoundOver, &btnClick,1); backBtn.SetLabel(&backBtnTxt); backBtn.SetTrigger(&trigB); GuiText createBtnTxt(tr("Create") , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); createBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage createBtnImg(&btnOutline); - GuiButton createBtn(&createBtnImg,&createBtnImg, 2, 3, -140, 400, &trigA, &btnSoundOver, &btnClick,1); + GuiButton createBtn(&createBtnImg,&createBtnImg, 2, 3, 160, 400, &trigA, &btnSoundOver, &btnClick,1); createBtn.SetLabel(&createBtnTxt); char txtfilename[55]; diff --git a/source/network/networkops.cpp b/source/network/networkops.cpp index 38e0b9f4..971a6191 100644 --- a/source/network/networkops.cpp +++ b/source/network/networkops.cpp @@ -16,7 +16,7 @@ #include "settings/cfg.h" #include "main.h" #include "http.h" -#include "svnrev.h" +#include "../svnrev.h" #define PORT 4299 diff --git a/source/prompts/DiscBrowser.cpp b/source/prompts/DiscBrowser.cpp index 33134c3a..0fd24976 100644 --- a/source/prompts/DiscBrowser.cpp +++ b/source/prompts/DiscBrowser.cpp @@ -241,6 +241,7 @@ int autoSelectDol(const char *id) if (strcmp(id,"RF8X69") == 0) return 464;//from isostar if (strcmp(id,"RZTP01") == 0) return 952;//from isostar + if (strcmp(id,"RZTE01") == 0) return 674;//from starstremr if (strcmp(id,"RMZX69") == 0) return 492;//from isostar if (strcmp(id,"RMZP69") == 0) return 492;//from isostar @@ -301,6 +302,8 @@ Grand Slam R5TP69 1493 Madden NFL08 RNFP69 1079 rboe69 = boogie ntsc = (675) + + RZTE01 = WSR = 674 Fifa08 RF8P69 463 Fifa08 RF8X69 464 diff --git a/source/prompts/TitleBrowser.cpp b/source/prompts/TitleBrowser.cpp index 384841cf..98dca12b 100644 --- a/source/prompts/TitleBrowser.cpp +++ b/source/prompts/TitleBrowser.cpp @@ -12,6 +12,9 @@ #include "settings/cfg.h" #include "sys.h" #include "menu.h" +#include "audio.h" + +#include "xml/xml.h" #include "../wad/title.h" @@ -36,6 +39,12 @@ int TitleBrowser(u32 type) u32 titles[100] ATTRIBUTE_ALIGN(32); s32 ret = -1; + //open the database file + FILE *f; + char path[100]; + + sprintf(path,"%s/config/database.txt",bootDevice); + f = fopen(path, "r"); // Get count of titles of our requested type ret = getTitles_TypeCount(type, &num_titles); @@ -61,21 +70,57 @@ int TitleBrowser(u32 type) customOptionList options3(num_titles); //write the titles on the option browser u32 i = 0; - while (i < num_titles){ - char name[256]; + + + + while (i < num_titles){ + //start from the beginning of the file each loop + rewind(f); + char name[50]; char text[15]; + strcpy(name,"");//make sure name is empty + //set the title's name, number, ID to text sprintf(text, "%s", titleText(type, titles[i])); getTitle_Name(name, TITLE_ID(type, titles[i]), text); + //get name from database cause i dont like the ADT function + char line[200]; + char tmp[50]; + snprintf(tmp,50,tmp," "); + snprintf(name,sizeof(name),"Unknown Title"); + + if (!f) { + sprintf(name,"Unknown--"); + } + else + { + while (fgets(line, sizeof(line), f)) { + if (line[0]== text[0]&& + line[1]== text[1]&& + line[2]== text[2]) + { int j=0; + for(j=0;(line[j+4]!='\0' || j<51);j++) + + tmp[j]=line[j+4]; + snprintf(name,sizeof(name),"%s",tmp); + break; + + } + + } + + } //set the text to the option browser - options3.SetName(i, "%s",name); - options3.SetValue(i, "%s (%08x)",text,titles[i]); - + options3.SetName(i, "%s",text); + options3.SetValue(i, "%s",name); + //options3.SetValue(i, "%s (%08x)",text,titles[i]); //move on to the next title i++; } + + bool exit = false; @@ -150,18 +195,58 @@ int TitleBrowser(u32 type) ret = optionBrowser3.GetClickedOption(); if(ret > -1) {//if a click happened - char name[256]; + + char name[50]; char text[15]; + rewind(f); + strcpy(name,"");//make sure name is empty + + //set the title's name, number, ID to text sprintf(text, "%s", titleText(type, titles[ret])); getTitle_Name(name, TITLE_ID(type, titles[ret]), text); + + //get name from database cause i dont like the ADT function + char line[200]; + char tmp[50]; + snprintf(tmp,50,tmp," "); + snprintf(name,sizeof(name),"Unknown Title"); + + if (!f) { + sprintf(name,"Unknown--"); + } + else + { + while (fgets(line, sizeof(line), f)) { + if (line[0]== text[0]&& + line[1]== text[1]&& + line[2]== text[2]) + { int j=0; + for(j=0;(line[j+4]!='\0' || j<51);j++) + + tmp[j]=line[j+4]; + snprintf(name,sizeof(name),"%s",tmp); + break; + + } + + } + } + char temp[100]; //prompt to boot selected title snprintf(temp, sizeof(temp), "%s : %s",text,name); int choice = WindowPrompt("Boot?", temp, tr("OK"), tr("Cancel")); if(choice) {//if they say yes + + //stop all this stuff before starting the channel + fclose(f); + CloseXMLDatabase(); + ExitGUIThreads(); + ShutdownAudio(); + StopGX(); WII_Initialize(); WII_LaunchTitle(TITLE_ID(type,titles[ret])); //this really shouldn't be needed because the title will be booted @@ -182,7 +267,8 @@ int TitleBrowser(u32 type) ret = -10; } } - + + fclose(f); HaltGui(); mainWindow->Remove(&w); ResumeGui(); diff --git a/source/settings/Settings.cpp b/source/settings/Settings.cpp index 48370aab..62a4563f 100644 --- a/source/settings/Settings.cpp +++ b/source/settings/Settings.cpp @@ -1770,10 +1770,39 @@ int MenuSettings() *********************************************************************************/ int GameSettings(struct discHdr * header) { - bool exit = false; + int menu = MENU_NONE; int ret; + int choice = 0; + bool exit = false; + int retVal = 0; - int pagetodisplay=1; + + + + + GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume); + GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume); + GuiSound btnClick1(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume); + + char imgPath[100]; + + snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path); + GuiImageData btnOutline(imgPath, button_dialogue_box_png); + snprintf(imgPath, sizeof(imgPath), "%ssettings_background.png", CFG.theme_path); + GuiImageData settingsbg(imgPath, settings_background_png); + + snprintf(imgPath, sizeof(imgPath), "%ssettings_title.png", CFG.theme_path); + GuiImageData MainButtonImgData(imgPath, settings_title_png); + + snprintf(imgPath, sizeof(imgPath), "%ssettings_title_over.png", CFG.theme_path); + GuiImageData MainButtonImgOverData(imgPath, settings_title_over_png); + + GuiTrigger trigA; + trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + GuiTrigger trigHome; + trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0); + GuiTrigger trigB; + trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); char gameName[31]; @@ -1786,478 +1815,753 @@ int GameSettings(struct discHdr * header) strncat(gameName, "...", 3); } - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume); + - char imgPath[100]; - snprintf(imgPath, sizeof(imgPath), "%socarina.png", CFG.theme_path); - GuiImageData btnOcarina(imgPath, ocarina_png); - snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path); - GuiImageData btnOutline(imgPath, button_dialogue_box_png); - snprintf(imgPath, sizeof(imgPath), "%sgamesettings_background.png", CFG.theme_path); - GuiImageData settingsbg(imgPath, settings_background_png); - - GuiTrigger trigA; - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiTrigger trigHome; - trigHome.SetButtonOnlyTrigger(-1, WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME, 0); - GuiTrigger trigB; - trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); - - GuiText titleTxt(get_title(header), 28, (GXColor){0, 0, 0, 255}); + GuiText titleTxt(get_title(header), 28, (GXColor){0, 0, 0, 255}); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetPosition(12,40); titleTxt.SetMaxWidth(356, GuiText::SCROLL); GuiImage settingsbackground(&settingsbg); - GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight()); - settingsbackgroundbtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP); - settingsbackgroundbtn.SetPosition(0, 0); - settingsbackgroundbtn.SetImage(&settingsbackground); - GuiText saveBtnTxt(tr("Save"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); + GuiText backBtnTxt(tr("Back") , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); + backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); + GuiImage backBtnImg(&btnOutline); + if (Settings.wsprompt == yes){ + backBtnTxt.SetWidescreen(CFG.widescreen); + backBtnImg.SetWidescreen(CFG.widescreen); + } + GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, -180, 400, &trigA, &btnSoundOver, &btnClick,1); + backBtn.SetLabel(&backBtnTxt); + backBtn.SetTrigger(&trigB); + + GuiButton homo(1,1); + homo.SetTrigger(&trigHome); + + GuiText saveBtnTxt(tr("Save"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); saveBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); GuiImage saveBtnImg(&btnOutline); if (Settings.wsprompt == yes){ saveBtnTxt.SetWidescreen(CFG.widescreen); saveBtnImg.SetWidescreen(CFG.widescreen);} - GuiButton saveBtn(&saveBtnImg,&saveBtnImg, 2, 3, -180, 400, &trigA, &btnSoundOver, &btnClick,1); - saveBtn.SetScale(0.9); + GuiButton saveBtn(&saveBtnImg,&saveBtnImg, 2, 3, 180, 400, &trigA, &btnSoundOver, &btnClick,1); saveBtn.SetLabel(&saveBtnTxt); - GuiText cancelBtnTxt(tr("Back"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); - cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); - GuiImage cancelBtnImg(&btnOutline); - if (Settings.wsprompt == yes){ - cancelBtnTxt.SetWidescreen(CFG.widescreen); - cancelBtnImg.SetWidescreen(CFG.widescreen);} - GuiButton cancelBtn(&cancelBtnImg,&cancelBtnImg, 2, 3, 180, 400, &trigA, &btnSoundOver, &btnClick,1); - cancelBtn.SetScale(0.9); - cancelBtn.SetLabel(&cancelBtnTxt); - cancelBtn.SetTrigger(&trigB); + - GuiText deleteBtnTxt(tr("Uninstall Menu"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); - deleteBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); - GuiImage deleteBtnImg(&btnOutline); - if (Settings.wsprompt == yes){ - deleteBtnTxt.SetWidescreen(CFG.widescreen); - deleteBtnImg.SetWidescreen(CFG.widescreen);} - GuiButton deleteBtn(&deleteBtnImg,&deleteBtnImg, 2, 3, 0, 400, &trigA, &btnSoundOver, &btnClick,1); - deleteBtn.SetScale(0.9); - deleteBtn.SetLabel(&deleteBtnTxt); + char MainButtonText[50]; + snprintf(MainButtonText, sizeof(MainButtonText), "%s", " "); - GuiImage GCTBtnImg(&btnOcarina); - if (Settings.wsprompt == yes){ - GCTBtnImg.SetWidescreen(CFG.widescreen);} - GuiButton GCTBtn(&GCTBtnImg,&GCTBtnImg, ALIGN_RIGHT, ALIGN_TOP, -20, 90, &trigA, &btnSoundOver, &btnClick,1); - GCTBtn.SetSize(80,80); - GCTBtnImg.SetScale(0.5); + GuiImage MainButton1Img(&MainButtonImgData); + GuiImage MainButton1ImgOver(&MainButtonImgOverData); + GuiText MainButton1Txt(MainButtonText, 22, (GXColor){0, 0, 0, 255}); + MainButton1Txt.SetMaxWidth(MainButton1Img.GetWidth()); + GuiButton MainButton1(MainButton1Img.GetWidth(), MainButton1Img.GetHeight()); + MainButton1.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + MainButton1.SetPosition(0, 90); + MainButton1.SetImage(&MainButton1Img); + MainButton1.SetImageOver(&MainButton1ImgOver); + MainButton1.SetLabel(&MainButton1Txt); + MainButton1.SetSoundOver(&btnSoundOver); + MainButton1.SetSoundClick(&btnClick1); + MainButton1.SetEffectGrow(); + MainButton1.SetTrigger(&trigA); - customOptionList options3(11); - GuiCustomOptionBrowser optionBrowser3(396, 280, &options3, CFG.theme_path, "bg_options_gamesettings.png", bg_options_settings_png, 1, 180); - optionBrowser3.SetPosition(0, 90); - optionBrowser3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + GuiImage MainButton2Img(&MainButtonImgData); + GuiImage MainButton2ImgOver(&MainButtonImgOverData); + GuiText MainButton2Txt(MainButtonText, 22, (GXColor){0, 0, 0, 255}); + MainButton2Txt.SetMaxWidth(MainButton2Img.GetWidth()); + GuiButton MainButton2(MainButton2Img.GetWidth(), MainButton2Img.GetHeight()); + MainButton2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + MainButton2.SetPosition(0, 160); + MainButton2.SetImage(&MainButton2Img); + MainButton2.SetImageOver(&MainButton2ImgOver); + MainButton2.SetLabel(&MainButton2Txt); + MainButton2.SetSoundOver(&btnSoundOver); + MainButton2.SetSoundClick(&btnClick1); + MainButton2.SetEffectGrow(); + MainButton2.SetTrigger(&trigA); + + GuiImage MainButton3Img(&MainButtonImgData); + GuiImage MainButton3ImgOver(&MainButtonImgOverData); + GuiText MainButton3Txt(MainButtonText, 22, (GXColor){0, 0, 0, 255}); + MainButton3Txt.SetMaxWidth(MainButton3Img.GetWidth()); + GuiButton MainButton3(MainButton3Img.GetWidth(), MainButton3Img.GetHeight()); + MainButton3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + MainButton3.SetPosition(0, 230); + MainButton3.SetImage(&MainButton3Img); + MainButton3.SetImageOver(&MainButton3ImgOver); + MainButton3.SetLabel(&MainButton3Txt); + MainButton3.SetSoundOver(&btnSoundOver); + MainButton3.SetSoundClick(&btnClick1); + MainButton3.SetEffectGrow(); + MainButton3.SetTrigger(&trigA); + + GuiImage MainButton4Img(&MainButtonImgData); + GuiImage MainButton4ImgOver(&MainButtonImgOverData); + GuiText MainButton4Txt(MainButtonText, 22, (GXColor){0, 0, 0, 255}); + MainButton4Txt.SetMaxWidth(MainButton4Img.GetWidth()); + GuiButton MainButton4(MainButton4Img.GetWidth(), MainButton4Img.GetHeight()); + MainButton4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + MainButton4.SetPosition(0, 300); + MainButton4.SetImage(&MainButton4Img); + MainButton4.SetImageOver(&MainButton4ImgOver); + MainButton4.SetLabel(&MainButton4Txt); + MainButton4.SetSoundOver(&btnSoundOver); + MainButton4.SetSoundClick(&btnClick1); + MainButton4.SetEffectGrow(); + MainButton4.SetTrigger(&trigA); + + customOptionList options2(MAXOPTIONS-1); + GuiCustomOptionBrowser optionBrowser2(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 0, 150); + optionBrowser2.SetPosition(0, 90); + optionBrowser2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - HaltGui(); GuiWindow w(screenwidth, screenheight); - w.Append(&settingsbackgroundbtn); - w.Append(&titleTxt); - w.Append(&deleteBtn); - w.Append(&saveBtn); - w.Append(&cancelBtn); - w.Append(&optionBrowser3); - w.Append(&GCTBtn); - - mainWindow->Append(&w); - + int opt_lang = languageChoice; // backup language setting struct Game_CFG* game_cfg = CFG_get_game_opt(header->id); - if (game_cfg)//if there are saved settings for this game use them + int pageToDisplay = 1; + while ( pageToDisplay > 0) //set pageToDisplay to 0 to quit { - videoChoice = game_cfg->video; - languageChoice = game_cfg->language; - ocarinaChoice = game_cfg->ocarina; - viChoice = game_cfg->vipatch; - iosChoice = game_cfg->ios; - parentalcontrolChoice = game_cfg->parentalcontrol; - fix002 = game_cfg->errorfix002; - countrystrings = game_cfg->patchcountrystrings; - alternatedol = game_cfg->loadalternatedol; - alternatedoloffset = game_cfg->alternatedolstart; - reloadblock = game_cfg->iosreloadblock; - strncpy(alternatedname, game_cfg->alternatedolname, sizeof(alternatedname)); - } - else - { - videoChoice = Settings.video; - languageChoice = Settings.language; - ocarinaChoice = Settings.ocarina; - viChoice = Settings.vpatch; - if(Settings.cios == ios222) { - iosChoice = i222; - } else { - iosChoice = i249; - } - parentalcontrolChoice = 0; - fix002 = Settings.error002; - countrystrings = Settings.patchcountrystrings; - alternatedol = off; - alternatedoloffset = 0; - reloadblock = off; - sprintf(alternatedname, " "); - } + VIDEO_WaitVSync (); - int opt_lang = languageChoice; // backup language setting + menu = MENU_NONE; - ResumeGui(); + /** Standard procedure made in all pages **/ + MainButton1.StopEffect(); + MainButton2.StopEffect(); + MainButton3.StopEffect(); + MainButton4.StopEffect(); - while(!exit) - { - VIDEO_WaitVSync(); + HaltGui(); - if (pagetodisplay==1){ - options3.SetName(0,"%s", tr("Video Mode")); - options3.SetName(1,"%s", tr("VIDTV Patch")); - options3.SetName(2,"%s", tr("Game Language")); - options3.SetName(3, "Ocarina"); - options3.SetName(4, "IOS"); - options3.SetName(5,"%s", tr("Parental control")); - options3.SetName(6,"%s", tr("Error 002 fix")); - options3.SetName(7,"%s", tr("Patch Country Strings")); - options3.SetName(8,"%s", tr("Alternate DOL")); - options3.SetName(9,"%s", tr("DOL from disc")); - options3.SetName(10,"%s", tr("Block IOS Reload")); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr("Game Load")); + MainButton1Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "Ocarina"); + MainButton2Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr("Uninstall Menu")); + MainButton3Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", tr("Default Gamesettings")); + MainButton4Txt.SetText(MainButtonText); - if (videoChoice == discdefault) options3.SetValue(0,"%s",tr("Disc Default")); - else if (videoChoice == systemdefault) options3.SetValue(0,"%s",tr("System Default")); - else if (videoChoice == patch) options3.SetValue(0,"%s",tr("AutoPatch")); - else if (videoChoice == pal50) options3.SetValue(0,"%s PAL50",tr("Force")); - else if (videoChoice == pal60) options3.SetValue(0,"%s PAL60",tr("Force")); - else if (videoChoice == ntsc) options3.SetValue(0,"%s NTSC",tr("Force")); + mainWindow->RemoveAll(); + mainWindow->Append(&w); + w.RemoveAll(); + w.Append(&settingsbackground); + w.Append(&titleTxt); + w.Append(&backBtn); + w.Append(&homo); + //w.Append(&saveBtn); + w.Append(&MainButton1); + w.Append(&MainButton2); + w.Append(&MainButton3); + w.Append(&MainButton4); - if (viChoice == on) options3.SetValue(1,"%s",tr("ON")); - else if (viChoice == off) options3.SetValue(1,"%s",tr("OFF")); + /** Disable ability to click through MainButtons */ + optionBrowser2.SetClickable(false); + /** Default no scrollbar and reset position **/ + optionBrowser2.SetScrollbar(0); + optionBrowser2.SetOffset(0); - if (languageChoice == ConsoleLangDefault) options3.SetValue(2,"%s",tr("Console Default")); - else if (languageChoice == jap) options3.SetValue(2,"%s",tr("Japanese")); - else if (languageChoice == ger) options3.SetValue(2,"%s",tr("German")); - else if (languageChoice == eng) options3.SetValue(2,"%s",tr("English")); - else if (languageChoice == fren) options3.SetValue(2,"%s",tr("French")); - else if (languageChoice == esp) options3.SetValue(2,"%s",tr("Spanish")); - else if (languageChoice == it) options3.SetValue(2,"%s",tr("Italian")); - else if (languageChoice == dut) options3.SetValue(2,"%s",tr("Dutch")); - else if (languageChoice == schin) options3.SetValue(2,"%s",tr("SChinese")); - else if (languageChoice == tchin) options3.SetValue(2,"%s",tr("TChinese")); - else if (languageChoice == kor) options3.SetValue(2,"%s",tr("Korean")); + MainButton1.StopEffect(); + MainButton2.StopEffect(); + MainButton3.StopEffect(); + MainButton4.StopEffect(); - if (ocarinaChoice == on) options3.SetValue(3,"%s",tr("ON")); - else if (ocarinaChoice == off) options3.SetValue(3,"%s",tr("OFF")); + MainButton1.SetEffectGrow(); + MainButton2.SetEffectGrow(); + MainButton3.SetEffectGrow(); + MainButton4.SetEffectGrow(); - if (iosChoice == i249) options3.SetValue(4,"249"); - else if (iosChoice == i222) options3.SetValue(4,"222"); - else if (iosChoice == i223) options3.SetValue(4,"223"); + + MainButton1.SetEffect(EFFECT_FADE, 20); + MainButton2.SetEffect(EFFECT_FADE, 20); + MainButton3.SetEffect(EFFECT_FADE, 20); + MainButton4.SetEffect(EFFECT_FADE, 20); + + mainWindow->Append(&w); + + - if (parentalcontrolChoice == 0) options3.SetValue(5, tr("0 (Everyone)")); - else if (parentalcontrolChoice == 1) options3.SetValue(5, tr("1 (Child 7+)")); - else if (parentalcontrolChoice == 2) options3.SetValue(5, tr("2 (Teen 12+)")); - else if (parentalcontrolChoice == 3) options3.SetValue(5, tr("3 (Mature 16+)")); - else if (parentalcontrolChoice == 4) options3.SetValue(5, tr("4 (Adults Only 18+)")); - - if (fix002 == on) options3.SetValue(6,tr("ON")); - else if (fix002 == off) options3.SetValue(6,tr("OFF")); - else if (fix002 == anti) options3.SetValue(6,tr("Anti")); - - if (countrystrings == on) options3.SetValue(7,tr("ON")); - else if (countrystrings == off) options3.SetValue(7,tr("OFF")); - - if (alternatedol == on) options3.SetValue(8,tr("DOL from SD")); - if (alternatedol == 2) options3.SetValue(8,tr("DOL from disc")); - else if (alternatedol == off) options3.SetValue(8,tr("OFF")); - - if (alternatedol == on) options3.SetValue(9,tr("SD selected")); - else if (alternatedol == off) options3.SetValue(9,tr("OFF")); - else options3.SetValue(9, alternatedname); - - if (reloadblock == on) options3.SetValue(10,tr("ON")); - else if (reloadblock == off) options3.SetValue(10,tr("OFF")); - - if(shutdown == 1) - Sys_Shutdown(); - if(reset == 1) - Sys_Reboot(); - - ret = optionBrowser3.GetClickedOption(); - - switch (ret) + if (game_cfg)//if there are saved settings for this game use them { - case 0: - videoChoice = (videoChoice + 1) % CFG_VIDEO_COUNT; - break; - case 1: - viChoice = (viChoice + 1) % 2; - break; - case 2: - languageChoice = (languageChoice + 1) % CFG_LANG_COUNT; - break; - case 3: - ocarinaChoice = (ocarinaChoice + 1) % 2; - break; - case 4: - iosChoice = (iosChoice + 1) % 3; - break; - case 5: - parentalcontrolChoice = (parentalcontrolChoice + 1) % 5; - break; - case 6: - fix002 = (fix002+1) % 3; - break; - case 7: - countrystrings = (countrystrings+1) % 2; - break; - case 8: - alternatedol = (alternatedol+1) % 3; - break; - case 9: - if(alternatedol == 2) { - char filename[10]; - snprintf(filename,sizeof(filename),"%c%c%c%c%c%c",header->id[0], header->id[1], header->id[2], - header->id[3],header->id[4], header->id[5]); - int dolchoice =0; - //check to see if we already know the offset of the correct dol - int autodol = autoSelectDol(filename); - - //if we do know that offset ask if they want to use it - if (autodol>0){ - dolchoice = WindowPrompt(0,tr("Do you want to use the alt dol that is known to be correct?"),tr("Yes"),tr("Pick from a list")); - if (dolchoice==1) - { - alternatedoloffset = autodol; - snprintf(alternatedname, sizeof(alternatedname), "%s <%i>", tr("AUTO"),autodol); - } - else {//they want to search for the correct dol themselves - int res = DiscBrowse(header); - if((res >= 0)&&(res !=696969))//if res==6969696 they pressed the back button - alternatedoloffset = res; - } - } - else { - int res = DiscBrowse(header); - if((res >= 0)&&(res !=696969)) - alternatedoloffset = res; - char tmp[170]; - snprintf(tmp,sizeof(tmp),tr("It seems that you have some information that will we helpfull to us. Please pass this information along to the DEV team. %s - %i") ,filename,alternatedoloffset); - WindowPrompt(0,tmp,tr("Ok")); - } - - - - } - break; - case 10: - reloadblock = (reloadblock+1) % 2; - break; - + videoChoice = game_cfg->video; + languageChoice = game_cfg->language; + ocarinaChoice = game_cfg->ocarina; + viChoice = game_cfg->vipatch; + iosChoice = game_cfg->ios; + parentalcontrolChoice = game_cfg->parentalcontrol; + fix002 = game_cfg->errorfix002; + countrystrings = game_cfg->patchcountrystrings; + alternatedol = game_cfg->loadalternatedol; + alternatedoloffset = game_cfg->alternatedolstart; + reloadblock = game_cfg->iosreloadblock; + strncpy(alternatedname, game_cfg->alternatedolname, sizeof(alternatedname)); } - } - - //the uninstall menu - if (pagetodisplay==2){ - for (int j=0;j<13;j++) - { - options3.SetName(j,NULL); - options3.SetValue(j,NULL); + else + { + videoChoice = Settings.video; + languageChoice = Settings.language; + ocarinaChoice = Settings.ocarina; + viChoice = Settings.vpatch; + if(Settings.cios == ios222) { + iosChoice = i222; + } else { + iosChoice = i249; } - options3.SetName(0,"%s", tr("Uninstall Game")); - options3.SetName(1,"%s", tr("Default Gamesettings")); - options3.SetName(2,"%s", tr("Reset Playcounter")); - options3.SetName(3,"%s", tr("Delete Boxart")); - options3.SetName(4,"%s", tr("Delete Discart")); - options3.SetName(5,"%s", tr("Delete CheatTxt")); + parentalcontrolChoice = 0; + fix002 = Settings.error002; + countrystrings = Settings.patchcountrystrings; + alternatedol = off; + alternatedoloffset = 0; + reloadblock = off; + sprintf(alternatedname, " "); + } + ResumeGui(); - if(shutdown == 1) - Sys_Shutdown(); - if(reset == 1) - Sys_Reboot(); + while(MainButton1.GetEffect() > 0) usleep(50); - ret = optionBrowser3.GetClickedOption(); + - int choice1; - char tmp[200]; - switch (ret) + while(menu == MENU_NONE) { - case 0: - choice1 = WindowPrompt(tr("Do you really want to delete:"),gameName,tr("Yes"),tr("Cancel")); - if (choice1 == 1) - { - CFG_forget_game_opt(header->id); - CFG_forget_game_num(header->id); - ret = WBFS_RemoveGame(header->id); - if (ret < 0) - { - WindowPrompt( - tr("Can't delete:"), - gameName, - tr("OK")); - } - else { - WindowPrompt(tr("Successfully deleted:"),gameName,tr("OK")); - retVal = 1; - } - } - else if (choice1 == 0) - { - optionBrowser3.SetFocus(1); - } - break; - case 1: - choice1 = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel")); - if(choice1 == 1) { - videoChoice = Settings.video; - viChoice = Settings.vpatch; - languageChoice = Settings.language; - ocarinaChoice = Settings.ocarina; - fix002 = Settings.error002; - countrystrings = Settings.patchcountrystrings; - alternatedol = off; - alternatedoloffset = 0; - reloadblock = off; - if(Settings.cios == ios222) { - iosChoice = i222; - } else { - iosChoice = i249; + VIDEO_WaitVSync (); + + if(MainButton1.GetState() == STATE_CLICKED) { + w.Append(&saveBtn); + MainButton1.SetEffect(EFFECT_FADE, -20); + MainButton2.SetEffect(EFFECT_FADE, -20); + MainButton3.SetEffect(EFFECT_FADE, -20); + MainButton4.SetEffect(EFFECT_FADE, -20); + while(MainButton1.GetEffect() > 0) usleep(50); + HaltGui(); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + exit = false; + for(int i = 0; i <= MAXOPTIONS-1; i++) options2.SetName(i, NULL); + options2.SetName(0, "%s",tr("Video Mode")); + options2.SetName(1, "%s",tr("VIDTV Patch")); + options2.SetName(2,"%s", tr("Game Language")); + options2.SetName(3, "Ocarina"); + options2.SetName(4, "IOS"); + options2.SetName(5,"%s", tr("Parental control")); + options2.SetName(6,"%s", tr("Error 002 fix")); + options2.SetName(7,"%s", tr("Patch Country Strings")); + options2.SetName(8,"%s", tr("Alternate DOL")); + options2.SetName(9,"%s", tr("DOL from disc")); + options2.SetName(10,"%s", tr("Block IOS Reload")); + for(int i = 0; i <= MAXOPTIONS-1; i++) options2.SetValue(i, NULL); + optionBrowser2.SetScrollbar(1); + w.Append(&optionBrowser2); + //w.Append(&saveBtn); + optionBrowser2.SetClickable(true); + ResumeGui(); + + VIDEO_WaitVSync (); + optionBrowser2.SetEffect(EFFECT_FADE, 20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + + int returnhere = 1; + char * languagefile; + languagefile = strrchr(Settings.language_path, '/')+1; + + while(!exit) + { + VIDEO_WaitVSync (); + + returnhere = 1; + + if(videoChoice >= 6) + videoChoice = 0; + if(viChoice >= 2) + viChoice = 0; + if (languageChoice >= 11) + languageChoice = 0; + if ( ocarinaChoice >= 2) + ocarinaChoice = 0; + if ( Settings.wsprompt > 1 ) + Settings.wsprompt = 0; + if ( iosChoice >= 3) + iosChoice = 0; + if ( Settings.wiilight > 2 ) + Settings.wiilight = 0; + if(parentalcontrolChoice >= 5) + parentalcontrolChoice = 0; + if(fix002 >= 3) + fix002 = 0; //RUMBLE + if(countrystrings >= 2) + countrystrings = 0; + if(alternatedol >= 3) + alternatedol = 0; + if(reloadblock >= 2) + reloadblock = 0; + + if (videoChoice == discdefault) options2.SetValue(0,"%s",tr("Disc Default")); + else if (videoChoice == systemdefault) options2.SetValue(0,"%s",tr("System Default")); + else if (videoChoice == patch) options2.SetValue(0,"%s",tr("AutoPatch")); + else if (videoChoice == pal50) options2.SetValue(0,"%s PAL50",tr("Force")); + else if (videoChoice == pal60) options2.SetValue(0,"%s PAL60",tr("Force")); + else if (videoChoice == ntsc) options2.SetValue(0,"%s NTSC",tr("Force")); + + if (viChoice == on) options2.SetValue(1,"%s",tr("ON")); + else if (viChoice == off) options2.SetValue(1,"%s",tr("OFF")); + + if (languageChoice == ConsoleLangDefault) options2.SetValue(2,"%s",tr("Console Default")); + else if (languageChoice == jap) options2.SetValue(2,"%s",tr("Japanese")); + else if (languageChoice == ger) options2.SetValue(2,"%s",tr("German")); + else if (languageChoice == eng) options2.SetValue(2,"%s",tr("English")); + else if (languageChoice == fren) options2.SetValue(2,"%s",tr("French")); + else if (languageChoice == esp) options2.SetValue(2,"%s",tr("Spanish")); + else if (languageChoice == it) options2.SetValue(2,"%s",tr("Italian")); + else if (languageChoice == dut) options2.SetValue(2,"%s",tr("Dutch")); + else if (languageChoice == schin) options2.SetValue(2,"%s",tr("SChinese")); + else if (languageChoice == tchin) options2.SetValue(2,"%s",tr("TChinese")); + else if (languageChoice == kor) options2.SetValue(2,"%s",tr("Korean")); + + if (ocarinaChoice == on) options2.SetValue(3,"%s",tr("ON")); + else if (ocarinaChoice == off) options2.SetValue(3,"%s",tr("OFF")); + + if (iosChoice == i249) options2.SetValue(4,"249"); + else if (iosChoice == i222) options2.SetValue(4,"222"); + else if (iosChoice == i223) options2.SetValue(4,"223"); + + if (parentalcontrolChoice == 0) options2.SetValue(5, tr("0 (Everyone)")); + else if (parentalcontrolChoice == 1) options2.SetValue(5, tr("1 (Child 7+)")); + else if (parentalcontrolChoice == 2) options2.SetValue(5, tr("2 (Teen 12+)")); + else if (parentalcontrolChoice == 3) options2.SetValue(5, tr("3 (Mature 16+)")); + else if (parentalcontrolChoice == 4) options2.SetValue(5, tr("4 (Adults Only 18+)")); + + if (fix002 == on) options2.SetValue(6,tr("ON")); + else if (fix002 == off) options2.SetValue(6,tr("OFF")); + else if (fix002 == anti) options2.SetValue(6,tr("Anti")); + + if (countrystrings == on) options2.SetValue(7,tr("ON")); + else if (countrystrings == off) options2.SetValue(7,tr("OFF")); + + if (alternatedol == on) options2.SetValue(8,tr("DOL from SD")); + if (alternatedol == 2) options2.SetValue(8,tr("DOL from disc")); + else if (alternatedol == off) options2.SetValue(8,tr("OFF")); + + if (alternatedol == on) options2.SetValue(9,tr("SD selected")); + else if (alternatedol == off) options2.SetValue(9,tr("OFF")); + else options2.SetValue(9, alternatedname); + + if (reloadblock == on) options2.SetValue(10,tr("ON")); + else if (reloadblock == off) options2.SetValue(10,tr("OFF")); + + if(backBtn.GetState() == STATE_CLICKED) + { + backBtn.ResetState(); + exit = true; + break; + } + + if(shutdown == 1) + Sys_Shutdown(); + else if(reset == 1) + Sys_Reboot(); + + else if(menu == MENU_DISCLIST) { + w.Remove(&optionBrowser2); + w.Remove(&backBtn); + WindowCredits(); + w.Append(&optionBrowser2); + w.Append(&backBtn); + } + else if(homo.GetState() == STATE_CLICKED) + { + cfg_save_global(); + optionBrowser2.SetState(STATE_DISABLED); + s32 thetimeofbg = bgMusic->GetPlayTime(); + bgMusic->Stop(); + choice = WindowExitPrompt(tr("Exit USB Loader GX?"),0, tr("Back to Loader"),tr("Wii Menu"),tr("Back"),0); + if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) + { + bgMusic->Play(); + } else { + bgMusic->PlayOggFile(Settings.ogg_path); + } + bgMusic->SetPlayTime(thetimeofbg); + SetVolumeOgg(255*(Settings.volume/100.0)); + if(choice == 3) { + Sys_LoadMenu(); // Back to System Menu + } else if (choice == 2) { + Sys_BackToLoader(); + } else { + homo.ResetState(); + } + optionBrowser2.SetState(STATE_DEFAULT); + } + + ret = optionBrowser2.GetClickedOption(); + + switch (ret) + { + case 0: + videoChoice = (videoChoice + 1) % CFG_VIDEO_COUNT; + break; + case 1: + viChoice = (viChoice + 1) % 2; + break; + case 2: + languageChoice = (languageChoice + 1) % CFG_LANG_COUNT; + break; + case 3: + ocarinaChoice = (ocarinaChoice + 1) % 2; + break; + case 4: + iosChoice = (iosChoice + 1) % 3; + break; + case 5: + parentalcontrolChoice = (parentalcontrolChoice + 1) % 5; + break; + case 6: + fix002 = (fix002+1) % 3; + break; + case 7: + countrystrings = (countrystrings+1) % 2; + break; + case 8: + alternatedol = (alternatedol+1) % 3; + break; + case 9: + if(alternatedol == 2) { + char filename[10]; + snprintf(filename,sizeof(filename),"%c%c%c%c%c%c",header->id[0], header->id[1], header->id[2], + header->id[3],header->id[4], header->id[5]); + int dolchoice =0; + //check to see if we already know the offset of the correct dol + int autodol = autoSelectDol(filename); + + //if we do know that offset ask if they want to use it + if (autodol>0){ + dolchoice = WindowPrompt(0,tr("Do you want to use the alt dol that is known to be correct?"),tr("Yes"),tr("Pick from a list")); + if (dolchoice==1) + { + alternatedoloffset = autodol; + snprintf(alternatedname, sizeof(alternatedname), "%s <%i>", tr("AUTO"),autodol); + } + else {//they want to search for the correct dol themselves + int res = DiscBrowse(header); + if((res >= 0)&&(res !=696969))//if res==6969696 they pressed the back button + alternatedoloffset = res; + } + } + else { + int res = DiscBrowse(header); + if((res >= 0)&&(res !=696969)) + alternatedoloffset = res; + char tmp[170]; + snprintf(tmp,sizeof(tmp),tr("It seems that you have some information that will we helpfull to us. Please pass this information along to the DEV team. %s - %i") ,filename,alternatedoloffset); + WindowPrompt(0,tmp,tr("Ok")); + } + + + + } + break; + case 10: + reloadblock = (reloadblock+1) % 2; + break; + + } + + if(saveBtn.GetState() == STATE_CLICKED) + { + + if(isInserted(bootDevice)) { + if (CFG_save_game_opt(header->id)) + { + // if language has changed, reload titles + int opt_langnew = 0; + game_cfg = CFG_get_game_opt(header->id); + if (game_cfg) opt_langnew = game_cfg->language; + 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")); + } + else + { + WindowPrompt(tr("Save Failed"), 0, tr("OK")); + } + } else { + WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK")); + } + + saveBtn.ResetState(); + optionBrowser2.SetFocus(1); + } + } + + optionBrowser2.SetEffect(EFFECT_FADE, -20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + MainButton1.ResetState(); + break; + w.Remove(&saveBtn); + } + + if(MainButton2.GetState() == STATE_CLICKED) { + char ID[7]; + snprintf (ID,sizeof(ID),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); + CheatMenu(ID); + MainButton2.ResetState(); + break; + } + + if(MainButton3.GetState() == STATE_CLICKED) { + MainButton1.SetEffect(EFFECT_FADE, -20); + MainButton2.SetEffect(EFFECT_FADE, -20); + MainButton3.SetEffect(EFFECT_FADE, -20); + MainButton4.SetEffect(EFFECT_FADE, -20); + while(MainButton3.GetEffect() > 0) usleep(50); + HaltGui(); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + //titleTxt.SetText(tr("Parental Control")); + exit = false; + + for(int i = 0; i <= MAXOPTIONS-1; i++) options2.SetName(i, NULL); + options2.SetName(0,"%s", tr("Uninstall Game")); + options2.SetName(1,"%s", tr("Reset Playcounter")); + options2.SetName(2,"%s", tr("Delete Boxart")); + options2.SetName(3,"%s", tr("Delete Discart")); + options2.SetName(4,"%s", tr("Delete CheatTxt")); + for(int i = 0; i <= MAXOPTIONS-1; i++) options2.SetValue(i, NULL); + w.Append(&optionBrowser2); + optionBrowser2.SetClickable(true); + ResumeGui(); + + VIDEO_WaitVSync (); + optionBrowser2.SetEffect(EFFECT_FADE, 20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + + while(!exit) + { + VIDEO_WaitVSync (); + + if(backBtn.GetState() == STATE_CLICKED) + { + backBtn.ResetState(); + exit = true; + break; + } + + if(shutdown == 1) + Sys_Shutdown(); + else if(reset == 1) + Sys_Reboot(); + + else if(homo.GetState() == STATE_CLICKED) + { + cfg_save_global(); + optionBrowser2.SetState(STATE_DISABLED); + s32 thetimeofbg = bgMusic->GetPlayTime(); + bgMusic->Stop(); + choice = WindowExitPrompt(tr("Exit USB Loader GX?"),0, tr("Back to Loader"),tr("Wii Menu"),tr("Back"),0); + if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) + { + bgMusic->Play(); + } else { + bgMusic->PlayOggFile(Settings.ogg_path); + } + bgMusic->SetPlayTime(thetimeofbg); + SetVolumeOgg(255*(Settings.volume/100.0)); + if(choice == 3) { + Sys_LoadMenu(); // Back to System Menu + } else if (choice == 2) { + Sys_BackToLoader(); + } else { + homo.ResetState(); + } + optionBrowser2.SetState(STATE_DEFAULT); + } + + ret = optionBrowser2.GetClickedOption(); + + int choice1; + char tmp[200]; + switch (ret) + { + case 0: + choice1 = WindowPrompt(tr("Do you really want to delete:"),gameName,tr("Yes"),tr("Cancel")); + if (choice1 == 1) + { + CFG_forget_game_opt(header->id); + CFG_forget_game_num(header->id); + ret = WBFS_RemoveGame(header->id); + if (ret < 0) + { + WindowPrompt( + tr("Can't delete:"), + gameName, + tr("OK")); + } + else { + WindowPrompt(tr("Successfully deleted:"),gameName,tr("OK")); + retVal = 1; + } + } + else if (choice1 == 0) + { + optionBrowser2.SetFocus(1); + } + break; + case 1: + int result; + result = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel")); + if(result == 1) { + if(isInserted(bootDevice)) { + struct Game_NUM* game_num = CFG_get_game_num(header->id); + if (game_num) { + favoritevar = game_num->favorite; + playcount = game_num->count; + } else { + favoritevar = 0; + playcount = 0; + } + playcount = 0; + CFG_save_game_num(header->id); + } + } + break; + case 2: + + snprintf(tmp,sizeof(tmp),"%s%c%c%c%c%c%c.png", Settings.covers_path, header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); + + choice1 = WindowPrompt(tr("Delete"),tmp,tr("Yes"),tr("No")); + if(choice1==1) + { + if(checkfile(tmp)) + remove(tmp); + } + break; + case 3: + + snprintf(tmp,sizeof(tmp),"%s%c%c%c%c%c%c.png", Settings.disc_path, header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); + + choice1 = WindowPrompt(tr("Delete"),tmp,tr("Yes"),tr("No")); + if(choice1==1) + { + if(checkfile(tmp)) + remove(tmp); + } + break; + case 4: + + snprintf(tmp,sizeof(tmp),"%s%c%c%c%c%c%c.txt", Settings.TxtCheatcodespath, header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); + + choice1 = WindowPrompt(tr("Delete"),tmp,tr("Yes"),tr("No")); + if(choice1==1) + { + if(checkfile(tmp)) + remove(tmp); + } + break; + + } } - parentalcontrolChoice = 0; - sprintf(alternatedname, " "); - CFG_forget_game_opt(header->id); - // if default language is different than language from main settings, reload titles - int opt_langnew = 0; - opt_langnew = Settings.language; - 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 + optionBrowser2.SetEffect(EFFECT_FADE, -20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + pageToDisplay = 1; + MainButton3.ResetState(); + break; } - break; - case 2: - int result; - result = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel")); - if(result == 1) { - if(isInserted(bootDevice)) { - struct Game_NUM* game_num = CFG_get_game_num(header->id); - if (game_num) { - favoritevar = game_num->favorite; - playcount = game_num->count; - } else { - favoritevar = 0; - playcount = 0; - } - playcount = 0; - CFG_save_game_num(header->id); + + if(MainButton4.GetState() == STATE_CLICKED) { + + int choice1 = WindowPrompt(tr("Are you sure?"),0,tr("Yes"),tr("Cancel")); + if(choice1 == 1) { + videoChoice = Settings.video; + viChoice = Settings.vpatch; + languageChoice = Settings.language; + ocarinaChoice = Settings.ocarina; + fix002 = Settings.error002; + countrystrings = Settings.patchcountrystrings; + alternatedol = off; + alternatedoloffset = 0; + reloadblock = off; + if(Settings.cios == ios222) { + iosChoice = i222; + } else { + iosChoice = i249; + } + parentalcontrolChoice = 0; + sprintf(alternatedname, " "); + CFG_forget_game_opt(header->id); + // if default language is different than language from main settings, reload titles + int opt_langnew = 0; + opt_langnew = Settings.language; + 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 + } + + pageToDisplay = 1; + MainButton4.ResetState(); + break; } - } + + + if(shutdown == 1) + Sys_Shutdown(); + if(reset == 1) + Sys_Reboot(); + + if(backBtn.GetState() == STATE_CLICKED) + { + menu = MENU_DISCLIST; + pageToDisplay = 0; break; - case 3: + } - snprintf(tmp,sizeof(tmp),"%s%c%c%c%c%c%c.png", Settings.covers_path, header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); - - choice1 = WindowPrompt(tr("Delete"),tmp,tr("Yes"),tr("No")); - if(choice1==1) - { - if(checkfile(tmp)) - remove(tmp); - } - break; - case 4: - - snprintf(tmp,sizeof(tmp),"%s%c%c%c%c%c%c.png", Settings.disc_path, header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); - - choice1 = WindowPrompt(tr("Delete"),tmp,tr("Yes"),tr("No")); - if(choice1==1) - { - if(checkfile(tmp)) - remove(tmp); - } - break; - case 5: - - snprintf(tmp,sizeof(tmp),"%s%c%c%c%c%c%c.txt", Settings.TxtCheatcodespath, header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); - - choice1 = WindowPrompt(tr("Delete"),tmp,tr("Yes"),tr("No")); - if(choice1==1) - { - if(checkfile(tmp)) - remove(tmp); - } - break; - - } - } - - - if(saveBtn.GetState() == STATE_CLICKED) - { -// if(isSdInserted()) { - if(isInserted(bootDevice)) { - if (CFG_save_game_opt(header->id)) + if(homo.GetState() == STATE_CLICKED) + { + cfg_save_global(); + optionBrowser2.SetState(STATE_DISABLED); + s32 thetimeofbg = bgMusic->GetPlayTime(); + bgMusic->Stop(); + choice = WindowExitPrompt(tr("Exit USB Loader GX?"),0, tr("Back to Loader"),tr("Wii Menu"),tr("Back"),0); + if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { - // if language has changed, reload titles - int opt_langnew = 0; - game_cfg = CFG_get_game_opt(header->id); - if (game_cfg) opt_langnew = game_cfg->language; - 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")); + bgMusic->Play(); + } else { + bgMusic->PlayOggFile(Settings.ogg_path); } - else + bgMusic->SetPlayTime(thetimeofbg); + SetVolumeOgg(255*(Settings.volume/100.0)); + + if(choice == 3) { - WindowPrompt(tr("Save Failed"), 0, tr("OK")); + Sys_LoadMenu(); // Back to System Menu + } else if (choice == 2) { + Sys_BackToLoader(); + } else { + homo.ResetState(); } - } else { - WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK")); - } - - saveBtn.ResetState(); - optionBrowser3.SetFocus(1); - } - - if (cancelBtn.GetState() == STATE_CLICKED) - { - exit = true; - break; - } - - if (deleteBtn.GetState() == STATE_CLICKED) - { - - pagetodisplay++; - deleteBtnTxt.SetText(tr("Settings")); - optionBrowser3.SetScrollbar(0); - optionBrowser3.SetOffset(0); - if (pagetodisplay>2) - { - pagetodisplay=1; - deleteBtnTxt.SetText(tr("Uninstall Menu")); - optionBrowser3.SetScrollbar(1); - } - - deleteBtn.ResetState(); - - } - - if (GCTBtn.GetState() == STATE_CLICKED) { - char ID[7]; - snprintf (ID,sizeof(ID),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); - CheatMenu(ID); - } + optionBrowser2.SetState(STATE_DEFAULT); + } + } } + w.SetEffect(EFFECT_FADE, -20); + while(w.GetEffect()>0) usleep(50); + + HaltGui(); - mainWindow->Remove(&w); - ResumeGui(); + mainWindow->RemoveAll(); + mainWindow->Append(bgImg); + + ResumeGui(); return retVal; } diff --git a/source/settings/cfg.c b/source/settings/cfg.c index c1e282cd..40189247 100644 --- a/source/settings/cfg.c +++ b/source/settings/cfg.c @@ -1745,8 +1745,10 @@ void CFG_Load(void) //moved this to the HDD wait screen to avoid the garbled green screen while it is loading *maybe* //OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true); // loaded after database to override database titles with custom titles - snprintf(pathname, sizeof(pathname), "%stitles.txt", Settings.titlestxt_path); - cfg_parsefile(pathname, &title_set); + + //took out this titles.txt shit because it is useless now. teh xml has all the titles in it + //snprintf(pathname, sizeof(pathname), "%stitles.txt", Settings.titlestxt_path); + //cfg_parsefile(pathname, &title_set); // cfg_parsearg(argc, argv); } diff --git a/source/svnrev.c b/source/svnrev.c index 510b8f81..485f421c 100644 --- a/source/svnrev.c +++ b/source/svnrev.c @@ -1,4 +1,4 @@ -#define SVN_REV "649:652M" +#define SVN_REV "653M" const char *GetRev() {