diff --git a/source/ngc/filebrowser.h b/source/ngc/filebrowser.h index 4744529..57b726a 100644 --- a/source/ngc/filebrowser.h +++ b/source/ngc/filebrowser.h @@ -18,7 +18,7 @@ #include #define MAXJOLIET 255 -#define MAXDISPLAY 35 +#define MAXDISPLAY 40 typedef struct { diff --git a/source/ngc/gui/gui.h b/source/ngc/gui/gui.h index 9e029db..c85148b 100644 --- a/source/ngc/gui/gui.h +++ b/source/ngc/gui/gui.h @@ -52,12 +52,13 @@ extern FreeTypeGX *fontSystem; -#define SCROLL_INITIAL_DELAY 20 -#define SCROLL_LOOP_DELAY 3 -#define PAGESIZE 8 -#define SAVELISTSIZE 6 -#define MAX_SAVES 20 -#define MAX_OPTIONS 30 +#define SCROLL_INITIAL_DELAY 20 +#define SCROLL_LOOP_DELAY 3 +#define FILE_PAGESIZE 10 +#define PAGESIZE 8 +#define SAVELISTSIZE 6 +#define MAX_SAVES 20 +#define MAX_OPTIONS 30 typedef void (*UpdateCallback)(void * e); @@ -889,14 +890,14 @@ class GuiFileBrowser : public GuiElement void Draw(); void TriggerUpdate(); void Update(GuiTrigger * t); - GuiButton * fileList[PAGESIZE]; + GuiButton * fileList[FILE_PAGESIZE]; protected: int selectedItem; bool listChanged; - GuiText * fileListText[PAGESIZE]; - GuiImage * fileListBg[PAGESIZE]; - GuiImage * fileListFolder[PAGESIZE]; + GuiText * fileListText[FILE_PAGESIZE]; + GuiImage * fileListBg[FILE_PAGESIZE]; + GuiImage * fileListFolder[FILE_PAGESIZE]; GuiButton * arrowUpBtn; GuiButton * arrowDownBtn; diff --git a/source/ngc/gui/gui_filebrowser.cpp b/source/ngc/gui/gui_filebrowser.cpp index 1516a52..0e28e67 100644 --- a/source/ngc/gui/gui_filebrowser.cpp +++ b/source/ngc/gui/gui_filebrowser.cpp @@ -92,26 +92,26 @@ GuiFileBrowser::GuiFileBrowser(int w, int h) scrollbarBoxBtn->SetImageOver(scrollbarBoxOverImg); scrollbarBoxBtn->SetAlignment(ALIGN_RIGHT, ALIGN_TOP); scrollbarBoxBtn->SetMinY(0); - scrollbarBoxBtn->SetMaxY(136); + scrollbarBoxBtn->SetMaxY(156); scrollbarBoxBtn->SetSelectable(false); scrollbarBoxBtn->SetClickable(false); scrollbarBoxBtn->SetHoldable(true); scrollbarBoxBtn->SetTrigger(trigHeldA); - for(int i=0; iSetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); fileListText[i]->SetPosition(5,0); fileListBg[i] = new GuiImage(bgGameSelectionEntry); fileListFolder[i] = new GuiImage(gameFolder); - fileList[i] = new GuiButton(380, 30); + fileList[i] = new GuiButton(380, 26); fileList[i]->SetParent(this); fileList[i]->SetLabel(fileListText[i]); fileList[i]->SetImageOver(fileListBg[i]); - fileList[i]->SetPosition(2,30*i+3); + fileList[i]->SetPosition(2,26*i+3); fileList[i]->SetTrigger(trigA); fileList[i]->SetSoundClick(btnSoundClick); } @@ -151,7 +151,7 @@ GuiFileBrowser::~GuiFileBrowser() delete trigHeldA; delete trigA; - for(int i=0; iResetState(); if(f == 1) @@ -177,7 +177,7 @@ void GuiFileBrowser::ResetState() stateChan = -1; selectedItem = 0; - for(int i=0; iResetState(); } @@ -198,7 +198,7 @@ void GuiFileBrowser::Draw() bgGameSelectionImg->Draw(); - for(int i=0; iDraw(); } @@ -227,7 +227,7 @@ void GuiFileBrowser::Update(GuiTrigger * t) if(scrollbarBoxBtn->GetState() == STATE_HELD && scrollbarBoxBtn->GetStateChan() == t->chan && t->wpad.ir.valid && - browser.numEntries > PAGESIZE + browser.numEntries > FILE_PAGESIZE ) { scrollbarBoxBtn->SetPosition(0,0); @@ -238,15 +238,15 @@ void GuiFileBrowser::Update(GuiTrigger * t) else if(positionWiimote > scrollbarBoxBtn->GetMaxY()) positionWiimote = scrollbarBoxBtn->GetMaxY(); - browser.pageIndex = (positionWiimote * browser.numEntries)/136.0 - selectedItem; + browser.pageIndex = (positionWiimote * browser.numEntries)/156.0 - selectedItem; if(browser.pageIndex <= 0) { browser.pageIndex = 0; } - else if(browser.pageIndex+PAGESIZE >= browser.numEntries) + else if(browser.pageIndex+FILE_PAGESIZE >= browser.numEntries) { - browser.pageIndex = browser.numEntries-PAGESIZE; + browser.pageIndex = browser.numEntries-FILE_PAGESIZE; } listChanged = true; focus = false; @@ -274,11 +274,11 @@ void GuiFileBrowser::Update(GuiTrigger * t) if(t->Right()) { - if(browser.pageIndex < browser.numEntries && browser.numEntries > PAGESIZE) + if(browser.pageIndex < browser.numEntries && browser.numEntries > FILE_PAGESIZE) { - browser.pageIndex += PAGESIZE; - if(browser.pageIndex+PAGESIZE >= browser.numEntries) - browser.pageIndex = browser.numEntries-PAGESIZE; + browser.pageIndex += FILE_PAGESIZE; + if(browser.pageIndex+FILE_PAGESIZE >= browser.numEntries) + browser.pageIndex = browser.numEntries-FILE_PAGESIZE; listChanged = true; } } @@ -286,7 +286,7 @@ void GuiFileBrowser::Update(GuiTrigger * t) { if(browser.pageIndex > 0) { - browser.pageIndex -= PAGESIZE; + browser.pageIndex -= FILE_PAGESIZE; if(browser.pageIndex < 0) browser.pageIndex = 0; listChanged = true; @@ -296,7 +296,7 @@ void GuiFileBrowser::Update(GuiTrigger * t) { if(browser.pageIndex + selectedItem + 1 < browser.numEntries) { - if(selectedItem == PAGESIZE-1) + if(selectedItem == FILE_PAGESIZE-1) { // move list down by 1 browser.pageIndex++; @@ -326,7 +326,7 @@ void GuiFileBrowser::Update(GuiTrigger * t) endNavigation: - for(int i=0; i= (browser.numEntries)/(PAGESIZE*1.0)) - position = 136; + else if((browser.pageIndex+FILE_PAGESIZE)/(FILE_PAGESIZE*1.0) >= (browser.numEntries)/(FILE_PAGESIZE*1.0)) + position = 156; } scrollbarBoxBtn->SetPosition(0,position+36); diff --git a/source/ngc/images/bg_game_selection.png b/source/ngc/images/bg_game_selection.png index 16cb03e..c92c6fa 100644 Binary files a/source/ngc/images/bg_game_selection.png and b/source/ngc/images/bg_game_selection.png differ diff --git a/source/ngc/images/bg_game_selection_entry.png b/source/ngc/images/bg_game_selection_entry.png index 556a996..b1842c2 100644 Binary files a/source/ngc/images/bg_game_selection_entry.png and b/source/ngc/images/bg_game_selection_entry.png differ diff --git a/source/ngc/images/folder.png b/source/ngc/images/folder.png index 269b5ca..14fab1d 100644 Binary files a/source/ngc/images/folder.png and b/source/ngc/images/folder.png differ diff --git a/source/ngc/images/scrollbar.png b/source/ngc/images/scrollbar.png index 46c8cf8..195ec16 100644 Binary files a/source/ngc/images/scrollbar.png and b/source/ngc/images/scrollbar.png differ diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 5c48a66..7a052a8 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -938,8 +938,8 @@ static int MenuGameSelection() buttonWindow.Append(&settingsBtn); buttonWindow.Append(&exitBtn); - GuiFileBrowser gameBrowser(424, 248); - gameBrowser.SetPosition(50, 108); + GuiFileBrowser gameBrowser(424, 268); + gameBrowser.SetPosition(50, 98); ResetBrowser(); HaltGui();