mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-22 11:19:17 +01:00
Added sound after successful disc installation (823). Battery indicator turns red when power is down to 1/4 like on the original Wii menu (456). Fixed code dump when setting "standard" music (602). Updated gecko codes URL to geckocodes.org (834), enabled reading CRLF txt files from geckocodes.org. Enabled longer synopsis text so that existing game descriptions aren't cut on the game info page (but please keep them short, this is for descriptions, not reviews).
This commit is contained in:
parent
ac175e1d07
commit
dd1700db8e
File diff suppressed because one or more lines are too long
2
gui.pnps
2
gui.pnps
@ -1 +1 @@
|
||||
<pd><ViewState><e p="gui\source\mload" x="false"></e><e p="gui\source\settings" x="true"></e><e p="gui\source\images" x="false"></e><e p="gui\source\prompts" x="true"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="false"></e><e p="gui\source\network" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\ramdisc" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="true"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="true"></e><e p="gui\source\patches" x="false"></e></ViewState></pd>
|
||||
<pd><ViewState><e p="gui\source\mload" x="false"></e><e p="gui\source\settings" x="true"></e><e p="gui\source\images" x="false"></e><e p="gui\source\prompts" x="true"></e><e p="gui\source\banner" x="false"></e><e p="gui\source\cheats" x="true"></e><e p="gui\source\network" x="false"></e><e p="gui\source\unzip" x="false"></e><e p="gui\source\usbloader" x="false"></e><e p="gui\source\xml" x="true"></e><e p="gui\source\fonts" x="false"></e><e p="gui\source\ramdisc" x="false"></e><e p="gui\source\sounds" x="false"></e><e p="gui\source\wad" x="false"></e><e p="gui" x="true"></e><e p="gui\source\homebrewboot" x="true"></e><e p="gui\source\language" x="false"></e><e p="gui\source" x="true"></e><e p="gui\source\libwbfs" x="false"></e><e p="gui\source\libwiigui" x="true"></e><e p="gui\source\patches" x="false"></e></ViewState></pd>
|
@ -175,20 +175,34 @@ int GCTCheats::openTxtfile(const char * filename) {
|
||||
filestr.seekg(0,ios_base::beg);
|
||||
|
||||
getline(filestr,sGameID);
|
||||
if (sGameID[sGameID.length() - 1] == '\r')
|
||||
sGameID.erase(sGameID.length() - 1);
|
||||
|
||||
getline(filestr,sGameTitle);
|
||||
filestr.ignore();
|
||||
if (sGameTitle[sGameTitle.length() - 1] == '\r')
|
||||
sGameTitle.erase(sGameTitle.length() - 1);
|
||||
|
||||
//filestr.ignore();
|
||||
getline(filestr,sCheatName[i]); // skip first line if file uses CRLF
|
||||
if (!sGameTitle[sGameTitle.length() - 1] == '\r')
|
||||
filestr.seekg(0,ios_base::beg);
|
||||
|
||||
while (!filestr.eof()) {
|
||||
getline(filestr,sCheatName[i]);
|
||||
|
||||
getline(filestr,sCheatName[i]); // '\n' delimiter by default
|
||||
if (sCheatName[i][sCheatName[i].length() - 1] == '\r')
|
||||
sCheatName[i].erase(sCheatName[i].length() - 1);
|
||||
|
||||
string cheatdata;
|
||||
bool emptyline = false;
|
||||
bool isComment = false;
|
||||
|
||||
do {
|
||||
getline(filestr,str,'\n');
|
||||
//cheatdata.append(str);
|
||||
|
||||
if (str == "") {
|
||||
getline(filestr,str);
|
||||
if (str[str.length() - 1] == '\r')
|
||||
str.erase(str.length() - 1);
|
||||
|
||||
if (str == "" || str[0] == '\r' || str[0] == '\n') {
|
||||
emptyline = true;
|
||||
break;
|
||||
}
|
||||
|
@ -62,6 +62,9 @@ extern const u32 menuin_ogg_size;
|
||||
extern const u8 menuout_ogg[];
|
||||
extern const u32 menuout_ogg_size;
|
||||
|
||||
extern const u8 success_ogg[];
|
||||
extern const u32 success_ogg_size;
|
||||
|
||||
extern const u8 credits_button_png[];
|
||||
extern const u32 credits_button_png_size;
|
||||
|
||||
@ -269,6 +272,9 @@ extern const u32 battery_bar_white_png_size;
|
||||
extern const u8 battery_red_png[];
|
||||
extern const u32 battery_red_png_size;
|
||||
|
||||
extern const u8 battery_bar_red_png[];
|
||||
extern const u32 battery_bar_red_png_size;
|
||||
|
||||
extern const u8 arrow_next_png[];
|
||||
extern const u32 arrow_next_png_size;
|
||||
|
||||
|
BIN
source/images/battery_bar_red.png
Normal file
BIN
source/images/battery_bar_red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 B |
Binary file not shown.
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 146 B |
@ -323,10 +323,12 @@ int MenuDiscList() {
|
||||
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery.png", CFG.theme_path);
|
||||
GuiImageData battery(imgPath, battery_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
||||
GuiImageData batteryRed(imgPath, battery_red_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar.png", CFG.theme_path);
|
||||
GuiImageData batteryBar(imgPath, battery_bar_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
||||
GuiImageData batteryRed(imgPath, battery_red_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar_red.png", CFG.theme_path);
|
||||
GuiImageData batteryBarRed(imgPath, battery_bar_red_png);
|
||||
|
||||
snprintf(imgPath, sizeof(imgPath), "%sfavIcon.png", CFG.theme_path);
|
||||
GuiImageData imgfavIcon(imgPath, favIcon_png);
|
||||
@ -1364,11 +1366,13 @@ static int MenuInstall() {
|
||||
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery.png", CFG.theme_path);
|
||||
GuiImageData battery(imgPath, battery_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
||||
GuiImageData batteryRed(imgPath, battery_red_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar.png", CFG.theme_path);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar.png", CFG.theme_path);
|
||||
GuiImageData batteryBar(imgPath, battery_bar_png);
|
||||
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
||||
GuiImageData batteryRed(imgPath, battery_red_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar_red.png", CFG.theme_path);
|
||||
GuiImageData batteryBarRed(imgPath, battery_bar_red_png);
|
||||
|
||||
HaltGui();
|
||||
GuiWindow w(screenwidth, screenheight);
|
||||
|
||||
@ -1449,7 +1453,14 @@ static int MenuInstall() {
|
||||
break;
|
||||
} else {
|
||||
__Menu_GetEntries(); //get the entries again
|
||||
GuiSound * instsuccess = NULL;
|
||||
instsuccess = new GuiSound(success_ogg, success_ogg_size, SOUND_OGG, Settings.sfxvolume);
|
||||
instsuccess->SetVolume(Settings.sfxvolume);
|
||||
instsuccess->SetLoop(0);
|
||||
instsuccess->Play();
|
||||
WindowPrompt (tr("Successfully installed:"),name,tr("OK"));
|
||||
instsuccess->Stop();
|
||||
delete instsuccess;
|
||||
menu = MENU_DISCLIST;
|
||||
break;
|
||||
}
|
||||
@ -1529,8 +1540,10 @@ static int MenuFormat() {
|
||||
snprintf(imgPath, sizeof(imgPath), "%smenu_button_over.png", CFG.theme_path);
|
||||
GuiImageData btnhomeOver(imgPath, menu_button_over_png);
|
||||
GuiImageData battery(battery_png);
|
||||
GuiImageData batteryRed(battery_red_png);
|
||||
GuiImageData batteryBar(battery_bar_png);
|
||||
GuiImageData batteryRed(battery_red_png);
|
||||
GuiImageData batteryBarRed(battery_bar_red_png);
|
||||
|
||||
|
||||
GuiTrigger trigA;
|
||||
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
|
||||
|
@ -710,10 +710,13 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
|
||||
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_white.png", CFG.theme_path);
|
||||
GuiImageData battery(imgPath, battery_white_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
||||
GuiImageData batteryRed(imgPath, battery_red_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar_white.png", CFG.theme_path);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar_white.png", CFG.theme_path);
|
||||
GuiImageData batteryBar(imgPath, battery_bar_white_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_red.png", CFG.theme_path);
|
||||
GuiImageData batteryRed(imgPath, battery_red_png);
|
||||
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar_red.png", CFG.theme_path);
|
||||
GuiImageData batteryBarRed(imgPath, battery_bar_red_png);
|
||||
|
||||
|
||||
#ifdef HW_RVL
|
||||
int i = 0, ret = 0, level;
|
||||
@ -871,12 +874,15 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
|
||||
if (WPAD_Probe(i, NULL) == WPAD_ERR_NONE) { // controller connected
|
||||
level = (userInput[i].wpad.battery_level / 100.0) * 4;
|
||||
if (level > 4) level = 4;
|
||||
batteryImg[i]->SetTile(level);
|
||||
|
||||
if (level == 0)
|
||||
batteryBarImg[i]->SetImage(&batteryRed);
|
||||
else
|
||||
|
||||
if (level <= 1) {
|
||||
batteryBarImg[i]->SetImage(&batteryBarRed);
|
||||
batteryImg[i]->SetImage(&batteryRed);
|
||||
} else {
|
||||
batteryBarImg[i]->SetImage(&batteryBar);
|
||||
}
|
||||
|
||||
batteryImg[i]->SetTile(level);
|
||||
|
||||
batteryBtn[i]->SetAlpha(255);
|
||||
} else { // controller not connected
|
||||
@ -3022,11 +3028,11 @@ int CodeDownload(const char *id) {
|
||||
snprintf(txtpath, sizeof(txtpath), "%s%s.txt", Settings.TxtCheatcodespath,id);
|
||||
|
||||
char codeurl[150];
|
||||
snprintf(codeurl, sizeof(codeurl), "http://usbgecko.com/codes/codes/R/%s.txt",id);
|
||||
snprintf(codeurl, sizeof(codeurl), "http://geckocodes.org/codes/R/%s.txt",id);
|
||||
|
||||
struct block file = downloadfile(codeurl);
|
||||
|
||||
if (file.size == 333) {
|
||||
if (file.size == 333 || file.size == 216 || file.size == 284) {
|
||||
strcat(codeurl, tr(" is not on the server."));
|
||||
|
||||
WindowPrompt(tr("Error"),codeurl,tr("Ok"));
|
||||
@ -3034,7 +3040,8 @@ int CodeDownload(const char *id) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (file.data != NULL) {
|
||||
if (file.data != NULL) {
|
||||
|
||||
FILE * pfile;
|
||||
pfile = fopen(txtpath, "wb");
|
||||
fwrite(file.data,1,file.size,pfile);
|
||||
|
@ -204,7 +204,7 @@ int showGameInfo(char *ID) {
|
||||
urlBtn.SetTrigger(&trig1);
|
||||
gameinfoWindow.Append(&urlBtn);
|
||||
|
||||
char linebuf[3000] = "";
|
||||
char linebuf[XML_SYNOPSISLEN] = "";
|
||||
char linebuf2[100] = "";
|
||||
|
||||
// enable icons for required accessories
|
||||
|
@ -206,7 +206,8 @@ bool MenuOGG() {
|
||||
cfg_save_global();
|
||||
}
|
||||
defaultBtn.ResetState();
|
||||
optionBrowser4.SetFocus(1);
|
||||
if (countoggs > 0)
|
||||
optionBrowser4.SetFocus(1);
|
||||
}
|
||||
|
||||
if (pathBtn.GetState() == STATE_CLICKED) {
|
||||
|
BIN
source/sounds/success.ogg
Normal file
BIN
source/sounds/success.ogg
Normal file
Binary file not shown.
@ -15,15 +15,16 @@ extern "C" {
|
||||
bool LoadGameInfoFromXML(char* gameid, char* langcode);
|
||||
|
||||
#define XML_ELEMMAX 15
|
||||
#define XML_SYNOPSISLEN 4000
|
||||
|
||||
struct gameXMLinfo {
|
||||
char id[7];
|
||||
char version[50];
|
||||
char region[7];
|
||||
char title[200];
|
||||
char synopsis[3000];
|
||||
char synopsis[XML_SYNOPSISLEN];
|
||||
char title_EN[200];
|
||||
char synopsis_EN[3000];
|
||||
char synopsis_EN[XML_SYNOPSISLEN];
|
||||
char locales[XML_ELEMMAX+1][5];
|
||||
int localeCnt;
|
||||
char developer[75];
|
||||
|
Loading…
Reference in New Issue
Block a user