From 268ec71c96f34525a33f64bfa6475aa17b4d0069 Mon Sep 17 00:00:00 2001 From: giantpune Date: Sun, 31 May 2009 05:56:44 +0000 Subject: [PATCH] fix issues with sort icons' imageOver. make list icon themable. added check for 4 digit disc image cause somebody had to be special and make a 4 digit image pack :P --- source/cfg.c | 8 +++++++ source/menu.cpp | 61 +++++++++++++++++++++++++++++++++++++------------ 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/source/cfg.c b/source/cfg.c index ba08ff06..5278aa5e 100644 --- a/source/cfg.c +++ b/source/cfg.c @@ -707,6 +707,14 @@ void theme_set(char *name, char *val) } } + else if (strcmp(cfg_name, "list_coords") == 0) { + short x,y; + if (sscanf(val, "%hd,%hd", &x, &y) == 2) { + THEME.list_x = x - (x % 4); + THEME.list_y = y; + } + } + else if (strcmp(cfg_name, "sortBarOffset") == 0) { short x; if (sscanf(val, "%hd", &x) == 1) { diff --git a/source/menu.cpp b/source/menu.cpp index 10136637..623924f7 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -951,8 +951,9 @@ int GameWindowPrompt() { int choice = -1, angle = 0; f32 size = 0.0; - char ID[4]; + char ID[5]; char IDFull[7]; + u8 faveChoice = 0; u16 playCount = 0; @@ -1166,6 +1167,14 @@ int GameWindowPrompt() delete diskCover; snprintf(imgPath, sizeof(imgPath), "%s%s.png", CFG.disc_path, ID); //changed to current id diskCover = new GuiImageData(imgPath, 0); + + + if (!diskCover->GetImage()) + { snprintf (ID,sizeof(ID),"%c%c%c%c", header->id[0], header->id[1], header->id[2], header->id[3]); + + delete diskCover; + snprintf(imgPath, sizeof(imgPath), "%s%s.png", CFG.disc_path, ID); //changed to current id + diskCover = new GuiImageData(imgPath, 0); if (!diskCover->GetImage()) { delete diskCover; @@ -1173,6 +1182,7 @@ int GameWindowPrompt() diskCover = new GuiImageData(imgPath,nodisc_png); } } + } @@ -3155,31 +3165,37 @@ static int MenuDiscList() if (Settings.fave) { favoriteBtn.SetImage(&favoriteBtnImg); + favoriteBtn.SetImageOver(&favoriteBtnImg); favoriteBtn.SetAlpha(255); } if (Settings.sort==all) { abcBtn.SetImage(&abcBtnImg); + abcBtn.SetImageOver(&abcBtnImg); abcBtn.SetAlpha(255); } else if (Settings.sort==pcount) { countBtn.SetImage(&countBtnImg); + countBtn.SetImageOver(&countBtnImg); countBtn.SetAlpha(255); } if (Settings.gameDisplay==list) { - listBtn.SetImage(&listBtnImg); + listBtn.SetImage(&listBtnImg); + listBtn.SetImageOver(&listBtnImg); listBtn.SetAlpha(255); } else if (Settings.gameDisplay==grid) { - gridBtn.SetImage(&gridBtnImg); + gridBtn.SetImage(&gridBtnImg); + gridBtn.SetImageOver(&gridBtnImg); gridBtn.SetAlpha(255); } else if (Settings.gameDisplay==carousel) { - carouselBtn.SetImage(&carouselBtnImg); + carouselBtn.SetImage(&carouselBtnImg); + carouselBtn.SetImageOver(&carouselBtnImg); carouselBtn.SetAlpha(255); } if (Settings.gameDisplay==list) @@ -3547,7 +3563,9 @@ static int MenuDiscList() gamecntTxt.SetTextf("%s: %i",LANGUAGE.Games, gameCnt); selectedold = 1; favoriteBtn.ResetState(); - Settings.fave ? (favoriteBtn.SetImage(&favoriteBtnImg), favoriteBtn.SetAlpha(255)) : (favoriteBtn.SetImage(&favoriteBtnImg_g), favoriteBtn.SetAlpha(180)); + Settings.fave ? (favoriteBtn.SetImage(&favoriteBtnImg),favoriteBtn.SetImageOver(&favoriteBtnImg), + favoriteBtn.SetAlpha(255)) : (favoriteBtn.SetImage(&favoriteBtnImg_g), + favoriteBtn.SetImageOver(&favoriteBtnImg_g), favoriteBtn.SetAlpha(180)); } else if(abcBtn.GetState() == STATE_CLICKED) @@ -3566,8 +3584,10 @@ static int MenuDiscList() gameCarousel.Reload(gameList, gameCnt);} selectedold = 1; abcBtn.SetImage(&abcBtnImg); + abcBtn.SetImageOver(&abcBtnImg); abcBtn.SetAlpha(255); countBtn.SetImage(&countBtnImg_g); + countBtn.SetImageOver(&countBtnImg_g); countBtn.SetAlpha(180); } abcBtn.ResetState(); @@ -3589,8 +3609,10 @@ static int MenuDiscList() gameCarousel.Reload(gameList, gameCnt);} selectedold = 1; abcBtn.SetImage(&abcBtnImg_g); + abcBtn.SetImageOver(&abcBtnImg_g); abcBtn.SetAlpha(180); countBtn.SetImage(&countBtnImg); + countBtn.SetImageOver(&countBtnImg); countBtn.SetAlpha(255); } countBtn.ResetState(); @@ -3601,12 +3623,14 @@ static int MenuDiscList() if (Settings.gameDisplay!=list){ if (Settings.gameDisplay==grid) { mainWindow->Remove(&gameGrid); - gridBtn.SetImage(&gridBtnImg_g); + gridBtn.SetImage(&gridBtnImg_g); + gridBtn.SetImageOver(&gridBtnImg_g); gridBtn.SetAlpha(180); } if (Settings.gameDisplay==carousel) { mainWindow->Remove(&gameCarousel); - carouselBtn.SetImage(&carouselBtnImg_g); + carouselBtn.SetImage(&carouselBtnImg_g); + carouselBtn.SetImageOver(&carouselBtnImg_g); carouselBtn.SetAlpha(180); } HaltGui(); @@ -3616,7 +3640,8 @@ static int MenuDiscList() mainWindow->Append(&gameBrowser); mainWindow->Append(&w); ResumeGui(); - listBtn.SetImage(&listBtnImg); + listBtn.SetImage(&listBtnImg); + listBtn.SetImageOver(&listBtnImg); listBtn.SetAlpha(255); if(CFG.widescreen) { @@ -3661,12 +3686,14 @@ static int MenuDiscList() if (GameIDTxt) w.Remove(GameIDTxt); if (GameRegionTxt) w.Remove(GameRegionTxt); w.Remove(&DownloadBtn); - listBtn.SetImage(&listBtnImg_g); + listBtn.SetImage(&listBtnImg_g); + listBtn.SetImageOver(&listBtnImg_g); listBtn.SetAlpha(180); } if (Settings.gameDisplay==carousel) { mainWindow->Remove(&gameCarousel); - carouselBtn.SetImage(&carouselBtnImg_g); + carouselBtn.SetImage(&carouselBtnImg_g); + carouselBtn.SetImageOver(&carouselBtnImg_g); carouselBtn.SetAlpha(180); } HaltGui(); @@ -3676,7 +3703,8 @@ static int MenuDiscList() mainWindow->Append(&gameGrid); mainWindow->Append(&w); ResumeGui(); - gridBtn.SetImage(&gridBtnImg); + gridBtn.SetImage(&gridBtnImg); + gridBtn.SetImageOver(&gridBtnImg); gridBtn.SetAlpha(255); if(CFG.widescreen) { @@ -3720,11 +3748,13 @@ static int MenuDiscList() if (GameIDTxt) w.Remove(GameIDTxt); if (GameRegionTxt) w.Remove(GameRegionTxt); w.Remove(&DownloadBtn); - listBtn.SetImage(&listBtnImg_g); + listBtn.SetImage(&listBtnImg_g); + listBtn.SetImageOver(&listBtnImg_g); listBtn.SetAlpha(180); if (Settings.gameDisplay==grid) mainWindow->Remove(&gameGrid); - gridBtn.SetImage(&gridBtnImg_g); + gridBtn.SetImage(&gridBtnImg_g); + gridBtn.SetImageOver(&gridBtnImg_g); gridBtn.SetAlpha(180); HaltGui(); mainWindow->Remove(&w); @@ -3733,7 +3763,8 @@ static int MenuDiscList() mainWindow->Append(&gameCarousel); mainWindow->Append(&w); ResumeGui(); - carouselBtn.SetImage(&carouselBtnImg); + carouselBtn.SetImage(&carouselBtnImg); + carouselBtn.SetImageOver(&carouselBtnImg); carouselBtn.SetAlpha(255); if(CFG.widescreen) { @@ -5427,7 +5458,7 @@ int GameSettings(struct discHdr * header) options3.SetName(2,"%s", LANGUAGE.Language); options3.SetName(3, "Ocarina"); options3.SetName(4, "IOS"); - options3.SetName(5,"%s", LANGUAGE.addToFavorite); + options3.SetName(5,"%s", LANGUAGE.Parentalcontrol); options3.SetName(6,"%s", LANGUAGE.Defaultgamesettings); GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);