*Whole new GlobalSettingsMenu arrangement (thx to dj_skull for his idea and plan (issue 433))

*Lots of small fixes
*Added Error002fix selection in GameSettings

**NOTE 1: You might want to delete your Configfiles before using this new Rev.

**NOTE 2: Known issue with Settings is that WiiMotePointer is sometimes being displaced. I am searching for the reason right now.
This commit is contained in:
dimok321 2009-06-06 17:26:52 +00:00
parent 95bf8acf16
commit 32144f46f9
29 changed files with 2051 additions and 1334 deletions

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,6 @@
#include "getentries.h"
/*** Variables that are also used extern ***/
char missingFiles[500][12];
int cntMissFiles = 0;
int networkisinitialized;
@ -32,6 +31,7 @@ static GuiText timeTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g,
static GuiText sizeTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
static GuiImageData progressbar(progressbar_png);
static GuiImage progressbarImg(&progressbar);
static char missingFiles[500][12];
/*** Extern variables ***/
extern GuiWindow * mainWindow;
@ -42,7 +42,6 @@ extern float gamesize;
extern struct discHdr * gameList;
extern u8 shutdown;
extern u8 reset;
extern int vol;
/*** Extern functions ***/
extern void ResumeGui();
@ -65,8 +64,8 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min)
GuiKeyboard keyboard(var, maxlen, min, keyset);
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[50];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
@ -139,7 +138,7 @@ void WindowCredits()
StopOgg();
creditsMusic = new GuiSound(credits_music_ogg, credits_music_ogg_size, SOUND_OGG, 55);
creditsMusic->SetVolume(55);
creditsMusic->SetVolume(60);
creditsMusic->SetLoop(1);
creditsMusic->Play();
@ -327,7 +326,7 @@ void WindowCredits()
bgMusic->PlayOggFile(Settings.ogg_path);
}
bgMusic->SetPlayTime(thetimeofbg);
SetVolumeOgg(255*(vol/100.0));
SetVolumeOgg(255*(Settings.volume/100.0));
}
/****************************************************************************
@ -350,8 +349,9 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
GuiWindow promptWindow(472,320);
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[50];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
@ -597,14 +597,14 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
const char *btn4Label)
{
GuiSound * homein = NULL;
homein = new GuiSound(menuin_ogg, menuin_ogg_size, SOUND_OGG, vol);
homein->SetVolume(vol);
homein = new GuiSound(menuin_ogg, menuin_ogg_size, SOUND_OGG, Settings.sfxvolume);
homein->SetVolume(Settings.sfxvolume);
homein->SetLoop(0);
homein->Play();
GuiSound * homeout = NULL;
homeout = new GuiSound(menuout_ogg, menuout_ogg_size, SOUND_OGG, vol);
homeout->SetVolume(vol);
homeout = new GuiSound(menuout_ogg, menuout_ogg_size, SOUND_OGG, Settings.sfxvolume);
homeout->SetVolume(Settings.sfxvolume);
homeout->SetLoop(0);
int choice = -1;
@ -613,8 +613,8 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
GuiWindow promptWindow(640,480);
promptWindow.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
promptWindow.SetPosition(0, 0);
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiImageData top(exit_top_png);
GuiImageData topOver(exit_top_over_png);
@ -909,8 +909,8 @@ int GameWindowPrompt()
GuiWindow promptWindow(472,320);
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
@ -1401,8 +1401,8 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
GuiWindow promptWindow(472,320);
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
@ -1604,8 +1604,8 @@ int NetworkInitPromp(int choice2)
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
@ -1922,8 +1922,8 @@ ProgressDownloadWindow(int choice2)
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
@ -2159,8 +2159,8 @@ ProgressUpdateWindow()
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10);
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
@ -2436,3 +2436,8 @@ ProgressUpdateWindow()
return 1;
}
char * GetMissingFiles()
{
return (char *) missingFiles;
}

View File

@ -21,5 +21,6 @@ int NetworkInitPromp(int choice2);
int ProgressWindow(const char *title, const char *msg);
int ProgressDownloadWindow(int choice2);
int ProgressUpdateWindow();
char * GetMissingFiles();
#endif

File diff suppressed because it is too large Load Diff

512
source/SettingsPrompts.cpp Normal file
View File

@ -0,0 +1,512 @@
#include <gccore.h>
#include <unistd.h>
#include <string.h>
#include "filelist.h"
#include "sys.h"
#include "language.h"
#include "libwiigui/gui.h"
#include "libwiigui/gui_customoptionbrowser.h"
#include "listfiles.h"
#include "cfg.h"
#include "main.h"
#include "PromptWindows.h"
#include "fatmounter.h"
/*** Extern variables ***/
extern GuiWindow * mainWindow;
extern GuiSound * bgMusic;
extern u8 shutdown;
extern u8 reset;
/*** Extern functions ***/
extern void ResumeGui();
extern void HaltGui();
/****************************************************************************
* MenuOGG
***************************************************************************/
bool MenuOGG()
{
int cnt = 0;
int ret = 0, choice = 0;
int scrollon, nothingchanged = 0;
bool returnhere = false;
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
snprintf(imgPath, sizeof(imgPath), "%ssettings_background.png", CFG.theme_path);
GuiImageData settingsbg(imgPath, settings_background_png);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiTrigger trigMinus;
trigMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0);
GuiTrigger trigPlus;
trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0);
char fullpath[150];
char shortpath[35];
int countoggs = GetAllDirFiles(Settings.oggload_path);
if(!strcmp("", Settings.oggload_path)) {
sprintf(shortpath, "%s", LANGUAGE.Standard);
} else {
sprintf(shortpath, "%s", Settings.oggload_path);
}
GuiText titleTxt(shortpath, 24, (GXColor){0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
titleTxt.SetPosition(0,0);
GuiButton pathBtn(300, 50);
pathBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
pathBtn.SetPosition(0,28);
pathBtn.SetLabel(&titleTxt);
pathBtn.SetSoundOver(&btnSoundOver);
pathBtn.SetSoundClick(&btnClick);
pathBtn.SetTrigger(&trigA);
pathBtn.SetEffectGrow();
GuiImage oggmenubackground(&settingsbg);
oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
oggmenubackground.SetPosition(0, 0);
GuiText backBtnTxt(LANGUAGE.Back , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes){
backBtnTxt.SetWidescreen(CFG.widescreen);
backBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton backBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
backBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
backBtn.SetPosition(-180, 400);
backBtn.SetLabel(&backBtnTxt);
backBtn.SetImage(&backBtnImg);
backBtn.SetSoundOver(&btnSoundOver);
backBtn.SetSoundClick(&btnClick);
backBtn.SetTrigger(&trigA);
backBtn.SetTrigger(&trigB);
backBtn.SetEffectGrow();
GuiText defaultBtnTxt(LANGUAGE.Default , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage defaultBtnImg(&btnOutline);
if (Settings.wsprompt == yes){
defaultBtnTxt.SetWidescreen(CFG.widescreen);
defaultBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton defaultBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
defaultBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
defaultBtn.SetPosition(180, 400);
defaultBtn.SetLabel(&defaultBtnTxt);
defaultBtn.SetImage(&defaultBtnImg);
defaultBtn.SetSoundOver(&btnSoundOver);
defaultBtn.SetSoundClick(&btnClick);
defaultBtn.SetTrigger(&trigA);
defaultBtn.SetEffectGrow();
customOptionList options2(countoggs);
for (cnt = 0; cnt < countoggs; cnt++) {
options2.SetValue(cnt, "%s", GetFileName(cnt));
options2.SetName(cnt,"%i.", cnt+1);
}
if(cnt < 9) {
scrollon = 0;
} else {
scrollon = 1;
}
GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 10);
optionBrowser4.SetPosition(0, 90);
optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
snprintf(imgPath, sizeof(imgPath), "%smp3_stop.png", CFG.theme_path);
GuiImageData stop(imgPath, mp3_stop_png);
snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_right.png", CFG.theme_path);
GuiImageData play(imgPath, startgame_arrow_right_png);
GuiImage playBtnImg(&play);
playBtnImg.SetWidescreen(CFG.widescreen);
GuiButton playBtn(play.GetWidth(), play.GetHeight());
playBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
playBtn.SetPosition(50, 400);
playBtn.SetImage(&playBtnImg);
playBtn.SetSoundOver(&btnSoundOver);
playBtn.SetSoundClick(&btnClick);
playBtn.SetTrigger(&trigA);
playBtn.SetTrigger(&trigPlus);
playBtn.SetEffectGrow();
GuiImage stopBtnImg(&stop);
stopBtnImg.SetWidescreen(CFG.widescreen);
GuiButton stopBtn(stop.GetWidth(), stop.GetHeight());
stopBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
stopBtn.SetPosition(-15, 400);
stopBtn.SetImage(&stopBtnImg);
stopBtn.SetSoundOver(&btnSoundOver);
stopBtn.SetSoundClick(&btnClick);
stopBtn.SetTrigger(&trigA);
stopBtn.SetTrigger(&trigMinus);
stopBtn.SetEffectGrow();
HaltGui();
GuiWindow w(screenwidth, screenheight);
w.Append(&oggmenubackground);
w.Append(&pathBtn);
w.Append(&backBtn);
w.Append(&playBtn);
w.Append(&stopBtn);
w.Append(&defaultBtn);
w.Append(&optionBrowser4);
mainWindow->Append(&w);
w.SetEffect(EFFECT_FADE, 20);
ResumeGui();
while(w.GetEffect()>0) usleep(50);
while(!returnhere)
{
if (backBtn.GetState() == STATE_CLICKED) {
if(nothingchanged == 1 && countoggs > 0) {
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play();
} else {
bgMusic->PlayOggFile(Settings.ogg_path);
}
}
break;
}
if (defaultBtn.GetState() == STATE_CLICKED) {
choice = WindowPrompt(LANGUAGE.Loadingstandardmusic,0,LANGUAGE.ok, LANGUAGE.Cancel,0,0);
if (choice == 1) {
sprintf(Settings.ogg_path, "notset");
bgMusic->Play();
SetVolumeOgg(255*(Settings.volume/100.0));
cfg_save_global();
}
defaultBtn.ResetState();
optionBrowser4.SetFocus(1);
}
if (pathBtn.GetState() == STATE_CLICKED) {
w.Remove(&optionBrowser4);
w.Remove(&backBtn);
w.Remove(&pathBtn);
w.Remove(&playBtn);
w.Remove(&stopBtn);
w.Remove(&defaultBtn);
char entered[43] = "";
strncpy(entered, Settings.oggload_path, sizeof(entered));
int result = OnScreenKeyboard(entered,43,0);
w.Append(&optionBrowser4);
w.Append(&pathBtn);
w.Append(&backBtn);
w.Append(&playBtn);
w.Append(&stopBtn);
w.Append(&defaultBtn);
if ( result == 1 ) {
int len = (strlen(entered)-1);
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.oggload_path, entered, sizeof(Settings.oggload_path));
WindowPrompt(LANGUAGE.Backgroundmusicpath,0,LANGUAGE.ok,0,0,0);
if(isSdInserted()) {
if(!strcmp("", Settings.oggload_path)) {
sprintf(Settings.ogg_path, "notset");
bgMusic->Play();
}
cfg_save_global();
returnhere = true;
break;
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
}
}
if(countoggs > 0) {
optionBrowser4.SetFocus(1);
}
pathBtn.ResetState();
}
ret = optionBrowser4.GetClickedOption();
if(ret>=0) {
choice = WindowPrompt(LANGUAGE.Setasbackgroundmusic,GetFileName(ret),LANGUAGE.Yes,LANGUAGE.No,0,0);
if(choice == 1) {
snprintf(fullpath,150,"%s%s",Settings.oggload_path,GetFileName(ret));
choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) {
WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0);
sprintf(Settings.ogg_path, "notset");
bgMusic->Play();
SetVolumeOgg(255*(Settings.volume/100.0));
} else {
snprintf(Settings.ogg_path, sizeof(Settings.ogg_path), "%s", fullpath);
cfg_save_global();
SetVolumeOgg(255*(Settings.volume/100.0));
nothingchanged = 0;
}
}
optionBrowser4.SetFocus(1);
}
if (playBtn.GetState() == STATE_CLICKED && countoggs > 0) {
if(countoggs > 0) {
ret = optionBrowser4.GetSelectedOption();
snprintf(fullpath, 150,"%s%s", Settings.oggload_path,GetFileName(ret));
choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) {
WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0);
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play();
} else {
bgMusic->PlayOggFile(Settings.ogg_path);
}
}
SetVolumeOgg(255*(Settings.volume/100.0));
nothingchanged = 1;
optionBrowser4.SetFocus(1);
}
playBtn.ResetState();
}
if(stopBtn.GetState() == STATE_CLICKED) {
if(countoggs > 0) {
StopOgg();
nothingchanged = 1;
optionBrowser4.SetFocus(1);
}
stopBtn.ResetState();
}
}
w.SetEffect(EFFECT_FADE, -20);
while(w.GetEffect()>0) usleep(50);
HaltGui();
mainWindow->Remove(&w);
ResumeGui();
return returnhere;
}
/****************************************************************************
* MenuLanguageSelect
***************************************************************************/
int MenuLanguageSelect()
{
int cnt = 0;
int ret = 0, choice = 0;
int scrollon;
int returnhere = 0;
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
snprintf(imgPath, sizeof(imgPath), "%ssettings_background.png", CFG.theme_path);
GuiImageData settingsbg(imgPath, settings_background_png);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
char fullpath[100];
int countfiles = GetAllDirFiles(Settings.languagefiles_path);
if(!strcmp("", Settings.languagefiles_path)) {
sprintf(fullpath, "%s", LANGUAGE.Standard);
} else {
sprintf(fullpath, "%s", Settings.languagefiles_path);
}
GuiText titleTxt(fullpath, 24, (GXColor){0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
titleTxt.SetPosition(0,0);
GuiButton pathBtn(300, 50);
pathBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
pathBtn.SetPosition(0,28);
pathBtn.SetLabel(&titleTxt);
pathBtn.SetSoundOver(&btnSoundOver);
pathBtn.SetSoundClick(&btnClick);
pathBtn.SetTrigger(&trigA);
pathBtn.SetEffectGrow();
GuiImage oggmenubackground(&settingsbg);
oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
oggmenubackground.SetPosition(0, 0);
GuiText backBtnTxt(LANGUAGE.Back , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes){
backBtnTxt.SetWidescreen(CFG.widescreen);
backBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton backBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
backBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
backBtn.SetPosition(-180, 400);
backBtn.SetLabel(&backBtnTxt);
backBtn.SetImage(&backBtnImg);
backBtn.SetSoundOver(&btnSoundOver);
backBtn.SetSoundClick(&btnClick);
backBtn.SetTrigger(&trigA);
backBtn.SetTrigger(&trigB);
backBtn.SetEffectGrow();
GuiText defaultBtnTxt(LANGUAGE.Default , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage defaultBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
defaultBtnTxt.SetWidescreen(CFG.widescreen);
defaultBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton defaultBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
defaultBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
defaultBtn.SetPosition(180, 400);
defaultBtn.SetLabel(&defaultBtnTxt);
defaultBtn.SetImage(&defaultBtnImg);
defaultBtn.SetSoundOver(&btnSoundOver);
defaultBtn.SetSoundClick(&btnClick);
defaultBtn.SetTrigger(&trigA);
defaultBtn.SetEffectGrow();
customOptionList options2(countfiles);
for (cnt = 0; cnt < countfiles; cnt++) {
options2.SetName(cnt, "%s", GetFileName(cnt));
options2.SetValue(cnt, NULL);
}
if(cnt < 9) {
scrollon = 0;
} else {
scrollon = 1;
}
GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 10);
optionBrowser4.SetPosition(0, 90);
optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
HaltGui();
GuiWindow w(screenwidth, screenheight);
w.Append(&oggmenubackground);
w.Append(&pathBtn);
w.Append(&backBtn);
w.Append(&defaultBtn);
w.Append(&optionBrowser4);
mainWindow->Append(&w);
w.SetEffect(EFFECT_FADE, 20);
ResumeGui();
while(w.GetEffect()>0) usleep(50);
while(!returnhere)
{
if (backBtn.GetState() == STATE_CLICKED) {
backBtn.ResetState();
break;
}
if (defaultBtn.GetState() == STATE_CLICKED) {
choice = WindowPrompt(LANGUAGE.Loadingstandardlanguage,0,LANGUAGE.ok, LANGUAGE.Cancel,0,0);
if (choice == 1) {
sprintf(Settings.language_path, "notset");
cfg_save_global();
lang_default();
CFG_Load();
returnhere = 2;
}
defaultBtn.ResetState();
optionBrowser4.SetFocus(1);
}
if (pathBtn.GetState() == STATE_CLICKED) {
w.Remove(&optionBrowser4);
w.Remove(&backBtn);
w.Remove(&pathBtn);
w.Remove(&defaultBtn);
char entered[43] = "";
strncpy(entered, Settings.languagefiles_path, sizeof(entered));
int result = OnScreenKeyboard(entered,43,0);
w.Append(&optionBrowser4);
w.Append(&pathBtn);
w.Append(&backBtn);
w.Append(&defaultBtn);
if ( result == 1 ) {
int len = (strlen(entered)-1);
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.languagefiles_path, entered, sizeof(Settings.languagefiles_path));
WindowPrompt(LANGUAGE.Languagepathchanged,0,LANGUAGE.ok,0,0,0);
if(isSdInserted()) {
cfg_save_global();
returnhere = 1;
break;
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
}
}
if(countfiles > 0) {
optionBrowser4.SetFocus(1);
}
pathBtn.ResetState();
}
ret = optionBrowser4.GetClickedOption();
if(ret>=0) {
choice = WindowPrompt(LANGUAGE.Doyouwanttochangelanguage, 0, LANGUAGE.Yes, LANGUAGE.Cancel,0,0);
if(choice == 1) {
if(isSdInserted()) {
snprintf(Settings.language_path, sizeof(Settings.language_path), "%s%s", Settings.languagefiles_path, GetFileName(ret));
cfg_save_global();
if(!checkfile(Settings.language_path)) {
sprintf(Settings.language_path, "notset");
WindowPrompt(LANGUAGE.Filenotfound,LANGUAGE.Loadingstandardlanguage,LANGUAGE.ok,0,0,0);
}
lang_default();
CFG_Load();
returnhere = 2;
break;
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
}
}
optionBrowser4.SetFocus(1);
}
}
w.SetEffect(EFFECT_FADE, -20);
while(w.GetEffect()>0) usleep(50);
HaltGui();
mainWindow->Remove(&w);
ResumeGui();
return returnhere;
}

14
source/SettingsPrompts.h Normal file
View File

@ -0,0 +1,14 @@
/****************************************************************************
* SettingsPrompts
* USB Loader GX 2009
*
* SettingsPrompts.h
***************************************************************************/
#ifndef _SETTINGSPROMPTS_H_
#define _SETTINGSPROMPTS_H_
bool MenuOGG();
int MenuLanguageSelect();
#endif

View File

@ -218,7 +218,7 @@ bool Search_and_patch_Video_Modes(void *Address, u32 Size, GXRModeObj* Table[])
return found;
}
s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 patchcountrystring)
s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 patchcountrystring, u8 error002fix)
{
app_entry appldr_entry;
app_init appldr_init;
@ -250,8 +250,10 @@ s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8
/* Initialize apploader */
appldr_init(__noprint);
if(error002fix) {
/* ERROR 002 fix (thanks to WiiPower for sharing this)*/
*(u32 *)0x80003140 = *(u32 *)0x80003188;
}
if (cheat)
{

View File

@ -5,6 +5,6 @@
typedef void (*entry_point)(void);
/* Prototypes */
s32 Apploader_Run(entry_point *, u8, u8, u8, u8);
s32 Apploader_Run(entry_point *, u8, u8, u8, u8, u8);
#endif

View File

@ -29,6 +29,7 @@ u8 languageChoice = 0;
u8 viChoice = 0;
u8 iosChoice = 0;
u8 parentalcontrolChoice = 0;
u8 fix002 = 0;
u8 xflip = 0;
u8 sort = 0;
u8 fave = 0;
@ -232,6 +233,7 @@ void CFG_Default(int widescreen) // -1 = non forced Mode
snprintf(Settings.titlestxt_path, sizeof(Settings.titlestxt_path), "SD:/config/");//default path for disc images
snprintf(Settings.unlockCode, sizeof(Settings.unlockCode), "ab121b"); // default password
snprintf(Settings.language_path, sizeof(Settings.language_path), "SD:/config/language/");
snprintf(Settings.languagefiles_path, sizeof(Settings.languagefiles_path), "SD:/config/language/");
snprintf(Settings.oggload_path, sizeof(Settings.oggload_path), "SD:/config/backgroundmusic/");
snprintf(Settings.update_path, sizeof(Settings.update_path), "SD:/apps/usbloader_gx/");
sprintf(Settings.ogg_path, "notset");
@ -335,7 +337,8 @@ void Global_Default(void)
{
Settings.sinfo = ((Settings.sinfo == GameID) ? Both : GameRegion);
}
Settings.volume = v80;
Settings.volume = 80;
Settings.sfxvolume = 80;
Settings.tooltips = TooltipsOn;
snprintf(Settings.unlockCode, sizeof(Settings.unlockCode), "ab121b");
Settings.parentalcontrol = 0;
@ -480,6 +483,10 @@ void path_set(char *name, char *val)
strcopy(Settings.language_path, val, sizeof(Settings.language_path));
return;
}
if (strcmp(name, "languagefiles_path") == 0) {
strcopy(Settings.languagefiles_path, val, sizeof(Settings.languagefiles_path));
return;
}
if (strcmp(name, "update_path") == 0) {
strcopy(Settings.update_path, val, sizeof(Settings.update_path));
return;
@ -888,6 +895,13 @@ void global_cfg_set(char *name, char *val)
}
return;
}
else if (strcmp(name, "sfxvolume") == 0) {
int i;
if (sscanf(val, "%d", &i) == 1) {
Settings.sfxvolume = i;
}
return;
}
else if (strcmp(name, "tooltips") == 0) {
int i;
if (sscanf(val, "%d", &i) == 1) {
@ -1104,6 +1118,7 @@ void cfg_set_game_opt(struct Game_CFG *game, u8 *id)
game->vipatch = viChoice;
game->ios = iosChoice;
game->parentalcontrol = parentalcontrolChoice;
game->errorfix002 = fix002;
}
struct Game_NUM* cfg_get_game_num(u8 *id)
@ -1154,6 +1169,7 @@ bool cfg_save_global()// save global settings
fprintf(f, "sinfo = %d\n ", Settings.sinfo);
fprintf(f, "rumble = %d\n ", Settings.rumble);
fprintf(f, "volume = %d\n ", Settings.volume);
fprintf(f, "sfxvolume = %d\n ", Settings.sfxvolume);
fprintf(f, "tooltips = %d\n ", Settings.tooltips);
fprintf(f, "password = %s\n ", Settings.unlockCode);
fprintf(f, "sort = %d\n ", Settings.sort);
@ -1173,6 +1189,7 @@ bool cfg_save_global()// save global settings
}
fprintf(f, "disc_path = %s\n ", Settings.disc_path);
fprintf(f, "language_path = %s\n ", Settings.language_path);
fprintf(f, "languagefiles_path = %s\n ", Settings.languagefiles_path);
fprintf(f, "oggload_path = %s\n ", Settings.oggload_path);
fprintf(f, "titlestxt_path = %s\n ", Settings.titlestxt_path);
if(!strcmp("", Settings.unlockCode)) {
@ -1247,6 +1264,11 @@ void game_set(char *name, char *val)
game->parentalcontrol = opt_c;
}
}
if (strcmp("errorfix002", opt_name) == 0) {
if (sscanf(opt_val, "%hd", &opt_c) == 1) {
game->errorfix002 = opt_c;
}
}
}
// next opt
@ -1383,7 +1405,8 @@ bool cfg_save_games()
fprintf(f, "ocarina:%d; ", cfg_game[i].ocarina);
fprintf(f, "vipatch:%d; ", cfg_game[i].vipatch);
fprintf(f, "ios:%d;", cfg_game[i].ios);
fprintf(f, "pctrl:%d;\n", cfg_game[i].parentalcontrol);
fprintf(f, "pctrl:%d;", cfg_game[i].parentalcontrol);
fprintf(f, "errorfix002:%d;\n", cfg_game[i].errorfix002);
}
fprintf(f, "# END\n");
fclose(f);
@ -1438,7 +1461,8 @@ bool cfg_load_global()
{
Settings.sinfo = ((Settings.sinfo == GameID) ? Both : GameRegion);
}
Settings.volume = v80;
Settings.volume = 80;
Settings.sfxvolume = 80;
return cfg_parsefile("SD:/config/GXGlobal.cfg", &global_cfg_set);
}

View File

@ -152,6 +152,7 @@ extern u8 viChoice;
extern u8 iosChoice;
extern u8 faveChoice;
extern u8 parentalcontrolChoice;
extern u8 fix002;
extern u8 xflip;
extern u8 qboot;
extern u8 sort;
@ -169,6 +170,7 @@ struct Game_CFG
u8 vipatch;
u8 ios;
u8 parentalcontrol;
u8 errorfix002;
};
struct Game_NUM
{
@ -201,7 +203,6 @@ enum {
schin,
tchin,
kor,
settings_language_max // always the last entry
};
@ -263,21 +264,6 @@ enum {
settings_tooltips_max // always the last entry
};
enum {
v10=0,
v20,
v30,
v40,
v50,
v60,
v70,
v80,
v90,
v100,
v0,
settings_volume_max // always the last entry
};
enum {
no=0,
yes,
@ -297,11 +283,11 @@ enum {
list,
grid,
carousel,
settings_display_max
};
enum {
scrollDefault,
scrollMarquee,
settings_scrolleffect_max // always the last entry
};
struct SSettings {
@ -315,6 +301,7 @@ struct SSettings {
int rumble;
int xflip;
int volume;
int sfxvolume;
int tooltips;
char unlockCode[20];
int parentalcontrol;
@ -335,6 +322,7 @@ struct SSettings {
char disc_path[100];
char titlestxt_path[100];
char language_path[100];
char languagefiles_path[100];
char oggload_path[100];
char ogg_path[150];
char update_path[150];

View File

@ -248,7 +248,7 @@ s32 Disc_IsWii(void)
return 0;
}
s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring)
s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix)
{
entry_point p_entry;
@ -260,7 +260,7 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa
return ret;
/* Run apploader */
ret = Apploader_Run(&p_entry, cheat, videoselected, vipatch, patchcountrystring);
ret = Apploader_Run(&p_entry, cheat, videoselected, vipatch, patchcountrystring, error002fix);
if (ret < 0)
return ret;
@ -295,7 +295,7 @@ s32 Disc_BootPartition(u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 pa
return 0;
}
s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring)
s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix)
{
u64 offset;
s32 ret;
@ -306,7 +306,7 @@ s32 Disc_WiiBoot(u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring)
return ret;
/* Boot partition */
return Disc_BootPartition(offset, videoselected, cheat, vipatch, patchcountrystring);
return Disc_BootPartition(offset, videoselected, cheat, vipatch, patchcountrystring, error002fix);
}
void PatchCountryStrings(void *Address, int Size)

View File

@ -46,8 +46,8 @@ void __Disc_SetLowMem(void);
s32 Disc_SetUSB(u8 *, int ios222);
s32 Disc_ReadHeader(void *);
s32 Disc_IsWii(void);
s32 Disc_BootPartition(u64, u8, u8, u8, u8);
s32 Disc_WiiBoot(u8, u8, u8, u8);
s32 Disc_BootPartition(u64, u8, u8, u8, u8, u8);
s32 Disc_WiiBoot(u8, u8, u8, u8, u8);
void PatchCountryStrings(void *Address, int Size);
#ifdef __cplusplus

View File

@ -38,15 +38,6 @@ extern const u32 menuin_ogg_size;
extern const u8 menuout_ogg[];
extern const u32 menuout_ogg_size;
extern const u8 tab_bg1_png[];
extern const u32 tab_bg1_png_size;
extern const u8 tab_bg2_png[];
extern const u32 tab_bg2_png_size;
extern const u8 tab_bg3_png[];
extern const u32 tab_bg3_png_size;
extern const u8 credits_button_png[];
extern const u32 credits_button_png_size;
@ -290,7 +281,13 @@ extern const u32 arrangeList_gray_png_size;
extern const u8 arrangeCarousel_gray_png[];
extern const u32 arrangeCarousel_gray_png_size;
extern const u8 updateRev_png[];
extern const u32 updateRev_png_size;
extern const u8 settings_title_png[];
extern const u32 settings_title_png_size;
extern const u8 settings_title_over_png[];
extern const u32 settings_title_over_png_size;
extern const u8 pageindicator_png[];
extern const u32 pageindicator_png_size;
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -57,6 +57,7 @@ snprintf(LANGUAGE.Continueinstallgame, sizeof(LANGUAGE.Continueinstallgame), "Co
snprintf(LANGUAGE.ConsoleDefault, sizeof(LANGUAGE.ConsoleDefault), "Console Default");
snprintf(LANGUAGE.Consoleshouldbeunlockedtomodifyit, sizeof(LANGUAGE.Consoleshouldbeunlockedtomodifyit), "Console should be unlocked to modify it.");
snprintf(LANGUAGE.ConsoleLocked, sizeof(LANGUAGE.ConsoleLocked), "Console Locked");
snprintf(LANGUAGE.Controllevel, sizeof(LANGUAGE.Controllevel), "Controllevel");
snprintf(LANGUAGE.CorrectPassword, sizeof(LANGUAGE.CorrectPassword), "Correct Password");
snprintf(LANGUAGE.Couldnotinitializenetwork, sizeof(LANGUAGE.Couldnotinitializenetwork), "Could not initialize network!");
snprintf(LANGUAGE.CouldnotopenDisc, sizeof(LANGUAGE.CouldnotopenDisc), "Could not open Disc");
@ -67,6 +68,7 @@ snprintf(LANGUAGE.CoverpathChanged, sizeof(LANGUAGE.CoverpathChanged), "Coverpat
snprintf(LANGUAGE.Coverpathchange, sizeof(LANGUAGE.Coverpathchange), "Coverpath change");
snprintf(LANGUAGE.count, sizeof(LANGUAGE.count), "Play Count");
snprintf(LANGUAGE.Credits, sizeof(LANGUAGE.Credits), "Credits");
snprintf(LANGUAGE.Custompaths, sizeof(LANGUAGE.Custompaths), "Custom Paths");
snprintf(LANGUAGE.DiscImages, sizeof(LANGUAGE.DiscImages), "Disc Images");
snprintf(LANGUAGE.DiscimagePath, sizeof(LANGUAGE.DiscimagePath), "Discimage Path");
snprintf(LANGUAGE.DiscpathChanged, sizeof(LANGUAGE.DiscpathChanged), "Discpath Changed");
@ -77,11 +79,13 @@ snprintf(LANGUAGE.Doyouwanttoformat, sizeof(LANGUAGE.Doyouwanttoformat), "Do you
snprintf(LANGUAGE.Doyoureallywanttodelete, sizeof(LANGUAGE.Doyoureallywanttodelete), "Do you really want to delete:");
snprintf(LANGUAGE.Doyouwanttoretryfor30secs, sizeof(LANGUAGE.Doyouwanttoretryfor30secs), "Do you want to retry for 30 secs?");
snprintf(LANGUAGE.Doyouwanttoupdate, sizeof(LANGUAGE.Doyouwanttoupdate), "How do you want to update?");
snprintf(LANGUAGE.Doyouwanttochangelanguage, sizeof(LANGUAGE.Doyouwanttochangelanguage), "Do you want to change language?");
snprintf(LANGUAGE.Downloadingfile, sizeof(LANGUAGE.Downloadingfile), "Downloading file");
snprintf(LANGUAGE.DownloadBoxartimage, sizeof(LANGUAGE.DownloadBoxartimage), "Download Boxart image?");
snprintf(LANGUAGE.Downloadfinished, sizeof(LANGUAGE.Downloadfinished), "Download finished");
snprintf(LANGUAGE.Defaultgamesettings, sizeof(LANGUAGE.Defaultgamesettings), "Default Gamesettings");
snprintf(LANGUAGE.Defaultsettings, sizeof(LANGUAGE.Defaultsettings), "Default Settings");
snprintf(LANGUAGE.Default, sizeof(LANGUAGE.Default), "Default");
snprintf(LANGUAGE.Error, sizeof(LANGUAGE.Error), "Error !");
snprintf(LANGUAGE.hour, sizeof(LANGUAGE.hour), "Hour");
snprintf(LANGUAGE.Homemenu, sizeof(LANGUAGE.Homemenu), "HOME Menu");
@ -122,8 +126,11 @@ snprintf(LANGUAGE.Gameisalreadyinstalled, sizeof(LANGUAGE.Gameisalreadyinstalled
snprintf(LANGUAGE.GameRegion, sizeof(LANGUAGE.GameRegion), "Game Region");
snprintf(LANGUAGE.GameSize, sizeof(LANGUAGE.GameSize), "Game Size");
snprintf(LANGUAGE.GoBack, sizeof(LANGUAGE.GoBack), "Go Back");
snprintf(LANGUAGE.GUISettings, sizeof(LANGUAGE.GUISettings), "GUI Settings");
snprintf(LANGUAGE.Gameload, sizeof(LANGUAGE.Gameload), "Game Load");
snprintf(LANGUAGE.HowtoShutdown, sizeof(LANGUAGE.HowtoShutdown), "How to Shutdown?");
snprintf(LANGUAGE.Language, sizeof(LANGUAGE.Language), "Game Language");
snprintf(LANGUAGE.Languagepathchanged, sizeof(LANGUAGE.Languagepathchanged), "Languagepath changed.");
snprintf(LANGUAGE.Left, sizeof(LANGUAGE.Left), "Left");
snprintf(LANGUAGE.LikeSysMenu, sizeof(LANGUAGE.LikeSysMenu), "Like SysMenu");
snprintf(LANGUAGE.LoadingincIOS, sizeof(LANGUAGE.LoadingincIOS), "Loading in cIOS249");
@ -157,7 +164,7 @@ snprintf(LANGUAGE.OFF, sizeof(LANGUAGE.OFF), "OFF");
snprintf(LANGUAGE.OfficialSite, sizeof(LANGUAGE.OfficialSite), "Official Site");
snprintf(LANGUAGE.ON, sizeof(LANGUAGE.ON), "ON");
snprintf(LANGUAGE.OnlyInstall, sizeof(LANGUAGE.OnlyInstall), "Only for Install");
snprintf(LANGUAGE.Parentalcontrol, sizeof(LANGUAGE.Parentalcontrol), "Parental control");
snprintf(LANGUAGE.Parentalcontrol, sizeof(LANGUAGE.Parentalcontrol), "Parental Control");
snprintf(LANGUAGE.Partition, sizeof(LANGUAGE.Partition), "Partition");
snprintf(LANGUAGE.Password, sizeof(LANGUAGE.Password), "Password");
snprintf(LANGUAGE.PasswordChanged, sizeof(LANGUAGE.PasswordChanged), "Password Changed");
@ -188,6 +195,7 @@ snprintf(LANGUAGE.Specialthanksto, sizeof(LANGUAGE.Specialthanksto), "Special th
snprintf(LANGUAGE.youwanttoformat, sizeof(LANGUAGE.youwanttoformat), "you want to format");
snprintf(LANGUAGE.Standard, sizeof(LANGUAGE.Standard), "Standard");
snprintf(LANGUAGE.settings, sizeof(LANGUAGE.settings), "Settings");
snprintf(LANGUAGE.Sound, sizeof(LANGUAGE.Sound), "Sound");
snprintf(LANGUAGE.ShutdowntoIdle, sizeof(LANGUAGE.ShutdowntoIdle), "Shutdown to Idle");
snprintf(LANGUAGE.ShutdownSystem, sizeof(LANGUAGE.ShutdownSystem), "Shutdown System");
snprintf(LANGUAGE.Success, sizeof(LANGUAGE.Success), "Success:");
@ -207,6 +215,7 @@ snprintf(LANGUAGE.Tooltips, sizeof(LANGUAGE.Tooltips), "Tooltips");
snprintf(LANGUAGE.Timeleft, sizeof(LANGUAGE.Timeleft), "Time left:");
snprintf(LANGUAGE.updating, sizeof(LANGUAGE.updating), "Updating");
snprintf(LANGUAGE.Unlock, sizeof(LANGUAGE.Unlock), "Unlock");
snprintf(LANGUAGE.UnlockConsoletousethisOption, sizeof(LANGUAGE.UnlockConsoletousethisOption), "Unlock console to use this option.");
snprintf(LANGUAGE.Unicodefix, sizeof(LANGUAGE.Unicodefix), "Unicode Fix");
snprintf(LANGUAGE.Uninstall, sizeof(LANGUAGE.Uninstall), "Uninstall");
snprintf(LANGUAGE.Updatepath, sizeof(LANGUAGE.Updatepath), "Updatepath");
@ -215,11 +224,13 @@ snprintf(LANGUAGE.Updatefailed, sizeof(LANGUAGE.Updatefailed), "Update failed");
snprintf(LANGUAGE.Updatedol, sizeof(LANGUAGE.Updatedol), "Update DOL");
snprintf(LANGUAGE.Updateall, sizeof(LANGUAGE.Updateall), "Update All");
snprintf(LANGUAGE.Updateto, sizeof(LANGUAGE.Updateto), "Update to");
snprintf(LANGUAGE.Update, sizeof(LANGUAGE.Update), "Update");
snprintf(LANGUAGE.USBLoaderisprotected, sizeof(LANGUAGE.USBLoaderisprotected), "USB Loader GX is protected");
snprintf(LANGUAGE.USBDevicenotfound, sizeof(LANGUAGE.USBDevicenotfound), "USB Device not found");
snprintf(LANGUAGE.VideoMode, sizeof(LANGUAGE.VideoMode), "Video Mode");
snprintf(LANGUAGE.VIDTVPatch, sizeof(LANGUAGE.VIDTVPatch), "VIDTV Patch");
snprintf(LANGUAGE.Volume, sizeof(LANGUAGE.Volume), "Volume");
snprintf(LANGUAGE.Volume, sizeof(LANGUAGE.Volume), "Music Volume");
snprintf(LANGUAGE.SFXVolume, sizeof(LANGUAGE.SFXVolume), "SFX Volume");
snprintf(LANGUAGE.Waiting, sizeof(LANGUAGE.Waiting), "Waiting...");
snprintf(LANGUAGE.WaitingforUSBDevice, sizeof(LANGUAGE.WaitingforUSBDevice), "Waiting for USB Device");
snprintf(LANGUAGE.WidescreenFix, sizeof(LANGUAGE.WidescreenFix), "Widescreen Fix");
@ -356,6 +367,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.ConsoleLocked, val, sizeof(LANGUAGE.ConsoleLocked));
return;
}
if (strcmp(name, "Controllevel") == 0) {
strcopy(LANGUAGE.Controllevel, val, sizeof(LANGUAGE.Controllevel));
return;
}
if (strcmp(name, "CorrectPassword") == 0) {
strcopy(LANGUAGE.CorrectPassword, val, sizeof(LANGUAGE.CorrectPassword));
return;
@ -396,6 +411,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.Credits, val, sizeof(LANGUAGE.Credits));
return;
}
if (strcmp(name, "Custompaths") == 0) {
strcopy(LANGUAGE.Custompaths, val, sizeof(LANGUAGE.Custompaths));
return;
}
if (strcmp(name, "DiscImages") == 0) {
strcopy(LANGUAGE.DiscImages, val, sizeof(LANGUAGE.DiscImages));
return;
@ -432,6 +451,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.Doyouwanttoretryfor30secs, val, sizeof(LANGUAGE.Doyouwanttoretryfor30secs));
return;
}
if (strcmp(name, "Doyouwanttochangelanguage") == 0) {
strcopy(LANGUAGE.Doyouwanttochangelanguage, val, sizeof(LANGUAGE.Doyouwanttochangelanguage));
return;
}
if (strcmp(name, "Downloadingfile") == 0) {
strcopy(LANGUAGE.Downloadingfile, val, sizeof(LANGUAGE.Downloadingfile));
return;
@ -452,6 +475,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.Defaultsettings, val, sizeof(LANGUAGE.Defaultsettings));
return;
}
if (strcmp(name, "Default") == 0) {
strcopy(LANGUAGE.Default, val, sizeof(LANGUAGE.Default));
return;
}
if (strcmp(name, "Error") == 0) {
strcopy(LANGUAGE.Error, val, sizeof(LANGUAGE.Error));
return;
@ -608,6 +635,14 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.GoBack, val, sizeof(LANGUAGE.GoBack));
return;
}
if (strcmp(name, "GUISettings") == 0) {
strcopy(LANGUAGE.GUISettings, val, sizeof(LANGUAGE.GUISettings));
return;
}
if (strcmp(name, "Gameload") == 0) {
strcopy(LANGUAGE.Gameload, val, sizeof(LANGUAGE.Gameload));
return;
}
if (strcmp(name, "GotoPage") == 0) {
strcopy(LANGUAGE.GotoPage, val, sizeof(LANGUAGE.GotoPage));
return;
@ -624,11 +659,14 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.keyboard, val, sizeof(LANGUAGE.keyboard));
return;
}
if (strcmp(name, "Language") == 0) {
strcopy(LANGUAGE.Language, val, sizeof(LANGUAGE.Language));
return;
}
if (strcmp(name, "Languagepathchanged") == 0) {
strcopy(LANGUAGE.Languagepathchanged, val, sizeof(LANGUAGE.Languagepathchanged));
return;
}
if (strcmp(name, "Langchange") == 0) {
strcopy(LANGUAGE.Langchange, val, sizeof(LANGUAGE.Langchange));
return;
@ -869,6 +907,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.Setasbackgroundmusic, val, sizeof(LANGUAGE.Setasbackgroundmusic));
return;
}
if (strcmp(name, "Sound") == 0) {
strcopy(LANGUAGE.Sound, val, sizeof(LANGUAGE.Sound));
return;
}
if (strcmp(name, "ShutdowntoIdle") == 0) {
strcopy(LANGUAGE.ShutdowntoIdle, val, sizeof(LANGUAGE.ShutdowntoIdle));
return;
@ -941,6 +983,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.Unlock, val, sizeof(LANGUAGE.Unlock));
return;
}
if (strcmp(name, "UnlockConsoletousethisOption") == 0) {
strcopy(LANGUAGE.UnlockConsoletousethisOption, val, sizeof(LANGUAGE.UnlockConsoletousethisOption));
return;
}
if (strcmp(name, "Unicodefix") == 0) {
strcopy(LANGUAGE.Unicodefix, val, sizeof(LANGUAGE.Unicodefix));
return;
@ -977,6 +1023,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.Updateto, val, sizeof(LANGUAGE.Updateto));
return;
}
if (strcmp(name, "Update") == 0) {
strcopy(LANGUAGE.Update, val, sizeof(LANGUAGE.Update));
return;
}
if (strcmp(name, "USBLoaderisprotected") == 0) {
strcopy(LANGUAGE.USBLoaderisprotected, val, sizeof(LANGUAGE.USBLoaderisprotected));
return;
@ -997,6 +1047,10 @@ void language_set(char *name, char *val)
strcopy(LANGUAGE.Volume, val, sizeof(LANGUAGE.Volume));
return;
}
if (strcmp(name, "SFXVolume") == 0) {
strcopy(LANGUAGE.SFXVolume, val, sizeof(LANGUAGE.SFXVolume));
return;
}
if (strcmp(name, "Waiting") == 0) {
strcopy(LANGUAGE.Waiting, val, sizeof(LANGUAGE.Waiting));
return;

View File

@ -11,7 +11,6 @@ extern "C"
struct LANGUAGE
{
char t3Covers[50];
char addToFavorite[50];
char all[30];
@ -39,6 +38,7 @@ struct LANGUAGE
char ConsoleDefault[50];
char Consoleshouldbeunlockedtomodifyit[100];
char ConsoleLocked[50];
char Controllevel[50];
char CorrectPassword[50];
char Couldnotinitializenetwork[50];
char CouldnotopenDisc[50];
@ -49,6 +49,7 @@ struct LANGUAGE
char Coverpathchange[50];
char count[20];
char Credits[30];
char Custompaths[60];
char DiscImages[50];
char DiscimagePath[50];
char DiscpathChanged[50];
@ -59,11 +60,13 @@ struct LANGUAGE
char Doyoureallywanttodelete[50];
char Doyouwanttoretryfor30secs[80];
char Doyouwanttoupdate[50];
char Doyouwanttochangelanguage[80];
char Downloadingfile[50];
char DownloadBoxartimage[50];
char Downloadfinished[50];
char Defaultgamesettings[50];
char Defaultsettings[40];
char Default[40];
char Error[30];
char BOOTERROR[50];
char ErrorreadingDisc[50];
@ -101,12 +104,15 @@ struct LANGUAGE
char GameRegion[50];
char GameSize[50];
char GoBack[50];
char GotoPage[50];///////
char GotoPage[50];
char GUISettings[80];
char Gameload[50];
char HowtoShutdown[50];
char Homemenu[30];
char hour[30];
char keyboard[50];
char Language[50];
char Languagepathchanged[80];
char Langchange[50];
char Left[50];
char LikeSysMenu[50];
@ -172,6 +178,7 @@ struct LANGUAGE
char settings[50];
char Setasbackgroundmusic[90];
char Standard[30];
char Sound[40];
char ShutdowntoIdle[50];
char ShutdownSystem[50];
char Success[30];
@ -190,6 +197,7 @@ struct LANGUAGE
char Tooltips[50];
char Timeleft[50];
char Unlock[50];
char UnlockConsoletousethisOption[100];
char Unicodefix[50];
char Uninstall[50];
char USBLoaderisprotected[80];
@ -201,9 +209,11 @@ struct LANGUAGE
char Updatedol[40];
char Updateall[40];
char Updateto[40];
char Update[40];
char VideoMode[50];
char VIDTVPatch[50];
char Volume[50];
char SFXVolume[50];
char Waiting[50];
char WaitingforUSBDevice[80];
char WidescreenFix[50];

View File

@ -8,6 +8,7 @@
#include "gui.h"
#include "../wpad.h"
#include "../main.h"
#include "../cfg.h"
#include "gui_customoptionbrowser.h"
@ -77,10 +78,6 @@ void customOptionList::SetValue(int i, const char *format, ...)
}
}
//int vol;
extern const int vol;
/**
* Constructor for the GuiCustomOptionBrowser class.
*/
@ -102,7 +99,7 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
trigHeldA = new GuiTrigger;
trigHeldA->SetHeldTrigger(-1, WPAD_BUTTON_A, PAD_BUTTON_A);
btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, vol);
btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume);
snprintf(imgPath, sizeof(imgPath), "%s%s", themePath, custombg);
bgOptions = new GuiImageData(imgPath, imagebg);
@ -315,6 +312,14 @@ int GuiCustomOptionBrowser::GetSelectedOption()
return found;
}
void GuiCustomOptionBrowser::SetClickable(bool enable)
{
for(int i = 0; i < size; i++)
{
optionBtn[i]->SetClickable(enable);
}
}
/****************************************************************************
* FindMenuItem
*
@ -419,8 +424,10 @@ void GuiCustomOptionBrowser::Update(GuiTrigger * t)
if(state == STATE_DISABLED || !t)
return;
if(options->IsChanged())
if(options->IsChanged()) {
coL2 = 0;
UpdateListEntries();
}
int old_listOffset = listOffset;
// scrolldelay affects how fast the list scrolls

View File

@ -38,6 +38,7 @@ class GuiCustomOptionBrowser : public GuiElement
int FindMenuItem(int c, int d);
int GetClickedOption();
int GetSelectedOption();
void SetClickable(bool enable);
void ResetState();
void SetFocus(int f);
void Draw();

View File

@ -12,12 +12,12 @@
#include <unistd.h>
#include "gui_gamebrowser.h"
#include "../cfg.h"
#include "../main.h"
#include <string.h>
#include <sstream>
#define GAMESELECTSIZE 30
extern const int vol;
int txtscroll = 0;
/**
* Constructor for the GuiGameBrowser class.
@ -40,7 +40,7 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
trigHeldA = new GuiTrigger;
trigHeldA->SetHeldTrigger(-1, WPAD_BUTTON_A, PAD_BUTTON_A);
btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, vol);
btnSoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume);
snprintf(imgPath, sizeof(imgPath), "%sbg_options.png", themePath);
bgGames = new GuiImageData(imgPath, imagebg);

View File

@ -26,8 +26,6 @@
#define SPEED_STEP 4
#define SAFETY 320
extern const int vol;
/**
* Constructor for the GuiGameCarousel class.
*/
@ -58,8 +56,8 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, struct discHdr * l, int count, co
trigMinus = new GuiTrigger;
trigMinus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0);
btnSoundClick = new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol);
btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
btnSoundClick = new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_left.png", CFG.theme_path);
imgLeft = new GuiImageData(imgPath, startgame_arrow_left_png);

View File

@ -17,9 +17,6 @@
#include <string.h>
#include <sstream>
extern const int vol;
/**
* Constructor for the GuiGameGrid class.
*/
@ -50,8 +47,8 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int gameCnt, const ch
trigMinus = new GuiTrigger;
trigMinus->SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0);
btnSoundClick = new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol);
btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
btnSoundClick = new GuiSound(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
btnSoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_left.png", CFG.theme_path);
imgLeft = new GuiImageData(imgPath, startgame_arrow_left_png);

View File

@ -9,12 +9,13 @@
***************************************************************************/
#include "gui.h"
#include "../main.h"
#include "../cfg.h"
#include <stdio.h>
#include <string.h>
/**
* Constructor for the GuiKeyboard class.
*/
extern const int vol;
unsigned int m;
//const Key thekeys;
GuiKeyboard::GuiKeyboard(char * t, u32 max, int min, int lang)
@ -286,8 +287,8 @@ GuiKeyboard::GuiKeyboard(char * t, u32 max, int min, int lang)
keyLarge = new GuiImageData(keyboard_largekey_over_png);
keyLargeOver = new GuiImageData(keyboard_largekey_over_png);
keySoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
keySoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, vol);
keySoundOver = new GuiSound(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
keySoundClick = new GuiSound(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume);
trigA = new GuiTrigger;
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
trigB = new GuiTrigger;

View File

@ -10,8 +10,8 @@
#include "listfiles.h"
char alldirfiles[300][70];
char filename[80];
static char alldirfiles[300][70];
char filenames[80];
bool findfile(const char * filename, const char * path)
{
@ -35,6 +35,10 @@ while ((file = readdir(dir)))
return false;
}
char * GetFileName(int i)
{
return alldirfiles[i];
}
s32 filenamescmp(const void *a, const void *b)
{
@ -42,7 +46,7 @@ s32 filenamescmp(const void *a, const void *b)
return stricmp((char *)a, (char *)b);
}
int GetFiles(char * filespath)
int GetAllDirFiles(char * filespath)
{
int countfiles = 0;
@ -57,12 +61,12 @@ if (dir == NULL) //If empty
}
else
{
while (dirnext(dir,filename,&st) == 0)
while (dirnext(dir,filenames,&st) == 0)
{
if ((st.st_mode & S_IFDIR) == 0)
{
// st.st_mode & S_IFDIR indicates a directory
snprintf(alldirfiles[countfiles], 70, "%s", filename);
snprintf(alldirfiles[countfiles], 70, "%s", filenames);
countfiles++;
}
}

View File

@ -7,7 +7,8 @@ extern "C"
#endif
bool findfile(const char * filename, const char * path);
int GetFiles(char * filespath);
char * GetFileName(int i);
int GetAllDirFiles(char * filespath);
#ifdef __cplusplus

View File

@ -1,6 +1,8 @@
/****************************************************************************
* USB Loader GX Team
*
* libwiigui Template
* Tantric 2009
* by Tantric 2009
*
* menu.cpp
* Menu flow routines - handles all menu logic
@ -40,7 +42,6 @@ GuiImageData * pointer[4];
GuiImage * bgImg = NULL;
GuiImageData * background = NULL;
GuiSound * bgMusic = NULL;
int vol = Settings.volume;
float gamesize;
/*** Variables used only in menu.cpp ***/
@ -57,8 +58,6 @@ static char gameregion[7];
extern FreeTypeGX *fontClock;
extern u8 shutdown;
extern u8 reset;
extern char alldirfiles[300][70];
extern char missingFiles[500][12];
extern int cntMissFiles;
extern int networkisinitialized;
extern struct discHdr * gameList;
@ -203,8 +202,8 @@ static int MenuDiscList()
nolist = 1;
}
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
snprintf(imgPath, sizeof(imgPath), "%sbutton_install.png", CFG.theme_path);
GuiImageData btnInstall(imgPath, button_install_png);
@ -609,7 +608,7 @@ static int MenuDiscList()
bgMusic->PlayOggFile(Settings.ogg_path);
}
bgMusic->SetPlayTime(thetimeofbg);
SetVolumeOgg(255*(vol/100.0));
SetVolumeOgg(255*(Settings.volume/100.0));
if(choice == 3)
{
@ -695,7 +694,7 @@ static int MenuDiscList()
if (netcheck)
{
if (missingFiles != NULL && cntMissFiles > 0)
if (GetMissingFiles() != NULL && cntMissFiles > 0)
{
char tempCnt[40];
@ -1389,7 +1388,7 @@ static int MenuInstall()
char *name;
static char buffer[MAX_CHARACTERS + 4];
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
char imgPath[100];
@ -1572,8 +1571,8 @@ static int MenuFormat()
options.length = cnt;
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 btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, Settings.sfxvolume);
snprintf(imgPath, sizeof(imgPath), "%swiimote_poweroff.png", CFG.theme_path);
GuiImageData btnpwroff(imgPath, wiimote_poweroff_png);
snprintf(imgPath, sizeof(imgPath), "%swiimote_poweroff_over.png", CFG.theme_path);
@ -1802,333 +1801,6 @@ static int MenuCheck()
return menu;
}
/****************************************************************************
* MenuOGG
***************************************************************************/
int MenuOGG()
{
int menu = MENU_NONE, cnt = 0;
int ret = 0, choice = 0;
int scrollon, nothingchanged = 0;
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, vol);
GuiSound btnClick(button_click2_pcm, button_click2_pcm_size, SOUND_PCM, vol);
char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png);
snprintf(imgPath, sizeof(imgPath), "%ssettings_background.png", CFG.theme_path);
GuiImageData settingsbg(imgPath, settings_background_png);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiTrigger trigMinus;
trigMinus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS, 0);
GuiTrigger trigPlus;
trigPlus.SetButtonOnlyTrigger(-1, WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS, 0);
char fullpath[150];
char shortpath[35];
int countoggs = GetFiles(Settings.oggload_path);
if(!strcmp("", Settings.oggload_path)) {
sprintf(shortpath, "%s", LANGUAGE.Standard);
} else if (strlen(Settings.oggload_path) < (27 + 3)) {
sprintf(shortpath, "%s", Settings.oggload_path);
}
else {
strncpy(shortpath, Settings.oggload_path, 27);
shortpath[27] = '\0';
strncat(shortpath, "...", 3);
}
GuiText titleTxt(shortpath, 24, (GXColor){0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
titleTxt.SetPosition(0,0);
GuiButton pathBtn(300, 50);
pathBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
pathBtn.SetPosition(0,28);
pathBtn.SetLabel(&titleTxt);
pathBtn.SetSoundOver(&btnSoundOver);
pathBtn.SetSoundClick(&btnClick);
pathBtn.SetTrigger(&trigA);
pathBtn.SetEffectGrow();
GuiImage oggmenubackground(&settingsbg);
oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
oggmenubackground.SetPosition(0, 0);
GuiText backBtnTxt(LANGUAGE.Back , 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes){
backBtnTxt.SetWidescreen(CFG.widescreen);
backBtnImg.SetWidescreen(CFG.widescreen);
}
GuiButton backBtn(btnOutline.GetWidth(), btnOutline.GetHeight());
backBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
backBtn.SetPosition(-180, 400);
backBtn.SetLabel(&backBtnTxt);
backBtn.SetImage(&backBtnImg);
backBtn.SetSoundOver(&btnSoundOver);
backBtn.SetSoundClick(&btnClick);
backBtn.SetTrigger(&trigA);
backBtn.SetTrigger(&trigB);
backBtn.SetEffectGrow();
customOptionList options2(countoggs);
for (cnt = 0; cnt < countoggs; cnt++) {
char tmp[30];
snprintf(tmp , 30, "%s", alldirfiles[cnt]);
options2.SetValue(cnt, "%s", tmp);
options2.SetName(cnt,"%i.", cnt+1);
}
// options2.length = cnt;
if(cnt < 9) {
scrollon = 0;
} else {
scrollon = 1;
}
GuiCustomOptionBrowser optionBrowser4(396, 280, &options2, CFG.theme_path, "bg_options_settings.png", bg_options_settings_png, scrollon, 55);
optionBrowser4.SetPosition(0, 90);
optionBrowser4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
int songPlaying=0;
snprintf(imgPath, sizeof(imgPath), "%sarrow_next.png", CFG.theme_path);
GuiImageData next(imgPath, arrow_next_png);
snprintf(imgPath, sizeof(imgPath), "%sarrow_previous.png", CFG.theme_path);
GuiImageData prev(imgPath, arrow_previous_png);
snprintf(imgPath, sizeof(imgPath), "%smp3_stop.png", CFG.theme_path);
GuiImageData stop(imgPath, mp3_stop_png);
snprintf(imgPath, sizeof(imgPath), "%smp3_pause.png", CFG.theme_path);
GuiImageData pause(imgPath, mp3_pause_png);
snprintf(imgPath, sizeof(imgPath), "%sstartgame_arrow_right.png", CFG.theme_path);
GuiImageData play(imgPath, startgame_arrow_right_png);
GuiImage nextBtnImg(&next);
GuiButton nextBtn(next.GetWidth(), next.GetHeight());
nextBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
nextBtn.SetPosition(130, 400);
nextBtn.SetImage(&nextBtnImg);
nextBtn.SetSoundOver(&btnSoundOver);
nextBtn.SetSoundClick(&btnClick);
nextBtn.SetTrigger(&trigA);
nextBtn.SetEffectGrow();
GuiImage prevBtnImg(&prev);
prevBtnImg.SetWidescreen(CFG.widescreen);
GuiButton prevBtn(prev.GetWidth(), prev.GetHeight());
prevBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
prevBtn.SetPosition(-60, 400);
prevBtn.SetImage(&prevBtnImg);
prevBtn.SetSoundOver(&btnSoundOver);
prevBtn.SetSoundClick(&btnClick);
prevBtn.SetTrigger(&trigA);
prevBtn.SetEffectGrow();
GuiImage playBtnImg(&play);
playBtnImg.SetWidescreen(CFG.widescreen);
GuiButton playBtn(play.GetWidth(), play.GetHeight());
playBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
playBtn.SetPosition(72, 400);
playBtn.SetImage(&playBtnImg);
playBtn.SetSoundOver(&btnSoundOver);
playBtn.SetSoundClick(&btnClick);
playBtn.SetTrigger(&trigA);
playBtn.SetTrigger(&trigPlus);
playBtn.SetEffectGrow();
GuiImage stopBtnImg(&stop);
stopBtnImg.SetWidescreen(CFG.widescreen);
GuiButton stopBtn(stop.GetWidth(), stop.GetHeight());
stopBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
stopBtn.SetPosition(17, 400);
stopBtn.SetImage(&stopBtnImg);
stopBtn.SetSoundOver(&btnSoundOver);
stopBtn.SetSoundClick(&btnClick);
stopBtn.SetTrigger(&trigA);
stopBtn.SetTrigger(&trigMinus);
stopBtn.SetEffectGrow();
HaltGui();
GuiWindow w(screenwidth, screenheight);
w.Append(&oggmenubackground);
w.Append(&pathBtn);
w.Append(&backBtn);
w.Append(&playBtn);
w.Append(&nextBtn);
w.Append(&prevBtn);
w.Append(&stopBtn);
mainWindow->Append(&w);
mainWindow->Append(&optionBrowser4);
ResumeGui();
while(menu == MENU_NONE)
{
if (backBtn.GetState() == STATE_CLICKED) {
if(nothingchanged == 1 && countoggs > 0) {
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play();
} else {
bgMusic->PlayOggFile(Settings.ogg_path);
}
}
menu = MENU_SETTINGS;
break;
}
if (pathBtn.GetState() == STATE_CLICKED) {
mainWindow->Remove(&optionBrowser4);
w.Remove(&backBtn);
w.Remove(&pathBtn);
w.Remove(&playBtn);
w.Remove(&nextBtn);
w.Remove(&prevBtn);
w.Remove(&stopBtn);
char entered[43] = "";
strncpy(entered, Settings.oggload_path, sizeof(entered));
int result = OnScreenKeyboard(entered,43,0);
mainWindow->Append(&optionBrowser4);
w.Append(&pathBtn);
w.Append(&backBtn);
w.Append(&playBtn);
w.Append(&nextBtn);
w.Append(&prevBtn);
w.Append(&stopBtn);
if ( result == 1 ) {
int len = (strlen(entered)-1);
if(entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.oggload_path, entered, sizeof(Settings.oggload_path));
WindowPrompt(LANGUAGE.Backgroundmusicpath,0,LANGUAGE.ok,0,0,0);
if(isSdInserted()) {
if(!strcmp("", Settings.oggload_path)) {
sprintf(Settings.ogg_path, "notset");
bgMusic->Play();
}
cfg_save_global();
menu = MENU_OGG;
break;
} else {
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
}
}
if(countoggs > 0) {
optionBrowser4.SetFocus(1);
}
pathBtn.ResetState();
}
ret = optionBrowser4.GetClickedOption();
if(ret>=0) {
choice = WindowPrompt(LANGUAGE.Setasbackgroundmusic,alldirfiles[ret],LANGUAGE.Yes,LANGUAGE.No,0,0);
if(choice == 1) {
snprintf(fullpath,150,"%s%s",Settings.oggload_path,alldirfiles[ret]);
choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) {
WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0);
sprintf(Settings.ogg_path, "notset");
bgMusic->Play();
SetVolumeOgg(255*(vol/100.0));
} else {
snprintf(Settings.ogg_path, sizeof(Settings.ogg_path), "%s", fullpath);
cfg_save_global();
SetVolumeOgg(255*(vol/100.0));
nothingchanged = 0;
}
}
optionBrowser4.SetFocus(1);
}
if (playBtn.GetState() == STATE_CLICKED && countoggs > 0) {
if(countoggs > 0) {
ret = optionBrowser4.GetSelectedOption();
songPlaying=ret;
snprintf(fullpath, 150,"%s%s", Settings.oggload_path,alldirfiles[ret]);
choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) {
WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0);
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play();
} else {
bgMusic->PlayOggFile(Settings.ogg_path);
}
}
SetVolumeOgg(255*(vol/100.0));
songPlaying=ret;
nothingchanged = 1;
optionBrowser4.SetFocus(1);
}
playBtn.ResetState();
}
if(nextBtn.GetState() == STATE_CLICKED){
if(countoggs > 0) {
songPlaying++;
if (songPlaying>(countoggs - 1)){songPlaying=0;}
snprintf(fullpath,150,"%s%s", Settings.oggload_path,alldirfiles[songPlaying]);
choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) {
WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0);
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play();
} else {
bgMusic->PlayOggFile(Settings.ogg_path);
}
}
nothingchanged = 1;
optionBrowser4.SetFocus(1);
}
SetVolumeOgg(255*(vol/100.0));
nextBtn.ResetState();
}
if(prevBtn.GetState() == STATE_CLICKED) {
if(countoggs > 0) {
songPlaying--;
if (songPlaying<0){songPlaying=(countoggs - 1);}
snprintf(fullpath,150,"%s%s", Settings.oggload_path,alldirfiles[songPlaying]);
choice = bgMusic->PlayOggFile(fullpath);
if(choice < 0) {
WindowPrompt(LANGUAGE.Notasupportedformat, LANGUAGE.Loadingstandardmusic, LANGUAGE.ok, 0,0,0);
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
bgMusic->Play();
} else {
bgMusic->PlayOggFile(Settings.ogg_path);
}
}
nothingchanged = 1;
optionBrowser4.SetFocus(1);
}
SetVolumeOgg(255*(vol/100.0));
prevBtn.ResetState();
}
if(stopBtn.GetState() == STATE_CLICKED) {
if(countoggs > 0) {
StopOgg();
nothingchanged = 1;
optionBrowser4.SetFocus(1);
}
stopBtn.ResetState();
}
}
HaltGui();
mainWindow->Remove(&optionBrowser4);
mainWindow->Remove(&w);
ResumeGui();
return menu;
}
/****************************************************************************
* MainMenu
@ -2164,8 +1836,8 @@ int MainMenu(int menu)
ResumeGui();
bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, SOUND_OGG, vol);
bgMusic->SetVolume(vol);
bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, SOUND_OGG, Settings.volume);
bgMusic->SetVolume(Settings.volume);
bgMusic->SetLoop(1); //loop music
// startup music
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
@ -2176,7 +1848,7 @@ int MainMenu(int menu)
while(currentMenu != MENU_EXIT)
{
SetVolumeOgg(255*(vol/100.0));
SetVolumeOgg(255*(Settings.volume/100.0));
switch (currentMenu)
{
@ -2195,53 +1867,10 @@ int MainMenu(int menu)
case MENU_DISCLIST:
currentMenu = MenuDiscList();
break;
case MENU_OGG:
currentMenu = MenuOGG();
break;
default: // unrecognized menu
currentMenu = MenuCheck();
break;
}
switch (Settings.volume)
{
case v10:
vol = 10;
break;
case v20:
vol = 20;
break;
case v30:
vol = 30;
break;
case v40:
vol = 40;
break;
case v50:
vol = 50;
break;
case v60:
vol = 60;
break;
case v70:
vol = 70;
break;
case v80:
vol = 80;
break;
case v90:
vol = 90;
break;
case v100:
vol = 100;
break;
case v0:
vol = 0;
break;
default:
vol = 80;
break;
}
}
ExitGUIThreads();
@ -2276,6 +1905,7 @@ int MainMenu(int menu)
languageChoice = game_cfg->language;
ocarinaChoice = game_cfg->ocarina;
viChoice = game_cfg->vipatch;
fix002 = game_cfg->errorfix002;
} else {
@ -2283,8 +1913,19 @@ int MainMenu(int menu)
languageChoice = Settings.language;
ocarinaChoice = Settings.ocarina;
viChoice = Settings.vpatch;
fix002 = off;
}
u8 errorfixer002 = 0;
switch(fix002)
{
case on:
errorfixer002 = 1;
break;
case off:
errorfixer002 = 0;
break;
}
switch(languageChoice)
{
@ -2405,7 +2046,7 @@ int MainMenu(int menu)
}
int ret = 0;
ret = Disc_WiiBoot(videoselected, cheat, vipatch, Settings.patchcountrystrings);
ret = Disc_WiiBoot(videoselected, cheat, vipatch, Settings.patchcountrystrings, errorfixer002);
if (ret < 0) {
Sys_LoadMenu();
}

View File

@ -27,8 +27,7 @@ enum
MENU_FORMAT,
MENU_INSTALL,
MENU_CHECK,
MENU_GAME_SETTINGS,
MENU_OGG
MENU_GAME_SETTINGS
};
#endif