made the sorting icons movable it theme file. favorite_coords, abc_coords, count_coords, grid_coords, carousel_coords, and sortBarOffset. sortBarOffset is the abount the buttons move to the left when switching to the grid view from list view. all buttons coords here are align_top, align_center. also there is a fixed number (different for each button) used to correct positions when CFG.widescreen returns false so there isn't complete theming freedom but it is enough for now.

This commit is contained in:
giantpune 2009-05-29 01:50:05 +00:00
parent 1faa39a755
commit 0c2898ac21
3 changed files with 115 additions and 46 deletions

View File

@ -309,6 +309,17 @@ void CFG_Default(int widescreen) // -1 = non forced Mode
THEME.gameText_g = 0;
THEME.gameText_b = 0;
THEME.pagesize = 9;
THEME.favorite_x = 20;
THEME.favorite_y = 13;
THEME.abc_x = 52;
THEME.abc_y = 13;
THEME.grid_x = 116;
THEME.grid_y = 13;
THEME.carousel_x = 148;
THEME.carousel_y = 13;
THEME.count_x = 84;
THEME.count_y = 13;
THEME.sortBarOffset = 100;
}
@ -654,6 +665,53 @@ void theme_set(char *name, char *val)
}
}
else if (strcmp(cfg_name, "favorite_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.favorite_x = x - (x % 4);
THEME.favorite_y = y;
}
}
else if (strcmp(cfg_name, "abc_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.abc_x = x - (x % 4);
THEME.abc_y = y;
}
}
else if (strcmp(cfg_name, "count_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.count_x = x - (x % 4);
THEME.count_y = y;
}
}
else if (strcmp(cfg_name, "carousel_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.carousel_x = x - (x % 4);
THEME.carousel_y = y;
}
}
else if (strcmp(cfg_name, "grid_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.grid_x = x - (x % 4);
THEME.grid_y = y;
}
}
else if (strcmp(cfg_name, "sortBarOffset") == 0) {
short x;
if (sscanf(val, "%hd", &x) == 1) {
THEME.sortBarOffset = x;
}
}
else if (strcmp(cfg_name, "info_color") == 0) {
short x,y,z;
if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) {

View File

@ -104,6 +104,17 @@ struct THEME
short battery2_y;
short battery3_y;
short battery4_y;
short favorite_x;
short favorite_y;
short abc_x;
short abc_y;
short grid_x;
short grid_y;
short carousel_x;
short carousel_y;
short count_x;
short count_y;
short sortBarOffset;
// short showPower;
// short showHome;
short setting_x;

View File

@ -3125,14 +3125,14 @@ static int MenuDiscList()
GuiImage favoriteBtnImg_g(&imgfavIcon_gray);
favoriteBtnImg.SetWidescreen(CFG.widescreen);
favoriteBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton favoriteBtn(&favoriteBtnImg_g,&favoriteBtnImg_g, 2, 3, 20, 15, &trigA, &btnSoundOver, &btnClick,1);
GuiButton favoriteBtn(&favoriteBtnImg_g,&favoriteBtnImg_g, 2, 3, THEME.favorite_x, THEME.favorite_y, &trigA, &btnSoundOver, &btnClick,1);
favoriteBtn.SetAlpha(180);
GuiImage abcBtnImg(&imgabcIcon);
abcBtnImg.SetWidescreen(CFG.widescreen);
GuiImage abcBtnImg_g(&imgabcIcon_gray);
abcBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton abcBtn(&abcBtnImg_g,&abcBtnImg_g, 2, 3, 52, 15, &trigA, &btnSoundOver, &btnClick,1);
GuiButton abcBtn(&abcBtnImg_g,&abcBtnImg_g, 2, 3, THEME.abc_x, THEME.abc_y, &trigA, &btnSoundOver, &btnClick,1);
abcBtn.SetAlpha(180);
@ -3140,7 +3140,7 @@ static int MenuDiscList()
countBtnImg.SetWidescreen(CFG.widescreen);
GuiImage countBtnImg_g(&imgplayCountIcon_gray);
countBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton countBtn(&countBtnImg_g,&countBtnImg_g, 2, 3, 84, 15, &trigA, &btnSoundOver, &btnClick,1);
GuiButton countBtn(&countBtnImg_g,&countBtnImg_g, 2, 3, THEME.count_x, THEME.count_y, &trigA, &btnSoundOver, &btnClick,1);
countBtn.SetAlpha(180);
@ -3150,7 +3150,7 @@ static int MenuDiscList()
GuiImage listBtnImg_g(&imgarrangeList_gray);
gridBtnImg_g.SetWidescreen(CFG.widescreen);
listBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton gridBtn(&gridBtnImg_g,&gridBtnImg_g, 2, 3, 116, 15, &trigA, &btnSoundOver, &btnClick,1);
GuiButton gridBtn(&gridBtnImg_g,&gridBtnImg_g, 2, 3, THEME.grid_x, THEME.grid_y, &trigA, &btnSoundOver, &btnClick,1);
gridBtn.SetAlpha(180);
if (Settings.gameDisplay==grid){gridBtn.SetImage(&listBtnImg_g);
gridBtn.SetImageOver(&listBtnImg_g);}
@ -3159,7 +3159,7 @@ static int MenuDiscList()
carosselleBtnImg.SetWidescreen(CFG.widescreen);
GuiImage carosselleBtnImg_g(&imgarrangeCarosselle_gray);
carosselleBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton carosselleBtn(&carosselleBtnImg_g,&carosselleBtnImg_g, 2, 3, 148, 15, &trigA, &btnSoundOver, &btnClick,1);
GuiButton carosselleBtn(&carosselleBtnImg_g,&carosselleBtnImg_g, 2, 3, THEME.carousel_x, THEME.carousel_y, &trigA, &btnSoundOver, &btnClick,1);
carosselleBtn.SetAlpha(180);
if (Settings.fave)
@ -3181,19 +3181,19 @@ static int MenuDiscList()
{
if(CFG.widescreen)
{
favoriteBtn.SetPosition(-80,13);
abcBtn.SetPosition(-48,13);
countBtn.SetPosition(-16,13);
gridBtn.SetPosition(16,13);
carosselleBtn.SetPosition(48,13);
favoriteBtn.SetPosition(THEME.favorite_x-THEME.sortBarOffset, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-THEME.sortBarOffset, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-THEME.sortBarOffset, THEME.count_y);
gridBtn.SetPosition(THEME.grid_x-THEME.sortBarOffset, THEME.grid_y);
carosselleBtn.SetPosition(THEME.carousel_x-THEME.sortBarOffset, THEME.carousel_y);
}
else
{
favoriteBtn.SetPosition(-100,13);
abcBtn.SetPosition(-60,13);
countBtn.SetPosition(-20,13);
gridBtn.SetPosition(20,13);
carosselleBtn.SetPosition(60,13);
favoriteBtn.SetPosition(THEME.favorite_x-20-THEME.sortBarOffset, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-12-THEME.sortBarOffset, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-4-THEME.sortBarOffset, THEME.count_y);
gridBtn.SetPosition(THEME.grid_x+4-THEME.sortBarOffset, THEME.grid_y);
carosselleBtn.SetPosition(THEME.carousel_x+12-THEME.sortBarOffset, THEME.carousel_y);
}
}
@ -3201,19 +3201,19 @@ static int MenuDiscList()
{
if(CFG.widescreen)
{
favoriteBtn.SetPosition(20,13);
abcBtn.SetPosition(52,13);
countBtn.SetPosition(84,13);
gridBtn.SetPosition(116,13);
carosselleBtn.SetPosition(148,13);
favoriteBtn.SetPosition(THEME.favorite_x, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x, THEME.abc_y);
countBtn.SetPosition(THEME.count_x, THEME.count_y);
gridBtn.SetPosition(THEME.grid_x, THEME.grid_y);
carosselleBtn.SetPosition(THEME.carousel_x, THEME.carousel_y);
}
else
{
favoriteBtn.SetPosition(0,13);
abcBtn.SetPosition(40,13);
countBtn.SetPosition(80,13);
gridBtn.SetPosition(120,13);
carosselleBtn.SetPosition(160,13);
favoriteBtn.SetPosition(THEME.favorite_x-20, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-12, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-4, THEME.count_y);
gridBtn.SetPosition(THEME.grid_x+4, THEME.grid_y);
carosselleBtn.SetPosition(THEME.carousel_x+12, THEME.carousel_y);
}
}
@ -3597,20 +3597,20 @@ static int MenuDiscList()
gridBtn.SetImageOver(&listBtnImg_g);
if(CFG.widescreen)
{
favoriteBtn.SetPosition(-80,13);
abcBtn.SetPosition(-48,13);
countBtn.SetPosition(-16,13);
gridBtn.SetPosition(16,13);
carosselleBtn.SetPosition(48,13);
favoriteBtn.SetPosition(THEME.favorite_x-THEME.sortBarOffset, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-THEME.sortBarOffset, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-THEME.sortBarOffset, THEME.count_y);
gridBtn.SetPosition(THEME.grid_x-THEME.sortBarOffset, THEME.grid_y);
carosselleBtn.SetPosition(THEME.carousel_x-THEME.sortBarOffset, THEME.carousel_y);
}
else
{
favoriteBtn.SetPosition(-100,13);
abcBtn.SetPosition(-60,13);
countBtn.SetPosition(-20,13);
gridBtn.SetPosition(20,13);
carosselleBtn.SetPosition(60,13);
}
favoriteBtn.SetPosition(THEME.favorite_x-20-THEME.sortBarOffset, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-12-THEME.sortBarOffset, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-4-THEME.sortBarOffset, THEME.count_y);
gridBtn.SetPosition(THEME.grid_x+4-THEME.sortBarOffset, THEME.grid_y);
carosselleBtn.SetPosition(THEME.carousel_x+12-THEME.sortBarOffset, THEME.carousel_y);
}
if((Settings.hddinfo == hr12)||(Settings.hddinfo == hr24)) {
clockTime.SetPosition(THEME.clock_x, THEME.clock_y+3);
clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y+3);
@ -3633,19 +3633,19 @@ static int MenuDiscList()
gridBtn.SetImageOver(&gridBtnImg_g);
if(CFG.widescreen)
{
favoriteBtn.SetPosition(20,15);
abcBtn.SetPosition(52,15);
countBtn.SetPosition(84,15);
gridBtn.SetPosition(116,15);
carosselleBtn.SetPosition(148,15);
favoriteBtn.SetPosition(THEME.favorite_x, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x, THEME.abc_y);
countBtn.SetPosition(THEME.count_x, THEME.count_y);
gridBtn.SetPosition(THEME.grid_x, THEME.grid_y);
carosselleBtn.SetPosition(THEME.carousel_x, THEME.carousel_y);
}
else
{
favoriteBtn.SetPosition(0,13);
abcBtn.SetPosition(40,13);
countBtn.SetPosition(80,13);
gridBtn.SetPosition(120,13);
carosselleBtn.SetPosition(160,13);
favoriteBtn.SetPosition(THEME.favorite_x-20, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-12, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-4, THEME.count_y);
gridBtn.SetPosition(THEME.grid_x+4, THEME.grid_y);
carosselleBtn.SetPosition(THEME.carousel_x+12, THEME.carousel_y);
}
if((Settings.hddinfo == hr12)||(Settings.hddinfo == hr24)) {