From e843d9a3be176d0bd39c6d17cfcfc4d62f944de8 Mon Sep 17 00:00:00 2001 From: giantpune Date: Wed, 13 May 2009 19:03:21 +0000 Subject: [PATCH] apply underscore fix to gamelist and game prompt. Fix bugs in mp3 player. --- source/libwiigui/gui_gamebrowser.cpp | 12 ++++++++++++ source/menu.cpp | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/source/libwiigui/gui_gamebrowser.cpp b/source/libwiigui/gui_gamebrowser.cpp index b53ceb24..37df06ef 100644 --- a/source/libwiigui/gui_gamebrowser.cpp +++ b/source/libwiigui/gui_gamebrowser.cpp @@ -136,6 +136,12 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co gameTxt[i] = new GuiText(buffer, 20, (GXColor){THEME.gameText_r, THEME.gameText_g, THEME.gameText_b, 0xff}); gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); gameTxt[i]->SetPosition(24,0); + char* pch; + + pch=strrchr((buffer),'_'); + + if (pch!=NULL){gameTxt[i]->SetPosition(24, 15);} + else {gameTxt[i]->SetPosition(24, 0);} gameBg[i] = new GuiImage(bgGamesEntry); @@ -351,6 +357,12 @@ void GuiGameBrowser::Update(GuiTrigger * t) } gameTxt[i]->SetText(buffer); + char* pch; + + pch=strrchr((buffer),'_'); + + if (pch!=NULL){gameTxt[i]->SetPosition(24, 15);} + else {gameTxt[i]->SetPosition(24, 0);} gameIndex[i] = next; next = this->FindMenuItem(next, 1); } diff --git a/source/menu.cpp b/source/menu.cpp index c365a4f4..e2ea5c5c 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -845,6 +845,13 @@ int GameWindowPrompt() diskImg.SetImage(diskCover); sizeTxt.SetText(sizeText); msgTxt.SetText(gameName); + char* pch; + + pch=strrchr((gameName),'_'); + + if (pch!=NULL){msgTxt.SetPosition(0, 16);} + else {msgTxt.SetPosition(0, 1);} + HaltGui(); mainWindow->SetState(STATE_DISABLED); @@ -4556,7 +4563,7 @@ int MenuMp3() cancelBtn.SetTrigger(&trigA); cancelBtn.SetEffectGrow(); - bool isplaying = false; +// bool isplaying = false; int songPlaying=0; GuiTrigger trigHome; @@ -4570,7 +4577,7 @@ int MenuMp3() GuiTrigger trigPlus; trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0); - int playerIsUp=0; +// int playerIsUp=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); @@ -4685,6 +4692,7 @@ int MenuMp3() { StopMp3(); songPlaying++; + if (songPlaying>(countmp3 - 1)){songPlaying=0;} //ret = (optionBrowser4.GetSelectedOption()+1); sprintf(fullpath,"%s%s", mp3path,mp3files[songPlaying]); PlayMp3(fullpath); @@ -4696,6 +4704,7 @@ int MenuMp3() { StopMp3(); songPlaying--; + if (songPlaying<0){songPlaying=(countmp3 - 1);} //ret = (optionBrowser4.GetSelectedOption()-1); sprintf(fullpath,"%s%s", mp3path,mp3files[songPlaying]); PlayMp3(fullpath);