*add scrolling Text to the GuiCostomOptionBrowser (now shown full Paths)

*add GuiText::SetTextf(format, ...); Set formatet text like printf
This commit is contained in:
ardi@ist-einmalig.de 2009-05-29 13:20:28 +00:00
parent cf1a8fb5a0
commit a5ec5c9d63
8 changed files with 710 additions and 663 deletions

View File

@ -439,13 +439,16 @@ void FreeTypeGX::loadGlyphData(FT_Bitmap *bmp, ftgxCharData *charData) {
*/ */
int16_t FreeTypeGX::getStyleOffsetWidth(uint16_t width, uint16_t format) { int16_t FreeTypeGX::getStyleOffsetWidth(uint16_t width, uint16_t format) {
if (format & FTGX_JUSTIFY_LEFT ) { switch(format & FTGX_JUSTIFY_MASK)
{
case FTGX_JUSTIFY_LEFT:
return 0; return 0;
}
else if (format & FTGX_JUSTIFY_CENTER ) { default:
case FTGX_JUSTIFY_CENTER:
return -(width >> 1); return -(width >> 1);
}
else if (format & FTGX_JUSTIFY_RIGHT ) { case FTGX_JUSTIFY_RIGHT:
return -width; return -width;
} }

View File

@ -201,7 +201,7 @@ int subfoldercheck(char * directory);
//Astidof - Begin of modification //Astidof - Begin of modification
enum { enum {
ConsoleLangDefault, ConsoleLangDefault=0,
jap, jap,
eng, eng,
ger, ger,
@ -211,21 +211,25 @@ enum {
dut, dut,
schin, schin,
tchin, tchin,
kor kor,
settings_language_max // always the last entry
}; };
enum { enum {
systemdefault, systemdefault=0,
discdefault, discdefault,
patch, patch,
pal50, pal50,
pal60, pal60,
ntsc ntsc,
settings_video_max // always the last entry
}; };
enum { enum {
off, off=0,
on, on,
settings_off_on_max // always the last entry
}; };
enum { enum {
@ -233,40 +237,45 @@ enum {
GameRegion, GameRegion,
Both, Both,
Neither, Neither,
settings_sinfo_max // always the last entry
}; };
enum { enum {
i249, i249=0,
i222, i222,
}; };
enum { enum {
ios249, ios249=0,
ios222, ios222,
settings_cios_max // always the last entry
}; };
enum { enum {
hr12, hr12=0,
hr24, hr24,
Off, Off,
settings_clock_max // always the last entry
}; };
enum { enum {
all, all=0,
pcount, pcount,
}; };
enum { enum {
RumbleOff, RumbleOff=0,
RumbleOn, RumbleOn,
settings_rumble_max // always the last entry
}; };
enum { enum {
TooltipsOff, TooltipsOff=0,
TooltipsOn, TooltipsOn,
settings_tooltips_max // always the last entry
}; };
enum { enum {
v10, v10=0,
v20, v20,
v30, v30,
v40, v40,
@ -277,27 +286,35 @@ enum {
v90, v90,
v100, v100,
v0, v0,
settings_volume_max // always the last entry
}; };
enum { enum {
no, no=0,
yes, yes,
sysmenu, sysmenu,
wtf, wtf,
disk3d, disk3d,
settings_xflip_max // always the last entry
}; };
enum { enum {
us, us=0,
dvorak, dvorak,
euro, euro,
azerty, azerty,
settings_keyset_max // always the last entry
}; };
enum { enum {
list, list,
grid, grid,
carousel, carousel,
}; };
enum {
scrollDefault,
scrollMarquee,
settings_scrolleffect_max // always the last entry
};
struct SSettings { struct SSettings {
int video; int video;
int language; int language;

View File

@ -659,6 +659,7 @@ class GuiText : public GuiElement
//!Sets the text of the GuiText element //!Sets the text of the GuiText element
//!\param t Text //!\param t Text
void SetText(const char * t); void SetText(const char * t);
void SetTextf(const char *format, ...) __attribute__((format(printf,2,3)));
//!Sets up preset values to be used by GuiText(t) //!Sets up preset values to be used by GuiText(t)
//!Useful when printing multiple text elements, all with the same attributes set //!Useful when printing multiple text elements, all with the same attributes set
//!\param sz Font size //!\param sz Font size

View File

@ -15,8 +15,68 @@
#define GAMESELECTSIZE 30 #define GAMESELECTSIZE 30
static int scrollbaron = 0;
int coL2; customOptionList::customOptionList(int size)
{
name = new char * [size];
value = new char * [size];
for (int i = 0; i < size; i++)
{
name[i] = 0;
value[i] = 0;
}
length = size;
changed = false;
}
customOptionList::~customOptionList()
{
for (int i = 0; i < length; i++)
{
free(name[i]);
free(value[i]);
}
delete [] name;
delete [] value;
}
void customOptionList::SetName(int i, const char *format, ...)
{
if(i >= 0 && i < length)
{
if(name[i]) free(name[i]);
name[i] = 0;
va_list va;
va_start(va, format);
vasprintf(&name[i], format, va);
va_end(va);
changed = true;
}
}
void customOptionList::SetValue(int i, const char *format, ...)
{
if(i >= 0 && i < length)
{
char *tmp=0;
va_list va;
va_start(va, format);
vasprintf(&tmp, format, va);
va_end(va);
if(tmp)
{
if(value[i] && !strcmp(tmp, value[i]))
free(tmp);
else
{
free(value[i]);
value[i] = tmp;
changed = true;
}
}
}
}
//int vol; //int vol;
extern const int vol; extern const int vol;
/** /**
@ -27,7 +87,7 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
width = w; width = w;
height = h; height = h;
options = l; options = l;
size = ((l->length > PAGESIZE)? PAGESIZE: l->length); size = ((l->GetLength() > PAGESIZE)? PAGESIZE: l->GetLength());
scrollbaron = scrollon; scrollbaron = scrollon;
selectable = true; selectable = true;
listOffset = this->FindMenuItem(-1, 1); listOffset = this->FindMenuItem(-1, 1);
@ -115,13 +175,14 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
optionIndex = new int[size]; optionIndex = new int[size];
optionVal = new GuiText * [size]; optionVal = new GuiText * [size];
optionValOver = new GuiText * [size];
optionBtn = new GuiButton * [size]; optionBtn = new GuiButton * [size];
optionTxt = new GuiText * [size]; optionTxt = new GuiText * [size];
optionBg = new GuiImage * [size]; optionBg = new GuiImage * [size];
for(int i=0; i < size; i++) for(int i=0; i < size; i++)
{ {
optionTxt[i] = new GuiText(options->name[i], 20, (GXColor){0, 0, 0, 0xff}); optionTxt[i] = new GuiText(options->GetName(i), 20, (GXColor){0, 0, 0, 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);
@ -129,12 +190,15 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
optionVal[i] = new GuiText(NULL, 20, (GXColor){0, 0, 0, 0xff}); optionVal[i] = new GuiText(NULL, 20, (GXColor){0, 0, 0, 0xff});
optionVal[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); optionVal[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
optionVal[i]->SetPosition(250,0);
optionValOver[i] = new GuiText(NULL, 20, (GXColor){0, 0, 0, 0xff});
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);
optionBtn[i]->SetParent(this); optionBtn[i]->SetParent(this);
optionBtn[i]->SetLabel(optionTxt[i], 0); optionBtn[i]->SetLabel(optionTxt[i], 0);
optionBtn[i]->SetLabel(optionVal[i], 1); optionBtn[i]->SetLabel(optionVal[i], 1);
optionBtn[i]->SetLabelOver(optionValOver[i], 1);
optionBtn[i]->SetImageOver(optionBg[i]); optionBtn[i]->SetImageOver(optionBg[i]);
optionBtn[i]->SetPosition(10,GAMESELECTSIZE*i+4); optionBtn[i]->SetPosition(10,GAMESELECTSIZE*i+4);
optionBtn[i]->SetRumble(false); optionBtn[i]->SetRumble(false);
@ -142,6 +206,7 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
optionBtn[i]->SetSoundClick(btnSoundClick); optionBtn[i]->SetSoundClick(btnSoundClick);
} }
UpdateListEntries();
} }
/** /**
@ -180,23 +245,18 @@ GuiCustomOptionBrowser::~GuiCustomOptionBrowser()
{ {
delete optionTxt[i]; delete optionTxt[i];
delete optionVal[i]; delete optionVal[i];
delete optionValOver[i];
delete optionBg[i]; delete optionBg[i];
delete optionBtn[i]; delete optionBtn[i];
} }
delete [] optionIndex; delete [] optionIndex;
delete [] optionVal; delete [] optionVal;
delete [] optionValOver;
delete [] optionBtn; delete [] optionBtn;
delete [] optionTxt; delete [] optionTxt;
delete [] optionBg; delete [] optionBg;
} }
void GuiCustomOptionBrowser::SetCol2Position(int x)
{
LOCK(this);
for(int i = 0; i < size; i++)
optionVal[i]->SetPosition(x,0);
}
void GuiCustomOptionBrowser::SetFocus(int f) void GuiCustomOptionBrowser::SetFocus(int f)
{ {
LOCK(this); LOCK(this);
@ -263,10 +323,10 @@ int GuiCustomOptionBrowser::FindMenuItem(int currentItem, int direction)
{ {
int nextItem = currentItem + direction; int nextItem = currentItem + direction;
if(nextItem < 0 || nextItem >= options->length) if(nextItem < 0 || nextItem >= options->GetLength())
return -1; return -1;
if(strlen(options->name[nextItem]) > 0) if(strlen(options->GetName(nextItem)) > 0)
return nextItem; return nextItem;
else else
return FindMenuItem(nextItem, direction); return FindMenuItem(nextItem, direction);
@ -304,31 +364,12 @@ void GuiCustomOptionBrowser::Draw()
} }
this->UpdateEffects(); this->UpdateEffects();
} }
void GuiCustomOptionBrowser::UpdateListEntries()
void GuiCustomOptionBrowser::Update(GuiTrigger * t)
{ {
LOCK(this); if(listOffset<0) listOffset = this->FindMenuItem(-1, 1);
int next, prev, lang = options->length; int next = listOffset;
if(state == STATE_DISABLED || !t)
return;
// 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);
arrowDownBtn->Update(t);
scrollbarBoxBtn->Update(t);
}
next = listOffset;
int maxNameWidth = 0;
for(int i=0; i < size; i++) for(int i=0; i < size; i++)
{ {
if(next >= 0) if(next >= 0)
@ -339,9 +380,11 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
optionBtn[i]->SetState(STATE_DEFAULT); optionBtn[i]->SetState(STATE_DEFAULT);
} }
optionTxt[i]->SetText(options->name[next]); optionTxt[i]->SetText(options->GetName(next));
optionVal[i]->SetText(options->value[next]); if(maxNameWidth < optionTxt[i]->GetTextWidth())
optionVal[i]->SetPosition(coL2, 0); maxNameWidth = optionTxt[i]->GetTextWidth();
optionVal[i]->SetText(options->GetValue(next));
optionValOver[i]->SetText(options->GetValue(next));
optionIndex[i] = next; optionIndex[i] = next;
next = this->FindMenuItem(next, 1); next = this->FindMenuItem(next, 1);
@ -351,6 +394,52 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
optionBtn[i]->SetVisible(false); optionBtn[i]->SetVisible(false);
optionBtn[i]->SetState(STATE_DISABLED); optionBtn[i]->SetState(STATE_DISABLED);
} }
}
if(coL2 < (24+maxNameWidth+16))
coL2 = 24+maxNameWidth+16;
for(int i=0; i < size; i++)
{
if(optionBtn[i]->GetState() != STATE_DISABLED)
{
optionVal[i]->SetPosition(coL2,0);
optionVal[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::DOTTED);
optionValOver[i]->SetPosition(coL2,0);
optionValOver[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::SCROLL);
}
}
}
void GuiCustomOptionBrowser::Update(GuiTrigger * t)
{
LOCK(this);
int next, prev, lang = options->GetLength();
if(state == STATE_DISABLED || !t)
return;
if(options->IsChanged())
UpdateListEntries();
int old_listOffset = listOffset;
// 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);
arrowDownBtn->Update(t);
scrollbarBoxBtn->Update(t);
}
next = listOffset;
for(int i=0; i < size; i++)
{
if(next >= 0)
next = this->FindMenuItem(next, 1);
if(focus) if(focus)
{ {
@ -374,7 +463,8 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
if(!focus) if(!focus)
return; // skip navigation return; // skip navigation
if (scrollbaron == 1) { if (scrollbaron == 1)
{
if (t->Down() || if (t->Down() ||
arrowDownBtn->GetState() == STATE_CLICKED || ////////////////////////////////////////////down arrowDownBtn->GetState() == STATE_CLICKED || ////////////////////////////////////////////down
@ -398,20 +488,19 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
} }
scrollbarBoxBtn->Draw(); scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay); usleep(10000 * scrolldelay);
}
WPAD_ScanPads();
}WPAD_ScanPads();
u8 cnt, buttons = NULL; u8 cnt, buttons = NULL;
/* Get pressed buttons */ /* Get pressed buttons */
for (cnt = 0; cnt < 4; cnt++) for (cnt = 0; cnt < 4; cnt++)
buttons |= WPAD_ButtonsHeld(cnt); buttons |= WPAD_ButtonsHeld(cnt);
if (buttons == WPAD_BUTTON_A) { if (buttons == WPAD_BUTTON_A)
{
} else { }
arrowDownBtn->ResetState(); else
{
arrowDownBtn->ResetState();
} }
} }
else if(t->Up() || else if(t->Up() ||
arrowUpBtn->GetState() == STATE_CLICKED || ////////////////////////////////////////////up arrowUpBtn->GetState() == STATE_CLICKED || ////////////////////////////////////////////up
@ -436,22 +525,24 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
usleep(10000 * scrolldelay); usleep(10000 * scrolldelay);
}WPAD_ScanPads(); }
WPAD_ScanPads();
u8 cnt, buttons = NULL; u8 cnt, buttons = NULL;
/* Get pressed buttons */ /* Get pressed buttons */
for (cnt = 0; cnt < 4; cnt++) for (cnt = 0; cnt < 4; cnt++)
buttons |= WPAD_ButtonsHeld(cnt); buttons |= WPAD_ButtonsHeld(cnt);
if (buttons == WPAD_BUTTON_A) { if (buttons == WPAD_BUTTON_A)
{
} else { }
else
{
arrowUpBtn->ResetState(); arrowUpBtn->ResetState();
} }
} }
if(scrollbarBoxBtn->GetState() == STATE_HELD && if(scrollbarBoxBtn->GetState() == STATE_HELD &&
scrollbarBoxBtn->GetStateChan() == t->chan && scrollbarBoxBtn->GetStateChan() == t->chan &&
t->wpad.ir.valid && options->length > size) t->wpad.ir.valid && options->GetLength() > size)
{ {
scrollbarBoxBtn->SetPosition(width/2-18+7,0); scrollbarBoxBtn->SetPosition(width/2-18+7,0);
int position = t->wpad.ir.y - 50 - scrollbarBoxBtn->GetTop(); int position = t->wpad.ir.y - 50 - scrollbarBoxBtn->GetTop();
@ -495,10 +586,9 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
listOffset = 0; listOffset = 0;
} }
} }
}
} else { else
{
if(t->Down()) if(t->Down())
{ {
next = this->FindMenuItem(optionIndex[selectedItem], 1); next = this->FindMenuItem(optionIndex[selectedItem], 1);
@ -538,6 +628,8 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
} }
} }
} }
if(old_listOffset != listOffset)
UpdateListEntries();
if(updateCB) if(updateCB)
updateCB(this); updateCB(this);

View File

@ -1,31 +1,33 @@
#include "gui.h" #include "gui.h"
extern int SetValue(int i, const char *format, ...) __attribute__((format(printf,2,3)));
class customOptionList { class customOptionList {
public: public:
customOptionList(int size) { customOptionList(int size);
name = new char * [size]; ~customOptionList();
value = new char * [size]; void SetName(int i, const char *format, ...) __attribute__((format (printf, 3, 4)));
for (int i = 0; i < size; i++) const char *GetName(int i)
{ {
name[i] = new char[40]; if(i >= 0 && i < length && name[i])
value[i] = new char[40]; return name[i];
else
return "";
} }
length = size; void SetValue(int i, const char *format, ...) __attribute__((format (printf, 3, 4)));
}; const char *GetValue(int i)
~customOptionList(){
for (int i = 0; i < length; i++)
{ {
delete [] name[i]; if(i >= 0 && i < length && value[i])
delete [] value[i]; return value[i];
else
return "";
} }
delete [] name; int GetLength() { return length; }
delete [] value; bool IsChanged() { bool ret = changed; changed = false; return ret;}
}; private:
public:
int length; int length;
char ** name; char ** name;
char ** value; char ** value;
bool changed;
}; };
//!Display a list of menu options //!Display a list of menu options
@ -34,7 +36,6 @@ class GuiCustomOptionBrowser : public GuiElement
public: public:
GuiCustomOptionBrowser(int w, int h, customOptionList * l, const char * themePath, const char *custombg, const u8 *imagebg, int scrollbar, int col2); GuiCustomOptionBrowser(int w, int h, customOptionList * l, const char * themePath, const char *custombg, const u8 *imagebg, int scrollbar, int col2);
~GuiCustomOptionBrowser(); ~GuiCustomOptionBrowser();
void SetCol2Position(int x);
int FindMenuItem(int c, int d); int FindMenuItem(int c, int d);
int GetClickedOption(); int GetClickedOption();
int GetSelectedOption(); int GetSelectedOption();
@ -42,16 +43,20 @@ class GuiCustomOptionBrowser : public GuiElement
void SetFocus(int f); void SetFocus(int f);
void Draw(); void Draw();
void Update(GuiTrigger * t); void Update(GuiTrigger * t);
GuiText ** optionVal;
protected: protected:
void UpdateListEntries();
int selectedItem; int selectedItem;
int listOffset; int listOffset;
int size; int size;
int coL2;
int scrollbaron;
customOptionList * options; customOptionList * options;
int * optionIndex; int * optionIndex;
GuiButton ** optionBtn; GuiButton ** optionBtn;
GuiText ** optionTxt; GuiText ** optionTxt;
GuiText ** optionVal;
GuiText ** optionValOver;
GuiImage ** optionBg; GuiImage ** optionBg;
GuiButton * arrowUpBtn; GuiButton * arrowUpBtn;

View File

@ -333,7 +333,6 @@ void GuiGameBrowser::UpdateListEntries()
game[i]->SetVisible(false); game[i]->SetVisible(false);
game[i]->SetState(STATE_DISABLED); game[i]->SetState(STATE_DISABLED);
} }
// }
} }
} }
@ -437,7 +436,6 @@ void GuiGameBrowser::Update(GuiTrigger * t)
{ {
// move list up by 1 // move list up by 1
listOffset = prev; listOffset = prev;
// UpdateEntries();
} }
else else
{ {
@ -500,10 +498,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
} }
scrollbarBoxBtn->Draw(); scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay); usleep(10000 * scrolldelay);
} }
} }
else if (position2 < position1) else if (position2 < position1)
{ {
@ -603,7 +598,6 @@ void GuiGameBrowser::Update(GuiTrigger * t)
{ {
// move list down by 1 // move list down by 1
listOffset = this->FindMenuItem(listOffset, 1); listOffset = this->FindMenuItem(listOffset, 1);
// UpdateEntries();
} }
else if(game[selectedItem+1]->IsVisible()) else if(game[selectedItem+1]->IsVisible())
{ {
@ -623,7 +617,6 @@ void GuiGameBrowser::Update(GuiTrigger * t)
{ {
// move list up by 1 // move list up by 1
listOffset = prev; listOffset = prev;
// UpdateEntries();
} }
else else
{ {

View File

@ -94,6 +94,18 @@ void GuiText::SetText(const char * t)
scrollPos2 = 0; scrollPos2 = 0;
scrollDelay = 0; scrollDelay = 0;
} }
void GuiText::SetTextf(const char *format, ...)
{
char *tmp=0;
va_list va;
va_start(va, format);
if((vasprintf(&tmp, format, va)>=0) && tmp)
{
this->SetText(tmp);
free(tmp);
}
va_end(va);
}
void GuiText::SetPresets(int sz, GXColor c, int w, int wrap, u16 s, int h, int v) void GuiText::SetPresets(int sz, GXColor c, int w, int wrap, u16 s, int h, int v)
{ {
@ -178,6 +190,9 @@ void GuiText::SetFont(FreeTypeGX *f)
int GuiText::GetTextWidth() int GuiText::GetTextWidth()
{ {
LOCK(this); LOCK(this);
if(!text)
return 0;
int newSize = size*this->GetScale(); int newSize = size*this->GetScale();
if(newSize != currentSize || currentWidescreen != widescreen) if(newSize != currentSize || currentWidescreen != widescreen)

View File

@ -57,12 +57,9 @@ static GuiImageData * pointer[4];
static GuiImage * bgImg = NULL; static GuiImage * bgImg = NULL;
static GuiButton * btnLogo = NULL; static GuiButton * btnLogo = NULL;
static GuiImageData * background = NULL; static GuiImageData * background = NULL;
static char prozent[10] = " "; static GuiText prTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
static char timet[50] = " "; static GuiText timeTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
static char sizeshow[20] = " "; static GuiText sizeTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
static GuiText prTxt(prozent, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
static GuiText timeTxt(prozent, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
static GuiText sizeTxt(sizeshow, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
static GuiText *GameIDTxt = NULL; static GuiText *GameIDTxt = NULL;
static GuiText *GameRegionTxt = NULL; static GuiText *GameRegionTxt = NULL;
static GuiSound * bgMusic = NULL; static GuiSound * bgMusic = NULL;
@ -953,7 +950,6 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
int GameWindowPrompt() int GameWindowPrompt()
{ {
int choice = -1, angle = 0; int choice = -1, angle = 0;
char sizeText[15];
f32 size = 0.0; f32 size = 0.0;
char ID[4]; char ID[4];
char IDFull[7]; char IDFull[7];
@ -1022,9 +1018,9 @@ int GameWindowPrompt()
nameBtn.SetEffectGrow(); nameBtn.SetEffectGrow();
} }
GuiText sizeTxt("", 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{50, 50, 50, 255}); //TODO: get the size here GuiText sizeTxt(NULL, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{50, 50, 50, 255}); //TODO: get the size here
sizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP); sizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
sizeTxt.SetPosition(-110,70); sizeTxt.SetPosition(-60,70);
// GuiImage diskImg; // GuiImage diskImg;
GuiDiskCover diskImg; GuiDiskCover diskImg;
@ -1038,8 +1034,7 @@ int GameWindowPrompt()
diskImg2.SetAngle(angle); diskImg2.SetAngle(angle);
diskImg2.SetBeta(180); diskImg2.SetBeta(180);
char PlayCnt[25]; GuiText playcntTxt(NULL, 18, (GXColor){THEME.info_r, THEME.info_g, THEME.info_b, 255});
GuiText playcntTxt(PlayCnt, 18, (GXColor){THEME.info_r, THEME.info_g, THEME.info_b, 255});
playcntTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); playcntTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
playcntTxt.SetPosition(-115,45); playcntTxt.SetPosition(-115,45);
@ -1156,9 +1151,6 @@ int GameWindowPrompt()
//load disc image based or what game is seleted //load disc image based or what game is seleted
struct discHdr * header = &gameList[gameSelected]; struct discHdr * header = &gameList[gameSelected];
WBFS_GameSize(header->id, &size);
snprintf(sizeText, sizeof(sizeText), "%.2fGB", size); //set size text
snprintf (ID,sizeof(ID),"%c%c%c", header->id[0], header->id[1], header->id[2]); snprintf (ID,sizeof(ID),"%c%c%c", header->id[0], header->id[1], header->id[2]);
snprintf (IDFull,sizeof(IDFull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); snprintf (IDFull,sizeof(IDFull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
@ -1230,7 +1222,9 @@ int GameWindowPrompt()
} }
else else
diskImg.SetImage(diskCover); diskImg.SetImage(diskCover);
sizeTxt.SetText(sizeText);
WBFS_GameSize(header->id, &size);
sizeTxt.SetTextf("%.2fGB", size); //set size text;
nameTxt.SetText(get_title(header)); nameTxt.SetText(get_title(header));
struct Game_NUM* game_num = CFG_get_game_num(header->id); struct Game_NUM* game_num = CFG_get_game_num(header->id);
@ -1241,8 +1235,7 @@ int GameWindowPrompt()
playCount = 0; playCount = 0;
faveChoice = 0; faveChoice = 0;
} }
sprintf(PlayCnt,"%s: %i",LANGUAGE.Plays, playCount); playcntTxt.SetTextf("%s: %i",LANGUAGE.Plays, playCount);
playcntTxt.SetText(PlayCnt);
btnFavoriteImg.SetImage(faveChoice ? &imgFavorite : &imgNotFavorite); btnFavoriteImg.SetImage(faveChoice ? &imgFavorite : &imgNotFavorite);
nameTxt.SetPosition(0, 1); nameTxt.SetPosition(0, 1);
@ -1522,8 +1515,7 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
} }
} }
char timer[20]; GuiText timerTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
GuiText timerTxt(timer, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
timerTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); timerTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
timerTxt.SetPosition(0,160); timerTxt.SetPosition(0,160);
@ -1550,8 +1542,7 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
if(IsDeviceWait) { if(IsDeviceWait) {
while(i >= 0) while(i >= 0)
{ {
sprintf(timer, "%u%s", i,LANGUAGE.secondsleft); timerTxt.SetTextf("%u%s", i,LANGUAGE.secondsleft);
timerTxt.SetText(timer);
VIDEO_WaitVSync(); VIDEO_WaitVSync();
if(Settings.cios == ios222) { if(Settings.cios == ios222) {
ret = IOS_ReloadIOS(222); ret = IOS_ReloadIOS(222);
@ -1725,8 +1716,7 @@ int NetworkInitPromp(int choice2)
} }
if (IP && ret > 0) { if (IP && ret > 0) {
sprintf(msg, "IP: %s", IP); msgTxt.SetTextf("IP: %s", IP);
msgTxt.SetText(msg);
cntMissFiles = 0; cntMissFiles = 0;
u32 i = 0; u32 i = 0;
char filename[11]; char filename[11];
@ -1823,16 +1813,13 @@ ShowProgress (s32 done, s32 total)
//Calculate percentage/size //Calculate percentage/size
f32 percent = (done * 100.0) / total; f32 percent = (done * 100.0) / total;
sprintf(prozent, "%0.2f", percent); prTxt.SetTextf("%0.2f", percent);
prTxt.SetText(prozent);
sprintf(timet,"%s %d:%02d:%02d",LANGUAGE.Timeleft,h,m,s); timeTxt.SetTextf("%s %d:%02d:%02d",LANGUAGE.Timeleft,h,m,s);
timeTxt.SetText(timet);
f32 gamesizedone = gamesize * done/total; f32 gamesizedone = gamesize * done/total;
sprintf(sizeshow,"%0.2fGB/%0.2fGB", gamesizedone, gamesize); sizeTxt.SetTextf("%0.2fGB/%0.2fGB", gamesizedone, gamesize);
sizeTxt.SetText(sizeshow);
if ((Settings.wsprompt == yes) && (CFG.widescreen)){ if ((Settings.wsprompt == yes) && (CFG.widescreen)){
progressbarImg.SetTile((int)(80*done/total));} progressbarImg.SetTile((int)(80*done/total));}
@ -2011,12 +1998,12 @@ ProgressDownloadWindow(int choice2)
GuiText titleTxt(LANGUAGE.Downloadingfile, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255}); GuiText titleTxt(LANGUAGE.Downloadingfile, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,60); titleTxt.SetPosition(0,60);
char msg[25] = " ";
GuiText msgTxt(msg, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255}); GuiText msgTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msgTxt.SetPosition(0,130); msgTxt.SetPosition(0,130);
char msg2[15] = " ";
GuiText msg2Txt(msg2, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255}); GuiText msg2Txt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msg2Txt.SetPosition(0,100); msg2Txt.SetPosition(0,100);
@ -2081,8 +2068,7 @@ ProgressDownloadWindow(int choice2)
while (i < cntMissFiles) { while (i < cntMissFiles) {
sprintf(prozent, "%i%%", 100*i/cntMissFiles); prTxt.SetTextf("%i%%", 100*i/cntMissFiles);
prTxt.SetText(prozent);
if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen
progressbarImg.SetPosition(80,40); progressbarImg.SetPosition(80,40);
@ -2091,10 +2077,8 @@ ProgressDownloadWindow(int choice2)
progressbarImg.SetTile(100*i/cntMissFiles); progressbarImg.SetTile(100*i/cntMissFiles);
} }
sprintf(msg, "%i %s", cntMissFiles - i, LANGUAGE.filesleft); msgTxt.SetTextf("%i %s", cntMissFiles - i, LANGUAGE.filesleft);
msgTxt.SetText(msg); msg2Txt.SetTextf("%s", missingFiles[i]);
sprintf(msg2, "%s", missingFiles[i]);
msg2Txt.SetText(msg2);
//download boxart image //download boxart image
char imgPath[100]; char imgPath[100];
@ -2374,29 +2358,24 @@ ProgressUpdateWindow()
sprintf(msg, "Rev%i %s.", revnumber, LANGUAGE.available); sprintf(msg, "Rev%i %s.", revnumber, LANGUAGE.available);
int choice = WindowPrompt(msg, LANGUAGE.Doyouwanttoupdate, LANGUAGE.Yes, LANGUAGE.No, 0, 0); int choice = WindowPrompt(msg, LANGUAGE.Doyouwanttoupdate, LANGUAGE.Yes, LANGUAGE.No, 0, 0);
if(choice == 1) { if(choice == 1) {
//sprintf(title, "%s", "%s USB Loader GX", LANGUAGE.updating); titleTxt.SetTextf("%s USB Loader GX", LANGUAGE.updating);
sprintf(title, "%s USB Loader GX", LANGUAGE.updating);
titleTxt.SetText(title);
msgTxt.SetPosition(0,100); msgTxt.SetPosition(0,100);
promptWindow.Append(&progressbarEmptyImg); promptWindow.Append(&progressbarEmptyImg);
promptWindow.Append(&progressbarImg); promptWindow.Append(&progressbarImg);
promptWindow.Append(&progressbarOutlineImg); promptWindow.Append(&progressbarOutlineImg);
promptWindow.Append(&prTxt); promptWindow.Append(&prTxt);
sprintf(msg, "Updating to Rev%i", revnumber); msgTxt.SetTextf("Updating to Rev%i", revnumber);
msgTxt.SetText(msg);
int filesize = downloadrev("http://www.techjawa.com/usbloadergx/boot.dol"); int filesize = downloadrev("http://www.techjawa.com/usbloadergx/boot.dol");
if(filesize > 0) { if(filesize > 0) {
pfile = fopen(dolpath, "wb"); pfile = fopen(dolpath, "wb");
for (int i = 0; i < filesize; i += blocksize) { for (int i = 0; i < filesize; i += blocksize) {
sprintf(prozent, "%i%%", 100*i/filesize); prTxt.SetTextf("%i%%", 100*i/filesize);
prTxt.SetText(prozent);
if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen if ((Settings.wsprompt == yes) && (CFG.widescreen)){/////////////adjust for widescreen
progressbarImg.SetTile(80*i/filesize); progressbarImg.SetTile(80*i/filesize);
} else { } else {
progressbarImg.SetTile(100*i/filesize); progressbarImg.SetTile(100*i/filesize);
} }
sprintf(msg2, "%iKB/%iKB", i/1024, filesize/1024); msg2Txt.SetTextf("%iKB/%iKB", i/1024, filesize/1024);
msg2Txt.SetText(msg2);
if(btn1.GetState() == STATE_CLICKED) { if(btn1.GetState() == STATE_CLICKED) {
fclose(pfile); fclose(pfile);
@ -2975,7 +2954,6 @@ static int MenuDiscList()
datagB=0; datagB=0;
int menu = MENU_NONE, dataef=0; int menu = MENU_NONE, dataef=0;
char imgPath[100]; char imgPath[100];
char buf[4];
__Menu_GetEntries(); __Menu_GetEntries();
f32 freespace, used, size = 0.0; f32 freespace, used, size = 0.0;
@ -2986,7 +2964,7 @@ static int MenuDiscList()
//CLOCK //CLOCK
struct tm * timeinfo; struct tm * timeinfo;
char theTime[80]; char theTime[80]="";
time_t lastrawtime=0; time_t lastrawtime=0;
WBFS_DiskSpace(&used, &freespace); WBFS_DiskSpace(&used, &freespace);
@ -3341,8 +3319,7 @@ static int MenuDiscList()
} }
else if (dataed > 0){ else if (dataed > 0){
sprintf(buf, "%i", (dataed-1)); clockTime.SetTextf("%i", (dataed-1));
clockTime.SetText(buf);
} }
} }
@ -3533,9 +3510,7 @@ static int MenuDiscList()
gameBrowser.Reload(gameList, gameCnt);} gameBrowser.Reload(gameList, gameCnt);}
else if (Settings.gameDisplay==grid){ else if (Settings.gameDisplay==grid){
gameGrid.Reload(gameList, gameCnt);} gameGrid.Reload(gameList, gameCnt);}
// gameBrowser.Reload(gameList, gameCnt); gamecntTxt.SetTextf("%s: %i",LANGUAGE.Games, gameCnt);
sprintf(GamesCnt,"%s: %i",LANGUAGE.Games, gameCnt);
gamecntTxt.SetText(GamesCnt);
selectedold = 1; selectedold = 1;
favoriteBtn.ResetState(); favoriteBtn.ResetState();
Settings.fave ? (favoriteBtn.SetImage(&favoriteBtnImg), favoriteBtn.SetAlpha(255)) : (favoriteBtn.SetImage(&favoriteBtnImg_g), favoriteBtn.SetAlpha(180)); Settings.fave ? (favoriteBtn.SetImage(&favoriteBtnImg), favoriteBtn.SetAlpha(255)) : (favoriteBtn.SetImage(&favoriteBtnImg_g), favoriteBtn.SetAlpha(180));
@ -4288,7 +4263,6 @@ static int MenuSettings()
{ {
int menu = MENU_NONE; int menu = MENU_NONE;
int ret; int ret;
char cfgtext[20];
int choice = 0; int choice = 0;
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
@ -4414,10 +4388,9 @@ static int MenuSettings()
btnLogo->SetUpdateCallback(WindowCredits); btnLogo->SetUpdateCallback(WindowCredits);
customOptionList options2(9); customOptionList options2(9);
GuiCustomOptionBrowser optionBrowser2(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 0, 200); GuiCustomOptionBrowser optionBrowser2(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, 0, 150);
optionBrowser2.SetPosition(0, 90); optionBrowser2.SetPosition(0, 90);
optionBrowser2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); optionBrowser2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
optionBrowser2.SetCol2Position(200);
GuiWindow w(screenwidth, screenheight); GuiWindow w(screenwidth, screenheight);
int pageToDisplay = 1; int pageToDisplay = 1;
@ -4427,17 +4400,17 @@ static int MenuSettings()
if ( pageToDisplay == 1) if ( pageToDisplay == 1)
{ {
sprintf(options2.name[0], "%s",LANGUAGE.VideoMode); options2.SetName(0, "%s",LANGUAGE.VideoMode);
sprintf(options2.name[1], "%s",LANGUAGE.VIDTVPatch); options2.SetName(1, "%s",LANGUAGE.VIDTVPatch);
sprintf(options2.name[2], "%s",LANGUAGE.Language); options2.SetName(2, "%s",LANGUAGE.Language);
sprintf(options2.name[3], "Ocarina"); options2.SetName(3, "Ocarina");
sprintf(options2.name[4],"%s", LANGUAGE.Display); options2.SetName(4,"%s", LANGUAGE.Display);
sprintf(options2.name[5],"%s", LANGUAGE.Clock); //CLOCK options2.SetName(5,"%s", LANGUAGE.Clock); //CLOCK
sprintf(options2.name[6],"%s", LANGUAGE.Rumble); //RUMBLE options2.SetName(6,"%s", LANGUAGE.Rumble); //RUMBLE
sprintf(options2.name[7],"%s", LANGUAGE.Volume); options2.SetName(7,"%s", LANGUAGE.Volume);
sprintf(options2.name[8],"%s", LANGUAGE.Tooltips); options2.SetName(8,"%s", LANGUAGE.Tooltips);
HaltGui(); HaltGui();
w.Append(&settingsbackgroundbtn); w.Append(&settingsbackgroundbtn);
@ -4487,15 +4460,15 @@ static int MenuSettings()
mainWindow->Append(&page1Btn); mainWindow->Append(&page1Btn);
mainWindow->Append(&page3Btn); mainWindow->Append(&page3Btn);
sprintf(options2.name[0],"%s", LANGUAGE.Password); options2.SetName(0,"%s", LANGUAGE.Password);
sprintf(options2.name[1],"%s", LANGUAGE.BootStandard); options2.SetName(1,"%s", LANGUAGE.BootStandard);
sprintf(options2.name[2],"%s", LANGUAGE.FlipX); options2.SetName(2,"%s", LANGUAGE.FlipX);
sprintf(options2.name[3],"%s", LANGUAGE.QuickBoot); options2.SetName(3,"%s", LANGUAGE.QuickBoot);
sprintf(options2.name[4],"%s", LANGUAGE.PromptsButtons); options2.SetName(4,"%s", LANGUAGE.PromptsButtons);
sprintf(options2.name[5],"%s", LANGUAGE.Parentalcontrol); options2.SetName(5,"%s", LANGUAGE.Parentalcontrol);
sprintf(options2.name[6],"%s", LANGUAGE.CoverPath); options2.SetName(6,"%s", LANGUAGE.CoverPath);
sprintf(options2.name[7],"%s", LANGUAGE.DiscimagePath); options2.SetName(7,"%s", LANGUAGE.DiscimagePath);
sprintf(options2.name[8],"%s", LANGUAGE.ThemePath); options2.SetName(8,"%s", LANGUAGE.ThemePath);
} }
else if ( pageToDisplay == 3 ) else if ( pageToDisplay == 3 )
{ {
@ -4516,15 +4489,15 @@ static int MenuSettings()
mainWindow->Append(&page3Btn); mainWindow->Append(&page3Btn);
sprintf(options2.name[0], "%s",LANGUAGE.Titlestxtpath); options2.SetName(0, "%s",LANGUAGE.Titlestxtpath);
sprintf(options2.name[1], "%s",LANGUAGE.AppLanguage); options2.SetName(1, "%s",LANGUAGE.AppLanguage);
sprintf(options2.name[2], "%s",LANGUAGE.keyboard); options2.SetName(2, "%s",LANGUAGE.keyboard);
sprintf(options2.name[3], "%s",LANGUAGE.Unicodefix); options2.SetName(3, "%s",LANGUAGE.Unicodefix);
sprintf(options2.name[4], "%s",LANGUAGE.Backgroundmusic); options2.SetName(4, "%s",LANGUAGE.Backgroundmusic);
sprintf(options2.name[5], "%s",LANGUAGE.Wiilight); options2.SetName(5, "%s",LANGUAGE.Wiilight);
sprintf(options2.name[6], "%s",LANGUAGE.Updatepath); options2.SetName(6, "%s",LANGUAGE.Updatepath);
sprintf(options2.name[7], "%s",LANGUAGE.MP3Menu); options2.SetName(7, "%s",LANGUAGE.MP3Menu);
sprintf(options2.name[8], "%s",LANGUAGE.Defaultsettings); options2.SetName(8, "%s",LANGUAGE.Defaultsettings);
} }
while(menu == MENU_NONE) while(menu == MENU_NONE)
@ -4533,77 +4506,77 @@ static int MenuSettings()
if ( pageToDisplay == 1 ) if ( pageToDisplay == 1 )
{ {
if(Settings.video > 5) if(Settings.video >= settings_video_max)
Settings.video = 0; Settings.video = 0;
if(Settings.language > 10) if(Settings.language >= settings_language_max)
Settings.language = 0; Settings.language = 0;
if(Settings.ocarina > 1) if(Settings.ocarina >= settings_off_on_max)
Settings.ocarina = 0; Settings.ocarina = 0;
if(Settings.vpatch > 1) if(Settings.vpatch >= settings_off_on_max)
Settings.vpatch = 0; Settings.vpatch = 0;
if(Settings.sinfo > 3) if(Settings.sinfo >= settings_sinfo_max)
Settings.sinfo = 0; Settings.sinfo = 0;
if(Settings.hddinfo > 2) if(Settings.hddinfo >= settings_clock_max)
Settings.hddinfo = 0; //CLOCK Settings.hddinfo = 0; //CLOCK
if(Settings.rumble > 1) if(Settings.rumble >= settings_rumble_max)
Settings.rumble = 0; //RUMBLE Settings.rumble = 0; //RUMBLE
if(Settings.volume > 10) if(Settings.volume >= settings_volume_max)
Settings.volume = 0; Settings.volume = 0;
if (Settings.tooltips > 1 ) if (Settings.tooltips >= settings_tooltips_max)
Settings.tooltips = 0; Settings.tooltips = 0;
if (Settings.video == discdefault) sprintf (options2.value[0],"%s",LANGUAGE.DiscDefault); if (Settings.video == discdefault) options2.SetValue(0,"%s",LANGUAGE.DiscDefault);
else if (Settings.video == systemdefault) sprintf (options2.value[0],"%s",LANGUAGE.SystemDefault); else if (Settings.video == systemdefault) options2.SetValue(0,"%s",LANGUAGE.SystemDefault);
else if (Settings.video == patch) sprintf (options2.value[0],"%s",LANGUAGE.AutoPatch); else if (Settings.video == patch) options2.SetValue(0,"%s",LANGUAGE.AutoPatch);
else if (Settings.video == pal50) sprintf (options2.value[0],"%s PAL50",LANGUAGE.Force); else if (Settings.video == pal50) options2.SetValue(0,"%s PAL50",LANGUAGE.Force);
else if (Settings.video == pal60) sprintf (options2.value[0],"%s PAL60",LANGUAGE.Force); else if (Settings.video == pal60) options2.SetValue(0,"%s PAL60",LANGUAGE.Force);
else if (Settings.video == ntsc) sprintf (options2.value[0],"%s NTSC",LANGUAGE.Force); else if (Settings.video == ntsc) options2.SetValue(0,"%s NTSC",LANGUAGE.Force);
if (Settings.vpatch == on) sprintf (options2.value[1],"%s",LANGUAGE.ON); if (Settings.vpatch == on) options2.SetValue(1,"%s",LANGUAGE.ON);
else if (Settings.vpatch == off) sprintf (options2.value[1],"%s",LANGUAGE.OFF); else if (Settings.vpatch == off) options2.SetValue(1,"%s",LANGUAGE.OFF);
if (Settings.language == ConsoleLangDefault) sprintf (options2.value[2],"%s",LANGUAGE.ConsoleDefault); if (Settings.language == ConsoleLangDefault) options2.SetValue(2,"%s",LANGUAGE.ConsoleDefault);
else if (Settings.language == jap) sprintf (options2.value[2],"%s",LANGUAGE.Japanese); else if (Settings.language == jap) options2.SetValue(2,"%s",LANGUAGE.Japanese);
else if (Settings.language == ger) sprintf (options2.value[2],"%s",LANGUAGE.German); else if (Settings.language == ger) options2.SetValue(2,"%s",LANGUAGE.German);
else if (Settings.language == eng) sprintf (options2.value[2],"%s",LANGUAGE.English); else if (Settings.language == eng) options2.SetValue(2,"%s",LANGUAGE.English);
else if (Settings.language == fren) sprintf (options2.value[2],"%s",LANGUAGE.French); else if (Settings.language == fren) options2.SetValue(2,"%s",LANGUAGE.French);
else if (Settings.language == esp) sprintf (options2.value[2],"%s",LANGUAGE.Spanish); else if (Settings.language == esp) options2.SetValue(2,"%s",LANGUAGE.Spanish);
else if (Settings.language == it) sprintf (options2.value[2],"%s",LANGUAGE.Italian); else if (Settings.language == it) options2.SetValue(2,"%s",LANGUAGE.Italian);
else if (Settings.language == dut) sprintf (options2.value[2],"%s",LANGUAGE.Dutch); else if (Settings.language == dut) options2.SetValue(2,"%s",LANGUAGE.Dutch);
else if (Settings.language == schin) sprintf (options2.value[2],"%s",LANGUAGE.SChinese); else if (Settings.language == schin) options2.SetValue(2,"%s",LANGUAGE.SChinese);
else if (Settings.language == tchin) sprintf (options2.value[2],"%s",LANGUAGE.TChinese); else if (Settings.language == tchin) options2.SetValue(2,"%s",LANGUAGE.TChinese);
else if (Settings.language == kor) sprintf (options2.value[2],"%s",LANGUAGE.Korean); else if (Settings.language == kor) options2.SetValue(2,"%s",LANGUAGE.Korean);
if (Settings.ocarina == on) sprintf (options2.value[3],"%s",LANGUAGE.ON); if (Settings.ocarina == on) options2.SetValue(3,"%s",LANGUAGE.ON);
else if (Settings.ocarina == off) sprintf (options2.value[3],"%s",LANGUAGE.OFF); else if (Settings.ocarina == off) options2.SetValue(3,"%s",LANGUAGE.OFF);
if (Settings.sinfo == GameID) sprintf (options2.value[4],"%s",LANGUAGE.GameID); if (Settings.sinfo == GameID) options2.SetValue(4,"%s",LANGUAGE.GameID);
else if (Settings.sinfo == GameRegion) sprintf (options2.value[4],"%s",LANGUAGE.GameRegion); else if (Settings.sinfo == GameRegion) options2.SetValue(4,"%s",LANGUAGE.GameRegion);
else if (Settings.sinfo == Both) sprintf (options2.value[4],"%s",LANGUAGE.Both); else if (Settings.sinfo == Both) options2.SetValue(4,"%s",LANGUAGE.Both);
else if (Settings.sinfo == Neither) sprintf (options2.value[4],"%s",LANGUAGE.Neither); else if (Settings.sinfo == Neither) options2.SetValue(4,"%s",LANGUAGE.Neither);
if (Settings.hddinfo == hr12) sprintf (options2.value[5],"12 %s",LANGUAGE.hour); if (Settings.hddinfo == hr12) options2.SetValue(5,"12 %s",LANGUAGE.hour);
else if (Settings.hddinfo == hr24) sprintf (options2.value[5],"24 %s",LANGUAGE.hour); else if (Settings.hddinfo == hr24) options2.SetValue(5,"24 %s",LANGUAGE.hour);
else if (Settings.hddinfo == Off) sprintf (options2.value[5],"%s",LANGUAGE.OFF); else if (Settings.hddinfo == Off) options2.SetValue(5,"%s",LANGUAGE.OFF);
if (Settings.rumble == RumbleOn) sprintf (options2.value[6],"%s",LANGUAGE.ON); if (Settings.rumble == RumbleOn) options2.SetValue(6,"%s",LANGUAGE.ON);
else if (Settings.rumble == RumbleOff) sprintf (options2.value[6],"%s",LANGUAGE.OFF); else if (Settings.rumble == RumbleOff) options2.SetValue(6,"%s",LANGUAGE.OFF);
if (Settings.volume == v10) sprintf (options2.value[7],"10"); if (Settings.volume == v10) options2.SetValue(7,"10");
else if (Settings.volume == v20) sprintf (options2.value[7],"20"); else if (Settings.volume == v20) options2.SetValue(7,"20");
else if (Settings.volume == v30) sprintf (options2.value[7],"30"); else if (Settings.volume == v30) options2.SetValue(7,"30");
else if (Settings.volume == v40) sprintf (options2.value[7],"40"); else if (Settings.volume == v40) options2.SetValue(7,"40");
else if (Settings.volume == v50) sprintf (options2.value[7],"50"); else if (Settings.volume == v50) options2.SetValue(7,"50");
else if (Settings.volume == v60) sprintf (options2.value[7],"60"); else if (Settings.volume == v60) options2.SetValue(7,"60");
else if (Settings.volume == v70) sprintf (options2.value[7],"70"); else if (Settings.volume == v70) options2.SetValue(7,"70");
else if (Settings.volume == v80) sprintf (options2.value[7],"80"); else if (Settings.volume == v80) options2.SetValue(7,"80");
else if (Settings.volume == v90) sprintf (options2.value[7],"90"); else if (Settings.volume == v90) options2.SetValue(7,"90");
else if (Settings.volume == v100) sprintf (options2.value[7],"100"); else if (Settings.volume == v100) options2.SetValue(7,"100");
else if (Settings.volume == v0) sprintf (options2.value[7],"%s",LANGUAGE.OFF); else if (Settings.volume == v0) options2.SetValue(7,"%s",LANGUAGE.OFF);
if (Settings.tooltips == TooltipsOn) sprintf (options2.value[8],"%s",LANGUAGE.ON); if (Settings.tooltips == TooltipsOn) options2.SetValue(8,"%s",LANGUAGE.ON);
else if (Settings.tooltips == TooltipsOff) sprintf (options2.value[8],"%s",LANGUAGE.OFF); else if (Settings.tooltips == TooltipsOff) options2.SetValue(8,"%s",LANGUAGE.OFF);
ret = optionBrowser2.GetClickedOption(); ret = optionBrowser2.GetClickedOption();
@ -4641,9 +4614,9 @@ static int MenuSettings()
if ( pageToDisplay == 2 ) if ( pageToDisplay == 2 )
{ {
if ( Settings.cios > 1 ) if ( Settings.cios >= settings_cios_max)
Settings.cios = 0; Settings.cios = 0;
if ( Settings.xflip > 4 ) if ( Settings.xflip >= settings_xflip_max)
Settings.xflip = 0; Settings.xflip = 0;
if ( Settings.qboot > 1 ) if ( Settings.qboot > 1 )
Settings.qboot = 0; Settings.qboot = 0;
@ -4653,59 +4626,35 @@ static int MenuSettings()
CFG.parentalcontrol = 0; CFG.parentalcontrol = 0;
if ( CFG.godmode != 1) sprintf(options2.value[0], "********"); if ( CFG.godmode != 1) options2.SetValue(0, "********");
else if (!strcmp("", Settings.unlockCode)) sprintf(options2.value[0], "%s",LANGUAGE.notset); else if (!strcmp("", Settings.unlockCode)) options2.SetValue(0, "%s",LANGUAGE.notset);
else sprintf(options2.value[0], Settings.unlockCode); else options2.SetValue(0, Settings.unlockCode);
if (CFG.godmode != 1) sprintf(options2.value[1], "********"); if (CFG.godmode != 1) options2.SetValue(1, "********");
else if (Settings.cios == ios249) sprintf (options2.value[1],"cIOS 249"); else if (Settings.cios == ios249) options2.SetValue(1,"cIOS 249");
else if (Settings.cios == ios222) sprintf (options2.value[1],"cIOS 222"); else if (Settings.cios == ios222) options2.SetValue(1,"cIOS 222");
if (Settings.xflip == no) sprintf (options2.value[2],"%s/%s",LANGUAGE.Right,LANGUAGE.Next); if (Settings.xflip == no) options2.SetValue(2,"%s/%s",LANGUAGE.Right,LANGUAGE.Next);
else if (Settings.xflip == yes) sprintf (options2.value[2],"%s/%s",LANGUAGE.Left,LANGUAGE.Prev); else if (Settings.xflip == yes) options2.SetValue(2,"%s/%s",LANGUAGE.Left,LANGUAGE.Prev);
else if (Settings.xflip == sysmenu) sprintf (options2.value[2],"%s", LANGUAGE.LikeSysMenu); else if (Settings.xflip == sysmenu) options2.SetValue(2,"%s", LANGUAGE.LikeSysMenu);
else if (Settings.xflip == wtf) sprintf (options2.value[2],"%s/%s",LANGUAGE.Right,LANGUAGE.Prev); else if (Settings.xflip == wtf) options2.SetValue(2,"%s/%s",LANGUAGE.Right,LANGUAGE.Prev);
else if (Settings.xflip == disk3d) sprintf (options2.value[2],"DiskFlip"); else if (Settings.xflip == disk3d) options2.SetValue(2,"DiskFlip");
if (Settings.qboot == no) sprintf (options2.value[3],"%s",LANGUAGE.No); if (Settings.qboot == no) options2.SetValue(3,"%s",LANGUAGE.No);
else if (Settings.qboot == yes) sprintf (options2.value[3],"%s",LANGUAGE.Yes); else if (Settings.qboot == yes) options2.SetValue(3,"%s",LANGUAGE.Yes);
if (Settings.wsprompt == no) sprintf (options2.value[4],"%s",LANGUAGE.Normal); if (Settings.wsprompt == no) options2.SetValue(4,"%s",LANGUAGE.Normal);
else if (Settings.wsprompt == yes) sprintf (options2.value[4],"%s",LANGUAGE.WidescreenFix); else if (Settings.wsprompt == yes) options2.SetValue(4,"%s",LANGUAGE.WidescreenFix);
if (CFG.godmode != 1) sprintf(options2.value[5], "********"); if (CFG.godmode != 1) options2.SetValue(5, "********");
else if(CFG.parentalcontrol == 0) sprintf(options2.value[5], "0"); else if(CFG.parentalcontrol == 0) options2.SetValue(5, "0");
else if(CFG.parentalcontrol == 1) sprintf(options2.value[5], "1"); else if(CFG.parentalcontrol == 1) options2.SetValue(5, "1");
else if(CFG.parentalcontrol == 2) sprintf(options2.value[5], "2"); else if(CFG.parentalcontrol == 2) options2.SetValue(5, "2");
else if(CFG.parentalcontrol == 3) sprintf(options2.value[5], "3"); else if(CFG.parentalcontrol == 3) options2.SetValue(5, "3");
options2.SetValue(6, "%s", CFG.covers_path);
if (strlen(CFG.covers_path) < (9 + 3)) { options2.SetValue(7, "%s", CFG.disc_path);
sprintf(cfgtext, "%s", CFG.covers_path); options2.SetValue(8, "%s", CFG.theme_path);
} else {
strncpy(cfgtext, CFG.covers_path, 9);
cfgtext[9] = '\0';
strncat(cfgtext, "...", 3);
}
sprintf(options2.value[6], "%s", cfgtext);
if (strlen(CFG.disc_path) < (9 + 3)) {
sprintf(cfgtext, "%s", CFG.disc_path);
} else {
strncpy(cfgtext, CFG.disc_path, 9);
cfgtext[9] = '\0';
strncat(cfgtext, "...", 3);
}
sprintf(options2.value[7], "%s", cfgtext);
if (strlen(CFG.theme_path) < (9 + 3)) {
sprintf(cfgtext, "%s", CFG.theme_path);
} else {
strncpy(cfgtext, CFG.theme_path, 9);
cfgtext[9] = '\0';
strncat(cfgtext, "...", 3);
}
sprintf(options2.value[8], "%s", cfgtext);
ret = optionBrowser2.GetClickedOption(); ret = optionBrowser2.GetClickedOption();
@ -4923,77 +4872,46 @@ static int MenuSettings()
break; break;
} }
} }
if (pageToDisplay == 3){ if (pageToDisplay == 3)
{
if ( Settings.keyset >= settings_keyset_max)
if ( Settings.keyset > 3 )
Settings.keyset = 0; Settings.keyset = 0;
if ( Settings.unicodefix > 2 ) if ( Settings.unicodefix > 2 )
Settings.unicodefix = 0; Settings.unicodefix = 0;
if ( Settings.wiilight > 2 ) if ( Settings.wiilight > 2 )
Settings.wiilight = 0; Settings.wiilight = 0;
if (strlen(CFG.titlestxt_path) < (9 + 3)) { options2.SetValue(0, "%s", CFG.titlestxt_path);
sprintf(cfgtext, "%s", CFG.titlestxt_path);
} else {
strncpy(cfgtext, CFG.titlestxt_path, 9);
cfgtext[9] = '\0';
strncat(cfgtext, "...", 3);
}
sprintf(options2.value[0], "%s", cfgtext);
if (strlen(CFG.language_path) < (9 + 3)) { options2.SetValue(1, "%s", CFG.language_path);
sprintf(cfgtext, "%s", CFG.language_path);
} else {
strncpy(cfgtext, CFG.language_path, 9);
cfgtext[9] = '\0';
strncat(cfgtext, "...", 3);
}
sprintf(options2.value[1], "%s", cfgtext);
if (Settings.keyset == us) options2.SetValue(2,"QWERTY");
else if (Settings.keyset == dvorak) options2.SetValue(2,"DVORAK");
else if (Settings.keyset == euro) options2.SetValue(2,"QWERTZ");
else if (Settings.keyset == azerty) options2.SetValue(2,"AZERTY");
if (Settings.keyset == us) sprintf (options2.value[2],"QWERTY"); if (Settings.unicodefix == 0) options2.SetValue(3,"%s",LANGUAGE.OFF);
else if (Settings.keyset == dvorak) sprintf (options2.value[2],"DVORAK"); else if (Settings.unicodefix == 1) options2.SetValue(3,"%s",LANGUAGE.TChinese);
else if (Settings.keyset == euro) sprintf (options2.value[2],"QWERTZ"); else if (Settings.unicodefix == 2) options2.SetValue(3,"%s",LANGUAGE.SChinese);
else if (Settings.keyset == azerty) sprintf (options2.value[2],"AZERTY");
if (Settings.unicodefix == 0) sprintf (options2.value[3],"%s",LANGUAGE.OFF); if(!strcmp("notset", CFG.ogg_path) || !strcmp("",CFG.oggload_path))
else if (Settings.unicodefix == 1) sprintf (options2.value[3],"%s",LANGUAGE.TChinese); options2.SetValue(4, "%s", LANGUAGE.Standard);
else if (Settings.unicodefix == 2) sprintf (options2.value[3],"%s",LANGUAGE.SChinese); else
options2.SetValue(4, "%s", CFG.ogg_path);
if(!strcmp("notset", CFG.ogg_path) || !strcmp("",CFG.oggload_path)) { if (Settings.wiilight == 0) options2.SetValue(5,"%s",LANGUAGE.OFF);
sprintf(options2.value[4], "%s", LANGUAGE.Standard); else if (Settings.wiilight == 1) options2.SetValue(5,"%s",LANGUAGE.ON);
} else { else if (Settings.wiilight == 2) options2.SetValue(5,"%s",LANGUAGE.OnlyInstall);
if (strlen(CFG.ogg_path) < (9 + 3)) {
sprintf(cfgtext, "%s", CFG.ogg_path);
} else {
strncpy(cfgtext, CFG.ogg_path, 9);
cfgtext[9] = '\0';
strncat(cfgtext, "...", 3);
}
sprintf(options2.value[4], "%s", cfgtext);
}
if (Settings.wiilight == 0) sprintf (options2.value[5],"%s",LANGUAGE.OFF); options2.SetValue(6, "%s", CFG.update_path);
else if (Settings.wiilight == 1) sprintf (options2.value[5],"%s",LANGUAGE.ON); options2.SetValue(7, "not working!");
else if (Settings.wiilight == 2) sprintf (options2.value[5],"%s",LANGUAGE.OnlyInstall); options2.SetValue(8, " ");
if (strlen(CFG.update_path) < (9 + 3)) {
sprintf(cfgtext, "%s", CFG.update_path);
} else {
strncpy(cfgtext, CFG.update_path, 9);
cfgtext[9] = '\0';
strncat(cfgtext, "...", 3);
}
sprintf(options2.value[6], "%s", cfgtext);
sprintf(options2.value[7], "not working!");
sprintf(options2.value[8], " ");
ret = optionBrowser2.GetClickedOption(); ret = optionBrowser2.GetClickedOption();
switch(ret) { switch(ret)
{
case 0: case 0:
if ( CFG.godmode == 1) if ( CFG.godmode == 1)
{ {
@ -5086,23 +5004,24 @@ static int MenuSettings()
Settings.unicodefix++; Settings.unicodefix++;
break; break;
case 4: case 4:
if(isSdInserted()) { if(isSdInserted())
{
menu = MENU_OGG; menu = MENU_OGG;
pageToDisplay = 0; pageToDisplay = 0;
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0);
} }
else
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0);
break; break;
case 5: case 5:
Settings.wiilight++; Settings.wiilight++;
break; break;
case 7: case 7:
if(isSdInserted()) { if(isSdInserted())
{
menu = MENU_MP3; menu = MENU_MP3;
pageToDisplay = 0; pageToDisplay = 0;
} else { } else
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0); WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtousethatoption, LANGUAGE.ok, 0,0,0);
}
break; break;
case 6: case 6:
if ( CFG.godmode == 1) if ( CFG.godmode == 1)
@ -5134,16 +5053,16 @@ static int MenuSettings()
strncpy(CFG.update_path, entered, sizeof(CFG.update_path)); strncpy(CFG.update_path, entered, sizeof(CFG.update_path));
WindowPrompt(LANGUAGE.Updatepathchanged,0,LANGUAGE.ok,0,0,0); WindowPrompt(LANGUAGE.Updatepathchanged,0,LANGUAGE.ok,0,0,0);
} }
} else {
WindowPrompt(0,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0);
} }
else
WindowPrompt(0,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0);
break; break;
case 8: case 8:
int choice = WindowPrompt(LANGUAGE.Areyousure, 0, LANGUAGE.Yes, LANGUAGE.Cancel, 0, 0); int choice = WindowPrompt(LANGUAGE.Areyousure, 0, LANGUAGE.Yes, LANGUAGE.Cancel, 0, 0);
if(choice == 1) { if(choice == 1)
if(isSdInserted()) { {
if(isSdInserted())
remove("SD:/config/GXGlobal.cfg"); remove("SD:/config/GXGlobal.cfg");
}
lang_default(); lang_default();
CFG_Load(); CFG_Load();
DefaultSettings(); DefaultSettings();
@ -5152,7 +5071,6 @@ static int MenuSettings()
} }
break; break;
} }
} }
if(shutdown == 1) if(shutdown == 1)
@ -5368,13 +5286,13 @@ int GameSettings(struct discHdr * header)
} }
customOptionList options3(7); customOptionList options3(7);
sprintf(options3.name[0],"%s", LANGUAGE.VideoMode); options3.SetName(0,"%s", LANGUAGE.VideoMode);
sprintf(options3.name[1],"%s", LANGUAGE.VIDTVPatch); options3.SetName(1,"%s", LANGUAGE.VIDTVPatch);
sprintf(options3.name[2],"%s", LANGUAGE.Language); options3.SetName(2,"%s", LANGUAGE.Language);
sprintf(options3.name[3], "Ocarina"); options3.SetName(3, "Ocarina");
sprintf(options3.name[4], "IOS"); options3.SetName(4, "IOS");
sprintf(options3.name[5],"Parental Control");//sprintf(options3.name[5],"%s", LANGUAGE.addToFavorite); options3.SetName(5,"%s", LANGUAGE.addToFavorite);
sprintf(options3.name[6],"%s", LANGUAGE.Defaultgamesettings); options3.SetName(6,"%s", LANGUAGE.Defaultgamesettings);
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol); GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol); GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol);
@ -5438,7 +5356,6 @@ int GameSettings(struct discHdr * header)
GuiCustomOptionBrowser optionBrowser3(396, 280, &options3, CFG.theme_path, "bg_options_gamesettings.png", bg_options_settings_png, 0, 200); GuiCustomOptionBrowser optionBrowser3(396, 280, &options3, CFG.theme_path, "bg_options_gamesettings.png", bg_options_settings_png, 0, 200);
optionBrowser3.SetPosition(0, 90); optionBrowser3.SetPosition(0, 90);
optionBrowser3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); optionBrowser3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
optionBrowser3.SetCol2Position(200);
HaltGui(); HaltGui();
GuiWindow w(screenwidth, screenheight); GuiWindow w(screenwidth, screenheight);
@ -5483,38 +5400,38 @@ int GameSettings(struct discHdr * header)
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
if (videoChoice == discdefault) sprintf (options3.value[0],"%s",LANGUAGE.DiscDefault); if (videoChoice == discdefault) options3.SetValue(0,"%s",LANGUAGE.DiscDefault);
else if (videoChoice == systemdefault) sprintf (options3.value[0],"%s",LANGUAGE.SystemDefault); else if (videoChoice == systemdefault) options3.SetValue(0,"%s",LANGUAGE.SystemDefault);
else if (videoChoice == patch) sprintf (options3.value[0],"%s",LANGUAGE.AutoPatch); else if (videoChoice == patch) options3.SetValue(0,"%s",LANGUAGE.AutoPatch);
else if (videoChoice == pal50) sprintf (options3.value[0],"%s PAL50",LANGUAGE.Force); else if (videoChoice == pal50) options3.SetValue(0,"%s PAL50",LANGUAGE.Force);
else if (videoChoice == pal60) sprintf (options3.value[0],"%s PAL60",LANGUAGE.Force); else if (videoChoice == pal60) options3.SetValue(0,"%s PAL60",LANGUAGE.Force);
else if (videoChoice == ntsc) sprintf (options3.value[0],"%s NTSC",LANGUAGE.Force); else if (videoChoice == ntsc) options3.SetValue(0,"%s NTSC",LANGUAGE.Force);
if (viChoice == on) sprintf (options3.value[1],"%s",LANGUAGE.ON); if (viChoice == on) options3.SetValue(1,"%s",LANGUAGE.ON);
else if (viChoice == off) sprintf (options3.value[1],"%s",LANGUAGE.OFF); else if (viChoice == off) options3.SetValue(1,"%s",LANGUAGE.OFF);
if (languageChoice == ConsoleLangDefault) sprintf (options3.value[2],"%s",LANGUAGE.ConsoleDefault); if (languageChoice == ConsoleLangDefault) options3.SetValue(2,"%s",LANGUAGE.ConsoleDefault);
else if (languageChoice == jap) sprintf (options3.value[2],"%s",LANGUAGE.Japanese); else if (languageChoice == jap) options3.SetValue(2,"%s",LANGUAGE.Japanese);
else if (languageChoice == ger) sprintf (options3.value[2],"%s",LANGUAGE.German); else if (languageChoice == ger) options3.SetValue(2,"%s",LANGUAGE.German);
else if (languageChoice == eng) sprintf (options3.value[2],"%s",LANGUAGE.English); else if (languageChoice == eng) options3.SetValue(2,"%s",LANGUAGE.English);
else if (languageChoice == fren) sprintf (options3.value[2],"%s",LANGUAGE.French); else if (languageChoice == fren) options3.SetValue(2,"%s",LANGUAGE.French);
else if (languageChoice == esp) sprintf (options3.value[2],"%s",LANGUAGE.Spanish); else if (languageChoice == esp) options3.SetValue(2,"%s",LANGUAGE.Spanish);
else if (languageChoice == it) sprintf (options3.value[2],"%s",LANGUAGE.Italian); else if (languageChoice == it) options3.SetValue(2,"%s",LANGUAGE.Italian);
else if (languageChoice == dut) sprintf (options3.value[2],"%s",LANGUAGE.Dutch); else if (languageChoice == dut) options3.SetValue(2,"%s",LANGUAGE.Dutch);
else if (languageChoice == schin) sprintf (options3.value[2],"%s",LANGUAGE.SChinese); else if (languageChoice == schin) options3.SetValue(2,"%s",LANGUAGE.SChinese);
else if (languageChoice == tchin) sprintf (options3.value[2],"%s",LANGUAGE.TChinese); else if (languageChoice == tchin) options3.SetValue(2,"%s",LANGUAGE.TChinese);
else if (languageChoice == kor) sprintf (options3.value[2],"%s",LANGUAGE.Korean); else if (languageChoice == kor) options3.SetValue(2,"%s",LANGUAGE.Korean);
if (ocarinaChoice == on) sprintf (options3.value[3],"%s",LANGUAGE.ON); if (ocarinaChoice == on) options3.SetValue(3,"%s",LANGUAGE.ON);
else if (ocarinaChoice == off) sprintf (options3.value[3],"%s",LANGUAGE.OFF); else if (ocarinaChoice == off) options3.SetValue(3,"%s",LANGUAGE.OFF);
if (iosChoice == i249) sprintf (options3.value[4],"249"); if (iosChoice == i249) options3.SetValue(4,"249");
else if (iosChoice == i222) sprintf (options3.value[4],"222"); else if (iosChoice == i222) options3.SetValue(4,"222");
if (parentalcontrolChoice == 0) sprintf (options3.value[5],"0 (Always)"); if (parentalcontrolChoice == 0) options3.SetValue(5,"0 (Always)");
else if (parentalcontrolChoice == 1) sprintf (options3.value[5],"1"); else if (parentalcontrolChoice == 1) options3.SetValue(5,"1");
else if (parentalcontrolChoice == 2) sprintf (options3.value[5],"2"); else if (parentalcontrolChoice == 2) options3.SetValue(5,"2");
else if (parentalcontrolChoice == 3) sprintf (options3.value[5],"3 (Mature)"); else if (parentalcontrolChoice == 3) options3.SetValue(5,"3 (Mature)");
if(shutdown == 1) if(shutdown == 1)
@ -5522,7 +5439,7 @@ int GameSettings(struct discHdr * header)
if(reset == 1) if(reset == 1)
Sys_Reboot(); Sys_Reboot();
sprintf(options3.value[6]," "); options3.SetValue(6," ");
ret = optionBrowser3.GetClickedOption(); ret = optionBrowser3.GetClickedOption();
@ -5823,10 +5740,12 @@ int MenuOGG()
customOptionList options2(countmp3); customOptionList options2(countmp3);
for (cnt = 0; cnt < countmp3; cnt++) { for (cnt = 0; cnt < countmp3; cnt++) {
snprintf(options2.value[cnt], 30, "%s", mp3files[cnt]); char tmp[30];
sprintf (options2.name[cnt],"%i.", cnt+1); snprintf(tmp , 30, "%s", mp3files[cnt]);
options2.SetValue(cnt, "%s", tmp);
options2.SetName(cnt,"%i.", cnt+1);
} }
options2.length = cnt; // options2.length = cnt;
if(cnt < 9) { if(cnt < 9) {
scrollon = 0; scrollon = 0;
@ -6085,16 +6004,19 @@ int MenuMp3()
GuiTrigger trigA; GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
customOptionList options2(500);
char mp3path[30] = "SD:/mp3/"; char mp3path[30] = "SD:/mp3/";
char fullpath[110]; char fullpath[110];
int countmp3 = GetFiles(mp3path); int countmp3 = GetFiles(mp3path);
customOptionList options2(countmp3);
for (cnt = 0; cnt < countmp3; cnt++) { for (cnt = 0; cnt < countmp3; cnt++) {
snprintf(options2.value[cnt], 30, "%s", mp3files[cnt]); char tmp[30];
sprintf (options2.name[cnt],"%i.", cnt+1); snprintf(tmp , 30, "%s", mp3files[cnt]);
options2.SetValue(cnt, "%s", tmp);
options2.SetName(cnt,"%i.", cnt+1);
} }
options2.length = cnt; // options2.length = cnt;
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png); GuiImageData btnOutline(imgPath, button_dialogue_box_png);
@ -6106,7 +6028,6 @@ int MenuMp3()
GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 85); GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 85);
optionBrowser4.SetPosition(0, 90); optionBrowser4.SetPosition(0, 90);
optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
optionBrowser4.SetCol2Position(85);
GuiText cancelBtnTxt(LANGUAGE.Back, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255}); GuiText cancelBtnTxt(LANGUAGE.Back, 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //{0, 0, 0, 255});
cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30); cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);