Added pagesize option (number of entries displayed in the gamelist)

This commit is contained in:
hungyip 2009-05-06 04:52:44 +00:00
parent 046be61cc4
commit c7ffd0ad09
3 changed files with 11 additions and 2 deletions

View File

@ -253,6 +253,7 @@ void CFG_Default(int widescreen) // -1 = non forced Mode
THEME.gameText_r = 0; THEME.gameText_r = 0;
THEME.gameText_g = 0; THEME.gameText_g = 0;
THEME.gameText_b = 0; THEME.gameText_b = 0;
THEME.pagesize = 9;
} }
@ -598,6 +599,13 @@ void theme_set(char *name, char *val)
} }
} }
else if (strcmp(cfg_name, "pagesize") == 0) {
short x;
if (sscanf(val, "%hd", &x) == 1) {
THEME.pagesize = x;
}
}
cfg_bool("show_id", &THEME.showID); cfg_bool("show_id", &THEME.showID);
cfg_bool("show_tooltip", &THEME.showToolTip); cfg_bool("show_tooltip", &THEME.showToolTip);
cfg_bool("show_hddinfo", &THEME.showHDD); cfg_bool("show_hddinfo", &THEME.showHDD);

View File

@ -123,6 +123,7 @@ struct THEME
short gameText_r; short gameText_r;
short gameText_g; short gameText_g;
short gameText_b; short gameText_b;
short pagesize;
}; };
extern struct CFG CFG; extern struct CFG CFG;

View File

@ -25,8 +25,8 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
height = h; height = h;
this->gameCnt = gameCnt; this->gameCnt = gameCnt;
gameList = l; gameList = l;
pagesize = (gameCnt > PAGESIZE) ? PAGESIZE : gameCnt; pagesize = (gameCnt > THEME.pagesize) ? THEME.pagesize : gameCnt;
scrollbaron = (gameCnt > PAGESIZE) ? 1 : 0; scrollbaron = (gameCnt > THEME.pagesize) ? 1 : 0;
selectable = true; selectable = true;
listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset; listOffset = (offset == 0) ? this->FindMenuItem(-1, 1) : offset;
selectedItem = selected - offset; selectedItem = selected - offset;