diff --git a/source/libwiigui/gui_customoptionbrowser.cpp b/source/libwiigui/gui_customoptionbrowser.cpp index 676251a5..eec242b1 100644 --- a/source/libwiigui/gui_customoptionbrowser.cpp +++ b/source/libwiigui/gui_customoptionbrowser.cpp @@ -62,7 +62,7 @@ void customOptionList::SetValue(int i, const char *format, ...) va_start(va, format); vasprintf(&tmp, format, va); va_end(va); - + if(tmp) { if(value[i] && !strcmp(tmp, value[i])) @@ -240,9 +240,9 @@ GuiCustomOptionBrowser::~GuiCustomOptionBrowser() delete bgOptionsEntry; delete trigA; + delete trigHeldA; delete btnSoundClick; -// delete optionBg; for(int i = 0; i < size; i++) { delete optionTxt[i]; @@ -405,7 +405,7 @@ void GuiCustomOptionBrowser::UpdateListEntries() { optionVal[i]->SetPosition(coL2,0); optionVal[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::DOTTED); - + optionValOver[i]->SetPosition(coL2,0); optionValOver[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::SCROLL); } @@ -435,7 +435,7 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t) arrowDownBtn->Update(t); scrollbarBoxBtn->Update(t); } - + next = listOffset; for(int i=0; i < size; i++) @@ -632,7 +632,7 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t) } if(old_listOffset != listOffset) UpdateListEntries(); - + if(updateCB) updateCB(this); } diff --git a/source/libwiigui/gui_customoptionbrowser.h b/source/libwiigui/gui_customoptionbrowser.h index 0455a495..1ba29893 100644 --- a/source/libwiigui/gui_customoptionbrowser.h +++ b/source/libwiigui/gui_customoptionbrowser.h @@ -82,9 +82,7 @@ class GuiCustomOptionBrowser : public GuiElement GuiImageData * scrollbarBox; GuiImageData * scrollbarBoxOver; - GuiSound * btnSoundOver; GuiSound * btnSoundClick; GuiTrigger * trigA; - GuiTrigger * trigB; GuiTrigger * trigHeldA; }; diff --git a/source/libwiigui/gui_gamebrowser.cpp b/source/libwiigui/gui_gamebrowser.cpp index d30964b3..1f7af330 100644 --- a/source/libwiigui/gui_gamebrowser.cpp +++ b/source/libwiigui/gui_gamebrowser.cpp @@ -181,7 +181,6 @@ GuiGameBrowser::~GuiGameBrowser() delete trigA; delete trigHeldA; delete btnSoundClick; - delete btnSoundOver; for(int i=0; igameCnt = (gameCnt < SAFETY) ? gameCnt : SAFETY; + gameCnt = (count < SAFETY) ? count : SAFETY; gameList = l; pagesize = (gameCnt < PAGESIZE) ? gameCnt : PAGESIZE; listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset; @@ -49,7 +48,6 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, struct discHdr * l, int gameCnt, trigA = new GuiTrigger; trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); - trigHeldA = new GuiTrigger; trigL = new GuiTrigger; trigL->SetButtonOnlyTrigger(-1, WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT, PAD_BUTTON_LEFT); trigR = new GuiTrigger; @@ -159,7 +157,6 @@ GuiGameCarousel::~GuiGameCarousel() delete btnLeft; delete trigA; - delete trigHeldA; delete trigL; delete trigR; delete trigPlus; @@ -430,7 +427,7 @@ void GuiGameCarousel::Reload(struct discHdr * l, int count) LOCK(this); - gameCnt = count; + gameCnt = (count < SAFETY) ? count : SAFETY; gameList = l; pagesize = (gameCnt < PAGESIZE) ? gameCnt : PAGESIZE; listOffset = this->FindMenuItem(-1, 1); diff --git a/source/libwiigui/gui_gamecarousel.h b/source/libwiigui/gui_gamecarousel.h index a19acff8..06f82dfc 100644 --- a/source/libwiigui/gui_gamecarousel.h +++ b/source/libwiigui/gui_gamecarousel.h @@ -55,6 +55,5 @@ class GuiGameCarousel : public GuiElement GuiTrigger * trigR; GuiTrigger * trigPlus; GuiTrigger * trigMinus; - GuiTrigger * trigHeldA; }; #endif diff --git a/source/libwiigui/gui_gamegrid.cpp b/source/libwiigui/gui_gamegrid.cpp index 56d02043..eebadd02 100644 --- a/source/libwiigui/gui_gamegrid.cpp +++ b/source/libwiigui/gui_gamegrid.cpp @@ -459,6 +459,17 @@ void GuiGameGrid::Update(GuiTrigger * t) void GuiGameGrid::Reload(struct discHdr * l, int count) { + for(int i=0; iid[0], header->id[1], header->id[2]); @@ -501,20 +508,29 @@ void GuiGameGrid::Reload(struct discHdr * l, int count) cover[i] = new GuiImageData(imgPath, nocover_png); //load no image } } - coverImg[i] = new GuiImage(cover[i]); coverImg[i]->SetWidescreen(CFG.widescreen); coverImg[i]->SetScale(0.6); - coverImg[i]->SetParent(game[i]); + game[i] = new GuiButton(coverImg[i]->GetWidth()*.45,coverImg[i]->GetHeight()*.7); + game[i]->SetParent(this); + game[i]->SetAlignment(ALIGN_TOP,ALIGN_LEFT); + game[i]->SetImage(coverImg[i]); + coverImg[i]->SetParent(game[i]); coverImg[i]->SetPosition(-10,-35); - game[i]->ResetState(); + if (i<4)game[i]->SetPosition((117+i*110)+THEME.gamegrid_x,25+THEME.gamegrid_y); + if (i>3)game[i]->SetPosition((117+(i-4)*110)+THEME.gamegrid_x,185+THEME.gamegrid_y); + game[i]->SetRumble(false); + game[i]->SetTrigger(trigA); + game[i]->SetSoundOver(btnSoundOver); + game[i]->SetSoundClick(btnSoundClick); + game[i]->SetEffectGrow(); game[i]->SetVisible(true); - game[i]->SetImage(coverImg[i]); - game[i]->SetClickable(true); - coverImg[i]->SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50); - if (((changed+pagesize)>gameCnt)&&(i>((gameCnt-changed)-1))) { - game[i]->SetVisible(false); - game[i]->SetClickable(false); - } + game[i]->SetClickable(true); + coverImg[i]->SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_IN, 50); + if (((changed+pagesize)>gameCnt)&&(i>((gameCnt-changed)-1))) { + game[i]->SetVisible(false); + game[i]->SetClickable(false); + game[i]->RemoveSoundOver(); + } } }