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:
lustar.mii 2009-08-07 16:10:54 +00:00
parent ac175e1d07
commit dd1700db8e
12 changed files with 72 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@ -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>

View File

@ -175,20 +175,34 @@ int GCTCheats::openTxtfile(const char * filename) {
filestr.seekg(0,ios_base::beg); filestr.seekg(0,ios_base::beg);
getline(filestr,sGameID); getline(filestr,sGameID);
if (sGameID[sGameID.length() - 1] == '\r')
sGameID.erase(sGameID.length() - 1);
getline(filestr,sGameTitle); 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()) { 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; string cheatdata;
bool emptyline = false; bool emptyline = false;
bool isComment = false; bool isComment = false;
do { do {
getline(filestr,str,'\n'); getline(filestr,str);
//cheatdata.append(str); if (str[str.length() - 1] == '\r')
str.erase(str.length() - 1);
if (str == "") { if (str == "" || str[0] == '\r' || str[0] == '\n') {
emptyline = true; emptyline = true;
break; break;
} }

View File

@ -62,6 +62,9 @@ extern const u32 menuin_ogg_size;
extern const u8 menuout_ogg[]; extern const u8 menuout_ogg[];
extern const u32 menuout_ogg_size; 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 u8 credits_button_png[];
extern const u32 credits_button_png_size; 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 u8 battery_red_png[];
extern const u32 battery_red_png_size; 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 u8 arrow_next_png[];
extern const u32 arrow_next_png_size; extern const u32 arrow_next_png_size;

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

View File

@ -323,10 +323,12 @@ int MenuDiscList() {
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);
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); 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); snprintf(imgPath, sizeof(imgPath), "%sfavIcon.png", CFG.theme_path);
GuiImageData imgfavIcon(imgPath, favIcon_png); GuiImageData imgfavIcon(imgPath, favIcon_png);
@ -1364,10 +1366,12 @@ static int MenuInstall() {
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);
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); 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(); HaltGui();
GuiWindow w(screenwidth, screenheight); GuiWindow w(screenwidth, screenheight);
@ -1449,7 +1453,14 @@ static int MenuInstall() {
break; break;
} else { } else {
__Menu_GetEntries(); //get the entries again __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")); WindowPrompt (tr("Successfully installed:"),name,tr("OK"));
instsuccess->Stop();
delete instsuccess;
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
break; break;
} }
@ -1529,8 +1540,10 @@ static int MenuFormat() {
snprintf(imgPath, sizeof(imgPath), "%smenu_button_over.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%smenu_button_over.png", CFG.theme_path);
GuiImageData btnhomeOver(imgPath, menu_button_over_png); GuiImageData btnhomeOver(imgPath, menu_button_over_png);
GuiImageData battery(battery_png); GuiImageData battery(battery_png);
GuiImageData batteryRed(battery_red_png);
GuiImageData batteryBar(battery_bar_png); GuiImageData batteryBar(battery_bar_png);
GuiImageData batteryRed(battery_red_png);
GuiImageData batteryBarRed(battery_bar_red_png);
GuiTrigger trigA; GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A); trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);

View File

@ -710,10 +710,13 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
snprintf(imgPath, sizeof(imgPath), "%sbattery_white.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%sbattery_white.png", CFG.theme_path);
GuiImageData battery(imgPath, battery_white_png); 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); 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 #ifdef HW_RVL
int i = 0, ret = 0, level; 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 if (WPAD_Probe(i, NULL) == WPAD_ERR_NONE) { // controller connected
level = (userInput[i].wpad.battery_level / 100.0) * 4; level = (userInput[i].wpad.battery_level / 100.0) * 4;
if (level > 4) level = 4; if (level > 4) level = 4;
batteryImg[i]->SetTile(level);
if (level == 0) if (level <= 1) {
batteryBarImg[i]->SetImage(&batteryRed); batteryBarImg[i]->SetImage(&batteryBarRed);
else batteryImg[i]->SetImage(&batteryRed);
} else {
batteryBarImg[i]->SetImage(&batteryBar); batteryBarImg[i]->SetImage(&batteryBar);
}
batteryImg[i]->SetTile(level);
batteryBtn[i]->SetAlpha(255); batteryBtn[i]->SetAlpha(255);
} else { // controller not connected } else { // controller not connected
@ -3022,11 +3028,11 @@ int CodeDownload(const char *id) {
snprintf(txtpath, sizeof(txtpath), "%s%s.txt", Settings.TxtCheatcodespath,id); snprintf(txtpath, sizeof(txtpath), "%s%s.txt", Settings.TxtCheatcodespath,id);
char codeurl[150]; 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); 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.")); strcat(codeurl, tr(" is not on the server."));
WindowPrompt(tr("Error"),codeurl,tr("Ok")); WindowPrompt(tr("Error"),codeurl,tr("Ok"));
@ -3035,6 +3041,7 @@ int CodeDownload(const char *id) {
} }
if (file.data != NULL) { if (file.data != NULL) {
FILE * pfile; FILE * pfile;
pfile = fopen(txtpath, "wb"); pfile = fopen(txtpath, "wb");
fwrite(file.data,1,file.size,pfile); fwrite(file.data,1,file.size,pfile);

View File

@ -204,7 +204,7 @@ int showGameInfo(char *ID) {
urlBtn.SetTrigger(&trig1); urlBtn.SetTrigger(&trig1);
gameinfoWindow.Append(&urlBtn); gameinfoWindow.Append(&urlBtn);
char linebuf[3000] = ""; char linebuf[XML_SYNOPSISLEN] = "";
char linebuf2[100] = ""; char linebuf2[100] = "";
// enable icons for required accessories // enable icons for required accessories

View File

@ -206,6 +206,7 @@ bool MenuOGG() {
cfg_save_global(); cfg_save_global();
} }
defaultBtn.ResetState(); defaultBtn.ResetState();
if (countoggs > 0)
optionBrowser4.SetFocus(1); optionBrowser4.SetFocus(1);
} }

BIN
source/sounds/success.ogg Normal file

Binary file not shown.

View File

@ -15,15 +15,16 @@ extern "C" {
bool LoadGameInfoFromXML(char* gameid, char* langcode); bool LoadGameInfoFromXML(char* gameid, char* langcode);
#define XML_ELEMMAX 15 #define XML_ELEMMAX 15
#define XML_SYNOPSISLEN 4000
struct gameXMLinfo { struct gameXMLinfo {
char id[7]; char id[7];
char version[50]; char version[50];
char region[7]; char region[7];
char title[200]; char title[200];
char synopsis[3000]; char synopsis[XML_SYNOPSISLEN];
char title_EN[200]; char title_EN[200];
char synopsis_EN[3000]; char synopsis_EN[XML_SYNOPSISLEN];
char locales[XML_ELEMMAX+1][5]; char locales[XML_ELEMMAX+1][5];
int localeCnt; int localeCnt;
char developer[75]; char developer[75];