mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-19 17:59:16 +01:00
*Some fixes.
*Instant change of Language now
This commit is contained in:
parent
5a535a61a6
commit
250fe45e81
69
source/cfg.c
69
source/cfg.c
@ -7,10 +7,7 @@
|
|||||||
#include <ogcsys.h>
|
#include <ogcsys.h>
|
||||||
#include "cfg.h"
|
#include "cfg.h"
|
||||||
#include "language.h"
|
#include "language.h"
|
||||||
//#include "language.c"
|
|
||||||
extern void language_set();
|
|
||||||
extern void lang_default();
|
|
||||||
extern char* strcopy();
|
|
||||||
struct SSettings Settings;
|
struct SSettings Settings;
|
||||||
//struct SSettings2 Settings2;
|
//struct SSettings2 Settings2;
|
||||||
|
|
||||||
@ -450,7 +447,7 @@ void cfg_set(char *name, char *val)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CFG.widescreen && strcmp(name, "wtheme_path") == 0) { // if in 16:9
|
if (CFG.widescreen && strcmp(name, "wtheme_path") == 0) { // if in 16:9
|
||||||
strcopy(CFG.theme_path, val, sizeof(CFG.theme_path));
|
strcopy(CFG.theme_path, val, sizeof(CFG.theme_path));
|
||||||
return;
|
return;
|
||||||
@ -478,10 +475,10 @@ void cfg_set(char *name, char *val)
|
|||||||
strcopy(CFG.unlockCode, val, sizeof(CFG.unlockCode));
|
strcopy(CFG.unlockCode, val, sizeof(CFG.unlockCode));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*if (strcmp(name, "lang_path") == 0) {
|
/*if (strcmp(name, "lang_path") == 0) {
|
||||||
strcopy(, val, sizeof(CFG.unlockCode));
|
strcopy(, val, sizeof(CFG.unlockCode));
|
||||||
return;
|
return;
|
||||||
@ -649,24 +646,24 @@ void theme_set(char *name, char *val)
|
|||||||
THEME.pagesize = x;
|
THEME.pagesize = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(cfg_name, "batteryUnused") == 0) {
|
else if (strcmp(cfg_name, "batteryUnused") == 0) {
|
||||||
short x;
|
short x;
|
||||||
if (sscanf(val, "%hd", &x) == 1) {
|
if (sscanf(val, "%hd", &x) == 1) {
|
||||||
THEME.batteryUnused = x;
|
THEME.batteryUnused = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(cfg_name, "maxcharacters") == 0) {
|
else if (strcmp(cfg_name, "maxcharacters") == 0) {
|
||||||
short x;
|
short x;
|
||||||
if (sscanf(val, "%hd", &x) == 1) {
|
if (sscanf(val, "%hd", &x) == 1) {
|
||||||
THEME.maxcharacters = x;
|
THEME.maxcharacters = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cfg_bool("show_id", &THEME.showID);
|
cfg_bool("show_id", &THEME.showID);
|
||||||
cfg_bool("show_tooltip", &THEME.showToolTip);
|
cfg_bool("show_tooltip", &THEME.showToolTip);
|
||||||
cfg_bool("show_hddinfo", &THEME.showHDD);
|
cfg_bool("show_hddinfo", &THEME.showHDD);
|
||||||
@ -1145,7 +1142,7 @@ bool CFG_forget_game_opt(u8 *id)
|
|||||||
return cfg_save_games();
|
return cfg_save_games();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFG_Load(int argc, char **argv)
|
void CFG_Load()
|
||||||
{
|
{
|
||||||
char pathname[200];
|
char pathname[200];
|
||||||
// bool ret = false;
|
// bool ret = false;
|
||||||
@ -1162,7 +1159,7 @@ void CFG_Load(int argc, char **argv)
|
|||||||
|
|
||||||
snprintf(pathname, sizeof(pathname), "%stheme.txt", CFG.theme_path);
|
snprintf(pathname, sizeof(pathname), "%stheme.txt", CFG.theme_path);
|
||||||
cfg_parsefile(pathname, &theme_set); //finally set console information
|
cfg_parsefile(pathname, &theme_set); //finally set console information
|
||||||
|
|
||||||
snprintf(pathname, sizeof(pathname), CFG.language_path);
|
snprintf(pathname, sizeof(pathname), CFG.language_path);
|
||||||
cfg_parsefile(pathname, &language_set);
|
cfg_parsefile(pathname, &language_set);
|
||||||
|
|
||||||
@ -1179,46 +1176,6 @@ void CFG_Load(int argc, char **argv)
|
|||||||
// load per-game settings
|
// load per-game settings
|
||||||
cfg_load_games();
|
cfg_load_games();
|
||||||
|
|
||||||
|
|
||||||
// cfg_parsearg(argc, argv);
|
|
||||||
}
|
|
||||||
void CFG_ReLoad()
|
|
||||||
{
|
|
||||||
char pathname[200];
|
|
||||||
// bool ret = false;
|
|
||||||
|
|
||||||
//set app path
|
|
||||||
// chdir_app(argv[0]);
|
|
||||||
|
|
||||||
CFG_Default(-1); // set defaults non forced
|
|
||||||
|
|
||||||
snprintf(pathname, sizeof(pathname), "SD:/config/global_settings.cfg");
|
|
||||||
|
|
||||||
cfg_parsefile(pathname, &widescreen_set); //first set widescreen
|
|
||||||
cfg_parsefile(pathname, &cfg_set); //then set config and layout options
|
|
||||||
|
|
||||||
snprintf(pathname, sizeof(pathname), "%stheme.txt", CFG.theme_path);
|
|
||||||
cfg_parsefile(pathname, &theme_set); //finally set console information
|
|
||||||
|
|
||||||
snprintf(pathname, sizeof(pathname), "%slanguage.txt",CFG.language_path);
|
|
||||||
cfg_parsefile(pathname, &language_set);
|
|
||||||
|
|
||||||
|
|
||||||
// if (!ret)
|
|
||||||
// {
|
|
||||||
// cfg_parsefile("SD:/config.txt", &widescreen_set);
|
|
||||||
// cfg_parsefile("SD:/config.txt", &cfg_set);
|
|
||||||
// cfg_parsefile("SD:/config.txt", &console_set);
|
|
||||||
// }
|
|
||||||
|
|
||||||
snprintf(pathname, sizeof(pathname), "SD:/config/titles.txt");
|
|
||||||
cfg_parsetitlefile(pathname, &title_set);
|
|
||||||
|
|
||||||
// load per-game settings
|
|
||||||
cfg_load_games();
|
|
||||||
lang_default();
|
|
||||||
|
|
||||||
|
|
||||||
// cfg_parsearg(argc, argv);
|
// cfg_parsearg(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,8 +159,7 @@ struct Game_CFG
|
|||||||
|
|
||||||
|
|
||||||
void CFG_Default(int widescreen); // -1 = non forced mode
|
void CFG_Default(int widescreen); // -1 = non forced mode
|
||||||
void CFG_Load(int argc, char **argv);
|
void CFG_Load();
|
||||||
void CFG_ReLoad();
|
|
||||||
void lang_defualt();
|
void lang_defualt();
|
||||||
struct Game_CFG* CFG_get_game_opt(u8 *id);
|
struct Game_CFG* CFG_get_game_opt(u8 *id);
|
||||||
bool CFG_save_game_opt(u8 *id);
|
bool CFG_save_game_opt(u8 *id);
|
||||||
|
@ -12,18 +12,18 @@ extern "C"
|
|||||||
struct LANGUAGE
|
struct LANGUAGE
|
||||||
{
|
{
|
||||||
|
|
||||||
char t3Covers[10];
|
char t3Covers[20];
|
||||||
char AppLanguage[10];
|
char AppLanguage[20];
|
||||||
char Areyousure[15];
|
char Areyousure[15];
|
||||||
char AutoPatch[15];
|
char AutoPatch[15];
|
||||||
char Back[10];
|
char Back[15];
|
||||||
char BacktoHBCorWiiMenu[25];
|
char BacktoHBCorWiiMenu[25];
|
||||||
char BacktoLoader[20];
|
char BacktoLoader[20];
|
||||||
char BacktoWiiMenu[20];
|
char BacktoWiiMenu[20];
|
||||||
char BootStandard[20];
|
char BootStandard[20];
|
||||||
char Both[8];
|
char Both[8];
|
||||||
char Cantcreatedirectory[25];
|
char Cantcreatedirectory[25];
|
||||||
char Cancel[10];
|
char Cancel[20];
|
||||||
char Cantbeformated[30];
|
char Cantbeformated[30];
|
||||||
char Cantdelete[25];
|
char Cantdelete[25];
|
||||||
char ClicktoDownloadCovers[30];
|
char ClicktoDownloadCovers[30];
|
||||||
@ -115,10 +115,10 @@ struct LANGUAGE
|
|||||||
char Notenoughfreespace[50];
|
char Notenoughfreespace[50];
|
||||||
char notset[30];
|
char notset[30];
|
||||||
char of[10];
|
char of[10];
|
||||||
char OFF[10];
|
char OFF[15];
|
||||||
char OfficialSite[30];
|
char OfficialSite[30];
|
||||||
char ok[8];
|
char ok[8];
|
||||||
char ON[10];
|
char ON[15];
|
||||||
char Parentalcontrol[25];
|
char Parentalcontrol[25];
|
||||||
char Partition[20];
|
char Partition[20];
|
||||||
char Password[20];
|
char Password[20];
|
||||||
@ -126,7 +126,7 @@ struct LANGUAGE
|
|||||||
char Passwordhasbeenchanged[50];
|
char Passwordhasbeenchanged[50];
|
||||||
char Passwordchange[30];
|
char Passwordchange[30];
|
||||||
char PowerofftheWii[30];
|
char PowerofftheWii[30];
|
||||||
char Prev[10];
|
char Prev[20];
|
||||||
char PromptsButtons[30];
|
char PromptsButtons[30];
|
||||||
char ReloadSD[20];
|
char ReloadSD[20];
|
||||||
char RenameGameonWBFS[30];
|
char RenameGameonWBFS[30];
|
||||||
@ -144,7 +144,7 @@ struct LANGUAGE
|
|||||||
char secondsleft[20];
|
char secondsleft[20];
|
||||||
char SelectthePartition[25];
|
char SelectthePartition[25];
|
||||||
char youwanttoformat[20];
|
char youwanttoformat[20];
|
||||||
char settings[15];
|
char settings[25];
|
||||||
char ShutdowntoIdle[25];
|
char ShutdowntoIdle[25];
|
||||||
char ShutdownSystem[25];
|
char ShutdownSystem[25];
|
||||||
char Success[15];
|
char Success[15];
|
||||||
@ -155,10 +155,10 @@ struct LANGUAGE
|
|||||||
char ThemePath[20];
|
char ThemePath[20];
|
||||||
char ThemepathChanged[30];
|
char ThemepathChanged[30];
|
||||||
char Themepathchange[30];
|
char Themepathchange[30];
|
||||||
char Try[10];
|
char Try[20];
|
||||||
char Tooltips[15];
|
char Tooltips[15];
|
||||||
char Timeleft[15];
|
char Timeleft[15];
|
||||||
char Unlock[10];
|
char Unlock[20];
|
||||||
char Uninstall[15];
|
char Uninstall[15];
|
||||||
char USBLoaderisprotected[40];
|
char USBLoaderisprotected[40];
|
||||||
char USBDevicenotfound[40];
|
char USBDevicenotfound[40];
|
||||||
@ -170,7 +170,7 @@ struct LANGUAGE
|
|||||||
char WidescreenFix[40];
|
char WidescreenFix[40];
|
||||||
char WiiMenu[15];
|
char WiiMenu[15];
|
||||||
char WrongPassword[30];
|
char WrongPassword[30];
|
||||||
char Yes[10];
|
char Yes[20];
|
||||||
char YoudonthavecIOS[30];
|
char YoudonthavecIOS[30];
|
||||||
char Japanese[20];
|
char Japanese[20];
|
||||||
char German[20];
|
char German[20];
|
||||||
@ -184,9 +184,12 @@ struct LANGUAGE
|
|||||||
char Korean[20];
|
char Korean[20];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern struct LANGUAGE LANGUAGE;
|
extern struct LANGUAGE LANGUAGE;
|
||||||
|
|
||||||
|
char* strcopy(char *dest, char *src, int size);
|
||||||
|
void lang_default();
|
||||||
|
void language_set(char *name, char *val);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "video2.h"
|
#include "video2.h"
|
||||||
#include "wpad.h"
|
#include "wpad.h"
|
||||||
#include "cfg.h"
|
#include "cfg.h"
|
||||||
#include "language.c"
|
#include "language.h"
|
||||||
|
|
||||||
|
|
||||||
/* Constants */
|
/* Constants */
|
||||||
@ -111,10 +111,10 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
SDCard_Init();
|
SDCard_Init();
|
||||||
lang_default();
|
lang_default();
|
||||||
CFG_Load(argc, argv);
|
CFG_Load();
|
||||||
|
|
||||||
DefaultSettings();
|
DefaultSettings();
|
||||||
|
|
||||||
|
|
||||||
SDCard_deInit();
|
SDCard_deInit();
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ static void WindowCredits(void * ptr)
|
|||||||
|
|
||||||
txt[i] = new GuiText(": http://code.google.com/p/usbloader-gui/", 20, (GXColor){255, 255, 255, 255});
|
txt[i] = new GuiText(": http://code.google.com/p/usbloader-gui/", 20, (GXColor){255, 255, 255, 255});
|
||||||
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(50,y); i++; //y+=28;
|
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(50,y); i++; //y+=28;
|
||||||
|
|
||||||
txt[i] = new GuiText(LANGUAGE.OfficialSite, 20, (GXColor){255, 255, 255, 255});
|
txt[i] = new GuiText(LANGUAGE.OfficialSite, 20, (GXColor){255, 255, 255, 255});
|
||||||
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(-180,y); i++; y+=28;
|
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(-180,y); i++; y+=28;
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ static void WindowCredits(void * ptr)
|
|||||||
txt[i] = new GuiText(LANGUAGE.Specialthanksto);
|
txt[i] = new GuiText(LANGUAGE.Specialthanksto);
|
||||||
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(-50,y);
|
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(-50,y);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
txt[i] = new GuiText(":");
|
txt[i] = new GuiText(":");
|
||||||
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(30,y+3);
|
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(30,y+3);
|
||||||
i++;
|
i++;
|
||||||
@ -284,7 +284,7 @@ static void WindowCredits(void * ptr)
|
|||||||
txt[i] = new GuiText(LANGUAGE.For);
|
txt[i] = new GuiText(LANGUAGE.For);
|
||||||
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(130,y);
|
txt[i]->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); txt[i]->SetPosition(130,y);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
y+=22;
|
y+=22;
|
||||||
|
|
||||||
txt[i] = new GuiText("Tantric libwiigui");
|
txt[i] = new GuiText("Tantric libwiigui");
|
||||||
@ -1999,7 +1999,7 @@ static int MenuInstall()
|
|||||||
//GuiImageData batteryRed(battery_red_png);
|
//GuiImageData batteryRed(battery_red_png);
|
||||||
//GuiImageData batteryBar(battery_bar_png);
|
//GuiImageData batteryBar(battery_bar_png);
|
||||||
char imgPath[100];
|
char imgPath[100];
|
||||||
|
|
||||||
snprintf(imgPath, sizeof(imgPath), "%sbattery.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%sbattery.png", CFG.theme_path);
|
||||||
GuiImageData battery(imgPath, battery_png);
|
GuiImageData battery(imgPath, battery_png);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
||||||
@ -2022,7 +2022,7 @@ static int MenuInstall()
|
|||||||
sprintf(txt, "P%d", i+1);
|
sprintf(txt, "P%d", i+1);
|
||||||
else
|
else
|
||||||
sprintf(txt, "P%d", i+1);
|
sprintf(txt, "P%d", i+1);
|
||||||
|
|
||||||
batteryTxt[i] = new GuiText(txt, 22, (GXColor){THEME.info_r, THEME.info_g, THEME.info_b, 255});
|
batteryTxt[i] = new GuiText(txt, 22, (GXColor){THEME.info_r, THEME.info_g, THEME.info_b, 255});
|
||||||
batteryTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
batteryTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
|
||||||
batteryImg[i] = new GuiImage(&battery);
|
batteryImg[i] = new GuiImage(&battery);
|
||||||
@ -2282,7 +2282,7 @@ static int MenuDiscList()
|
|||||||
GuiImageData btnhomeOver(imgPath, menu_button_over_png);
|
GuiImageData btnhomeOver(imgPath, menu_button_over_png);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%sSDcard.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%sSDcard.png", CFG.theme_path);
|
||||||
GuiImageData btnsdcard(imgPath, sdcard_png);
|
GuiImageData btnsdcard(imgPath, sdcard_png);
|
||||||
|
|
||||||
snprintf(imgPath, sizeof(imgPath), "%sbattery.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%sbattery.png", CFG.theme_path);
|
||||||
GuiImageData battery(imgPath, battery_png);
|
GuiImageData battery(imgPath, battery_png);
|
||||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
||||||
@ -3943,7 +3943,7 @@ static int MenuSettings()
|
|||||||
}
|
}
|
||||||
/////load new theme//////////////
|
/////load new theme//////////////
|
||||||
mainWindow->Remove(bgImg);
|
mainWindow->Remove(bgImg);
|
||||||
CFG_ReLoad();
|
CFG_Load();
|
||||||
CFG_LoadGlobal();
|
CFG_LoadGlobal();
|
||||||
menu = MENU_SETTINGS;
|
menu = MENU_SETTINGS;
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
@ -3992,7 +3992,7 @@ static int MenuSettings()
|
|||||||
}
|
}
|
||||||
if (pageToDisplay == 3){
|
if (pageToDisplay == 3){
|
||||||
sprintf(options2.value[0], " ");
|
sprintf(options2.value[0], " ");
|
||||||
|
|
||||||
if (strlen(CFG.language_path) < (9 + 3)) {
|
if (strlen(CFG.language_path) < (9 + 3)) {
|
||||||
sprintf(cfgtext, "%s", CFG.language_path);
|
sprintf(cfgtext, "%s", CFG.language_path);
|
||||||
} else {
|
} else {
|
||||||
@ -4001,7 +4001,7 @@ static int MenuSettings()
|
|||||||
strncat(cfgtext, "...", 3);
|
strncat(cfgtext, "...", 3);
|
||||||
}
|
}
|
||||||
sprintf(options2.value[1], "%s", cfgtext);
|
sprintf(options2.value[1], "%s", cfgtext);
|
||||||
|
|
||||||
sprintf(options2.value[2], " ");
|
sprintf(options2.value[2], " ");
|
||||||
sprintf(options2.value[3], " ");
|
sprintf(options2.value[3], " ");
|
||||||
sprintf(options2.value[4], " ");
|
sprintf(options2.value[4], " ");
|
||||||
@ -4019,7 +4019,7 @@ static int MenuSettings()
|
|||||||
pageToDisplay = 0;
|
pageToDisplay = 0;
|
||||||
break;
|
break;
|
||||||
/////
|
/////
|
||||||
|
|
||||||
case 1: // language file path
|
case 1: // language file path
|
||||||
if ( CFG.godmode == 1)
|
if ( CFG.godmode == 1)
|
||||||
{
|
{
|
||||||
@ -4044,13 +4044,15 @@ static int MenuSettings()
|
|||||||
{ strncpy(CFG.language_path, entered, sizeof(CFG.language_path));
|
{ strncpy(CFG.language_path, entered, sizeof(CFG.language_path));
|
||||||
if(isSdInserted() == 1) {
|
if(isSdInserted() == 1) {
|
||||||
cfg_save_global();
|
cfg_save_global();
|
||||||
//CFG_ReLoad();
|
lang_default();
|
||||||
//CFG_LoadGlobal();
|
CFG_Load();
|
||||||
CFG_ReLoad();
|
menu = MENU_SETTINGS;
|
||||||
|
pageToDisplay = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
|
WindowPrompt(LANGUAGE.NoSDcardinserted, LANGUAGE.InsertaSDCardtosave, LANGUAGE.ok, 0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4058,7 +4060,7 @@ static int MenuSettings()
|
|||||||
WindowPrompt(LANGUAGE.Langchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0);
|
WindowPrompt(LANGUAGE.Langchange,LANGUAGE.Consoleshouldbeunlockedtomodifyit,LANGUAGE.ok,0,0,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user