From 3f360ea8bd849a52ac189c4aabe986f41e932569 Mon Sep 17 00:00:00 2001 From: dborth Date: Thu, 18 Jun 2009 05:48:32 +0000 Subject: [PATCH] shrink file selector font size, increase to 10 entries --- source/ngc/filebrowser.h | 2 +- source/ngc/gui/gui.h | 21 ++++---- source/ngc/gui/gui_filebrowser.cpp | 48 +++++++++--------- source/ngc/images/bg_game_selection.png | Bin 1470 -> 1528 bytes source/ngc/images/bg_game_selection_entry.png | Bin 279 -> 268 bytes source/ngc/images/folder.png | Bin 1565 -> 1323 bytes source/ngc/images/scrollbar.png | Bin 270 -> 270 bytes source/ngc/menu.cpp | 4 +- 8 files changed, 38 insertions(+), 37 deletions(-) diff --git a/source/ngc/filebrowser.h b/source/ngc/filebrowser.h index 4476b42..2f5743a 100644 --- a/source/ngc/filebrowser.h +++ b/source/ngc/filebrowser.h @@ -15,7 +15,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 13d8b4f..91a70ba 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 16cb03e736bf18e1686c78ac5e9313115cb43d2a..c92c6fa8f2dc141e140f8914ab143c2086d41e1c 100644 GIT binary patch delta 351 zcmV-l0igcA3-}9=77GCk2nGNE0D|aZ%#k4|0h*CYTmq!5v8dn!lRW}Cf56{RuP+yu zODRCt^J;mi=7a#~h~F146_>LqKvQ{DTbOY|0CYrc;cRhPO#%8QuYSGoNw|4q&M5(~ zuCC5c6fZgHD)fE60ezcx>dQC7FK6F%QUI*0^Jk6}mmi15dqBx6dH1K8cf#zs51bYN zZA*V!P@Ne6^9Izg80U@jeUOC zFUo}n>00zioR{OIU)J@d&C3@*3zwZI0BbiJ=h^Vrdp}L9eGv6%Ih+UMeC5mlXw&;~ x9#|Qlq*Slh9S;EiI{%6X009Ev|Kkq<1_1APp28wc;T`}0002ovPDHLkV1lS|s!IR> delta 346 zcmV-g0j2)<3%(1G77GCQ2nGNE0IHlacab3|0br3zTmq&nv8dn!fABZ;`f_o(lmc`; zua=i;P6&XG_emaOgqt_!oDu-*>gxPN z@sg9SLf_{b(6?!)zI-$Ma`s&(1;DyGf96PW`Eh8x2b8>$cYm6BC(NGvz-a-{w)D3J z)rs*xZ$J%;ao$KTe{z7ni1S{4TAe%`e)#(7_ydzp4}dlKZSG{4I`LGPt$tYCP8Xi( z^rCd?_^!NJiSv1!eZ}t_7=9x3ZQc=jHVisV09v|n?Lw$6Oo#cOzg+p~Se)ncqFi{8 zu0@Z;c{xt{WnEv|ynOMqaM^hRuy(U?o(+G!_tUi62T_m4IC(J6SI!K8HoYI`ftB$| sO7(i(@c{6z^RIXS5Fh~lKmHJ407V_1n(~xA@Bjb+07*qoM6N<$f(}irzW@LL diff --git a/source/ngc/images/bg_game_selection_entry.png b/source/ngc/images/bg_game_selection_entry.png index 556a99689633627f43cc39e26470bdf5bbac9b1b..b1842c21041f3ceacdf8d528fea493138d061afe 100644 GIT binary patch delta 167 zcmV;Y09gN*0*nHX7YZB*1^@s6PrB*bks&Bku1Q2eRCwC#-60Z!P!xtyV8lWrxCtW5 zb17`e;0_>LoN>k>Ua&C6cdee2UjEA$Zg_P>R3G#GdaD4S(COEvI4FK{1 zY0sTC04UaxoHaZC#qlTl`hHjgfP6q+&&3)5L?i$J delta 178 zcmV;j08Rgl0+#}i7YZN<1^@s6JOVBaks&Bkxk*GpRCwC#*&zo466zuiBL{Q4GJ0x0000DNk~Le0000S0000S2nGNE0CElAl#wAPe+11* zL_t(|+U!=%ZyQw*pZE6dZoK~3*!gl|Ql}(Ul%^Dff_kesAfTuchh8`o3321lzk+{( z3kSprRY-6_2&qCe0tpVZ4OHp}GztMVq;*oK!L^;;eP7J1ovMKVLfs$QVSy^?0(s(d392NtQ z7xOu{cx~x=Nop9YPtTP(v*U$A=~p4V&8Zj8UD_A$UyJICpa?w3z>ed$A;)oQVP4ep z1H9(Dye7D<&Cksg85cR<_k0E_1Ytj8OfRE{{Q=S0o=sy69GR%TcjDOCf4hYoOgM#H z`AGGoaF}&54zOV0QAfgHSOm}IfZ&kCJFufv5f}uSlnxIM@7dJa_>;BD*=I(A1*sK~ zqK%Fa27}`qHXgK~9T}LO3cvx40a}O?1T+5`2Wz-cq!3s~RivQNIe37cDO9BVr5KcY+ajVL7Bl?;jH@t#rxm~nPn;PS90 zejLa7PB->X%#NQrezg4NPPdJY%$}hxF%#q&Zromm*_j%+e;8B`lql6D%SOU&dNoN^*^_~#z5sd&hr~pCRAZ9{MRmnD-*P>W3Anhp$b=9f)@T%? zv>Iu#Rx&Mn+425tqZ+0oj_Qa??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s_E}|Ku5;SNWrOvCHUyeSy=piC2_Xo%9KIpq3HTV zTb>3oz!M2bS_YaCGZycg5E%jJjQoPD+b_KT=?u(Yrm%LSf29no$bf#ZcDKA$0-b#d zK(nAh8E_&AoTu(+JGQB1sBW|*eDUpX(iD|pfNzS#;hm0XOpNo4{+;YuG6p5eXDq`` zJGOGDsW(42n+wW?gKjRjkHw+Mtjp=C2lS#L8g})1h#Q*Q4U}nsvNtOOrFOeL+-NlF z*z@;Xy?SN;e~Zr^dbLuJW9=y1=Ox;p9z5Lx&5Qx7C%C`|<@CzA)xoH@fC z$5~;FjpA3mffOZ|wyA)WcGGWkSV`4WO2NTCrz=5rnw16^Cjd=#D4>}DEG#VG;ll32 zkGnMIxP&j1u%!|kwJ)u-qSCHRZ~@(lO^Hfk#%QUyOe(?bic(|)P%4#BLq>37N#Db{ zK9(@WeMPG5oVs_sUbpk5xq-VL zm}gPA_|M9vrTT%#m&?^k{MFafaB=Bcek`zF;88oL7q5;@yoO19Ao1i3)P*|*pwD}a zV0=D*dhYDy`6mwVEj~0gSab^2Yqjx1(Y2K&_-pwrHlGl5hty|-o*qAXaDVl?T(SS- wzW&+_9#D_5xB=ugzl_NLKTdZVz<&Y^0Cb8oM(;{>(EtDd07*qoM6N<$f<(dTAOHXW diff --git a/source/ngc/images/scrollbar.png b/source/ngc/images/scrollbar.png index 46c8cf8efddeec27b4d231115e987d5c0dcf1263..195ec168a7fc61182ed034a2178061e2502bf59b 100644 GIT binary patch delta 93 zcmV-j0HXhn0*(TZ7YfJ-1^@s6n!2O!ks&cCArSx|5CB1-2@U9nrXLN6@+G3N5B0HX_O$YOk%4rPkOvvRbp;pz5Df^8il%lA00000NkvXXu0mjf@9iM) delta 97 zcmV-n0G|Jj0*(TZ7Ye`#1^@s6cIhF4ks&cHp#gv}3`N0&P1u0_s@bm_FiKFB!C)%x zsV}~`tg7gG=2){o{VUJw{yZG9d69v18-RfO^$IWmIZz0Fi>9^900000NkvXXu0mjf DqRlBa diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 59e15b3..a0b1990 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -925,8 +925,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();