mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-17 16:59:17 +01:00
Made theme setting to define max characters for game list. Use "maxcharacters = ##" in theme.txt. Default is 36. This does not affect for the title appears anywhere but the game list.
This commit is contained in:
parent
5fabf08980
commit
fe926e0eb4
@ -237,6 +237,7 @@ void CFG_Default(int widescreen) // -1 = non forced Mode
|
||||
THEME.cover_x = 26;
|
||||
THEME.cover_y = 55;
|
||||
THEME.showID = 1;
|
||||
THEME.maxcharacters = 36;
|
||||
THEME.id_x = 68;
|
||||
THEME.id_y = 305;
|
||||
THEME.region_x = 68;
|
||||
@ -631,6 +632,13 @@ void theme_set(char *name, char *val)
|
||||
THEME.pagesize = x;
|
||||
}
|
||||
}
|
||||
|
||||
else if (strcmp(cfg_name, "maxcharacters") == 0) {
|
||||
short x;
|
||||
if (sscanf(val, "%hd", &x) == 1) {
|
||||
THEME.maxcharacters = x;
|
||||
}
|
||||
}
|
||||
|
||||
cfg_bool("show_id", &THEME.showID);
|
||||
cfg_bool("show_tooltip", &THEME.showToolTip);
|
||||
|
@ -79,6 +79,7 @@ struct THEME
|
||||
short cover_x;
|
||||
short cover_y;
|
||||
short showID;
|
||||
short maxcharacters;
|
||||
short id_x;
|
||||
short id_y;
|
||||
short region_x;
|
||||
|
@ -13,8 +13,12 @@
|
||||
#include "gui_gamebrowser.h"
|
||||
#include "../cfg.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <sstream>
|
||||
|
||||
#define GAMESELECTSIZE 30
|
||||
extern const int vol;
|
||||
int txtscroll = 0;
|
||||
/**
|
||||
* Constructor for the GuiGameBrowser class.
|
||||
*/
|
||||
@ -114,18 +118,18 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
|
||||
gameTxt = new GuiText * [pagesize];
|
||||
gameBg = new GuiImage * [pagesize];
|
||||
|
||||
char buffer[CFG.maxcharacters + 4];
|
||||
char buffer[THEME.maxcharacters + 4];
|
||||
|
||||
for(int i=0; i < pagesize; i++)
|
||||
{
|
||||
if (strlen(get_title(&gameList[i])) < (u32)(CFG.maxcharacters + 3))
|
||||
if (strlen(get_title(&gameList[i])) < (u32)(THEME.maxcharacters + 3))
|
||||
{
|
||||
sprintf(buffer, "%s", get_title(&gameList[i]));
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(buffer, get_title(&gameList[i]), CFG.maxcharacters);
|
||||
buffer[CFG.maxcharacters] = '\0';
|
||||
sprintf(buffer, get_title(&gameList[i]), THEME.maxcharacters);
|
||||
buffer[THEME.maxcharacters] = '\0';
|
||||
strncat(buffer, "...", 3);
|
||||
}
|
||||
|
||||
@ -314,8 +318,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
||||
// scrolldelay affects how fast the list scrolls
|
||||
// when the arrows are clicked
|
||||
float scrolldelay = 3.5;
|
||||
|
||||
|
||||
|
||||
if (scrollbaron == 1) {
|
||||
// update the location of the scroll box based on the position in the option list
|
||||
arrowUpBtn->Update(t);
|
||||
@ -324,7 +327,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
||||
}
|
||||
|
||||
next = listOffset;
|
||||
char buffer[CFG.maxcharacters + 4];
|
||||
char buffer[THEME.maxcharacters + 4];
|
||||
|
||||
for(int i=0; i<pagesize; i++)
|
||||
{
|
||||
@ -336,14 +339,14 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
||||
game[i]->SetState(STATE_DEFAULT);
|
||||
}
|
||||
|
||||
if (strlen(get_title(&gameList[next])) < (u32)(CFG.maxcharacters + 3))
|
||||
if (strlen(get_title(&gameList[next])) < (u32)(THEME.maxcharacters + 3))
|
||||
{
|
||||
sprintf(buffer, "%s", get_title(&gameList[next]));
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(buffer, get_title(&gameList[next]), CFG.maxcharacters);
|
||||
buffer[CFG.maxcharacters] = '\0';
|
||||
sprintf(buffer, get_title(&gameList[next]), THEME.maxcharacters);
|
||||
buffer[THEME.maxcharacters] = '\0';
|
||||
strncat(buffer, "...", 3);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user