diff --git a/gui.pnproj b/gui.pnproj index 77c31d0b..d27620f0 100644 --- a/gui.pnproj +++ b/gui.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/source/PromptWindows.cpp b/source/PromptWindows.cpp index d019b2fe..1fafa3ef 100644 --- a/source/PromptWindows.cpp +++ b/source/PromptWindows.cpp @@ -22,7 +22,6 @@ #include "getentries.h" /*** Variables that are also used extern ***/ -char missingFiles[500][12]; int cntMissFiles = 0; int networkisinitialized; @@ -32,6 +31,7 @@ static GuiText timeTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, static GuiText sizeTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); static GuiImageData progressbar(progressbar_png); static GuiImage progressbarImg(&progressbar); +static char missingFiles[500][12]; /*** Extern variables ***/ extern GuiWindow * mainWindow; @@ -42,7 +42,6 @@ extern float gamesize; extern struct discHdr * gameList; extern u8 shutdown; extern u8 reset; -extern int vol; /*** Extern functions ***/ extern void ResumeGui(); @@ -65,8 +64,8 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) GuiKeyboard keyboard(var, maxlen, min, keyset); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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[50]; snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path); @@ -139,7 +138,7 @@ void WindowCredits() StopOgg(); creditsMusic = new GuiSound(credits_music_ogg, credits_music_ogg_size, SOUND_OGG, 55); - creditsMusic->SetVolume(55); + creditsMusic->SetVolume(60); creditsMusic->SetLoop(1); creditsMusic->Play(); @@ -327,7 +326,7 @@ void WindowCredits() bgMusic->PlayOggFile(Settings.ogg_path); } bgMusic->SetPlayTime(thetimeofbg); - SetVolumeOgg(255*(vol/100.0)); + SetVolumeOgg(255*(Settings.volume/100.0)); } /**************************************************************************** @@ -350,8 +349,9 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, GuiWindow promptWindow(472,320); promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetPosition(0, -10); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + + 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[50]; snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path); GuiImageData btnOutline(imgPath, button_dialogue_box_png); @@ -597,14 +597,14 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, const char *btn4Label) { GuiSound * homein = NULL; - homein = new GuiSound(menuin_ogg, menuin_ogg_size, SOUND_OGG, vol); - homein->SetVolume(vol); + homein = new GuiSound(menuin_ogg, menuin_ogg_size, SOUND_OGG, Settings.sfxvolume); + homein->SetVolume(Settings.sfxvolume); homein->SetLoop(0); homein->Play(); GuiSound * homeout = NULL; - homeout = new GuiSound(menuout_ogg, menuout_ogg_size, SOUND_OGG, vol); - homeout->SetVolume(vol); + homeout = new GuiSound(menuout_ogg, menuout_ogg_size, SOUND_OGG, Settings.sfxvolume); + homeout->SetVolume(Settings.sfxvolume); homeout->SetLoop(0); int choice = -1; @@ -613,8 +613,8 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label, GuiWindow promptWindow(640,480); promptWindow.SetAlignment(ALIGN_LEFT, ALIGN_TOP); promptWindow.SetPosition(0, 0); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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); GuiImageData top(exit_top_png); GuiImageData topOver(exit_top_over_png); @@ -909,8 +909,8 @@ int GameWindowPrompt() GuiWindow promptWindow(472,320); promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetPosition(0, -10); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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), "%sbutton_dialogue_box.png", CFG.theme_path); @@ -1401,8 +1401,8 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char * GuiWindow promptWindow(472,320); promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetPosition(0, -10); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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), "%sbutton_dialogue_box.png", CFG.theme_path); @@ -1604,8 +1604,8 @@ int NetworkInitPromp(int choice2) promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetPosition(0, -10); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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), "%sbutton_dialogue_box.png", CFG.theme_path); @@ -1922,8 +1922,8 @@ ProgressDownloadWindow(int choice2) promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetPosition(0, -10); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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), "%sbutton_dialogue_box.png", CFG.theme_path); @@ -2159,8 +2159,8 @@ ProgressUpdateWindow() promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetPosition(0, -10); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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), "%sbutton_dialogue_box.png", CFG.theme_path); @@ -2436,3 +2436,8 @@ ProgressUpdateWindow() return 1; } + +char * GetMissingFiles() +{ + return (char *) missingFiles; +} diff --git a/source/PromptWindows.h b/source/PromptWindows.h index 56430195..01eb2029 100644 --- a/source/PromptWindows.h +++ b/source/PromptWindows.h @@ -21,5 +21,6 @@ int NetworkInitPromp(int choice2); int ProgressWindow(const char *title, const char *msg); int ProgressDownloadWindow(int choice2); int ProgressUpdateWindow(); +char * GetMissingFiles(); #endif diff --git a/source/Settings.cpp b/source/Settings.cpp index 0eb59e54..8a0c0aa5 100644 --- a/source/Settings.cpp +++ b/source/Settings.cpp @@ -1,4 +1,5 @@ #include +#include #include "menu.h" #include "filelist.h" @@ -10,6 +11,7 @@ #include "fatmounter.h" #include "PromptWindows.h" #include "getentries.h" +#include "SettingsPrompts.h" /*** Extern functions ***/ extern void ResumeGui(); @@ -23,7 +25,6 @@ extern GuiImageData * pointer[4]; extern GuiImageData * background; extern u8 shutdown; extern u8 reset; -extern int vol; /**************************************************************************** * MenuSettings @@ -33,9 +34,19 @@ int MenuSettings() int menu = MENU_NONE; int ret; int choice = 0; + bool exit = false; - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + enum { + FADE, + LEFT, + RIGHT + }; + + int slidedirection = FADE; + + 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]; @@ -43,14 +54,30 @@ int MenuSettings() 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), "%stab_bg1.png", CFG.theme_path); - GuiImageData tab1(imgPath, tab_bg1_png); - snprintf(imgPath, sizeof(imgPath), "%stab_bg2.png", CFG.theme_path); - GuiImageData tab2(imgPath, tab_bg2_png); - snprintf(imgPath, sizeof(imgPath), "%stab_bg3.png", CFG.theme_path); - GuiImageData tab3(imgPath, tab_bg3_png); - snprintf(imgPath, sizeof(imgPath), "%supdateRev.png", CFG.theme_path); - GuiImageData updateRevImgData(imgPath, updateRev_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); + + snprintf(imgPath, sizeof(imgPath), "%spageindicator.png", CFG.theme_path); + GuiImageData PageindicatorImgData(imgPath, pageindicator_png); + + snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_left.png", CFG.theme_path); + GuiImageData arrow_left(imgPath, startgame_arrow_left_png); + + snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_right.png", CFG.theme_path); + GuiImageData arrow_right(imgPath, startgame_arrow_right_png); + + snprintf(imgPath, sizeof(imgPath), "%scredits_button.png", CFG.theme_path); + GuiImageData creditsImgData(imgPath, credits_button_png); + + snprintf(imgPath, sizeof(imgPath), "%scredits_button_over.png", CFG.theme_path); + GuiImageData creditsOver(imgPath, credits_button_over_png); + + GuiImage creditsImg(&creditsImgData); + GuiImage creditsImgOver(&creditsOver); GuiTrigger trigA; trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); @@ -72,773 +99,1313 @@ int MenuSettings() titleTxt.SetPosition(0,40); GuiImage settingsbackground(&settingsbg); - GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight()); - settingsbackgroundbtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP); - settingsbackgroundbtn.SetPosition(0, 0); - settingsbackgroundbtn.SetImage(&settingsbackground); GuiText backBtnTxt(LANGUAGE.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);} + 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); - homo.SetAlignment(ALIGN_LEFT, ALIGN_TOP); - homo.SetPosition(0,0); - GuiImage tab1Img(&tab1); - GuiImage tab2Img(&tab2); - GuiImage tab3Img(&tab3); - GuiButton tabBtn(tab1.GetWidth(), tab1.GetHeight()); - tabBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - tabBtn.SetPosition(-202, 90); - tabBtn.SetImage(&tab1Img); - tabBtn.SetRumble(false); + GuiImage PageindicatorImg1(&PageindicatorImgData); + GuiText PageindicatorTxt1("1", 22, (GXColor){0, 0, 0, 255}); + GuiButton PageIndicatorBtn1(PageindicatorImg1.GetWidth(), PageindicatorImg1.GetHeight()); + PageIndicatorBtn1.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + PageIndicatorBtn1.SetPosition(200, 400); + PageIndicatorBtn1.SetImage(&PageindicatorImg1); + PageIndicatorBtn1.SetLabel(&PageindicatorTxt1); + PageIndicatorBtn1.SetSoundOver(&btnSoundOver); + PageIndicatorBtn1.SetSoundClick(&btnClick1); + PageIndicatorBtn1.SetTrigger(&trigA); + PageIndicatorBtn1.SetEffectGrow(); - GuiButton page1Btn(40, 96); - page1Btn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - page1Btn.SetPosition(-202, 90); - page1Btn.SetSoundOver(&btnSoundOver); - page1Btn.SetSoundClick(&btnClick); - page1Btn.SetTrigger(0, &trigA); + GuiImage PageindicatorImg2(&PageindicatorImgData); + GuiText PageindicatorTxt2("2", 22, (GXColor){0, 0, 0, 255}); + GuiButton PageIndicatorBtn2(PageindicatorImg2.GetWidth(), PageindicatorImg2.GetHeight()); + PageIndicatorBtn2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + PageIndicatorBtn2.SetPosition(235, 400); + PageIndicatorBtn2.SetImage(&PageindicatorImg2); + PageIndicatorBtn2.SetLabel(&PageindicatorTxt2); + PageIndicatorBtn2.SetSoundOver(&btnSoundOver); + PageIndicatorBtn2.SetSoundClick(&btnClick1); + PageIndicatorBtn2.SetTrigger(&trigA); + PageIndicatorBtn2.SetEffectGrow(); - GuiButton page2Btn(40, 96); - page2Btn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - page2Btn.SetPosition(-202, 186); - page2Btn.SetSoundOver(&btnSoundOver); - page2Btn.SetSoundClick(&btnClick); - page2Btn.SetTrigger(0, &trigA); - page2Btn.SetTrigger(1, &trigR); - page2Btn.SetTrigger(2, &trigPlus); + GuiImage GoLeftImg(&arrow_left); + GuiButton GoLeftBtn(GoLeftImg.GetWidth(), GoLeftImg.GetHeight()); + GoLeftBtn.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); + GoLeftBtn.SetPosition(25, -25); + GoLeftBtn.SetImage(&GoLeftImg); + GoLeftBtn.SetSoundOver(&btnSoundOver); + GoLeftBtn.SetSoundClick(&btnClick); + GoLeftBtn.SetEffectGrow(); + GoLeftBtn.SetTrigger(&trigA); + GoLeftBtn.SetTrigger(&trigL); + GoLeftBtn.SetTrigger(&trigMinus); - GuiButton page3Btn(40, 96); - page3Btn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - page3Btn.SetPosition(-202, 282); - page3Btn.SetSoundOver(&btnSoundOver); - page3Btn.SetSoundClick(&btnClick); - page3Btn.SetTrigger(0, &trigA); - page3Btn.SetTrigger(1, &trigR); - page3Btn.SetTrigger(2, &trigPlus); + GuiImage GoRightImg(&arrow_right); + GuiButton GoRightBtn(GoRightImg.GetWidth(), GoRightImg.GetHeight()); + GoRightBtn.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE); + GoRightBtn.SetPosition(-25, -25); + GoRightBtn.SetImage(&GoRightImg); + GoRightBtn.SetSoundOver(&btnSoundOver); + GoRightBtn.SetSoundClick(&btnClick); + GoRightBtn.SetEffectGrow(); + GoRightBtn.SetTrigger(&trigA); + GoRightBtn.SetTrigger(&trigR); + GoRightBtn.SetTrigger(&trigPlus); - const char * text = LANGUAGE.Unlock; - if (Settings.godmode == 1) - text = LANGUAGE.Lock; - GuiText lockBtnTxt(text, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); - lockBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); - GuiImage lockBtnImg(&btnOutline); - lockBtnImg.SetWidescreen(CFG.widescreen); - GuiButton lockBtn(&lockBtnImg,&lockBtnImg, 2, 3, 180, 400, &trigA, &btnSoundOver, &btnClick,1); - lockBtn.SetLabel(&lockBtnTxt); + char MainButtonText[50]; + snprintf(MainButtonText, sizeof(MainButtonText), "%s", " "); - GuiImage updateBtnImg(&updateRevImgData); - updateBtnImg.SetWidescreen(CFG.widescreen); - GuiButton updateBtn(&updateBtnImg,&updateBtnImg, 2, 3, 70, 400, &trigA, &btnSoundOver, &btnClick,1); - updateBtn.SetVisible(false); - updateBtn.SetClickable(false); + 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); - GuiImageData logo(credits_button_png); - GuiImage logoImg(&logo); - GuiImageData logoOver(credits_button_over_png); - GuiImage logoImgOver(&logoOver); + 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); - GuiButton btnLogo(logoImg.GetWidth(), logoImg.GetHeight()); - btnLogo.SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM); - btnLogo.SetPosition(0, -35); - btnLogo.SetImage(&logoImg); - btnLogo.SetImageOver(&logoImgOver); - btnLogo.SetEffectGrow(); - btnLogo.SetSoundOver(&btnSoundOver); - btnLogo.SetSoundClick(&btnClick); - btnLogo.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(9); 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); + GuiWindow w(screenwidth, screenheight); int pageToDisplay = 1; while ( pageToDisplay > 0) //set pageToDisplay to 0 to quit { + VIDEO_WaitVSync (); + menu = MENU_NONE; + if ( pageToDisplay == 1) { + /** Standard procedure made in all pages **/ + MainButton1.StopEffect(); + MainButton2.StopEffect(); + MainButton3.StopEffect(); + MainButton4.StopEffect(); - options2.SetName(0, "%s",LANGUAGE.VideoMode); - options2.SetName(1, "%s",LANGUAGE.VIDTVPatch); - options2.SetName(2, "%s",LANGUAGE.Language); - - options2.SetName(3, "Ocarina"); - - options2.SetName(4,"%s", LANGUAGE.Display); - options2.SetName(5,"%s", LANGUAGE.Clock); //CLOCK - options2.SetName(6,"%s", LANGUAGE.Rumble); //RUMBLE - options2.SetName(7,"%s", LANGUAGE.Volume); - options2.SetName(8,"%s", LANGUAGE.Tooltips); + if(slidedirection == RIGHT) { + MainButton1.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); + MainButton2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); + MainButton3.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); + MainButton4.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); + while (MainButton1.GetEffect()>0) usleep(50); + } + else if(slidedirection == LEFT) { + MainButton1.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); + MainButton2.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); + MainButton3.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); + MainButton4.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); + while (MainButton1.GetEffect()>0) usleep(50); + } HaltGui(); - w.Append(&settingsbackgroundbtn); + + snprintf(MainButtonText, sizeof(MainButtonText), "%s", LANGUAGE.GUISettings); + MainButton1Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", LANGUAGE.Gameload); + MainButton2Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", LANGUAGE.Parentalcontrol); + MainButton3Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", LANGUAGE.Sound); + MainButton4Txt.SetText(MainButtonText); + + mainWindow->RemoveAll(); + mainWindow->Append(&w); + w.RemoveAll(); + w.Append(&settingsbackground); + w.Append(&PageIndicatorBtn1); + w.Append(&PageIndicatorBtn2); w.Append(&titleTxt); w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - w.Append(&btnLogo); w.Append(&homo); - //set triggers for tabs - page1Btn.RemoveTrigger(1); - page1Btn.RemoveTrigger(2); - page2Btn.RemoveTrigger(1); - page2Btn.RemoveTrigger(2); - page3Btn.RemoveTrigger(1); - page3Btn.RemoveTrigger(2); - page2Btn.SetTrigger(1, &trigPlus); - page2Btn.SetTrigger(2, &trigR); - page3Btn.SetTrigger(1, &trigMinus); - page3Btn.SetTrigger(2, &trigL); + w.Append(&GoRightBtn); + w.Append(&GoLeftBtn); + w.Append(&MainButton1); + w.Append(&MainButton2); + w.Append(&MainButton3); + w.Append(&MainButton4); + PageIndicatorBtn1.SetAlpha(255); + PageIndicatorBtn2.SetAlpha(50); + + /** Creditsbutton change **/ + MainButton4.SetImage(&MainButton4Img); + MainButton4.SetImageOver(&MainButton4ImgOver); + + /** Disable ability to click through MainButtons */ + optionBrowser2.SetClickable(false); + + MainButton1.StopEffect(); + MainButton2.StopEffect(); + MainButton3.StopEffect(); + MainButton4.StopEffect(); + + MainButton1.SetEffectGrow(); + MainButton2.SetEffectGrow(); + MainButton3.SetEffectGrow(); + MainButton4.SetEffectGrow(); + + if(slidedirection == FADE) { + MainButton1.SetEffect(EFFECT_FADE, 20); + MainButton2.SetEffect(EFFECT_FADE, 20); + MainButton3.SetEffect(EFFECT_FADE, 20); + MainButton4.SetEffect(EFFECT_FADE, 20); + } + else if(slidedirection == LEFT) { + MainButton1.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); + MainButton2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); + MainButton3.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); + MainButton4.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); + } + else if(slidedirection == RIGHT) { + MainButton1.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); + MainButton2.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); + MainButton3.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); + MainButton4.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); + } mainWindow->Append(&w); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&page3Btn); - ResumeGui(); + + while(MainButton1.GetEffect() > 0) usleep(50); + } else if ( pageToDisplay == 2 ) { - page1Btn.RemoveTrigger(1); - page1Btn.RemoveTrigger(2); - page2Btn.RemoveTrigger(1); - page2Btn.RemoveTrigger(2); - page3Btn.RemoveTrigger(1); - page3Btn.RemoveTrigger(2); - page1Btn.SetTrigger(1, &trigMinus); - page1Btn.SetTrigger(2, &trigL); - page3Btn.SetTrigger(1, &trigPlus); - page3Btn.SetTrigger(2, &trigR); + /** Standard procedure made in all pages **/ + MainButton1.StopEffect(); + MainButton2.StopEffect(); + MainButton3.StopEffect(); + MainButton4.StopEffect(); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page3Btn); + if(slidedirection == RIGHT) { + MainButton1.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); + MainButton2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); + MainButton3.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); + MainButton4.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_OUT, 35); + while (MainButton1.GetEffect()>0) usleep(50); + } + else if(slidedirection == LEFT) { + MainButton1.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); + MainButton2.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); + MainButton3.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); + MainButton4.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_OUT, 35); + while (MainButton1.GetEffect()>0) usleep(50); + } - options2.SetName(0,"%s", LANGUAGE.Password); - options2.SetName(1,"%s", LANGUAGE.BootStandard); - options2.SetName(2,"%s", LANGUAGE.FlipX); - options2.SetName(3,"%s", LANGUAGE.QuickBoot); - options2.SetName(4,"%s", LANGUAGE.PromptsButtons); - options2.SetName(5,"%s", LANGUAGE.Parentalcontrol); - options2.SetName(6,"%s", LANGUAGE.CoverPath); - options2.SetName(7,"%s", LANGUAGE.DiscimagePath); - options2.SetName(8,"%s", LANGUAGE.ThemePath); - } - else if ( pageToDisplay == 3 ) - { - page1Btn.RemoveTrigger(1); - page1Btn.RemoveTrigger(2); - page2Btn.RemoveTrigger(1); - page2Btn.RemoveTrigger(2); - page3Btn.RemoveTrigger(1); - page3Btn.RemoveTrigger(2); - page2Btn.SetTrigger(1, &trigMinus); - page2Btn.SetTrigger(2, &trigL); - page1Btn.SetTrigger(1, &trigPlus); - page1Btn.SetTrigger(2, &trigR); + HaltGui(); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page3Btn); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", LANGUAGE.Custompaths); + MainButton1Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", LANGUAGE.Update); + MainButton2Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", LANGUAGE.Defaultsettings); + MainButton3Txt.SetText(MainButtonText); + snprintf(MainButtonText, sizeof(MainButtonText), "%s", LANGUAGE.Credits); + MainButton4Txt.SetText(MainButtonText); - options2.SetName(0, "%s",LANGUAGE.Titlestxtpath); - options2.SetName(1, "%s",LANGUAGE.AppLanguage); - options2.SetName(2, "%s",LANGUAGE.keyboard); - options2.SetName(3, "%s",LANGUAGE.Unicodefix); - options2.SetName(4, "%s",LANGUAGE.Backgroundmusic); - options2.SetName(5, "%s",LANGUAGE.Wiilight); - options2.SetName(6, "%s",LANGUAGE.Updatepath); - options2.SetName(7, "%s",LANGUAGE.Patchcountrystrings); - options2.SetName(8, "%s",LANGUAGE.Defaultsettings); + mainWindow->RemoveAll(); + mainWindow->Append(&w); + w.RemoveAll(); + w.Append(&settingsbackground); + w.Append(&PageIndicatorBtn1); + w.Append(&PageIndicatorBtn2); + w.Append(&titleTxt); + w.Append(&backBtn); + w.Append(&homo); + w.Append(&GoRightBtn); + w.Append(&GoLeftBtn); + w.Append(&MainButton1); + w.Append(&MainButton2); + w.Append(&MainButton3); + w.Append(&MainButton4); + + PageIndicatorBtn1.SetAlpha(50); + PageIndicatorBtn2.SetAlpha(255); + + /** Creditsbutton change **/ + MainButton4.SetImage(&creditsImg); + MainButton4.SetImageOver(&creditsImgOver); + + /** Disable ability to click through MainButtons */ + optionBrowser2.SetClickable(false); + + MainButton1.StopEffect(); + MainButton2.StopEffect(); + MainButton3.StopEffect(); + MainButton4.StopEffect(); + + MainButton1.SetEffectGrow(); + MainButton2.SetEffectGrow(); + MainButton3.SetEffectGrow(); + MainButton4.SetEffectGrow(); + + if(slidedirection == FADE) { + MainButton1.SetEffect(EFFECT_FADE, 20); + MainButton2.SetEffect(EFFECT_FADE, 20); + MainButton3.SetEffect(EFFECT_FADE, 20); + MainButton4.SetEffect(EFFECT_FADE, 20); + } + else if(slidedirection == LEFT) { + MainButton1.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); + MainButton2.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); + MainButton3.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); + MainButton4.SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 35); + } + else if(slidedirection == RIGHT) { + MainButton1.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); + MainButton2.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); + MainButton3.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); + MainButton4.SetEffect(EFFECT_SLIDE_RIGHT | EFFECT_SLIDE_IN, 35); + } + + mainWindow->Append(&w); + + ResumeGui(); + + while(MainButton1.GetEffect() > 0) usleep(50); } + while(menu == MENU_NONE) { VIDEO_WaitVSync (); if ( pageToDisplay == 1 ) { - if(Settings.video >= settings_video_max) - Settings.video = 0; - if(Settings.language >= settings_language_max) - Settings.language = 0; - if(Settings.ocarina >= settings_off_on_max) - Settings.ocarina = 0; - if(Settings.vpatch >= settings_off_on_max) - Settings.vpatch = 0; - if(Settings.sinfo >= settings_sinfo_max) - Settings.sinfo = 0; - if(Settings.hddinfo >= settings_clock_max) - Settings.hddinfo = 0; //CLOCK - if(Settings.rumble >= settings_rumble_max) - Settings.rumble = 0; //RUMBLE - if(Settings.volume >= settings_volume_max) - Settings.volume = 0; - if (Settings.tooltips >= settings_tooltips_max) - Settings.tooltips = 0; + if(MainButton1.GetState() == STATE_CLICKED) { + 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(&PageIndicatorBtn1); + w.Remove(&PageIndicatorBtn2); + w.Remove(&GoRightBtn); + w.Remove(&GoLeftBtn); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + titleTxt.SetText(LANGUAGE.GUISettings); + exit = false; + options2.SetName(0, "%s",LANGUAGE.AppLanguage); + options2.SetName(1, "%s",LANGUAGE.Display); + options2.SetName(2, "%s",LANGUAGE.Clock); + options2.SetName(3, "%s",LANGUAGE.Tooltips); + options2.SetName(4, "%s",LANGUAGE.FlipX); + options2.SetName(5, "%s",LANGUAGE.PromptsButtons); + options2.SetName(6, "%s",LANGUAGE.keyboard); + options2.SetName(7, "%s",LANGUAGE.Wiilight); + options2.SetName(8, "%s", LANGUAGE.Rumble); + for(int i = 0; i < 9; i++) options2.SetValue(i, NULL); + w.Append(&optionBrowser2); + optionBrowser2.SetClickable(true); + ResumeGui(); - if (Settings.video == discdefault) options2.SetValue(0,"%s",LANGUAGE.DiscDefault); - else if (Settings.video == systemdefault) options2.SetValue(0,"%s",LANGUAGE.SystemDefault); - else if (Settings.video == patch) options2.SetValue(0,"%s",LANGUAGE.AutoPatch); - else if (Settings.video == pal50) options2.SetValue(0,"%s PAL50",LANGUAGE.Force); - else if (Settings.video == pal60) options2.SetValue(0,"%s PAL60",LANGUAGE.Force); - else if (Settings.video == ntsc) options2.SetValue(0,"%s NTSC",LANGUAGE.Force); + VIDEO_WaitVSync (); + optionBrowser2.SetEffect(EFFECT_FADE, 20); + while(optionBrowser2.GetEffect() > 0) usleep(50); - if (Settings.vpatch == on) options2.SetValue(1,"%s",LANGUAGE.ON); - else if (Settings.vpatch == off) options2.SetValue(1,"%s",LANGUAGE.OFF); + int returnhere = 1; + char * languagefile; + languagefile = strrchr(Settings.language_path, '/')+1; - if (Settings.language == ConsoleLangDefault) options2.SetValue(2,"%s",LANGUAGE.ConsoleDefault); - else if (Settings.language == jap) options2.SetValue(2,"%s",LANGUAGE.Japanese); - else if (Settings.language == ger) options2.SetValue(2,"%s",LANGUAGE.German); - else if (Settings.language == eng) options2.SetValue(2,"%s",LANGUAGE.English); - else if (Settings.language == fren) options2.SetValue(2,"%s",LANGUAGE.French); - else if (Settings.language == esp) options2.SetValue(2,"%s",LANGUAGE.Spanish); - else if (Settings.language == it) options2.SetValue(2,"%s",LANGUAGE.Italian); - else if (Settings.language == dut) options2.SetValue(2,"%s",LANGUAGE.Dutch); - else if (Settings.language == schin) options2.SetValue(2,"%s",LANGUAGE.SChinese); - else if (Settings.language == tchin) options2.SetValue(2,"%s",LANGUAGE.TChinese); - else if (Settings.language == kor) options2.SetValue(2,"%s",LANGUAGE.Korean); + while(!exit) + { + VIDEO_WaitVSync (); - if (Settings.ocarina == on) options2.SetValue(3,"%s",LANGUAGE.ON); - else if (Settings.ocarina == off) options2.SetValue(3,"%s",LANGUAGE.OFF); + returnhere = 1; - if (Settings.sinfo == GameID) options2.SetValue(4,"%s",LANGUAGE.GameID); - else if (Settings.sinfo == GameRegion) options2.SetValue(4,"%s",LANGUAGE.GameRegion); - else if (Settings.sinfo == Both) options2.SetValue(4,"%s",LANGUAGE.Both); - else if (Settings.sinfo == Neither) options2.SetValue(4,"%s",LANGUAGE.Neither); + if(Settings.sinfo >= settings_sinfo_max) + Settings.sinfo = 0; + if(Settings.hddinfo >= settings_clock_max) + Settings.hddinfo = 0; //CLOCK + if (Settings.tooltips >= settings_tooltips_max) + Settings.tooltips = 0; + if ( Settings.xflip >= settings_xflip_max) + Settings.xflip = 0; + if ( Settings.wsprompt > 1 ) + Settings.wsprompt = 0; + if ( Settings.keyset >= settings_keyset_max) + Settings.keyset = 0; + if ( Settings.wiilight > 2 ) + Settings.wiilight = 0; + if(Settings.rumble >= settings_rumble_max) + Settings.rumble = 0; //RUMBLE - if (Settings.hddinfo == hr12) options2.SetValue(5,"12 %s",LANGUAGE.hour); - else if (Settings.hddinfo == hr24) options2.SetValue(5,"24 %s",LANGUAGE.hour); - else if (Settings.hddinfo == Off) options2.SetValue(5,"%s",LANGUAGE.OFF); + if(!strcmp("notset", Settings.language_path)) + options2.SetValue(0, "%s", LANGUAGE.Default); + else + options2.SetValue(0, "%s", languagefile); - if (Settings.rumble == RumbleOn) options2.SetValue(6,"%s",LANGUAGE.ON); - else if (Settings.rumble == RumbleOff) options2.SetValue(6,"%s",LANGUAGE.OFF); + if (Settings.sinfo == GameID) options2.SetValue(1,"%s",LANGUAGE.GameID); + else if (Settings.sinfo == GameRegion) options2.SetValue(1,"%s",LANGUAGE.GameRegion); + else if (Settings.sinfo == Both) options2.SetValue(1,"%s",LANGUAGE.Both); + else if (Settings.sinfo == Neither) options2.SetValue(1,"%s",LANGUAGE.Neither); - if (Settings.volume == v10) options2.SetValue(7,"10"); - else if (Settings.volume == v20) options2.SetValue(7,"20"); - else if (Settings.volume == v30) options2.SetValue(7,"30"); - else if (Settings.volume == v40) options2.SetValue(7,"40"); - else if (Settings.volume == v50) options2.SetValue(7,"50"); - else if (Settings.volume == v60) options2.SetValue(7,"60"); - else if (Settings.volume == v70) options2.SetValue(7,"70"); - else if (Settings.volume == v80) options2.SetValue(7,"80"); - else if (Settings.volume == v90) options2.SetValue(7,"90"); - else if (Settings.volume == v100) options2.SetValue(7,"100"); - else if (Settings.volume == v0) options2.SetValue(7,"%s",LANGUAGE.OFF); + if (Settings.hddinfo == hr12) options2.SetValue(2,"12 %s",LANGUAGE.hour); + else if (Settings.hddinfo == hr24) options2.SetValue(2,"24 %s",LANGUAGE.hour); + else if (Settings.hddinfo == Off) options2.SetValue(2,"%s",LANGUAGE.OFF); + if (Settings.tooltips == TooltipsOn) options2.SetValue(3,"%s",LANGUAGE.ON); + else if (Settings.tooltips == TooltipsOff) options2.SetValue(3,"%s",LANGUAGE.OFF); - if (Settings.tooltips == TooltipsOn) options2.SetValue(8,"%s",LANGUAGE.ON); - else if (Settings.tooltips == TooltipsOff) options2.SetValue(8,"%s",LANGUAGE.OFF); + if (Settings.xflip == no) options2.SetValue(4,"%s/%s",LANGUAGE.Right,LANGUAGE.Next); + else if (Settings.xflip == yes) options2.SetValue(4,"%s/%s",LANGUAGE.Left,LANGUAGE.Prev); + else if (Settings.xflip == sysmenu) options2.SetValue(4,"%s", LANGUAGE.LikeSysMenu); + else if (Settings.xflip == wtf) options2.SetValue(4,"%s/%s",LANGUAGE.Right,LANGUAGE.Prev); + else if (Settings.xflip == disk3d) options2.SetValue(4,"DiskFlip"); - ret = optionBrowser2.GetClickedOption(); + if (Settings.wsprompt == no) options2.SetValue(5,"%s",LANGUAGE.Normal); + else if (Settings.wsprompt == yes) options2.SetValue(5,"%s",LANGUAGE.WidescreenFix); - switch (ret) - { - case 0: - Settings.video++; - break; - case 1: - Settings.vpatch++; - break; - case 2: - Settings.language++; - break; - case 3: - Settings.ocarina++; - break; - case 4: // Game Code and Region - Settings.sinfo++; - break; - case 5: //CLOCK - Settings.hddinfo++; - break; - case 6: //Rumble - Settings.rumble++; - break; - case 7: - Settings.volume++; - break; - case 8: - Settings.tooltips++; - break; - } - } + if (Settings.keyset == us) options2.SetValue(6,"QWERTY"); + else if (Settings.keyset == dvorak) options2.SetValue(6,"DVORAK"); + else if (Settings.keyset == euro) options2.SetValue(6,"QWERTZ"); + else if (Settings.keyset == azerty) options2.SetValue(6,"AZERTY"); - if ( pageToDisplay == 2 ) - { - if ( Settings.cios >= settings_cios_max) - Settings.cios = 0; - if ( Settings.xflip >= settings_xflip_max) - Settings.xflip = 0; - if ( Settings.qboot > 1 ) - Settings.qboot = 0; - if ( Settings.wsprompt > 1 ) - Settings.wsprompt = 0; - if (Settings.parentalcontrol > 3 ) - Settings.parentalcontrol = 0; + if (Settings.wiilight == 0) options2.SetValue(7,"%s",LANGUAGE.OFF); + else if (Settings.wiilight == 1) options2.SetValue(7,"%s",LANGUAGE.ON); + else if (Settings.wiilight == 2) options2.SetValue(7,"%s",LANGUAGE.OnlyInstall); + if (Settings.rumble == RumbleOn) options2.SetValue(8,"%s",LANGUAGE.ON); + else if (Settings.rumble == RumbleOff) options2.SetValue(8,"%s",LANGUAGE.OFF); - if ( Settings.godmode != 1) options2.SetValue(0, "********"); - else if (!strcmp("", Settings.unlockCode)) options2.SetValue(0, "%s",LANGUAGE.notset); - else options2.SetValue(0, Settings.unlockCode); - - if (Settings.godmode != 1) options2.SetValue(1, "********"); - else if (Settings.cios == ios249) options2.SetValue(1,"cIOS 249"); - else if (Settings.cios == ios222) options2.SetValue(1,"cIOS 222"); - - if (Settings.xflip == no) options2.SetValue(2,"%s/%s",LANGUAGE.Right,LANGUAGE.Next); - else if (Settings.xflip == yes) options2.SetValue(2,"%s/%s",LANGUAGE.Left,LANGUAGE.Prev); - else if (Settings.xflip == sysmenu) options2.SetValue(2,"%s", LANGUAGE.LikeSysMenu); - else if (Settings.xflip == wtf) options2.SetValue(2,"%s/%s",LANGUAGE.Right,LANGUAGE.Prev); - else if (Settings.xflip == disk3d) options2.SetValue(2,"DiskFlip"); - - if (Settings.qboot == no) options2.SetValue(3,"%s",LANGUAGE.No); - else if (Settings.qboot == yes) options2.SetValue(3,"%s",LANGUAGE.Yes); - - if (Settings.wsprompt == no) options2.SetValue(4,"%s",LANGUAGE.Normal); - else if (Settings.wsprompt == yes) options2.SetValue(4,"%s",LANGUAGE.WidescreenFix); - - if (Settings.godmode != 1) options2.SetValue(5, "********"); - else if(Settings.parentalcontrol == 0) options2.SetValue(5, "0"); - else if(Settings.parentalcontrol == 1) options2.SetValue(5, "1"); - else if(Settings.parentalcontrol == 2) options2.SetValue(5, "2"); - else if(Settings.parentalcontrol == 3) options2.SetValue(5, "3"); - - options2.SetValue(6, "%s", Settings.covers_path); - options2.SetValue(7, "%s", Settings.disc_path); - options2.SetValue(8, "%s", CFG.theme_path); - - ret = optionBrowser2.GetClickedOption(); - - switch (ret) - { - - case 0: // Modify Password - if ( Settings.godmode == 1) - { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - char entered[20] = ""; - strncpy(entered, Settings.unlockCode, sizeof(entered)); - int result = OnScreenKeyboard(entered, 20,0); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - if ( result == 1 ) - { - strncpy(Settings.unlockCode, entered, sizeof(Settings.unlockCode)); - WindowPrompt(LANGUAGE.PasswordChanged,LANGUAGE.Passwordhasbeenchanged,LANGUAGE.ok,0,0,0); - } - } - else - { - WindowPrompt(LANGUAGE.Passwordchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); - } - break; - case 1: - if ( Settings.godmode == 1) - Settings.cios++; - break; - case 2: - Settings.xflip++; - break; - case 3: - Settings.qboot++; - break; - case 4: - Settings.wsprompt++; - break; - case 5: - if ( Settings.godmode == 1) - Settings.parentalcontrol++; - break; - case 6: - if ( Settings.godmode == 1) + if(backBtn.GetState() == STATE_CLICKED) { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - char entered[43] = ""; - strncpy(entered, Settings.covers_path, sizeof(entered)); - int result = OnScreenKeyboard(entered,43,4); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - if ( result == 1 ) - { - int len = (strlen(entered)-1); - if(entered[len] !='/') - strncat (entered, "/", 1); - strncpy(Settings.covers_path, entered, sizeof(Settings.covers_path)); - WindowPrompt(LANGUAGE.CoverpathChanged,0,LANGUAGE.ok,0,0,0); - if(!isSdInserted()) { - WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); - } - } - } - else - { - WindowPrompt(LANGUAGE.Coverpathchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); - } - break; - case 7: - if ( Settings.godmode == 1) + 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) { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - char entered[43] = ""; - strncpy(entered, Settings.disc_path, sizeof(entered)); - int result = OnScreenKeyboard(entered, 43,4); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - if ( result == 1 ) - { - int len = (strlen(entered)-1); - if(entered[len] !='/') - strncat (entered, "/", 1); - strncpy(Settings.disc_path, entered, sizeof(Settings.disc_path)); - WindowPrompt(LANGUAGE.DiscpathChanged,0,LANGUAGE.ok,0,0,0); - if(!isSdInserted()) { - WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); - } - } - } - else - { - WindowPrompt(LANGUAGE.Discpathchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); - } - break; - case 8: - if ( Settings.godmode == 1) + cfg_save_global(); + optionBrowser2.SetState(STATE_DISABLED); + s32 thetimeofbg = bgMusic->GetPlayTime(); + bgMusic->Stop(); + choice = WindowExitPrompt(LANGUAGE.ExitUSBISOLoader,0, LANGUAGE.BacktoLoader,LANGUAGE.WiiMenu,LANGUAGE.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) { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - char entered[43] = ""; - strncpy(entered, CFG.theme_path, sizeof(entered)); - int result = OnScreenKeyboard(entered, 43,4); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - if ( result == 1 ) - { - int len = (strlen(entered)-1); - if(entered[len] !='/') - strncat (entered, "/", 1); - strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path)); - WindowPrompt(LANGUAGE.ThemepathChanged,0,LANGUAGE.ok,0,0,0); - if(!isSdInserted()) { - WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); + case 0: + if(isSdInserted()) { + if ( Settings.godmode == 1) + { + w.SetEffect(EFFECT_FADE, -20); + while(w.GetEffect()>0) usleep(50); + mainWindow->Remove(&w); + while(returnhere == 1) + returnhere = MenuLanguageSelect(); + if(returnhere == 2) { + menu = MENU_SETTINGS; + pageToDisplay = 0; + exit = true; + mainWindow->Append(&w); + break; + } else { + HaltGui(); + mainWindow->Append(&w); + w.SetEffect(EFFECT_FADE, 20); + ResumeGui(); + while(w.GetEffect()>0) usleep(50); + } } else { - cfg_save_global(); + WindowPrompt(LANGUAGE.Langchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); } - mainWindow->Remove(bgImg); - CFG_Load(); - CFG_LoadGlobal(); - menu = MENU_SETTINGS; - #ifdef HW_RVL - snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path); - pointer[0] = new GuiImageData(imgPath, player1_point_png); - snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path); - pointer[1] = new GuiImageData(imgPath, player2_point_png); - snprintf(imgPath, sizeof(imgPath), "%splayer3_point.png", CFG.theme_path); - pointer[2] = new GuiImageData(imgPath, player3_point_png); - snprintf(imgPath, sizeof(imgPath), "%splayer4_point.png", CFG.theme_path); - pointer[3] = new GuiImageData(imgPath, player4_point_png); - #endif - if (CFG.widescreen) - snprintf(imgPath, sizeof(imgPath), "%swbackground.png", CFG.theme_path); - else - snprintf(imgPath, sizeof(imgPath), "%sbackground.png", CFG.theme_path); + } else { + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0); + } + break; + case 1: + Settings.sinfo++; + break; + case 2: + Settings.hddinfo++; + break; + case 3: + Settings.tooltips++; + break; + case 4: + Settings.xflip++; + break; + case 5: + Settings.wsprompt++; + break; + case 6: + Settings.keyset++; + break; + case 7: + Settings.wiilight++; + break; + case 8: + Settings.rumble++; + break; + } + } + optionBrowser2.SetEffect(EFFECT_FADE, -20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + titleTxt.SetText(LANGUAGE.settings); + slidedirection = FADE; + if(returnhere != 2) + pageToDisplay = 1; + MainButton1.ResetState(); + break; + } - background = new GuiImageData(imgPath, CFG.widescreen? wbackground_png : background_png); + if(MainButton2.GetState() == STATE_CLICKED) { + MainButton1.SetEffect(EFFECT_FADE, -20); + MainButton2.SetEffect(EFFECT_FADE, -20); + MainButton3.SetEffect(EFFECT_FADE, -20); + MainButton4.SetEffect(EFFECT_FADE, -20); + while(MainButton2.GetEffect() > 0) usleep(50); + HaltGui(); + w.Remove(&PageIndicatorBtn1); + w.Remove(&PageIndicatorBtn2); + w.Remove(&GoRightBtn); + w.Remove(&GoLeftBtn); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + titleTxt.SetText(LANGUAGE.Gameload); + exit = false; + options2.SetName(0, "%s",LANGUAGE.VideoMode); + options2.SetName(1, "%s",LANGUAGE.VIDTVPatch); + options2.SetName(2, "%s",LANGUAGE.Patchcountrystrings); + options2.SetName(3, "Ocarina"); + options2.SetName(4,"%s", LANGUAGE.BootStandard); + options2.SetName(5, "%s",LANGUAGE.QuickBoot); + options2.SetName(6, NULL); + options2.SetName(7, NULL); + options2.SetName(8, NULL); + for(int i = 0; i < 9; i++) options2.SetValue(i, NULL); + w.Append(&optionBrowser2); + optionBrowser2.SetClickable(true); + ResumeGui(); - bgImg = new GuiImage(background); - mainWindow->Append(bgImg); - mainWindow->Append(&w); + VIDEO_WaitVSync (); + optionBrowser2.SetEffect(EFFECT_FADE, 20); + while(optionBrowser2.GetEffect() > 0) usleep(50); - w.Append(&settingsbackgroundbtn); - w.Append(&titleTxt); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - w.Append(&btnLogo); + while(!exit) + { + VIDEO_WaitVSync (); + if(Settings.video >= settings_video_max) + Settings.video = 0; + if(Settings.vpatch >= settings_off_on_max) + Settings.vpatch = 0; + if ( Settings.patchcountrystrings > 1) + Settings.patchcountrystrings = 0; + if(Settings.ocarina >= settings_off_on_max) + Settings.ocarina = 0; + if ( Settings.qboot > 1 ) + Settings.qboot = 0; + if ( Settings.cios >= settings_cios_max) + Settings.cios = 0; - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - } - } - else - { - WindowPrompt(LANGUAGE.Themepathchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); - } - break; - } + if (Settings.video == discdefault) options2.SetValue(0,"%s",LANGUAGE.DiscDefault); + else if (Settings.video == systemdefault) options2.SetValue(0,"%s",LANGUAGE.SystemDefault); + else if (Settings.video == patch) options2.SetValue(0,"%s",LANGUAGE.AutoPatch); + else if (Settings.video == pal50) options2.SetValue(0,"%s PAL50",LANGUAGE.Force); + else if (Settings.video == pal60) options2.SetValue(0,"%s PAL60",LANGUAGE.Force); + else if (Settings.video == ntsc) options2.SetValue(0,"%s NTSC",LANGUAGE.Force); + + if (Settings.vpatch == on) options2.SetValue(1,"%s",LANGUAGE.ON); + else if (Settings.vpatch == off) options2.SetValue(1,"%s",LANGUAGE.OFF); + + if (Settings.patchcountrystrings == 0) options2.SetValue(2,"%s",LANGUAGE.OFF); + else if (Settings.patchcountrystrings == 1) options2.SetValue(2,"%s",LANGUAGE.ON); + + if (Settings.ocarina == on) options2.SetValue(3,"%s",LANGUAGE.ON); + else if (Settings.ocarina == off) options2.SetValue(3,"%s",LANGUAGE.OFF); + + if (Settings.godmode != 1) options2.SetValue(4, "********"); + else if (Settings.cios == ios249) options2.SetValue(4,"cIOS 249"); + else if (Settings.cios == ios222) options2.SetValue(4,"cIOS 222"); + + if (Settings.qboot == no) options2.SetValue(5,"%s",LANGUAGE.No); + else if (Settings.qboot == yes) options2.SetValue(5,"%s",LANGUAGE.Yes); + + 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(LANGUAGE.ExitUSBISOLoader,0, LANGUAGE.BacktoLoader,LANGUAGE.WiiMenu,LANGUAGE.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: + Settings.video++; + break; + case 1: + Settings.vpatch++; + break; + case 2: + Settings.patchcountrystrings++; + break; + case 3: + Settings.ocarina++; + break; + case 4: + if(Settings.godmode) + Settings.cios++; + break; + case 5: + Settings.qboot++; + break; + } + } + optionBrowser2.SetEffect(EFFECT_FADE, -20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + titleTxt.SetText(LANGUAGE.settings); + slidedirection = FADE; + pageToDisplay = 1; + 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(&PageIndicatorBtn1); + w.Remove(&PageIndicatorBtn2); + w.Remove(&GoRightBtn); + w.Remove(&GoLeftBtn); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + titleTxt.SetText(LANGUAGE.Parentalcontrol); + exit = false; + if(Settings.godmode) + options2.SetName(0, "Console"); + options2.SetName(1, "%s", LANGUAGE.Password); + options2.SetName(2, "%s",LANGUAGE.Controllevel); + options2.SetName(3, NULL); + options2.SetName(4, NULL); + options2.SetName(5, NULL); + options2.SetName(6, NULL); + options2.SetName(7, NULL); + options2.SetName(8, NULL); + for(int i = 0; i < 9; 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 (Settings.parentalcontrol > 3 ) + Settings.parentalcontrol = 0; + + if( Settings.godmode == 1 ) options2.SetValue(0, "Unlocked"); + else if( Settings.godmode == 0 ) options2.SetValue(0, "Locked"); + + if ( Settings.godmode != 1) options2.SetValue(1, "********"); + else if (!strcmp("", Settings.unlockCode)) options2.SetValue(1, "%s",LANGUAGE.notset); + else options2.SetValue(1, Settings.unlockCode); + + if (Settings.godmode != 1) options2.SetValue(2, "********"); + else if(Settings.parentalcontrol == 0) options2.SetValue(2, "%s", LANGUAGE.OFF); + else if(Settings.parentalcontrol == 1) options2.SetValue(2, "1"); + else if(Settings.parentalcontrol == 2) options2.SetValue(2, "2"); + else if(Settings.parentalcontrol == 3) options2.SetValue(2, "3"); + + 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(LANGUAGE.ExitUSBISOLoader,0, LANGUAGE.BacktoLoader,LANGUAGE.WiiMenu,LANGUAGE.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: + if (!strcmp("", Settings.unlockCode)) + { + Settings.godmode = !Settings.godmode; + break; + } + else if ( Settings.godmode == 0 ) { + //password check to unlock Install,Delete and Format + w.Remove(&optionBrowser2); + w.Remove(&backBtn); + char entered[20] = ""; + int result = OnScreenKeyboard(entered, 20,0); + w.Append(&optionBrowser2); + w.Append(&backBtn); + if ( result == 1 ) { + if (!strcmp(entered, Settings.unlockCode)) //if password correct + { + if (Settings.godmode == 0) { + WindowPrompt(LANGUAGE.CorrectPassword,LANGUAGE.InstallRenameandDeleteareunlocked,LANGUAGE.ok,0,0,0); + Settings.godmode = 1; + __Menu_GetEntries(); + menu = MENU_DISCLIST; + } + } else { + WindowPrompt(LANGUAGE.WrongPassword,LANGUAGE.USBLoaderisprotected,LANGUAGE.ok,0,0,0); + } + } + } else { + int choice = WindowPrompt (LANGUAGE.LockConsole,LANGUAGE.Areyousure,LANGUAGE.Yes,LANGUAGE.No,0,0); + if(choice == 1) { + WindowPrompt(LANGUAGE.ConsoleLocked,LANGUAGE.USBLoaderisprotected,LANGUAGE.ok,0,0,0); + Settings.godmode = 0; + __Menu_GetEntries(); + menu = MENU_DISCLIST; + } + } + break; + case 1:// Modify Password + if ( Settings.godmode == 1) + { + w.Remove(&optionBrowser2); + w.Remove(&backBtn); + char entered[20] = ""; + strncpy(entered, Settings.unlockCode, sizeof(entered)); + int result = OnScreenKeyboard(entered, 20,0); + w.Append(&optionBrowser2); + w.Append(&backBtn); + if ( result == 1 ) { + strncpy(Settings.unlockCode, entered, sizeof(Settings.unlockCode)); + WindowPrompt(LANGUAGE.PasswordChanged,LANGUAGE.Passwordhasbeenchanged,LANGUAGE.ok,0,0,0); + } + } else { + WindowPrompt(LANGUAGE.Passwordchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); + } + break; + case 2: + if(Settings.godmode) + Settings.parentalcontrol++; + break; + } + } + optionBrowser2.SetEffect(EFFECT_FADE, -20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + titleTxt.SetText(LANGUAGE.settings); + slidedirection = FADE; + pageToDisplay = 1; + MainButton3.ResetState(); + break; + } + + if(MainButton4.GetState() == STATE_CLICKED) { + MainButton1.SetEffect(EFFECT_FADE, -20); + MainButton2.SetEffect(EFFECT_FADE, -20); + MainButton3.SetEffect(EFFECT_FADE, -20); + MainButton4.SetEffect(EFFECT_FADE, -20); + while(MainButton4.GetEffect() > 0) usleep(50); + HaltGui(); + w.Remove(&PageIndicatorBtn1); + w.Remove(&PageIndicatorBtn2); + w.Remove(&GoRightBtn); + w.Remove(&GoLeftBtn); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + titleTxt.SetText(LANGUAGE.Sound); + exit = false; + options2.SetName(0, "%s",LANGUAGE.Backgroundmusic); + options2.SetName(1, "%s",LANGUAGE.Volume); + options2.SetName(2, "%s",LANGUAGE.SFXVolume); + options2.SetName(3, NULL); + options2.SetName(4, NULL); + options2.SetName(5, NULL); + options2.SetName(6, NULL); + options2.SetName(7, NULL); + options2.SetName(8, NULL); + for(int i = 0; i < 9; 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); + + char * oggfile; + oggfile = strrchr(Settings.ogg_path, '/')+1; + + while(!exit) + { + VIDEO_WaitVSync (); + + if(!strcmp("notset", Settings.ogg_path) || !strcmp("",Settings.oggload_path)) + options2.SetValue(0, "%s", LANGUAGE.Standard); + else { + options2.SetValue(0, "%s", oggfile); + } + + if(Settings.volume > 0) + options2.SetValue(1,"%i", Settings.volume); + else + options2.SetValue(1,"%s", LANGUAGE.OFF); + if(Settings.sfxvolume > 0) + options2.SetValue(2,"%i", Settings.sfxvolume); + else + options2.SetValue(2,"%s", LANGUAGE.OFF); + + 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(LANGUAGE.ExitUSBISOLoader,0, LANGUAGE.BacktoLoader,LANGUAGE.WiiMenu,LANGUAGE.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: + if(isSdInserted()) + { + w.SetEffect(EFFECT_FADE, -20); + while(w.GetEffect()>0) usleep(50); + mainWindow->Remove(&w); + bool returnhere = true; + while(returnhere) + returnhere = MenuOGG(); + HaltGui(); + mainWindow->Append(&w); + w.SetEffect(EFFECT_FADE, 20); + ResumeGui(); + while(w.GetEffect()>0) usleep(50); + } + else + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0); + break; + case 1: + Settings.volume += 10; + if(Settings.volume > 100) + Settings.volume = 0; + SetVolumeOgg(255*(Settings.volume/100.0)); + break; + case 2: + Settings.sfxvolume += 10; + if(Settings.sfxvolume > 100) + Settings.sfxvolume = 0; + btnSoundOver.SetVolume(Settings.sfxvolume); + btnClick.SetVolume(Settings.sfxvolume); + btnClick1.SetVolume(Settings.sfxvolume); + break; + } + } + optionBrowser2.SetEffect(EFFECT_FADE, -20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + titleTxt.SetText(LANGUAGE.settings); + slidedirection = FADE; + pageToDisplay = 1; + MainButton4.ResetState(); + break; + } } - if (pageToDisplay == 3) + + if ( pageToDisplay == 2) { + if(MainButton1.GetState() == STATE_CLICKED) { + 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(&PageIndicatorBtn1); + w.Remove(&PageIndicatorBtn2); + w.Remove(&GoRightBtn); + w.Remove(&GoLeftBtn); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + titleTxt.SetText(LANGUAGE.Custompaths); + exit = false; + if(Settings.godmode) + options2.SetName(0, "%s", LANGUAGE.CoverPath); + options2.SetName(1, "%s", LANGUAGE.DiscimagePath); + options2.SetName(2, "%s", LANGUAGE.ThemePath); + options2.SetName(3, "%s", LANGUAGE.Titlestxtpath); + options2.SetName(4, "%s", LANGUAGE.Updatepath); + options2.SetName(5, NULL); + options2.SetName(6, NULL); + options2.SetName(7, NULL); + options2.SetName(8, NULL); + for(int i = 0; i < 9; i++) options2.SetValue(i, NULL); + w.Append(&optionBrowser2); + optionBrowser2.SetClickable(true); + ResumeGui(); - if ( Settings.keyset >= settings_keyset_max) - Settings.keyset = 0; - if ( Settings.unicodefix > 2 ) - Settings.unicodefix = 0; - if ( Settings.wiilight > 2 ) - Settings.wiilight = 0; - if ( Settings.patchcountrystrings > 1) - Settings.patchcountrystrings = 0; + VIDEO_WaitVSync (); + optionBrowser2.SetEffect(EFFECT_FADE, 20); + while(optionBrowser2.GetEffect() > 0) usleep(50); - options2.SetValue(0, "%s", Settings.titlestxt_path); + if(Settings.godmode) { - options2.SetValue(1, "%s", Settings.language_path); + while(!exit) + { + VIDEO_WaitVSync (); - if (Settings.keyset == us) options2.SetValue(2,"QWERTY"); - else if (Settings.keyset == dvorak) options2.SetValue(2,"DVORAK"); - else if (Settings.keyset == euro) options2.SetValue(2,"QWERTZ"); - else if (Settings.keyset == azerty) options2.SetValue(2,"AZERTY"); + options2.SetValue(0, "%s", Settings.covers_path); + options2.SetValue(1, "%s", Settings.disc_path); + options2.SetValue(2, "%s", CFG.theme_path); + options2.SetValue(3, "%s", Settings.titlestxt_path); + options2.SetValue(4, "%s", Settings.update_path); - if (Settings.unicodefix == 0) options2.SetValue(3,"%s",LANGUAGE.OFF); - else if (Settings.unicodefix == 1) options2.SetValue(3,"%s",LANGUAGE.TChinese); - else if (Settings.unicodefix == 2) options2.SetValue(3,"%s",LANGUAGE.SChinese); + if(backBtn.GetState() == STATE_CLICKED) + { + backBtn.ResetState(); + exit = true; + break; + } - if(!strcmp("notset", Settings.ogg_path) || !strcmp("",Settings.oggload_path)) - options2.SetValue(4, "%s", LANGUAGE.Standard); - else - options2.SetValue(4, "%s", Settings.ogg_path); + if(shutdown == 1) + Sys_Shutdown(); + else if(reset == 1) + Sys_Reboot(); - if (Settings.wiilight == 0) options2.SetValue(5,"%s",LANGUAGE.OFF); - else if (Settings.wiilight == 1) options2.SetValue(5,"%s",LANGUAGE.ON); - else if (Settings.wiilight == 2) options2.SetValue(5,"%s",LANGUAGE.OnlyInstall); + else if(homo.GetState() == STATE_CLICKED) + { + cfg_save_global(); + optionBrowser2.SetState(STATE_DISABLED); + s32 thetimeofbg = bgMusic->GetPlayTime(); + bgMusic->Stop(); + choice = WindowExitPrompt(LANGUAGE.ExitUSBISOLoader,0, LANGUAGE.BacktoLoader,LANGUAGE.WiiMenu,LANGUAGE.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); + } - options2.SetValue(6, "%s", Settings.update_path); + ret = optionBrowser2.GetClickedOption(); - if (Settings.patchcountrystrings == 0) options2.SetValue(7,"%s",LANGUAGE.OFF); - else if (Settings.patchcountrystrings == 1) options2.SetValue(7,"%s",LANGUAGE.ON); + switch (ret) + { + case 0: + if ( Settings.godmode == 1) + { + w.Remove(&optionBrowser2); + w.Remove(&backBtn); + char entered[43] = ""; + strncpy(entered, Settings.covers_path, sizeof(entered)); + int result = OnScreenKeyboard(entered,43,4); + w.Append(&optionBrowser2); + w.Append(&backBtn); + if ( result == 1 ) + { + int len = (strlen(entered)-1); + if(entered[len] !='/') + strncat (entered, "/", 1); + strncpy(Settings.covers_path, entered, sizeof(Settings.covers_path)); + WindowPrompt(LANGUAGE.CoverpathChanged,0,LANGUAGE.ok,0,0,0); + if(!isSdInserted()) { + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); + } + } + } else { + WindowPrompt(LANGUAGE.Coverpathchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); + } + break; + case 1: + if ( Settings.godmode == 1) + { + w.Remove(&optionBrowser2); + w.Remove(&backBtn); + char entered[43] = ""; + strncpy(entered, Settings.disc_path, sizeof(entered)); + int result = OnScreenKeyboard(entered, 43,4); + w.Append(&optionBrowser2); + w.Append(&backBtn); + if ( result == 1 ) + { + int len = (strlen(entered)-1); + if(entered[len] !='/') + strncat (entered, "/", 1); + strncpy(Settings.disc_path, entered, sizeof(Settings.disc_path)); + WindowPrompt(LANGUAGE.DiscpathChanged,0,LANGUAGE.ok,0,0,0); + if(!isSdInserted()) { + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); + } + } + } else { + WindowPrompt(LANGUAGE.Discpathchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); + } + break; + case 2: + if ( Settings.godmode == 1) + { + w.Remove(&optionBrowser2); + w.Remove(&backBtn); + char entered[43] = ""; + strncpy(entered, CFG.theme_path, sizeof(entered)); + int result = OnScreenKeyboard(entered, 43,4); + HaltGui(); + w.RemoveAll(); + if ( result == 1 ) + { + int len = (strlen(entered)-1); + if(entered[len] !='/') + strncat (entered, "/", 1); + strncpy(CFG.theme_path, entered, sizeof(CFG.theme_path)); + WindowPrompt(LANGUAGE.ThemepathChanged,0,LANGUAGE.ok,0,0,0); + if(!isSdInserted()) { + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); + } else { + cfg_save_global(); + } + mainWindow->Remove(bgImg); + CFG_Load(); + CFG_LoadGlobal(); + menu = MENU_SETTINGS; + #ifdef HW_RVL + snprintf(imgPath, sizeof(imgPath), "%splayer1_point.png", CFG.theme_path); + pointer[0] = new GuiImageData(imgPath, player1_point_png); + snprintf(imgPath, sizeof(imgPath), "%splayer2_point.png", CFG.theme_path); + pointer[1] = new GuiImageData(imgPath, player2_point_png); + snprintf(imgPath, sizeof(imgPath), "%splayer3_point.png", CFG.theme_path); + pointer[2] = new GuiImageData(imgPath, player3_point_png); + snprintf(imgPath, sizeof(imgPath), "%splayer4_point.png", CFG.theme_path); + pointer[3] = new GuiImageData(imgPath, player4_point_png); + #endif + if (CFG.widescreen) + snprintf(imgPath, sizeof(imgPath), "%swbackground.png", CFG.theme_path); + else + snprintf(imgPath, sizeof(imgPath), "%sbackground.png", CFG.theme_path); - options2.SetValue(8, " "); + background = new GuiImageData(imgPath, CFG.widescreen? wbackground_png : background_png); - ret = optionBrowser2.GetClickedOption(); + bgImg = new GuiImage(background); + mainWindow->Append(bgImg); + mainWindow->Append(&w); + } + w.Append(&settingsbackground); + w.Append(&titleTxt); + w.Append(&backBtn); + w.Append(&optionBrowser2); + ResumeGui(); + } else { + WindowPrompt(LANGUAGE.Themepathchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); + } + break; + } + } + /** If not godmode don't let him inside **/ + } else { + WindowPrompt(LANGUAGE.ConsoleLocked, LANGUAGE.UnlockConsoletousethisOption, LANGUAGE.ok, 0, 0, 0); + } + optionBrowser2.SetEffect(EFFECT_FADE, -20); + while(optionBrowser2.GetEffect() > 0) usleep(50); + titleTxt.SetText(LANGUAGE.settings); + slidedirection = FADE; + pageToDisplay = 2; + MainButton1.ResetState(); + break; + } - switch(ret) - { - case 0: - if ( Settings.godmode == 1) - { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - char entered[43] = ""; - strncpy(entered, Settings.titlestxt_path, sizeof(entered)); - int result = OnScreenKeyboard(entered,43,4); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - if ( result == 1 ) - { - int len = (strlen(entered)-1); - if(entered[len] !='/') - strncat (entered, "/", 1); - strncpy(Settings.titlestxt_path, entered, sizeof(Settings.titlestxt_path)); - WindowPrompt(LANGUAGE.TitlestxtpathChanged,0,LANGUAGE.ok,0,0,0); - if(isSdInserted()) { - cfg_save_global(); - CFG_Load(); - } else { - WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); - } - } - } - else - { - WindowPrompt(LANGUAGE.Titlestxtpathchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); - } - break; - case 1: // language file path - if ( Settings.godmode == 1) - { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - char entered[40] = ""; - strncpy(entered, Settings.language_path, sizeof(entered)); - int result = OnScreenKeyboard(entered, 40,0); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - if ( result == 1 ) - { strncpy(Settings.language_path, entered, sizeof(Settings.language_path)); - if(isSdInserted()) { - cfg_save_global(); - if(!checkfile(Settings.language_path)) { - WindowPrompt(LANGUAGE.Filenotfound,LANGUAGE.Loadingstandardlanguage,LANGUAGE.ok,0,0,0); - } - lang_default(); - CFG_Load(); - menu = MENU_SETTINGS; - pageToDisplay = 0; - } else { - WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); - } - } - } - else - { - WindowPrompt(LANGUAGE.Langchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); - } - break; - case 2: - Settings.keyset++; - break; - case 3: - Settings.unicodefix++; - break; - case 4: - if(isSdInserted()) - { - menu = MENU_OGG; - pageToDisplay = 0; - } - else - WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0); - break; - case 5: - Settings.wiilight++; - break; - case 7: - Settings.patchcountrystrings++; - break; - case 6: - if ( Settings.godmode == 1) - { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - char entered[43] = ""; - strncpy(entered, Settings.update_path, sizeof(entered)); - int result = OnScreenKeyboard(entered,43,4); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - if ( result == 1 ) - { - int len = (strlen(entered)-1); - if(entered[len] !='/') - strncat (entered, "/", 1); - strncpy(Settings.update_path, entered, sizeof(Settings.update_path)); - WindowPrompt(LANGUAGE.Updatepathchanged,0,LANGUAGE.ok,0,0,0); - } - } - else - WindowPrompt(0,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0); - break; - case 8: - int choice = WindowPrompt(LANGUAGE.Areyousure, 0, LANGUAGE.Yes, LANGUAGE.Cancel, 0, 0); - if(choice == 1) - { + if(MainButton2.GetState() == STATE_CLICKED) { + MainButton1.SetEffect(EFFECT_FADE, -20); + MainButton2.SetEffect(EFFECT_FADE, -20); + MainButton3.SetEffect(EFFECT_FADE, -20); + MainButton4.SetEffect(EFFECT_FADE, -20); + while(MainButton2.GetEffect() > 0) usleep(50); + w.Remove(&PageIndicatorBtn1); + w.Remove(&PageIndicatorBtn2); + w.Remove(&GoRightBtn); + w.Remove(&GoLeftBtn); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + if(isSdInserted() && Settings.godmode) { + w.Remove(&optionBrowser2); + w.Remove(&backBtn); + int ret = ProgressUpdateWindow(); + if(ret < 0) { + WindowPrompt(LANGUAGE.Updatefailed,0,LANGUAGE.ok,0,0,0); + } + w.Append(&optionBrowser2); + w.Append(&backBtn); + } else { + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0); + } + slidedirection = FADE; + pageToDisplay = 2; + 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); + w.Remove(&PageIndicatorBtn1); + w.Remove(&PageIndicatorBtn2); + w.Remove(&GoRightBtn); + w.Remove(&GoLeftBtn); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + w.Remove(&backBtn); + w.Remove(&optionBrowser2); + if(Settings.godmode) { + int choice = WindowPrompt(LANGUAGE.Areyousure, 0, LANGUAGE.Yes, LANGUAGE.Cancel, 0, 0); + if(choice == 1) { if(isSdInserted()) remove("SD:/config/GXGlobal.cfg"); lang_default(); CFG_Load(); menu = MENU_SETTINGS; pageToDisplay = 0; - } - break; - } + } + } else { + WindowPrompt(LANGUAGE.ConsoleLocked, LANGUAGE.UnlockConsoletousethisOption, LANGUAGE.ok, 0, 0, 0); + } + w.Append(&backBtn); + w.Append(&optionBrowser2); + slidedirection = FADE; + pageToDisplay = 2; + MainButton3.ResetState(); + break; + } + + if(MainButton4.GetState() == STATE_CLICKED) { + MainButton1.SetEffect(EFFECT_FADE, -20); + MainButton2.SetEffect(EFFECT_FADE, -20); + MainButton3.SetEffect(EFFECT_FADE, -20); + MainButton4.SetEffect(EFFECT_FADE, -20); + while(MainButton4.GetEffect() > 0) usleep(50); + w.Remove(&PageIndicatorBtn1); + w.Remove(&PageIndicatorBtn2); + w.Remove(&GoRightBtn); + w.Remove(&GoLeftBtn); + w.Remove(&MainButton1); + w.Remove(&MainButton2); + w.Remove(&MainButton3); + w.Remove(&MainButton4); + WindowCredits(); + slidedirection = FADE; + pageToDisplay = 2; + MainButton4.ResetState(); + break; + } } if(shutdown == 1) @@ -846,33 +1413,6 @@ int MenuSettings() if(reset == 1) Sys_Reboot(); - if(page1Btn.GetState() == STATE_CLICKED) - { - pageToDisplay = 1; - page1Btn.ResetState(); - tabBtn.SetImage(&tab1Img); - menu = MENU_NONE; - break; - } - - if(page2Btn.GetState() == STATE_CLICKED) - { - pageToDisplay = 2; - menu = MENU_NONE; - page2Btn.ResetState(); - tabBtn.SetImage(&tab2Img); - break; - } - - if(page3Btn.GetState() == STATE_CLICKED) - { - pageToDisplay = 3; - menu = MENU_NONE; - page3Btn.ResetState(); - tabBtn.SetImage(&tab3Img); - break; - } - if(backBtn.GetState() == STATE_CLICKED) { //Add the procedure call to save the global configuration @@ -884,124 +1424,50 @@ int MenuSettings() break; } - if(updateBtn.GetState() == STATE_CLICKED) { - if(isSdInserted() && Settings.godmode) { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&btnLogo); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - int ret = ProgressUpdateWindow(); - if(ret < 0) { - WindowPrompt(LANGUAGE.Updatefailed,0,LANGUAGE.ok,0,0,0); - } - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - w.Append(&btnLogo); - } else { - WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0); - } - updateBtn.ResetState(); - } - - if(btnLogo.GetState() == STATE_CLICKED) { - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&btnLogo); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - WindowCredits(); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - w.Append(&btnLogo); - btnLogo.ResetState(); - } - - if(lockBtn.GetState() == STATE_CLICKED) + if(GoLeftBtn.GetState() == STATE_CLICKED) { - if (!strcmp("", Settings.unlockCode)) - { - Settings.godmode = !Settings.godmode; - } - else if ( Settings.godmode == 0 ) - { - //password check to unlock Install,Delete and Format - mainWindow->Remove(&optionBrowser2); - mainWindow->Remove(&page1Btn); - mainWindow->Remove(&page2Btn); - mainWindow->Remove(&tabBtn); - mainWindow->Remove(&page3Btn); - w.Remove(&backBtn); - w.Remove(&lockBtn); - w.Remove(&updateBtn); - char entered[20] = ""; - int result = OnScreenKeyboard(entered, 20,0); - mainWindow->Append(&optionBrowser2); - mainWindow->Append(&tabBtn); - mainWindow->Append(&page1Btn); - mainWindow->Append(&page2Btn); - mainWindow->Append(&page3Btn); - w.Append(&backBtn); - w.Append(&lockBtn); - w.Append(&updateBtn); - mainWindow->Append(&tabBtn); - if ( result == 1 ) { - if (!strcmp(entered, Settings.unlockCode)) //if password correct - { - if (Settings.godmode == 0) { - WindowPrompt(LANGUAGE.CorrectPassword,LANGUAGE.InstallRenameandDeleteareunlocked,LANGUAGE.ok,0,0,0); - Settings.godmode = 1; - __Menu_GetEntries(); - menu = MENU_DISCLIST; - } - } - else - { - WindowPrompt(LANGUAGE.WrongPassword,LANGUAGE.USBLoaderisprotected,LANGUAGE.ok,0,0,0); - } - } - } - else - { - int choice = WindowPrompt (LANGUAGE.LockConsole,LANGUAGE.Areyousure,LANGUAGE.Yes,LANGUAGE.No,0,0); - if(choice == 1) { - WindowPrompt(LANGUAGE.ConsoleLocked,LANGUAGE.USBLoaderisprotected,LANGUAGE.ok,0,0,0); - Settings.godmode = 0; - __Menu_GetEntries(); - menu = MENU_DISCLIST; - } - } - if ( Settings.godmode == 1) - { - lockBtnTxt.SetText(LANGUAGE.Lock); - } - else - { - lockBtnTxt.SetText(LANGUAGE.Unlock); - } - lockBtn.ResetState(); + pageToDisplay--; + /** Change direction of the flying buttons **/ + if(pageToDisplay < 1) + pageToDisplay = 2; + slidedirection = LEFT; + GoLeftBtn.ResetState(); + break; } - else if(homo.GetState() == STATE_CLICKED) + + if(GoRightBtn.GetState() == STATE_CLICKED) + { + pageToDisplay++; + /** Change direction of the flying buttons **/ + if(pageToDisplay > 2) + pageToDisplay = 1; + slidedirection = RIGHT; + GoRightBtn.ResetState(); + break; + } + + if(PageIndicatorBtn1.GetState() == STATE_CLICKED) + { + if(pageToDisplay == 2) { + slidedirection = LEFT; + pageToDisplay = 1; + PageIndicatorBtn1.ResetState(); + break; + } + PageIndicatorBtn1.ResetState(); + } + else if(PageIndicatorBtn2.GetState() == STATE_CLICKED) + { + if(pageToDisplay == 1) { + slidedirection = RIGHT; + pageToDisplay = 2; + PageIndicatorBtn2.ResetState(); + break; + } else + PageIndicatorBtn2.ResetState(); + } + + if(homo.GetState() == STATE_CLICKED) { cfg_save_global(); optionBrowser2.SetState(STATE_DISABLED); @@ -1011,41 +1477,28 @@ int MenuSettings() if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { bgMusic->Play(); - } - else - { + } else { bgMusic->PlayOggFile(Settings.ogg_path); } bgMusic->SetPlayTime(thetimeofbg); - SetVolumeOgg(255*(vol/100.0)); + SetVolumeOgg(255*(Settings.volume/100.0)); if(choice == 3) { Sys_LoadMenu(); // Back to System Menu - } - else if (choice == 2) - { + } else if (choice == 2) { Sys_BackToLoader(); - } - else - { + } else { homo.ResetState(); } - } - if(Settings.godmode) { - updateBtn.SetVisible(true); - updateBtn.SetClickable(true); - } else { - updateBtn.SetVisible(false); - updateBtn.SetClickable(false); - } - if(settingsbackgroundbtn.GetState() == STATE_CLICKED) - { - optionBrowser2.SetFocus(1); - break; + optionBrowser2.SetState(STATE_DEFAULT); } } } + + w.SetEffect(EFFECT_FADE, -20); + while(w.GetEffect()>0) usleep(50); + HaltGui(); mainWindow->RemoveAll(); mainWindow->Append(bgImg); @@ -1074,17 +1527,18 @@ int GameSettings(struct discHdr * header) strncat(gameName, "...", 3); } - customOptionList options3(7); + customOptionList options3(8); options3.SetName(0,"%s", LANGUAGE.VideoMode); options3.SetName(1,"%s", LANGUAGE.VIDTVPatch); options3.SetName(2,"%s", LANGUAGE.Language); options3.SetName(3, "Ocarina"); options3.SetName(4, "IOS"); options3.SetName(5,"%s", LANGUAGE.Parentalcontrol); - options3.SetName(6,"%s", LANGUAGE.Defaultgamesettings); + options3.SetName(6,"%s", "Error 002 fix"); + options3.SetName(7,"%s", LANGUAGE.Defaultgamesettings); - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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]; @@ -1153,11 +1607,9 @@ int GameSettings(struct discHdr * header) w.Append(&deleteBtn); w.Append(&saveBtn); w.Append(&cancelBtn); + w.Append(&optionBrowser3); mainWindow->Append(&w); - mainWindow->Append(&optionBrowser3); - - ResumeGui(); struct Game_CFG* game_cfg = CFG_get_game_opt(header->id); @@ -1169,6 +1621,7 @@ int GameSettings(struct discHdr * header) viChoice = game_cfg->vipatch; iosChoice = game_cfg->ios; parentalcontrolChoice = game_cfg->parentalcontrol; + fix002 = game_cfg->errorfix002; } else { @@ -1182,8 +1635,11 @@ int GameSettings(struct discHdr * header) iosChoice = i249; } parentalcontrolChoice = 0; + fix002 = off; } + ResumeGui(); + while(!exit) { @@ -1222,13 +1678,15 @@ int GameSettings(struct discHdr * header) else if (parentalcontrolChoice == 2) options3.SetValue(5,"2"); else if (parentalcontrolChoice == 3) options3.SetValue(5,"3 (Mature)"); + if (fix002 == on) options3.SetValue(6,LANGUAGE.ON); + else if (fix002 == off) options3.SetValue(6,LANGUAGE.OFF); if(shutdown == 1) Sys_Shutdown(); if(reset == 1) Sys_Reboot(); - options3.SetValue(6, " "); + options3.SetValue(7, NULL); ret = optionBrowser3.GetClickedOption(); @@ -1253,12 +1711,16 @@ int GameSettings(struct discHdr * header) parentalcontrolChoice = (parentalcontrolChoice + 1) % 4; break; case 6: + fix002 = (fix002+1) % 2; + break; + case 7: int choice = WindowPrompt(LANGUAGE.Areyousure,0,LANGUAGE.Yes,LANGUAGE.Cancel,0,0); if(choice == 1) { videoChoice = discdefault; viChoice = off; languageChoice = ConsoleLangDefault; ocarinaChoice = off; + fix002 = off; if(Settings.cios == ios222) { iosChoice = i222; } else { @@ -1333,7 +1795,6 @@ int GameSettings(struct discHdr * header) } HaltGui(); - mainWindow->Remove(&optionBrowser3); mainWindow->Remove(&w); ResumeGui(); diff --git a/source/SettingsPrompts.cpp b/source/SettingsPrompts.cpp new file mode 100644 index 00000000..e374b723 --- /dev/null +++ b/source/SettingsPrompts.cpp @@ -0,0 +1,512 @@ +#include +#include +#include + +#include "filelist.h" +#include "sys.h" +#include "language.h" +#include "libwiigui/gui.h" +#include "libwiigui/gui_customoptionbrowser.h" +#include "listfiles.h" +#include "cfg.h" +#include "main.h" +#include "PromptWindows.h" +#include "fatmounter.h" + + +/*** Extern variables ***/ +extern GuiWindow * mainWindow; +extern GuiSound * bgMusic; +extern u8 shutdown; +extern u8 reset; + +/*** Extern functions ***/ +extern void ResumeGui(); +extern void HaltGui(); + + +/**************************************************************************** + * MenuOGG + ***************************************************************************/ +bool MenuOGG() +{ + int cnt = 0; + int ret = 0, choice = 0; + int scrollon, nothingchanged = 0; + bool returnhere = false; + + 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), "%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); + + GuiTrigger trigA; + trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + GuiTrigger trigB; + trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); + GuiTrigger trigMinus; + trigMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0); + GuiTrigger trigPlus; + trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0); + + char fullpath[150]; + char shortpath[35]; + int countoggs = GetAllDirFiles(Settings.oggload_path); + + if(!strcmp("", Settings.oggload_path)) { + sprintf(shortpath, "%s", LANGUAGE.Standard); + } else { + sprintf(shortpath, "%s", Settings.oggload_path); + } + + GuiText titleTxt(shortpath, 24, (GXColor){0, 0, 0, 255}); + titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); + titleTxt.SetPosition(0,0); + GuiButton pathBtn(300, 50); + pathBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + pathBtn.SetPosition(0,28); + pathBtn.SetLabel(&titleTxt); + pathBtn.SetSoundOver(&btnSoundOver); + pathBtn.SetSoundClick(&btnClick); + pathBtn.SetTrigger(&trigA); + pathBtn.SetEffectGrow(); + + GuiImage oggmenubackground(&settingsbg); + oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP); + oggmenubackground.SetPosition(0, 0); + + GuiText backBtnTxt(LANGUAGE.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(btnOutline.GetWidth(), btnOutline.GetHeight()); + backBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + backBtn.SetPosition(-180, 400); + backBtn.SetLabel(&backBtnTxt); + backBtn.SetImage(&backBtnImg); + backBtn.SetSoundOver(&btnSoundOver); + backBtn.SetSoundClick(&btnClick); + backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(&trigB); + backBtn.SetEffectGrow(); + + GuiText defaultBtnTxt(LANGUAGE.Default , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); + defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); + GuiImage defaultBtnImg(&btnOutline); + if (Settings.wsprompt == yes){ + defaultBtnTxt.SetWidescreen(CFG.widescreen); + defaultBtnImg.SetWidescreen(CFG.widescreen); + } + GuiButton defaultBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); + defaultBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + defaultBtn.SetPosition(180, 400); + defaultBtn.SetLabel(&defaultBtnTxt); + defaultBtn.SetImage(&defaultBtnImg); + defaultBtn.SetSoundOver(&btnSoundOver); + defaultBtn.SetSoundClick(&btnClick); + defaultBtn.SetTrigger(&trigA); + defaultBtn.SetEffectGrow(); + + customOptionList options2(countoggs); + + for (cnt = 0; cnt < countoggs; cnt++) { + options2.SetValue(cnt, "%s", GetFileName(cnt)); + options2.SetName(cnt,"%i.", cnt+1); + } + + if(cnt < 9) { + scrollon = 0; + } else { + scrollon = 1; + } + + GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 10); + optionBrowser4.SetPosition(0, 90); + optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + + snprintf(imgPath, sizeof(imgPath), "%smp3_stop.png", CFG.theme_path); + GuiImageData stop(imgPath, mp3_stop_png); + snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_right.png", CFG.theme_path); + GuiImageData play(imgPath, startgame_arrow_right_png); + + GuiImage playBtnImg(&play); + playBtnImg.SetWidescreen(CFG.widescreen); + GuiButton playBtn(play.GetWidth(), play.GetHeight()); + playBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + playBtn.SetPosition(50, 400); + playBtn.SetImage(&playBtnImg); + playBtn.SetSoundOver(&btnSoundOver); + playBtn.SetSoundClick(&btnClick); + playBtn.SetTrigger(&trigA); + playBtn.SetTrigger(&trigPlus); + playBtn.SetEffectGrow(); + + GuiImage stopBtnImg(&stop); + stopBtnImg.SetWidescreen(CFG.widescreen); + GuiButton stopBtn(stop.GetWidth(), stop.GetHeight()); + stopBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + stopBtn.SetPosition(-15, 400); + stopBtn.SetImage(&stopBtnImg); + stopBtn.SetSoundOver(&btnSoundOver); + stopBtn.SetSoundClick(&btnClick); + stopBtn.SetTrigger(&trigA); + stopBtn.SetTrigger(&trigMinus); + stopBtn.SetEffectGrow(); + + HaltGui(); + GuiWindow w(screenwidth, screenheight); + w.Append(&oggmenubackground); + w.Append(&pathBtn); + w.Append(&backBtn); + w.Append(&playBtn); + w.Append(&stopBtn); + w.Append(&defaultBtn); + w.Append(&optionBrowser4); + mainWindow->Append(&w); + + w.SetEffect(EFFECT_FADE, 20); + ResumeGui(); + + while(w.GetEffect()>0) usleep(50); + + while(!returnhere) + { + + if (backBtn.GetState() == STATE_CLICKED) { + if(nothingchanged == 1 && countoggs > 0) { + if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { + bgMusic->Play(); + } else { + bgMusic->PlayOggFile(Settings.ogg_path); + } + } + break; + } + + if (defaultBtn.GetState() == STATE_CLICKED) { + choice = WindowPrompt(LANGUAGE.Loadingstandardmusic,0,LANGUAGE.ok, LANGUAGE.Cancel,0,0); + if (choice == 1) { + sprintf(Settings.ogg_path, "notset"); + bgMusic->Play(); + SetVolumeOgg(255*(Settings.volume/100.0)); + cfg_save_global(); + } + defaultBtn.ResetState(); + optionBrowser4.SetFocus(1); + } + + if (pathBtn.GetState() == STATE_CLICKED) { + w.Remove(&optionBrowser4); + w.Remove(&backBtn); + w.Remove(&pathBtn); + w.Remove(&playBtn); + w.Remove(&stopBtn); + w.Remove(&defaultBtn); + char entered[43] = ""; + strncpy(entered, Settings.oggload_path, sizeof(entered)); + int result = OnScreenKeyboard(entered,43,0); + w.Append(&optionBrowser4); + w.Append(&pathBtn); + w.Append(&backBtn); + w.Append(&playBtn); + w.Append(&stopBtn); + w.Append(&defaultBtn); + if ( result == 1 ) { + int len = (strlen(entered)-1); + if(entered[len] !='/') + strncat (entered, "/", 1); + strncpy(Settings.oggload_path, entered, sizeof(Settings.oggload_path)); + WindowPrompt(LANGUAGE.Backgroundmusicpath,0,LANGUAGE.ok,0,0,0); + if(isSdInserted()) { + if(!strcmp("", Settings.oggload_path)) { + sprintf(Settings.ogg_path, "notset"); + bgMusic->Play(); + } + cfg_save_global(); + returnhere = true; + break; + } else { + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); + } + } + if(countoggs > 0) { + optionBrowser4.SetFocus(1); + } + pathBtn.ResetState(); + } + + ret = optionBrowser4.GetClickedOption(); + + if(ret>=0) { + choice = WindowPrompt(LANGUAGE.Setasbackgroundmusic,GetFileName(ret),LANGUAGE.Yes,LANGUAGE.No,0,0); + if(choice == 1) { + snprintf(fullpath,150,"%s%s",Settings.oggload_path,GetFileName(ret)); + choice = bgMusic->PlayOggFile(fullpath); + if(choice < 0) { + WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0); + sprintf(Settings.ogg_path, "notset"); + bgMusic->Play(); + SetVolumeOgg(255*(Settings.volume/100.0)); + } else { + snprintf(Settings.ogg_path, sizeof(Settings.ogg_path), "%s", fullpath); + cfg_save_global(); + SetVolumeOgg(255*(Settings.volume/100.0)); + nothingchanged = 0; + } + } + optionBrowser4.SetFocus(1); + } + + if (playBtn.GetState() == STATE_CLICKED && countoggs > 0) { + if(countoggs > 0) { + ret = optionBrowser4.GetSelectedOption(); + snprintf(fullpath, 150,"%s%s", Settings.oggload_path,GetFileName(ret)); + choice = bgMusic->PlayOggFile(fullpath); + if(choice < 0) { + WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0); + if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { + bgMusic->Play(); + } else { + bgMusic->PlayOggFile(Settings.ogg_path); + } + } + SetVolumeOgg(255*(Settings.volume/100.0)); + nothingchanged = 1; + optionBrowser4.SetFocus(1); + } + playBtn.ResetState(); + } + + if(stopBtn.GetState() == STATE_CLICKED) { + if(countoggs > 0) { + StopOgg(); + nothingchanged = 1; + optionBrowser4.SetFocus(1); + } + stopBtn.ResetState(); + } + } + + w.SetEffect(EFFECT_FADE, -20); + while(w.GetEffect()>0) usleep(50); + + HaltGui(); + mainWindow->Remove(&w); + ResumeGui(); + + return returnhere; +} + +/**************************************************************************** + * MenuLanguageSelect + ***************************************************************************/ +int MenuLanguageSelect() +{ + int cnt = 0; + int ret = 0, choice = 0; + int scrollon; + int returnhere = 0; + + 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), "%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); + + GuiTrigger trigA; + trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); + GuiTrigger trigB; + trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); + + char fullpath[100]; + int countfiles = GetAllDirFiles(Settings.languagefiles_path); + + if(!strcmp("", Settings.languagefiles_path)) { + sprintf(fullpath, "%s", LANGUAGE.Standard); + } else { + sprintf(fullpath, "%s", Settings.languagefiles_path); + } + + GuiText titleTxt(fullpath, 24, (GXColor){0, 0, 0, 255}); + titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); + titleTxt.SetPosition(0,0); + GuiButton pathBtn(300, 50); + pathBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + pathBtn.SetPosition(0,28); + pathBtn.SetLabel(&titleTxt); + pathBtn.SetSoundOver(&btnSoundOver); + pathBtn.SetSoundClick(&btnClick); + pathBtn.SetTrigger(&trigA); + pathBtn.SetEffectGrow(); + + GuiImage oggmenubackground(&settingsbg); + oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP); + oggmenubackground.SetPosition(0, 0); + + GuiText backBtnTxt(LANGUAGE.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(btnOutline.GetWidth(), btnOutline.GetHeight()); + backBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + backBtn.SetPosition(-180, 400); + backBtn.SetLabel(&backBtnTxt); + backBtn.SetImage(&backBtnImg); + backBtn.SetSoundOver(&btnSoundOver); + backBtn.SetSoundClick(&btnClick); + backBtn.SetTrigger(&trigA); + backBtn.SetTrigger(&trigB); + backBtn.SetEffectGrow(); + + GuiText defaultBtnTxt(LANGUAGE.Default , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); + defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); + GuiImage defaultBtnImg(&btnOutline); + if (Settings.wsprompt == yes) { + defaultBtnTxt.SetWidescreen(CFG.widescreen); + defaultBtnImg.SetWidescreen(CFG.widescreen); + } + GuiButton defaultBtn(btnOutline.GetWidth(), btnOutline.GetHeight()); + defaultBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + defaultBtn.SetPosition(180, 400); + defaultBtn.SetLabel(&defaultBtnTxt); + defaultBtn.SetImage(&defaultBtnImg); + defaultBtn.SetSoundOver(&btnSoundOver); + defaultBtn.SetSoundClick(&btnClick); + defaultBtn.SetTrigger(&trigA); + defaultBtn.SetEffectGrow(); + + customOptionList options2(countfiles); + + for (cnt = 0; cnt < countfiles; cnt++) { + options2.SetName(cnt, "%s", GetFileName(cnt)); + options2.SetValue(cnt, NULL); + } + + if(cnt < 9) { + scrollon = 0; + } else { + scrollon = 1; + } + + GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 10); + optionBrowser4.SetPosition(0, 90); + optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); + + HaltGui(); + GuiWindow w(screenwidth, screenheight); + w.Append(&oggmenubackground); + w.Append(&pathBtn); + w.Append(&backBtn); + w.Append(&defaultBtn); + w.Append(&optionBrowser4); + mainWindow->Append(&w); + + w.SetEffect(EFFECT_FADE, 20); + ResumeGui(); + + while(w.GetEffect()>0) usleep(50); + + while(!returnhere) + { + + if (backBtn.GetState() == STATE_CLICKED) { + + backBtn.ResetState(); + break; + } + + if (defaultBtn.GetState() == STATE_CLICKED) { + choice = WindowPrompt(LANGUAGE.Loadingstandardlanguage,0,LANGUAGE.ok, LANGUAGE.Cancel,0,0); + if (choice == 1) { + sprintf(Settings.language_path, "notset"); + cfg_save_global(); + lang_default(); + CFG_Load(); + returnhere = 2; + } + defaultBtn.ResetState(); + optionBrowser4.SetFocus(1); + } + + if (pathBtn.GetState() == STATE_CLICKED) { + w.Remove(&optionBrowser4); + w.Remove(&backBtn); + w.Remove(&pathBtn); + w.Remove(&defaultBtn); + char entered[43] = ""; + strncpy(entered, Settings.languagefiles_path, sizeof(entered)); + int result = OnScreenKeyboard(entered,43,0); + w.Append(&optionBrowser4); + w.Append(&pathBtn); + w.Append(&backBtn); + w.Append(&defaultBtn); + if ( result == 1 ) { + int len = (strlen(entered)-1); + if(entered[len] !='/') + strncat (entered, "/", 1); + strncpy(Settings.languagefiles_path, entered, sizeof(Settings.languagefiles_path)); + WindowPrompt(LANGUAGE.Languagepathchanged,0,LANGUAGE.ok,0,0,0); + if(isSdInserted()) { + cfg_save_global(); + returnhere = 1; + break; + } else { + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); + } + } + if(countfiles > 0) { + optionBrowser4.SetFocus(1); + } + pathBtn.ResetState(); + } + + ret = optionBrowser4.GetClickedOption(); + + if(ret>=0) { + choice = WindowPrompt(LANGUAGE.Doyouwanttochangelanguage, 0, LANGUAGE.Yes, LANGUAGE.Cancel,0,0); + if(choice == 1) { + if(isSdInserted()) { + snprintf(Settings.language_path, sizeof(Settings.language_path), "%s%s", Settings.languagefiles_path, GetFileName(ret)); + cfg_save_global(); + if(!checkfile(Settings.language_path)) { + sprintf(Settings.language_path, "notset"); + WindowPrompt(LANGUAGE.Filenotfound,LANGUAGE.Loadingstandardlanguage,LANGUAGE.ok,0,0,0); + } + lang_default(); + CFG_Load(); + returnhere = 2; + break; + } else { + WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); + } + } + optionBrowser4.SetFocus(1); + } + + } + + w.SetEffect(EFFECT_FADE, -20); + while(w.GetEffect()>0) usleep(50); + + HaltGui(); + mainWindow->Remove(&w); + ResumeGui(); + + return returnhere; +} + diff --git a/source/SettingsPrompts.h b/source/SettingsPrompts.h new file mode 100644 index 00000000..69ec697c --- /dev/null +++ b/source/SettingsPrompts.h @@ -0,0 +1,14 @@ +/**************************************************************************** + * SettingsPrompts + * USB Loader GX 2009 + * + * SettingsPrompts.h + ***************************************************************************/ + +#ifndef _SETTINGSPROMPTS_H_ +#define _SETTINGSPROMPTS_H_ + +bool MenuOGG(); +int MenuLanguageSelect(); + +#endif diff --git a/source/apploader.c b/source/apploader.c index fa44369f..3d95c9cd 100644 --- a/source/apploader.c +++ b/source/apploader.c @@ -218,7 +218,7 @@ bool Search_and_patch_Video_Modes(void *Address, u32 Size, GXRModeObj* Table[]) return found; } -s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 patchcountrystring) +s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 patchcountrystring, u8 error002fix) { app_entry appldr_entry; app_init appldr_init; @@ -250,8 +250,10 @@ s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 /* Initialize apploader */ appldr_init(__noprint); + if(error002fix) { /* ERROR 002 fix (thanks to WiiPower for sharing this)*/ - *(u32 *)0x80003140 = *(u32 *)0x80003188; + *(u32 *)0x80003140 = *(u32 *)0x80003188; + } if (cheat) { diff --git a/source/apploader.h b/source/apploader.h index c1d75c00..6123ad71 100644 --- a/source/apploader.h +++ b/source/apploader.h @@ -5,6 +5,6 @@ typedef void (*entry_point)(void); /* Prototypes */ -s32 Apploader_Run(entry_point *, u8, u8, u8, u8); +s32 Apploader_Run(entry_point *, u8, u8, u8, u8, u8); #endif diff --git a/source/cfg.c b/source/cfg.c index c9200b8a..1e1b61c2 100644 --- a/source/cfg.c +++ b/source/cfg.c @@ -29,6 +29,7 @@ u8 languageChoice = 0; u8 viChoice = 0; u8 iosChoice = 0; u8 parentalcontrolChoice = 0; +u8 fix002 = 0; u8 xflip = 0; u8 sort = 0; u8 fave = 0; @@ -232,6 +233,7 @@ void CFG_Default(int widescreen) // -1 = non forced Mode snprintf(Settings.titlestxt_path, sizeof(Settings.titlestxt_path), "SD:/config/");//default path for disc images snprintf(Settings.unlockCode, sizeof(Settings.unlockCode), "ab121b"); // default password snprintf(Settings.language_path, sizeof(Settings.language_path), "SD:/config/language/"); + snprintf(Settings.languagefiles_path, sizeof(Settings.languagefiles_path), "SD:/config/language/"); snprintf(Settings.oggload_path, sizeof(Settings.oggload_path), "SD:/config/backgroundmusic/"); snprintf(Settings.update_path, sizeof(Settings.update_path), "SD:/apps/usbloader_gx/"); sprintf(Settings.ogg_path, "notset"); @@ -335,7 +337,8 @@ void Global_Default(void) { Settings.sinfo = ((Settings.sinfo == GameID) ? Both : GameRegion); } - Settings.volume = v80; + Settings.volume = 80; + Settings.sfxvolume = 80; Settings.tooltips = TooltipsOn; snprintf(Settings.unlockCode, sizeof(Settings.unlockCode), "ab121b"); Settings.parentalcontrol = 0; @@ -480,6 +483,10 @@ void path_set(char *name, char *val) strcopy(Settings.language_path, val, sizeof(Settings.language_path)); return; } + if (strcmp(name, "languagefiles_path") == 0) { + strcopy(Settings.languagefiles_path, val, sizeof(Settings.languagefiles_path)); + return; + } if (strcmp(name, "update_path") == 0) { strcopy(Settings.update_path, val, sizeof(Settings.update_path)); return; @@ -888,6 +895,13 @@ void global_cfg_set(char *name, char *val) } return; } + else if (strcmp(name, "sfxvolume") == 0) { + int i; + if (sscanf(val, "%d", &i) == 1) { + Settings.sfxvolume = i; + } + return; + } else if (strcmp(name, "tooltips") == 0) { int i; if (sscanf(val, "%d", &i) == 1) { @@ -1104,6 +1118,7 @@ void cfg_set_game_opt(struct Game_CFG *game, u8 *id) game->vipatch = viChoice; game->ios = iosChoice; game->parentalcontrol = parentalcontrolChoice; + game->errorfix002 = fix002; } struct Game_NUM* cfg_get_game_num(u8 *id) @@ -1154,6 +1169,7 @@ bool cfg_save_global()// save global settings fprintf(f, "sinfo = %d\n ", Settings.sinfo); fprintf(f, "rumble = %d\n ", Settings.rumble); fprintf(f, "volume = %d\n ", Settings.volume); + fprintf(f, "sfxvolume = %d\n ", Settings.sfxvolume); fprintf(f, "tooltips = %d\n ", Settings.tooltips); fprintf(f, "password = %s\n ", Settings.unlockCode); fprintf(f, "sort = %d\n ", Settings.sort); @@ -1173,6 +1189,7 @@ bool cfg_save_global()// save global settings } fprintf(f, "disc_path = %s\n ", Settings.disc_path); fprintf(f, "language_path = %s\n ", Settings.language_path); + fprintf(f, "languagefiles_path = %s\n ", Settings.languagefiles_path); fprintf(f, "oggload_path = %s\n ", Settings.oggload_path); fprintf(f, "titlestxt_path = %s\n ", Settings.titlestxt_path); if(!strcmp("", Settings.unlockCode)) { @@ -1247,6 +1264,11 @@ void game_set(char *name, char *val) game->parentalcontrol = opt_c; } } + if (strcmp("errorfix002", opt_name) == 0) { + if (sscanf(opt_val, "%hd", &opt_c) == 1) { + game->errorfix002 = opt_c; + } + } } // next opt @@ -1383,7 +1405,8 @@ bool cfg_save_games() fprintf(f, "ocarina:%d; ", cfg_game[i].ocarina); fprintf(f, "vipatch:%d; ", cfg_game[i].vipatch); fprintf(f, "ios:%d;", cfg_game[i].ios); - fprintf(f, "pctrl:%d;\n", cfg_game[i].parentalcontrol); + fprintf(f, "pctrl:%d;", cfg_game[i].parentalcontrol); + fprintf(f, "errorfix002:%d;\n", cfg_game[i].errorfix002); } fprintf(f, "# END\n"); fclose(f); @@ -1438,7 +1461,8 @@ bool cfg_load_global() { Settings.sinfo = ((Settings.sinfo == GameID) ? Both : GameRegion); } - Settings.volume = v80; + Settings.volume = 80; + Settings.sfxvolume = 80; return cfg_parsefile("SD:/config/GXGlobal.cfg", &global_cfg_set); } diff --git a/source/cfg.h b/source/cfg.h index c6834c85..4fb3385e 100644 --- a/source/cfg.h +++ b/source/cfg.h @@ -152,6 +152,7 @@ extern u8 viChoice; extern u8 iosChoice; extern u8 faveChoice; extern u8 parentalcontrolChoice; +extern u8 fix002; extern u8 xflip; extern u8 qboot; extern u8 sort; @@ -169,6 +170,7 @@ struct Game_CFG u8 vipatch; u8 ios; u8 parentalcontrol; + u8 errorfix002; }; struct Game_NUM { @@ -201,7 +203,6 @@ enum { schin, tchin, kor, - settings_language_max // always the last entry }; @@ -263,21 +264,6 @@ enum { settings_tooltips_max // always the last entry }; -enum { - v10=0, - v20, - v30, - v40, - v50, - v60, - v70, - v80, - v90, - v100, - v0, - settings_volume_max // always the last entry -}; - enum { no=0, yes, @@ -297,11 +283,11 @@ enum { list, grid, carousel, + settings_display_max }; enum { scrollDefault, scrollMarquee, - settings_scrolleffect_max // always the last entry }; struct SSettings { @@ -315,6 +301,7 @@ struct SSettings { int rumble; int xflip; int volume; + int sfxvolume; int tooltips; char unlockCode[20]; int parentalcontrol; @@ -335,6 +322,7 @@ struct SSettings { char disc_path[100]; char titlestxt_path[100]; char language_path[100]; + char languagefiles_path[100]; char oggload_path[100]; char ogg_path[150]; char update_path[150]; diff --git a/source/disc.c b/source/disc.c index 527017c0..6f83df56 100644 --- a/source/disc.c +++ b/source/disc.c @@ -248,7 +248,7 @@ s32 Disc_IsWii(void) return 0; } -s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring) +s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix) { entry_point p_entry; @@ -260,7 +260,7 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa return ret; /* Run apploader */ - ret = Apploader_Run(&p_entry, cheat, videoselected, vipatch, patchcountrystring); + ret = Apploader_Run(&p_entry, cheat, videoselected, vipatch, patchcountrystring, error002fix); if (ret < 0) return ret; @@ -295,7 +295,7 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa return 0; } -s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring) +s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix) { u64 offset; s32 ret; @@ -306,7 +306,7 @@ s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring) return ret; /* Boot partition */ - return Disc_BootPartition(offset, videoselected, cheat, vipatch, patchcountrystring); + return Disc_BootPartition(offset, videoselected, cheat, vipatch, patchcountrystring, error002fix); } void PatchCountryStrings(void *Address, int Size) diff --git a/source/disc.h b/source/disc.h index f52e1e71..d7d3f82c 100644 --- a/source/disc.h +++ b/source/disc.h @@ -46,8 +46,8 @@ void __Disc_SetLowMem(void); s32 Disc_SetUSB(u8 *, int ios222); s32 Disc_ReadHeader(void *); s32 Disc_IsWii(void); -s32 Disc_BootPartition(u64, u8, u8, u8, u8); -s32 Disc_WiiBoot(u8, u8, u8, u8); +s32 Disc_BootPartition(u64, u8, u8, u8, u8, u8); +s32 Disc_WiiBoot(u8, u8, u8, u8, u8); void PatchCountryStrings(void *Address, int Size); #ifdef __cplusplus diff --git a/source/filelist.h b/source/filelist.h index 127eab67..b3351505 100644 --- a/source/filelist.h +++ b/source/filelist.h @@ -38,15 +38,6 @@ extern const u32 menuin_ogg_size; extern const u8 menuout_ogg[]; extern const u32 menuout_ogg_size; -extern const u8 tab_bg1_png[]; -extern const u32 tab_bg1_png_size; - -extern const u8 tab_bg2_png[]; -extern const u32 tab_bg2_png_size; - -extern const u8 tab_bg3_png[]; -extern const u32 tab_bg3_png_size; - extern const u8 credits_button_png[]; extern const u32 credits_button_png_size; @@ -290,7 +281,13 @@ extern const u32 arrangeList_gray_png_size; extern const u8 arrangeCarousel_gray_png[]; extern const u32 arrangeCarousel_gray_png_size; -extern const u8 updateRev_png[]; -extern const u32 updateRev_png_size; +extern const u8 settings_title_png[]; +extern const u32 settings_title_png_size; + +extern const u8 settings_title_over_png[]; +extern const u32 settings_title_over_png_size; + +extern const u8 pageindicator_png[]; +extern const u32 pageindicator_png_size; #endif diff --git a/source/images/tab_bg1.png b/source/images/tab_bg1.png deleted file mode 100644 index fd738f65..00000000 Binary files a/source/images/tab_bg1.png and /dev/null differ diff --git a/source/images/tab_bg2.png b/source/images/tab_bg2.png deleted file mode 100644 index 505a679f..00000000 Binary files a/source/images/tab_bg2.png and /dev/null differ diff --git a/source/images/tab_bg3.png b/source/images/tab_bg3.png deleted file mode 100644 index 71929e1c..00000000 Binary files a/source/images/tab_bg3.png and /dev/null differ diff --git a/source/images/updateRev.png b/source/images/updateRev.png deleted file mode 100644 index d5e67e2d..00000000 Binary files a/source/images/updateRev.png and /dev/null differ diff --git a/source/language.c b/source/language.c index b6375cf3..d92a53eb 100644 --- a/source/language.c +++ b/source/language.c @@ -57,6 +57,7 @@ snprintf(LANGUAGE.Continueinstallgame, sizeof(LANGUAGE.Continueinstallgame), "Co snprintf(LANGUAGE.ConsoleDefault, sizeof(LANGUAGE.ConsoleDefault), "Console Default"); snprintf(LANGUAGE.Consoleshouldbeunlockedtomodifyit, sizeof(LANGUAGE.Consoleshouldbeunlockedtomodifyit), "Console should be unlocked to modify it."); snprintf(LANGUAGE.ConsoleLocked, sizeof(LANGUAGE.ConsoleLocked), "Console Locked"); +snprintf(LANGUAGE.Controllevel, sizeof(LANGUAGE.Controllevel), "Controllevel"); snprintf(LANGUAGE.CorrectPassword, sizeof(LANGUAGE.CorrectPassword), "Correct Password"); snprintf(LANGUAGE.Couldnotinitializenetwork, sizeof(LANGUAGE.Couldnotinitializenetwork), "Could not initialize network!"); snprintf(LANGUAGE.CouldnotopenDisc, sizeof(LANGUAGE.CouldnotopenDisc), "Could not open Disc"); @@ -67,6 +68,7 @@ snprintf(LANGUAGE.CoverpathChanged, sizeof(LANGUAGE.CoverpathChanged), "Coverpat snprintf(LANGUAGE.Coverpathchange, sizeof(LANGUAGE.Coverpathchange), "Coverpath change"); snprintf(LANGUAGE.count, sizeof(LANGUAGE.count), "Play Count"); snprintf(LANGUAGE.Credits, sizeof(LANGUAGE.Credits), "Credits"); +snprintf(LANGUAGE.Custompaths, sizeof(LANGUAGE.Custompaths), "Custom Paths"); snprintf(LANGUAGE.DiscImages, sizeof(LANGUAGE.DiscImages), "Disc Images"); snprintf(LANGUAGE.DiscimagePath, sizeof(LANGUAGE.DiscimagePath), "Discimage Path"); snprintf(LANGUAGE.DiscpathChanged, sizeof(LANGUAGE.DiscpathChanged), "Discpath Changed"); @@ -77,11 +79,13 @@ snprintf(LANGUAGE.Doyouwanttoformat, sizeof(LANGUAGE.Doyouwanttoformat), "Do you snprintf(LANGUAGE.Doyoureallywanttodelete, sizeof(LANGUAGE.Doyoureallywanttodelete), "Do you really want to delete:"); snprintf(LANGUAGE.Doyouwanttoretryfor30secs, sizeof(LANGUAGE.Doyouwanttoretryfor30secs), "Do you want to retry for 30 secs?"); snprintf(LANGUAGE.Doyouwanttoupdate, sizeof(LANGUAGE.Doyouwanttoupdate), "How do you want to update?"); +snprintf(LANGUAGE.Doyouwanttochangelanguage, sizeof(LANGUAGE.Doyouwanttochangelanguage), "Do you want to change language?"); snprintf(LANGUAGE.Downloadingfile, sizeof(LANGUAGE.Downloadingfile), "Downloading file"); snprintf(LANGUAGE.DownloadBoxartimage, sizeof(LANGUAGE.DownloadBoxartimage), "Download Boxart image?"); snprintf(LANGUAGE.Downloadfinished, sizeof(LANGUAGE.Downloadfinished), "Download finished"); snprintf(LANGUAGE.Defaultgamesettings, sizeof(LANGUAGE.Defaultgamesettings), "Default Gamesettings"); snprintf(LANGUAGE.Defaultsettings, sizeof(LANGUAGE.Defaultsettings), "Default Settings"); +snprintf(LANGUAGE.Default, sizeof(LANGUAGE.Default), "Default"); snprintf(LANGUAGE.Error, sizeof(LANGUAGE.Error), "Error !"); snprintf(LANGUAGE.hour, sizeof(LANGUAGE.hour), "Hour"); snprintf(LANGUAGE.Homemenu, sizeof(LANGUAGE.Homemenu), "HOME Menu"); @@ -122,8 +126,11 @@ snprintf(LANGUAGE.Gameisalreadyinstalled, sizeof(LANGUAGE.Gameisalreadyinstalled snprintf(LANGUAGE.GameRegion, sizeof(LANGUAGE.GameRegion), "Game Region"); snprintf(LANGUAGE.GameSize, sizeof(LANGUAGE.GameSize), "Game Size"); snprintf(LANGUAGE.GoBack, sizeof(LANGUAGE.GoBack), "Go Back"); +snprintf(LANGUAGE.GUISettings, sizeof(LANGUAGE.GUISettings), "GUI Settings"); +snprintf(LANGUAGE.Gameload, sizeof(LANGUAGE.Gameload), "Game Load"); snprintf(LANGUAGE.HowtoShutdown, sizeof(LANGUAGE.HowtoShutdown), "How to Shutdown?"); snprintf(LANGUAGE.Language, sizeof(LANGUAGE.Language), "Game Language"); +snprintf(LANGUAGE.Languagepathchanged, sizeof(LANGUAGE.Languagepathchanged), "Languagepath changed."); snprintf(LANGUAGE.Left, sizeof(LANGUAGE.Left), "Left"); snprintf(LANGUAGE.LikeSysMenu, sizeof(LANGUAGE.LikeSysMenu), "Like SysMenu"); snprintf(LANGUAGE.LoadingincIOS, sizeof(LANGUAGE.LoadingincIOS), "Loading in cIOS249"); @@ -157,7 +164,7 @@ snprintf(LANGUAGE.OFF, sizeof(LANGUAGE.OFF), "OFF"); snprintf(LANGUAGE.OfficialSite, sizeof(LANGUAGE.OfficialSite), "Official Site"); snprintf(LANGUAGE.ON, sizeof(LANGUAGE.ON), "ON"); snprintf(LANGUAGE.OnlyInstall, sizeof(LANGUAGE.OnlyInstall), "Only for Install"); -snprintf(LANGUAGE.Parentalcontrol, sizeof(LANGUAGE.Parentalcontrol), "Parental control"); +snprintf(LANGUAGE.Parentalcontrol, sizeof(LANGUAGE.Parentalcontrol), "Parental Control"); snprintf(LANGUAGE.Partition, sizeof(LANGUAGE.Partition), "Partition"); snprintf(LANGUAGE.Password, sizeof(LANGUAGE.Password), "Password"); snprintf(LANGUAGE.PasswordChanged, sizeof(LANGUAGE.PasswordChanged), "Password Changed"); @@ -188,6 +195,7 @@ snprintf(LANGUAGE.Specialthanksto, sizeof(LANGUAGE.Specialthanksto), "Special th snprintf(LANGUAGE.youwanttoformat, sizeof(LANGUAGE.youwanttoformat), "you want to format"); snprintf(LANGUAGE.Standard, sizeof(LANGUAGE.Standard), "Standard"); snprintf(LANGUAGE.settings, sizeof(LANGUAGE.settings), "Settings"); +snprintf(LANGUAGE.Sound, sizeof(LANGUAGE.Sound), "Sound"); snprintf(LANGUAGE.ShutdowntoIdle, sizeof(LANGUAGE.ShutdowntoIdle), "Shutdown to Idle"); snprintf(LANGUAGE.ShutdownSystem, sizeof(LANGUAGE.ShutdownSystem), "Shutdown System"); snprintf(LANGUAGE.Success, sizeof(LANGUAGE.Success), "Success:"); @@ -207,6 +215,7 @@ snprintf(LANGUAGE.Tooltips, sizeof(LANGUAGE.Tooltips), "Tooltips"); snprintf(LANGUAGE.Timeleft, sizeof(LANGUAGE.Timeleft), "Time left:"); snprintf(LANGUAGE.updating, sizeof(LANGUAGE.updating), "Updating"); snprintf(LANGUAGE.Unlock, sizeof(LANGUAGE.Unlock), "Unlock"); +snprintf(LANGUAGE.UnlockConsoletousethisOption, sizeof(LANGUAGE.UnlockConsoletousethisOption), "Unlock console to use this option."); snprintf(LANGUAGE.Unicodefix, sizeof(LANGUAGE.Unicodefix), "Unicode Fix"); snprintf(LANGUAGE.Uninstall, sizeof(LANGUAGE.Uninstall), "Uninstall"); snprintf(LANGUAGE.Updatepath, sizeof(LANGUAGE.Updatepath), "Updatepath"); @@ -215,11 +224,13 @@ snprintf(LANGUAGE.Updatefailed, sizeof(LANGUAGE.Updatefailed), "Update failed"); snprintf(LANGUAGE.Updatedol, sizeof(LANGUAGE.Updatedol), "Update DOL"); snprintf(LANGUAGE.Updateall, sizeof(LANGUAGE.Updateall), "Update All"); snprintf(LANGUAGE.Updateto, sizeof(LANGUAGE.Updateto), "Update to"); +snprintf(LANGUAGE.Update, sizeof(LANGUAGE.Update), "Update"); snprintf(LANGUAGE.USBLoaderisprotected, sizeof(LANGUAGE.USBLoaderisprotected), "USB Loader GX is protected"); snprintf(LANGUAGE.USBDevicenotfound, sizeof(LANGUAGE.USBDevicenotfound), "USB Device not found"); snprintf(LANGUAGE.VideoMode, sizeof(LANGUAGE.VideoMode), "Video Mode"); snprintf(LANGUAGE.VIDTVPatch, sizeof(LANGUAGE.VIDTVPatch), "VIDTV Patch"); -snprintf(LANGUAGE.Volume, sizeof(LANGUAGE.Volume), "Volume"); +snprintf(LANGUAGE.Volume, sizeof(LANGUAGE.Volume), "Music Volume"); +snprintf(LANGUAGE.SFXVolume, sizeof(LANGUAGE.SFXVolume), "SFX Volume"); snprintf(LANGUAGE.Waiting, sizeof(LANGUAGE.Waiting), "Waiting..."); snprintf(LANGUAGE.WaitingforUSBDevice, sizeof(LANGUAGE.WaitingforUSBDevice), "Waiting for USB Device"); snprintf(LANGUAGE.WidescreenFix, sizeof(LANGUAGE.WidescreenFix), "Widescreen Fix"); @@ -356,6 +367,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.ConsoleLocked, val, sizeof(LANGUAGE.ConsoleLocked)); return; } + if (strcmp(name, "Controllevel") == 0) { + strcopy(LANGUAGE.Controllevel, val, sizeof(LANGUAGE.Controllevel)); + return; + } if (strcmp(name, "CorrectPassword") == 0) { strcopy(LANGUAGE.CorrectPassword, val, sizeof(LANGUAGE.CorrectPassword)); return; @@ -396,6 +411,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Credits, val, sizeof(LANGUAGE.Credits)); return; } + if (strcmp(name, "Custompaths") == 0) { + strcopy(LANGUAGE.Custompaths, val, sizeof(LANGUAGE.Custompaths)); + return; + } if (strcmp(name, "DiscImages") == 0) { strcopy(LANGUAGE.DiscImages, val, sizeof(LANGUAGE.DiscImages)); return; @@ -432,6 +451,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Doyouwanttoretryfor30secs, val, sizeof(LANGUAGE.Doyouwanttoretryfor30secs)); return; } + if (strcmp(name, "Doyouwanttochangelanguage") == 0) { + strcopy(LANGUAGE.Doyouwanttochangelanguage, val, sizeof(LANGUAGE.Doyouwanttochangelanguage)); + return; + } if (strcmp(name, "Downloadingfile") == 0) { strcopy(LANGUAGE.Downloadingfile, val, sizeof(LANGUAGE.Downloadingfile)); return; @@ -452,6 +475,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Defaultsettings, val, sizeof(LANGUAGE.Defaultsettings)); return; } + if (strcmp(name, "Default") == 0) { + strcopy(LANGUAGE.Default, val, sizeof(LANGUAGE.Default)); + return; + } if (strcmp(name, "Error") == 0) { strcopy(LANGUAGE.Error, val, sizeof(LANGUAGE.Error)); return; @@ -608,6 +635,14 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.GoBack, val, sizeof(LANGUAGE.GoBack)); return; } + if (strcmp(name, "GUISettings") == 0) { + strcopy(LANGUAGE.GUISettings, val, sizeof(LANGUAGE.GUISettings)); + return; + } + if (strcmp(name, "Gameload") == 0) { + strcopy(LANGUAGE.Gameload, val, sizeof(LANGUAGE.Gameload)); + return; + } if (strcmp(name, "GotoPage") == 0) { strcopy(LANGUAGE.GotoPage, val, sizeof(LANGUAGE.GotoPage)); return; @@ -624,11 +659,14 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.keyboard, val, sizeof(LANGUAGE.keyboard)); return; } - if (strcmp(name, "Language") == 0) { strcopy(LANGUAGE.Language, val, sizeof(LANGUAGE.Language)); return; } + if (strcmp(name, "Languagepathchanged") == 0) { + strcopy(LANGUAGE.Languagepathchanged, val, sizeof(LANGUAGE.Languagepathchanged)); + return; + } if (strcmp(name, "Langchange") == 0) { strcopy(LANGUAGE.Langchange, val, sizeof(LANGUAGE.Langchange)); return; @@ -869,6 +907,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Setasbackgroundmusic, val, sizeof(LANGUAGE.Setasbackgroundmusic)); return; } + if (strcmp(name, "Sound") == 0) { + strcopy(LANGUAGE.Sound, val, sizeof(LANGUAGE.Sound)); + return; + } if (strcmp(name, "ShutdowntoIdle") == 0) { strcopy(LANGUAGE.ShutdowntoIdle, val, sizeof(LANGUAGE.ShutdowntoIdle)); return; @@ -941,6 +983,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Unlock, val, sizeof(LANGUAGE.Unlock)); return; } + if (strcmp(name, "UnlockConsoletousethisOption") == 0) { + strcopy(LANGUAGE.UnlockConsoletousethisOption, val, sizeof(LANGUAGE.UnlockConsoletousethisOption)); + return; + } if (strcmp(name, "Unicodefix") == 0) { strcopy(LANGUAGE.Unicodefix, val, sizeof(LANGUAGE.Unicodefix)); return; @@ -977,6 +1023,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Updateto, val, sizeof(LANGUAGE.Updateto)); return; } + if (strcmp(name, "Update") == 0) { + strcopy(LANGUAGE.Update, val, sizeof(LANGUAGE.Update)); + return; + } if (strcmp(name, "USBLoaderisprotected") == 0) { strcopy(LANGUAGE.USBLoaderisprotected, val, sizeof(LANGUAGE.USBLoaderisprotected)); return; @@ -997,6 +1047,10 @@ void language_set(char *name, char *val) strcopy(LANGUAGE.Volume, val, sizeof(LANGUAGE.Volume)); return; } + if (strcmp(name, "SFXVolume") == 0) { + strcopy(LANGUAGE.SFXVolume, val, sizeof(LANGUAGE.SFXVolume)); + return; + } if (strcmp(name, "Waiting") == 0) { strcopy(LANGUAGE.Waiting, val, sizeof(LANGUAGE.Waiting)); return; diff --git a/source/language.h b/source/language.h index ffaaabc4..cf30051c 100644 --- a/source/language.h +++ b/source/language.h @@ -11,7 +11,6 @@ extern "C" struct LANGUAGE { - char t3Covers[50]; char addToFavorite[50]; char all[30]; @@ -39,6 +38,7 @@ struct LANGUAGE char ConsoleDefault[50]; char Consoleshouldbeunlockedtomodifyit[100]; char ConsoleLocked[50]; + char Controllevel[50]; char CorrectPassword[50]; char Couldnotinitializenetwork[50]; char CouldnotopenDisc[50]; @@ -49,6 +49,7 @@ struct LANGUAGE char Coverpathchange[50]; char count[20]; char Credits[30]; + char Custompaths[60]; char DiscImages[50]; char DiscimagePath[50]; char DiscpathChanged[50]; @@ -59,11 +60,13 @@ struct LANGUAGE char Doyoureallywanttodelete[50]; char Doyouwanttoretryfor30secs[80]; char Doyouwanttoupdate[50]; + char Doyouwanttochangelanguage[80]; char Downloadingfile[50]; char DownloadBoxartimage[50]; char Downloadfinished[50]; char Defaultgamesettings[50]; char Defaultsettings[40]; + char Default[40]; char Error[30]; char BOOTERROR[50]; char ErrorreadingDisc[50]; @@ -101,12 +104,15 @@ struct LANGUAGE char GameRegion[50]; char GameSize[50]; char GoBack[50]; - char GotoPage[50];/////// + char GotoPage[50]; + char GUISettings[80]; + char Gameload[50]; char HowtoShutdown[50]; char Homemenu[30]; char hour[30]; char keyboard[50]; char Language[50]; + char Languagepathchanged[80]; char Langchange[50]; char Left[50]; char LikeSysMenu[50]; @@ -172,6 +178,7 @@ struct LANGUAGE char settings[50]; char Setasbackgroundmusic[90]; char Standard[30]; + char Sound[40]; char ShutdowntoIdle[50]; char ShutdownSystem[50]; char Success[30]; @@ -190,6 +197,7 @@ struct LANGUAGE char Tooltips[50]; char Timeleft[50]; char Unlock[50]; + char UnlockConsoletousethisOption[100]; char Unicodefix[50]; char Uninstall[50]; char USBLoaderisprotected[80]; @@ -201,9 +209,11 @@ struct LANGUAGE char Updatedol[40]; char Updateall[40]; char Updateto[40]; + char Update[40]; char VideoMode[50]; char VIDTVPatch[50]; char Volume[50]; + char SFXVolume[50]; char Waiting[50]; char WaitingforUSBDevice[80]; char WidescreenFix[50]; diff --git a/source/libwiigui/gui_customoptionbrowser.cpp b/source/libwiigui/gui_customoptionbrowser.cpp index a6c5adba..905d9512 100644 --- a/source/libwiigui/gui_customoptionbrowser.cpp +++ b/source/libwiigui/gui_customoptionbrowser.cpp @@ -8,6 +8,7 @@ #include "gui.h" #include "../wpad.h" +#include "../main.h" #include "../cfg.h" #include "gui_customoptionbrowser.h" @@ -77,10 +78,6 @@ void customOptionList::SetValue(int i, const char *format, ...) } } - - -//int vol; -extern const int vol; /** * Constructor for the GuiCustomOptionBrowser class. */ @@ -102,7 +99,7 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList * trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); trigHeldA = new GuiTrigger; trigHeldA->SetHeldTrigger(-1, WPAD_BUTTON_A, PAD_BUTTON_A); - btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, vol); + btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume); snprintf(imgPath, sizeof(imgPath), "%s%s", themePath, custombg); bgOptions = new GuiImageData(imgPath, imagebg); @@ -315,6 +312,14 @@ int GuiCustomOptionBrowser::GetSelectedOption() return found; } +void GuiCustomOptionBrowser::SetClickable(bool enable) +{ + for(int i = 0; i < size; i++) + { + optionBtn[i]->SetClickable(enable); + } +} + /**************************************************************************** * FindMenuItem * @@ -419,8 +424,10 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t) if(state == STATE_DISABLED || !t) return; - if(options->IsChanged()) + if(options->IsChanged()) { + coL2 = 0; UpdateListEntries(); + } int old_listOffset = listOffset; // scrolldelay affects how fast the list scrolls diff --git a/source/libwiigui/gui_customoptionbrowser.h b/source/libwiigui/gui_customoptionbrowser.h index 3a6be5e3..66f568e5 100644 --- a/source/libwiigui/gui_customoptionbrowser.h +++ b/source/libwiigui/gui_customoptionbrowser.h @@ -38,6 +38,7 @@ class GuiCustomOptionBrowser : public GuiElement int FindMenuItem(int c, int d); int GetClickedOption(); int GetSelectedOption(); + void SetClickable(bool enable); void ResetState(); void SetFocus(int f); void Draw(); diff --git a/source/libwiigui/gui_gamebrowser.cpp b/source/libwiigui/gui_gamebrowser.cpp index bc74545b..63f7070e 100644 --- a/source/libwiigui/gui_gamebrowser.cpp +++ b/source/libwiigui/gui_gamebrowser.cpp @@ -12,12 +12,12 @@ #include #include "gui_gamebrowser.h" #include "../cfg.h" +#include "../main.h" #include #include #define GAMESELECTSIZE 30 -extern const int vol; int txtscroll = 0; /** * Constructor for the GuiGameBrowser class. @@ -40,7 +40,7 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); trigHeldA = new GuiTrigger; trigHeldA->SetHeldTrigger(-1, WPAD_BUTTON_A, PAD_BUTTON_A); - btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, vol); + btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume); snprintf(imgPath, sizeof(imgPath), "%sbg_options.png", themePath); bgGames = new GuiImageData(imgPath, imagebg); diff --git a/source/libwiigui/gui_gamecarousel.cpp b/source/libwiigui/gui_gamecarousel.cpp index 0044f504..e2928cf8 100644 --- a/source/libwiigui/gui_gamecarousel.cpp +++ b/source/libwiigui/gui_gamecarousel.cpp @@ -26,8 +26,6 @@ #define SPEED_STEP 4 #define SAFETY 320 -extern const int vol; - /** * Constructor for the GuiGameCarousel class. */ @@ -58,8 +56,8 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, struct discHdr * l, int count, co trigMinus = new GuiTrigger; trigMinus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0); - btnSoundClick = new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); - btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); + btnSoundClick = new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume); + btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume); snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_left.png", CFG.theme_path); imgLeft = new GuiImageData(imgPath, startgame_arrow_left_png); diff --git a/source/libwiigui/gui_gamegrid.cpp b/source/libwiigui/gui_gamegrid.cpp index d4571d64..21259f37 100644 --- a/source/libwiigui/gui_gamegrid.cpp +++ b/source/libwiigui/gui_gamegrid.cpp @@ -17,9 +17,6 @@ #include #include - -extern const int vol; - /** * Constructor for the GuiGameGrid class. */ @@ -50,8 +47,8 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int gameCnt, const ch trigMinus = new GuiTrigger; trigMinus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0); - btnSoundClick = new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); - btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); + btnSoundClick = new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume); + btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume); snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_left.png", CFG.theme_path); imgLeft = new GuiImageData(imgPath, startgame_arrow_left_png); diff --git a/source/libwiigui/gui_keyboard.cpp b/source/libwiigui/gui_keyboard.cpp index effb8810..fdf0debe 100644 --- a/source/libwiigui/gui_keyboard.cpp +++ b/source/libwiigui/gui_keyboard.cpp @@ -9,12 +9,13 @@ ***************************************************************************/ #include "gui.h" +#include "../main.h" +#include "../cfg.h" #include #include /** * Constructor for the GuiKeyboard class. */ -extern const int vol; unsigned int m; //const Key thekeys; GuiKeyboard::GuiKeyboard(char * t, u32 max, int min, int lang) @@ -209,7 +210,7 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max, int min, int lang) } }; memcpy(keys, thekeys, sizeof(thekeys));} - + //AZERTY// if (mode == 3){ Key thekeys[4][11] = { @@ -286,8 +287,8 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max, int min, int lang) keyLarge = new GuiImageData(keyboard_largekey_over_png); keyLargeOver = new GuiImageData(keyboard_largekey_over_png); - keySoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - keySoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, vol); + keySoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume); + keySoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume); trigA = new GuiTrigger; trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); trigB = new GuiTrigger; @@ -302,7 +303,7 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max, int min, int lang) keyBackOverImg = new GuiImage(keyMediumOver); keyBackText = new GuiText("Back", 20, (GXColor){0, 0, 0, 0xff}); //GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x, int y, GuiTrigger* trig, GuiSound* sndOver, GuiSound* sndClick, u8 grow); - + //keyBack = new GuiButton(keyMedium->GetWidth(), keyMedium->GetHeight()); keyBack = new GuiButton(keyBackImg, keyBackOverImg, 0, 3, 11*42+40+eurocheck, 0*42+120, trigA, keySoundOver, keySoundClick,1); //keyBack->SetImage(keyBackImg); diff --git a/source/listfiles.c b/source/listfiles.c index c5f554fc..9a1d1619 100644 --- a/source/listfiles.c +++ b/source/listfiles.c @@ -10,8 +10,8 @@ #include "listfiles.h" -char alldirfiles[300][70]; -char filename[80]; +static char alldirfiles[300][70]; +char filenames[80]; bool findfile(const char * filename, const char * path) { @@ -35,6 +35,10 @@ while ((file = readdir(dir))) return false; } +char * GetFileName(int i) +{ + return alldirfiles[i]; +} s32 filenamescmp(const void *a, const void *b) { @@ -42,7 +46,7 @@ s32 filenamescmp(const void *a, const void *b) return stricmp((char *)a, (char *)b); } -int GetFiles(char * filespath) +int GetAllDirFiles(char * filespath) { int countfiles = 0; @@ -57,12 +61,12 @@ if (dir == NULL) //If empty } else { - while (dirnext(dir,filename,&st) == 0) + while (dirnext(dir,filenames,&st) == 0) { if ((st.st_mode & S_IFDIR) == 0) { // st.st_mode & S_IFDIR indicates a directory - snprintf(alldirfiles[countfiles], 70, "%s", filename); + snprintf(alldirfiles[countfiles], 70, "%s", filenames); countfiles++; } } diff --git a/source/listfiles.h b/source/listfiles.h index 58c9522c..7281c05b 100644 --- a/source/listfiles.h +++ b/source/listfiles.h @@ -7,7 +7,8 @@ extern "C" #endif bool findfile(const char * filename, const char * path); -int GetFiles(char * filespath); +char * GetFileName(int i); +int GetAllDirFiles(char * filespath); #ifdef __cplusplus diff --git a/source/menu.cpp b/source/menu.cpp index 91961697..f5465cf6 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -1,6 +1,8 @@ /**************************************************************************** + * USB Loader GX Team + * * libwiigui Template - * Tantric 2009 + * by Tantric 2009 * * menu.cpp * Menu flow routines - handles all menu logic @@ -40,7 +42,6 @@ GuiImageData * pointer[4]; GuiImage * bgImg = NULL; GuiImageData * background = NULL; GuiSound * bgMusic = NULL; -int vol = Settings.volume; float gamesize; /*** Variables used only in menu.cpp ***/ @@ -57,8 +58,6 @@ static char gameregion[7]; extern FreeTypeGX *fontClock; extern u8 shutdown; extern u8 reset; -extern char alldirfiles[300][70]; -extern char missingFiles[500][12]; extern int cntMissFiles; extern int networkisinitialized; extern struct discHdr * gameList; @@ -203,8 +202,8 @@ static int MenuDiscList() nolist = 1; } - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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); snprintf(imgPath, sizeof(imgPath), "%sbutton_install.png", CFG.theme_path); GuiImageData btnInstall(imgPath, button_install_png); @@ -609,7 +608,7 @@ static int MenuDiscList() bgMusic->PlayOggFile(Settings.ogg_path); } bgMusic->SetPlayTime(thetimeofbg); - SetVolumeOgg(255*(vol/100.0)); + SetVolumeOgg(255*(Settings.volume/100.0)); if(choice == 3) { @@ -695,7 +694,7 @@ static int MenuDiscList() if (netcheck) { - if (missingFiles != NULL && cntMissFiles > 0) + if (GetMissingFiles() != NULL && cntMissFiles > 0) { char tempCnt[40]; @@ -1389,7 +1388,7 @@ static int MenuInstall() char *name; static char buffer[MAX_CHARACTERS + 4]; - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); + GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume); char imgPath[100]; @@ -1572,8 +1571,8 @@ static int MenuFormat() options.length = cnt; - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); + 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); snprintf(imgPath, sizeof(imgPath), "%swiimote_poweroff.png", CFG.theme_path); GuiImageData btnpwroff(imgPath, wiimote_poweroff_png); snprintf(imgPath, sizeof(imgPath), "%swiimote_poweroff_over.png", CFG.theme_path); @@ -1802,333 +1801,6 @@ static int MenuCheck() return menu; } -/**************************************************************************** - * MenuOGG - ***************************************************************************/ -int MenuOGG() -{ - int menu = MENU_NONE, cnt = 0; - int ret = 0, choice = 0; - int scrollon, nothingchanged = 0; - - GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); - GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); - - 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); - - GuiTrigger trigA; - trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - GuiTrigger trigB; - trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B); - GuiTrigger trigMinus; - trigMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0); - GuiTrigger trigPlus; - trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0); - - char fullpath[150]; - char shortpath[35]; - int countoggs = GetFiles(Settings.oggload_path); - - if(!strcmp("", Settings.oggload_path)) { - sprintf(shortpath, "%s", LANGUAGE.Standard); - } else if (strlen(Settings.oggload_path) < (27 + 3)) { - sprintf(shortpath, "%s", Settings.oggload_path); - } - else { - strncpy(shortpath, Settings.oggload_path, 27); - shortpath[27] = '\0'; - strncat(shortpath, "...", 3); - } - - GuiText titleTxt(shortpath, 24, (GXColor){0, 0, 0, 255}); - titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); - titleTxt.SetPosition(0,0); - GuiButton pathBtn(300, 50); - pathBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - pathBtn.SetPosition(0,28); - pathBtn.SetLabel(&titleTxt); - pathBtn.SetSoundOver(&btnSoundOver); - pathBtn.SetSoundClick(&btnClick); - pathBtn.SetTrigger(&trigA); - pathBtn.SetEffectGrow(); - - GuiImage oggmenubackground(&settingsbg); - oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP); - oggmenubackground.SetPosition(0, 0); - - GuiText backBtnTxt(LANGUAGE.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(btnOutline.GetWidth(), btnOutline.GetHeight()); - backBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - backBtn.SetPosition(-180, 400); - backBtn.SetLabel(&backBtnTxt); - backBtn.SetImage(&backBtnImg); - backBtn.SetSoundOver(&btnSoundOver); - backBtn.SetSoundClick(&btnClick); - backBtn.SetTrigger(&trigA); - backBtn.SetTrigger(&trigB); - backBtn.SetEffectGrow(); - - customOptionList options2(countoggs); - - for (cnt = 0; cnt < countoggs; cnt++) { - char tmp[30]; - snprintf(tmp , 30, "%s", alldirfiles[cnt]); - options2.SetValue(cnt, "%s", tmp); - options2.SetName(cnt,"%i.", cnt+1); - } - // options2.length = cnt; - - if(cnt < 9) { - scrollon = 0; - } else { - scrollon = 1; - } - - GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 55); - optionBrowser4.SetPosition(0, 90); - optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - - int songPlaying=0; - - snprintf(imgPath, sizeof(imgPath), "%sarrow_next.png", CFG.theme_path); - GuiImageData next(imgPath, arrow_next_png); - snprintf(imgPath, sizeof(imgPath), "%sarrow_previous.png", CFG.theme_path); - GuiImageData prev(imgPath, arrow_previous_png); - snprintf(imgPath, sizeof(imgPath), "%smp3_stop.png", CFG.theme_path); - GuiImageData stop(imgPath, mp3_stop_png); - snprintf(imgPath, sizeof(imgPath), "%smp3_pause.png", CFG.theme_path); - GuiImageData pause(imgPath, mp3_pause_png); - snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_right.png", CFG.theme_path); - GuiImageData play(imgPath, startgame_arrow_right_png); - - GuiImage nextBtnImg(&next); - GuiButton nextBtn(next.GetWidth(), next.GetHeight()); - nextBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - nextBtn.SetPosition(130, 400); - nextBtn.SetImage(&nextBtnImg); - nextBtn.SetSoundOver(&btnSoundOver); - nextBtn.SetSoundClick(&btnClick); - nextBtn.SetTrigger(&trigA); - nextBtn.SetEffectGrow(); - - GuiImage prevBtnImg(&prev); - prevBtnImg.SetWidescreen(CFG.widescreen); - GuiButton prevBtn(prev.GetWidth(), prev.GetHeight()); - prevBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - prevBtn.SetPosition(-60, 400); - prevBtn.SetImage(&prevBtnImg); - prevBtn.SetSoundOver(&btnSoundOver); - prevBtn.SetSoundClick(&btnClick); - prevBtn.SetTrigger(&trigA); - prevBtn.SetEffectGrow(); - - GuiImage playBtnImg(&play); - playBtnImg.SetWidescreen(CFG.widescreen); - GuiButton playBtn(play.GetWidth(), play.GetHeight()); - playBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - playBtn.SetPosition(72, 400); - playBtn.SetImage(&playBtnImg); - playBtn.SetSoundOver(&btnSoundOver); - playBtn.SetSoundClick(&btnClick); - playBtn.SetTrigger(&trigA); - playBtn.SetTrigger(&trigPlus); - playBtn.SetEffectGrow(); - - GuiImage stopBtnImg(&stop); - stopBtnImg.SetWidescreen(CFG.widescreen); - GuiButton stopBtn(stop.GetWidth(), stop.GetHeight()); - stopBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - stopBtn.SetPosition(17, 400); - stopBtn.SetImage(&stopBtnImg); - stopBtn.SetSoundOver(&btnSoundOver); - stopBtn.SetSoundClick(&btnClick); - stopBtn.SetTrigger(&trigA); - stopBtn.SetTrigger(&trigMinus); - stopBtn.SetEffectGrow(); - - HaltGui(); - GuiWindow w(screenwidth, screenheight); - w.Append(&oggmenubackground); - w.Append(&pathBtn); - w.Append(&backBtn); - w.Append(&playBtn); - w.Append(&nextBtn); - w.Append(&prevBtn); - w.Append(&stopBtn); - mainWindow->Append(&w); - mainWindow->Append(&optionBrowser4); - - ResumeGui(); - - while(menu == MENU_NONE) - { - - if (backBtn.GetState() == STATE_CLICKED) { - if(nothingchanged == 1 && countoggs > 0) { - if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { - bgMusic->Play(); - } else { - bgMusic->PlayOggFile(Settings.ogg_path); - } - } - menu = MENU_SETTINGS; - break; - } - - if (pathBtn.GetState() == STATE_CLICKED) { - mainWindow->Remove(&optionBrowser4); - w.Remove(&backBtn); - w.Remove(&pathBtn); - w.Remove(&playBtn); - w.Remove(&nextBtn); - w.Remove(&prevBtn); - w.Remove(&stopBtn); - char entered[43] = ""; - strncpy(entered, Settings.oggload_path, sizeof(entered)); - int result = OnScreenKeyboard(entered,43,0); - mainWindow->Append(&optionBrowser4); - w.Append(&pathBtn); - w.Append(&backBtn); - w.Append(&playBtn); - w.Append(&nextBtn); - w.Append(&prevBtn); - w.Append(&stopBtn); - if ( result == 1 ) { - int len = (strlen(entered)-1); - if(entered[len] !='/') - strncat (entered, "/", 1); - strncpy(Settings.oggload_path, entered, sizeof(Settings.oggload_path)); - WindowPrompt(LANGUAGE.Backgroundmusicpath,0,LANGUAGE.ok,0,0,0); - if(isSdInserted()) { - if(!strcmp("", Settings.oggload_path)) { - sprintf(Settings.ogg_path, "notset"); - bgMusic->Play(); - } - cfg_save_global(); - menu = MENU_OGG; - break; - } else { - WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0); - } - } - if(countoggs > 0) { - optionBrowser4.SetFocus(1); - } - pathBtn.ResetState(); - } - - ret = optionBrowser4.GetClickedOption(); - - if(ret>=0) { - choice = WindowPrompt(LANGUAGE.Setasbackgroundmusic,alldirfiles[ret],LANGUAGE.Yes,LANGUAGE.No,0,0); - if(choice == 1) { - snprintf(fullpath,150,"%s%s",Settings.oggload_path,alldirfiles[ret]); - choice = bgMusic->PlayOggFile(fullpath); - if(choice < 0) { - WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0); - sprintf(Settings.ogg_path, "notset"); - bgMusic->Play(); - SetVolumeOgg(255*(vol/100.0)); - } else { - snprintf(Settings.ogg_path, sizeof(Settings.ogg_path), "%s", fullpath); - cfg_save_global(); - SetVolumeOgg(255*(vol/100.0)); - nothingchanged = 0; - } - } - optionBrowser4.SetFocus(1); - } - - if (playBtn.GetState() == STATE_CLICKED && countoggs > 0) { - if(countoggs > 0) { - ret = optionBrowser4.GetSelectedOption(); - songPlaying=ret; - snprintf(fullpath, 150,"%s%s", Settings.oggload_path,alldirfiles[ret]); - choice = bgMusic->PlayOggFile(fullpath); - if(choice < 0) { - WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0); - if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { - bgMusic->Play(); - } else { - bgMusic->PlayOggFile(Settings.ogg_path); - } - } - SetVolumeOgg(255*(vol/100.0)); - songPlaying=ret; - nothingchanged = 1; - optionBrowser4.SetFocus(1); - } - playBtn.ResetState(); - } - - if(nextBtn.GetState() == STATE_CLICKED){ - if(countoggs > 0) { - songPlaying++; - if (songPlaying>(countoggs - 1)){songPlaying=0;} - snprintf(fullpath,150,"%s%s", Settings.oggload_path,alldirfiles[songPlaying]); - choice = bgMusic->PlayOggFile(fullpath); - if(choice < 0) { - WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0); - if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { - bgMusic->Play(); - } else { - bgMusic->PlayOggFile(Settings.ogg_path); - } - } - nothingchanged = 1; - optionBrowser4.SetFocus(1); - } - SetVolumeOgg(255*(vol/100.0)); - nextBtn.ResetState(); - } - if(prevBtn.GetState() == STATE_CLICKED) { - if(countoggs > 0) { - songPlaying--; - if (songPlaying<0){songPlaying=(countoggs - 1);} - snprintf(fullpath,150,"%s%s", Settings.oggload_path,alldirfiles[songPlaying]); - choice = bgMusic->PlayOggFile(fullpath); - if(choice < 0) { - WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0); - if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { - bgMusic->Play(); - } else { - bgMusic->PlayOggFile(Settings.ogg_path); - } - } - nothingchanged = 1; - optionBrowser4.SetFocus(1); - } - SetVolumeOgg(255*(vol/100.0)); - prevBtn.ResetState(); - } - if(stopBtn.GetState() == STATE_CLICKED) { - if(countoggs > 0) { - StopOgg(); - nothingchanged = 1; - optionBrowser4.SetFocus(1); - } - stopBtn.ResetState(); - } - } - - HaltGui(); - mainWindow->Remove(&optionBrowser4); - mainWindow->Remove(&w); - ResumeGui(); - - return menu; -} /**************************************************************************** * MainMenu @@ -2164,8 +1836,8 @@ int MainMenu(int menu) ResumeGui(); - bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, SOUND_OGG, vol); - bgMusic->SetVolume(vol); + bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, SOUND_OGG, Settings.volume); + bgMusic->SetVolume(Settings.volume); bgMusic->SetLoop(1); //loop music // startup music if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { @@ -2176,7 +1848,7 @@ int MainMenu(int menu) while(currentMenu != MENU_EXIT) { - SetVolumeOgg(255*(vol/100.0)); + SetVolumeOgg(255*(Settings.volume/100.0)); switch (currentMenu) { @@ -2195,53 +1867,10 @@ int MainMenu(int menu) case MENU_DISCLIST: currentMenu = MenuDiscList(); break; - case MENU_OGG: - currentMenu = MenuOGG(); - break; default: // unrecognized menu currentMenu = MenuCheck(); break; } - - switch (Settings.volume) - { - case v10: - vol = 10; - break; - case v20: - vol = 20; - break; - case v30: - vol = 30; - break; - case v40: - vol = 40; - break; - case v50: - vol = 50; - break; - case v60: - vol = 60; - break; - case v70: - vol = 70; - break; - case v80: - vol = 80; - break; - case v90: - vol = 90; - break; - case v100: - vol = 100; - break; - case v0: - vol = 0; - break; - default: - vol = 80; - break; - } } ExitGUIThreads(); @@ -2276,6 +1905,7 @@ int MainMenu(int menu) languageChoice = game_cfg->language; ocarinaChoice = game_cfg->ocarina; viChoice = game_cfg->vipatch; + fix002 = game_cfg->errorfix002; } else { @@ -2283,8 +1913,19 @@ int MainMenu(int menu) languageChoice = Settings.language; ocarinaChoice = Settings.ocarina; viChoice = Settings.vpatch; + fix002 = off; } + u8 errorfixer002 = 0; + switch(fix002) + { + case on: + errorfixer002 = 1; + break; + case off: + errorfixer002 = 0; + break; + } switch(languageChoice) { @@ -2405,7 +2046,7 @@ int MainMenu(int menu) } int ret = 0; - ret = Disc_WiiBoot(videoselected, cheat, vipatch, Settings.patchcountrystrings); + ret = Disc_WiiBoot(videoselected, cheat, vipatch, Settings.patchcountrystrings, errorfixer002); if (ret < 0) { Sys_LoadMenu(); } diff --git a/source/menu.h b/source/menu.h index ae5dba76..bbe4734c 100644 --- a/source/menu.h +++ b/source/menu.h @@ -27,8 +27,7 @@ enum MENU_FORMAT, MENU_INSTALL, MENU_CHECK, - MENU_GAME_SETTINGS, - MENU_OGG + MENU_GAME_SETTINGS }; #endif