mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-19 17:59:16 +01:00
added clock_color, settingstext_color, gamegrid_coords, and gamecarousel_coords. settings color affects every customoptionbrowser text. gamegrid and gamecarousel coords are 4 variables. the first 2 are x/y. the second really just mover the arrows in relation to the gameboxes for now.
This commit is contained in:
parent
550b792db9
commit
99cd6f420e
52
source/cfg.c
52
source/cfg.c
@ -259,6 +259,20 @@ void CFG_Default(int widescreen) // -1 = non forced Mode
|
|||||||
THEME.selection_w = 396;
|
THEME.selection_w = 396;
|
||||||
THEME.selection_h = 280;
|
THEME.selection_h = 280;
|
||||||
THEME.batteryUnused = 70;
|
THEME.batteryUnused = 70;
|
||||||
|
THEME.gamegrid_w = 640;
|
||||||
|
THEME.gamegrid_h = 400;
|
||||||
|
THEME.gamegrid_x = 0;
|
||||||
|
THEME.gamegrid_y = 20;
|
||||||
|
THEME.gamecarousel_w = 640;
|
||||||
|
THEME.gamecarousel_h = 400;
|
||||||
|
THEME.gamecarousel_x = 0;
|
||||||
|
THEME.gamecarousel_y = -20;
|
||||||
|
THEME.clock_r = 138;
|
||||||
|
THEME.clock_g = 138;
|
||||||
|
THEME.clock_b = 138;
|
||||||
|
THEME.settingsTxt_r = 0;
|
||||||
|
THEME.settingsTxt_g = 0;
|
||||||
|
THEME.settingsTxt_b = 0;
|
||||||
THEME.cover_x = 26;
|
THEME.cover_x = 26;
|
||||||
THEME.cover_y = 55;
|
THEME.cover_y = 55;
|
||||||
THEME.showID = 1;
|
THEME.showID = 1;
|
||||||
@ -547,6 +561,26 @@ void theme_set(char *name, char *val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(strcmp(cfg_name, "gamegrid_coords") == 0) {
|
||||||
|
int x,y,w,h;
|
||||||
|
if (sscanf(val, "%d,%d,%d,%d", &x, &y, &w, &h) == 4) {
|
||||||
|
THEME.gamegrid_x = x - (x % 4);
|
||||||
|
THEME.gamegrid_y = y;
|
||||||
|
THEME.gamegrid_w = w;
|
||||||
|
THEME.gamegrid_h = h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strcmp(cfg_name, "gamecarousel_coords") == 0) {
|
||||||
|
int x,y,w,h;
|
||||||
|
if (sscanf(val, "%d,%d,%d,%d", &x, &y, &w, &h) == 4) {
|
||||||
|
THEME.gamecarousel_x = x - (x % 4);
|
||||||
|
THEME.gamecarousel_y = y;
|
||||||
|
THEME.gamecarousel_w = w;
|
||||||
|
THEME.gamecarousel_h = h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if (strcmp(cfg_name, "covers_coords") == 0) {
|
else if (strcmp(cfg_name, "covers_coords") == 0) {
|
||||||
short x,y;
|
short x,y;
|
||||||
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
|
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
|
||||||
@ -749,6 +783,24 @@ void theme_set(char *name, char *val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (strcmp(cfg_name, "clock_color") == 0) {
|
||||||
|
short x,y,z;
|
||||||
|
if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) {
|
||||||
|
THEME.clock_r = x;
|
||||||
|
THEME.clock_g = y;
|
||||||
|
THEME.clock_b = z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (strcmp(cfg_name, "settingstext_color") == 0) {
|
||||||
|
short x,y,z;
|
||||||
|
if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) {
|
||||||
|
THEME.settingsTxt_r = x;
|
||||||
|
THEME.settingsTxt_g = y;
|
||||||
|
THEME.settingsTxt_b = z;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if (strcmp(cfg_name, "pagesize") == 0) {
|
else if (strcmp(cfg_name, "pagesize") == 0) {
|
||||||
short x;
|
short x;
|
||||||
if (sscanf(val, "%hd", &x) == 1) {
|
if (sscanf(val, "%hd", &x) == 1) {
|
||||||
|
14
source/cfg.h
14
source/cfg.h
@ -83,6 +83,14 @@ struct THEME
|
|||||||
int selection_y;
|
int selection_y;
|
||||||
int selection_w;
|
int selection_w;
|
||||||
int selection_h;
|
int selection_h;
|
||||||
|
int gamegrid_x;
|
||||||
|
int gamegrid_y;
|
||||||
|
int gamegrid_w;
|
||||||
|
int gamegrid_h;
|
||||||
|
int gamecarousel_x;
|
||||||
|
int gamecarousel_y;
|
||||||
|
int gamecarousel_w;
|
||||||
|
int gamecarousel_h;
|
||||||
short cover_x;
|
short cover_x;
|
||||||
short cover_y;
|
short cover_y;
|
||||||
short showID;
|
short showID;
|
||||||
@ -141,6 +149,12 @@ struct THEME
|
|||||||
short prompttxt_r;
|
short prompttxt_r;
|
||||||
short prompttxt_g;
|
short prompttxt_g;
|
||||||
short prompttxt_b;
|
short prompttxt_b;
|
||||||
|
short settingsTxt_r;
|
||||||
|
short settingsTxt_g;
|
||||||
|
short settingsTxt_b;
|
||||||
|
short clock_r;
|
||||||
|
short clock_g;
|
||||||
|
short clock_b;
|
||||||
short clock_x;
|
short clock_x;
|
||||||
short clock_y;
|
short clock_y;
|
||||||
short clockAlign;
|
short clockAlign;
|
||||||
|
@ -8,8 +8,10 @@
|
|||||||
|
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "../wpad.h"
|
#include "../wpad.h"
|
||||||
|
#include "../cfg.h"
|
||||||
#include "gui_customoptionbrowser.h"
|
#include "gui_customoptionbrowser.h"
|
||||||
|
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
@ -182,16 +184,16 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
|
|||||||
|
|
||||||
for(int i=0; i < size; i++)
|
for(int i=0; i < size; i++)
|
||||||
{
|
{
|
||||||
optionTxt[i] = new GuiText(options->GetName(i), 20, (GXColor){0, 0, 0, 0xff});
|
optionTxt[i] = new GuiText(options->GetName(i), 20, (GXColor){THEME.settingsTxt_r, THEME.settingsTxt_g, THEME.settingsTxt_b, 0xff});
|
||||||
optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
optionTxt[i]->SetPosition(24,0);
|
optionTxt[i]->SetPosition(24,0);
|
||||||
|
|
||||||
optionBg[i] = new GuiImage(bgOptionsEntry);
|
optionBg[i] = new GuiImage(bgOptionsEntry);
|
||||||
|
|
||||||
optionVal[i] = new GuiText(NULL, 20, (GXColor){0, 0, 0, 0xff});
|
optionVal[i] = new GuiText(NULL, 20, (GXColor){THEME.settingsTxt_r, THEME.settingsTxt_g, THEME.settingsTxt_b, 0xff});
|
||||||
optionVal[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
optionVal[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
|
|
||||||
optionValOver[i] = new GuiText(NULL, 20, (GXColor){0, 0, 0, 0xff});
|
optionValOver[i] = new GuiText(NULL, 20, (GXColor){THEME.settingsTxt_r, THEME.settingsTxt_g, THEME.settingsTxt_b, 0xff});
|
||||||
optionValOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
optionValOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
|
|
||||||
optionBtn[i] = new GuiButton(width,GAMESELECTSIZE);//(width-28,GAMESELECTSIZE);
|
optionBtn[i] = new GuiButton(width,GAMESELECTSIZE);//(width-28,GAMESELECTSIZE);
|
||||||
|
@ -125,8 +125,8 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int gameCnt, const ch
|
|||||||
game[i]->SetImage(coverImg[i]);
|
game[i]->SetImage(coverImg[i]);
|
||||||
coverImg[i]->SetParent(game[i]);
|
coverImg[i]->SetParent(game[i]);
|
||||||
coverImg[i]->SetPosition(-10,-35);
|
coverImg[i]->SetPosition(-10,-35);
|
||||||
if (i<4)game[i]->SetPosition(117+i*110,25);
|
if (i<4)game[i]->SetPosition((117+i*110)+THEME.gamegrid_x,25+THEME.gamegrid_y);
|
||||||
if (i>3)game[i]->SetPosition(117+(i-4)*110,185);
|
if (i>3)game[i]->SetPosition((117+(i-4)*110)+THEME.gamegrid_x,185+THEME.gamegrid_y);
|
||||||
game[i]->SetRumble(false);
|
game[i]->SetRumble(false);
|
||||||
game[i]->SetTrigger(trigA);
|
game[i]->SetTrigger(trigA);
|
||||||
game[i]->SetSoundOver(btnSoundOver);
|
game[i]->SetSoundOver(btnSoundOver);
|
||||||
|
@ -3274,22 +3274,23 @@ static int MenuDiscList()
|
|||||||
gameBrowser.SetPosition(THEME.selection_x, THEME.selection_y);
|
gameBrowser.SetPosition(THEME.selection_x, THEME.selection_y);
|
||||||
gameBrowser.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
gameBrowser.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
||||||
|
|
||||||
GuiGameGrid gameGrid(640,400, gameList, gameCnt, CFG.theme_path, bg_options_png, 0, 0);
|
GuiGameGrid gameGrid(THEME.gamegrid_w,THEME.gamegrid_h, gameList, gameCnt, CFG.theme_path, bg_options_png, 0, 0);
|
||||||
gameGrid.SetPosition(0,20);
|
gameGrid.SetPosition(THEME.gamegrid_x,THEME.gamegrid_y);
|
||||||
gameGrid.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
gameGrid.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
||||||
|
|
||||||
|
//GuiGameCarousel gameCarousel(THEME.gamecarousel_w, THEME.gamecarousel_h, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset);
|
||||||
GuiGameCarousel gameCarousel(640, 400, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset);
|
GuiGameCarousel gameCarousel(640, 400, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset);
|
||||||
gameCarousel.SetPosition(0,-20);
|
gameCarousel.SetPosition(THEME.gamecarousel_x,THEME.gamecarousel_y);
|
||||||
gameCarousel.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
gameCarousel.SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
|
||||||
|
|
||||||
GuiText clockTimeBack("88:88", 40, (GXColor){138, 138, 138, 40});
|
GuiText clockTimeBack("88:88", 40, (GXColor){THEME.clock_r, THEME.clock_g, THEME.clock_b, 40});
|
||||||
clockTimeBack.SetAlignment(THEME.clockAlign, ALIGN_TOP);
|
clockTimeBack.SetAlignment(THEME.clockAlign, ALIGN_TOP);
|
||||||
clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y);
|
clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y);
|
||||||
clockTimeBack.SetFont(fontClock);
|
clockTimeBack.SetFont(fontClock);
|
||||||
if (Settings.gameDisplay==grid || Settings.gameDisplay==carousel) {
|
if (Settings.gameDisplay==grid || Settings.gameDisplay==carousel) {
|
||||||
clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y+3);
|
clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y+3);
|
||||||
}
|
}
|
||||||
GuiText clockTime(theTime, 40, (GXColor){138, 138, 138, 240});
|
GuiText clockTime(theTime, 40, (GXColor){THEME.clock_r, THEME.clock_g, THEME.clock_b, 240});
|
||||||
clockTime.SetAlignment(THEME.clockAlign, ALIGN_TOP);
|
clockTime.SetAlignment(THEME.clockAlign, ALIGN_TOP);
|
||||||
clockTime.SetPosition(THEME.clock_x, THEME.clock_y);
|
clockTime.SetPosition(THEME.clock_x, THEME.clock_y);
|
||||||
clockTime.SetFont(fontClock);
|
clockTime.SetFont(fontClock);
|
||||||
|
Loading…
Reference in New Issue
Block a user