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

This commit is contained in:
giantpune 2009-05-31 05:56:44 +00:00
parent 637a1a5032
commit 268ec71c96
2 changed files with 54 additions and 15 deletions

View File

@ -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) { else if (strcmp(cfg_name, "sortBarOffset") == 0) {
short x; short x;
if (sscanf(val, "%hd", &x) == 1) { if (sscanf(val, "%hd", &x) == 1) {

View File

@ -951,8 +951,9 @@ int GameWindowPrompt()
{ {
int choice = -1, angle = 0; int choice = -1, angle = 0;
f32 size = 0.0; f32 size = 0.0;
char ID[4]; char ID[5];
char IDFull[7]; char IDFull[7];
u8 faveChoice = 0; u8 faveChoice = 0;
u16 playCount = 0; u16 playCount = 0;
@ -1166,6 +1167,14 @@ int GameWindowPrompt()
delete diskCover; delete diskCover;
snprintf(imgPath, sizeof(imgPath), "%s%s.png", CFG.disc_path, ID); //changed to current id snprintf(imgPath, sizeof(imgPath), "%s%s.png", CFG.disc_path, ID); //changed to current id
diskCover = new GuiImageData(imgPath, 0); 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()) if (!diskCover->GetImage())
{ {
delete diskCover; delete diskCover;
@ -1173,6 +1182,7 @@ int GameWindowPrompt()
diskCover = new GuiImageData(imgPath,nodisc_png); diskCover = new GuiImageData(imgPath,nodisc_png);
} }
} }
}
@ -3155,31 +3165,37 @@ static int MenuDiscList()
if (Settings.fave) if (Settings.fave)
{ {
favoriteBtn.SetImage(&favoriteBtnImg); favoriteBtn.SetImage(&favoriteBtnImg);
favoriteBtn.SetImageOver(&favoriteBtnImg);
favoriteBtn.SetAlpha(255); favoriteBtn.SetAlpha(255);
} }
if (Settings.sort==all) if (Settings.sort==all)
{ {
abcBtn.SetImage(&abcBtnImg); abcBtn.SetImage(&abcBtnImg);
abcBtn.SetImageOver(&abcBtnImg);
abcBtn.SetAlpha(255); abcBtn.SetAlpha(255);
} }
else if (Settings.sort==pcount) else if (Settings.sort==pcount)
{ {
countBtn.SetImage(&countBtnImg); countBtn.SetImage(&countBtnImg);
countBtn.SetImageOver(&countBtnImg);
countBtn.SetAlpha(255); countBtn.SetAlpha(255);
} }
if (Settings.gameDisplay==list) if (Settings.gameDisplay==list)
{ {
listBtn.SetImage(&listBtnImg); listBtn.SetImage(&listBtnImg);
listBtn.SetImageOver(&listBtnImg);
listBtn.SetAlpha(255); listBtn.SetAlpha(255);
} }
else if (Settings.gameDisplay==grid) else if (Settings.gameDisplay==grid)
{ {
gridBtn.SetImage(&gridBtnImg); gridBtn.SetImage(&gridBtnImg);
gridBtn.SetImageOver(&gridBtnImg);
gridBtn.SetAlpha(255); gridBtn.SetAlpha(255);
} }
else if (Settings.gameDisplay==carousel) else if (Settings.gameDisplay==carousel)
{ {
carouselBtn.SetImage(&carouselBtnImg); carouselBtn.SetImage(&carouselBtnImg);
carouselBtn.SetImageOver(&carouselBtnImg);
carouselBtn.SetAlpha(255); carouselBtn.SetAlpha(255);
} }
if (Settings.gameDisplay==list) if (Settings.gameDisplay==list)
@ -3547,7 +3563,9 @@ static int MenuDiscList()
gamecntTxt.SetTextf("%s: %i",LANGUAGE.Games, gameCnt); gamecntTxt.SetTextf("%s: %i",LANGUAGE.Games, gameCnt);
selectedold = 1; selectedold = 1;
favoriteBtn.ResetState(); 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) else if(abcBtn.GetState() == STATE_CLICKED)
@ -3566,8 +3584,10 @@ static int MenuDiscList()
gameCarousel.Reload(gameList, gameCnt);} gameCarousel.Reload(gameList, gameCnt);}
selectedold = 1; selectedold = 1;
abcBtn.SetImage(&abcBtnImg); abcBtn.SetImage(&abcBtnImg);
abcBtn.SetImageOver(&abcBtnImg);
abcBtn.SetAlpha(255); abcBtn.SetAlpha(255);
countBtn.SetImage(&countBtnImg_g); countBtn.SetImage(&countBtnImg_g);
countBtn.SetImageOver(&countBtnImg_g);
countBtn.SetAlpha(180); countBtn.SetAlpha(180);
} }
abcBtn.ResetState(); abcBtn.ResetState();
@ -3589,8 +3609,10 @@ static int MenuDiscList()
gameCarousel.Reload(gameList, gameCnt);} gameCarousel.Reload(gameList, gameCnt);}
selectedold = 1; selectedold = 1;
abcBtn.SetImage(&abcBtnImg_g); abcBtn.SetImage(&abcBtnImg_g);
abcBtn.SetImageOver(&abcBtnImg_g);
abcBtn.SetAlpha(180); abcBtn.SetAlpha(180);
countBtn.SetImage(&countBtnImg); countBtn.SetImage(&countBtnImg);
countBtn.SetImageOver(&countBtnImg);
countBtn.SetAlpha(255); countBtn.SetAlpha(255);
} }
countBtn.ResetState(); countBtn.ResetState();
@ -3601,12 +3623,14 @@ static int MenuDiscList()
if (Settings.gameDisplay!=list){ if (Settings.gameDisplay!=list){
if (Settings.gameDisplay==grid) { if (Settings.gameDisplay==grid) {
mainWindow->Remove(&gameGrid); mainWindow->Remove(&gameGrid);
gridBtn.SetImage(&gridBtnImg_g); gridBtn.SetImage(&gridBtnImg_g);
gridBtn.SetImageOver(&gridBtnImg_g);
gridBtn.SetAlpha(180); gridBtn.SetAlpha(180);
} }
if (Settings.gameDisplay==carousel) { if (Settings.gameDisplay==carousel) {
mainWindow->Remove(&gameCarousel); mainWindow->Remove(&gameCarousel);
carouselBtn.SetImage(&carouselBtnImg_g); carouselBtn.SetImage(&carouselBtnImg_g);
carouselBtn.SetImageOver(&carouselBtnImg_g);
carouselBtn.SetAlpha(180); carouselBtn.SetAlpha(180);
} }
HaltGui(); HaltGui();
@ -3616,7 +3640,8 @@ static int MenuDiscList()
mainWindow->Append(&gameBrowser); mainWindow->Append(&gameBrowser);
mainWindow->Append(&w); mainWindow->Append(&w);
ResumeGui(); ResumeGui();
listBtn.SetImage(&listBtnImg); listBtn.SetImage(&listBtnImg);
listBtn.SetImageOver(&listBtnImg);
listBtn.SetAlpha(255); listBtn.SetAlpha(255);
if(CFG.widescreen) if(CFG.widescreen)
{ {
@ -3661,12 +3686,14 @@ static int MenuDiscList()
if (GameIDTxt) w.Remove(GameIDTxt); if (GameIDTxt) w.Remove(GameIDTxt);
if (GameRegionTxt) w.Remove(GameRegionTxt); if (GameRegionTxt) w.Remove(GameRegionTxt);
w.Remove(&DownloadBtn); w.Remove(&DownloadBtn);
listBtn.SetImage(&listBtnImg_g); listBtn.SetImage(&listBtnImg_g);
listBtn.SetImageOver(&listBtnImg_g);
listBtn.SetAlpha(180); listBtn.SetAlpha(180);
} }
if (Settings.gameDisplay==carousel) { if (Settings.gameDisplay==carousel) {
mainWindow->Remove(&gameCarousel); mainWindow->Remove(&gameCarousel);
carouselBtn.SetImage(&carouselBtnImg_g); carouselBtn.SetImage(&carouselBtnImg_g);
carouselBtn.SetImageOver(&carouselBtnImg_g);
carouselBtn.SetAlpha(180); carouselBtn.SetAlpha(180);
} }
HaltGui(); HaltGui();
@ -3676,7 +3703,8 @@ static int MenuDiscList()
mainWindow->Append(&gameGrid); mainWindow->Append(&gameGrid);
mainWindow->Append(&w); mainWindow->Append(&w);
ResumeGui(); ResumeGui();
gridBtn.SetImage(&gridBtnImg); gridBtn.SetImage(&gridBtnImg);
gridBtn.SetImageOver(&gridBtnImg);
gridBtn.SetAlpha(255); gridBtn.SetAlpha(255);
if(CFG.widescreen) if(CFG.widescreen)
{ {
@ -3720,11 +3748,13 @@ static int MenuDiscList()
if (GameIDTxt) w.Remove(GameIDTxt); if (GameIDTxt) w.Remove(GameIDTxt);
if (GameRegionTxt) w.Remove(GameRegionTxt); if (GameRegionTxt) w.Remove(GameRegionTxt);
w.Remove(&DownloadBtn); w.Remove(&DownloadBtn);
listBtn.SetImage(&listBtnImg_g); listBtn.SetImage(&listBtnImg_g);
listBtn.SetImageOver(&listBtnImg_g);
listBtn.SetAlpha(180); listBtn.SetAlpha(180);
if (Settings.gameDisplay==grid) if (Settings.gameDisplay==grid)
mainWindow->Remove(&gameGrid); mainWindow->Remove(&gameGrid);
gridBtn.SetImage(&gridBtnImg_g); gridBtn.SetImage(&gridBtnImg_g);
gridBtn.SetImageOver(&gridBtnImg_g);
gridBtn.SetAlpha(180); gridBtn.SetAlpha(180);
HaltGui(); HaltGui();
mainWindow->Remove(&w); mainWindow->Remove(&w);
@ -3733,7 +3763,8 @@ static int MenuDiscList()
mainWindow->Append(&gameCarousel); mainWindow->Append(&gameCarousel);
mainWindow->Append(&w); mainWindow->Append(&w);
ResumeGui(); ResumeGui();
carouselBtn.SetImage(&carouselBtnImg); carouselBtn.SetImage(&carouselBtnImg);
carouselBtn.SetImageOver(&carouselBtnImg);
carouselBtn.SetAlpha(255); carouselBtn.SetAlpha(255);
if(CFG.widescreen) if(CFG.widescreen)
{ {
@ -5427,7 +5458,7 @@ int GameSettings(struct discHdr * header)
options3.SetName(2,"%s", LANGUAGE.Language); options3.SetName(2,"%s", LANGUAGE.Language);
options3.SetName(3, "Ocarina"); options3.SetName(3, "Ocarina");
options3.SetName(4, "IOS"); options3.SetName(4, "IOS");
options3.SetName(5,"%s", LANGUAGE.addToFavorite); options3.SetName(5,"%s", LANGUAGE.Parentalcontrol);
options3.SetName(6,"%s", LANGUAGE.Defaultgamesettings); options3.SetName(6,"%s", LANGUAGE.Defaultgamesettings);
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);