From 63a5de42ca6e2f989eb05192dcf30b6ac64cd848 Mon Sep 17 00:00:00 2001 From: giantpune Date: Sat, 20 Jun 2009 10:10:40 +0000 Subject: [PATCH] Made 002fix automatic when anti-002 is turned on. Didn't test it at all. If it breaks games it can be reverted. Made tooltip transparency in the theme file. use tooltipAlpha = ###. default is 255 (max). --- source/libwiigui/gui_gamegrid.cpp | 4 ++-- source/menu.cpp | 9 +++++---- source/settings/cfg.c | 7 +++++++ source/settings/cfg.h | 1 + source/usbloader/apploader.c | 2 +- source/xml/xml.c | 4 ++++ 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/source/libwiigui/gui_gamegrid.cpp b/source/libwiigui/gui_gamegrid.cpp index f48dfaba..604afef2 100644 --- a/source/libwiigui/gui_gamegrid.cpp +++ b/source/libwiigui/gui_gamegrid.cpp @@ -148,7 +148,7 @@ GuiGameGrid::GuiGameGrid(int w, int h, struct discHdr * l, int count, const char titleTT = new GuiTooltip("test"); titleTT->SetAlignment(ALIGN_LEFT, ALIGN_TOP); titleTT->SetPosition(-100,0); - titleTT->SetAlpha(175); + titleTT->SetAlpha(THEME.tooltipAlpha); // if (Settings.wsprompt == yes) // installBtnTT.SetWidescreen(CFG.widescreen); @@ -1356,7 +1356,7 @@ void GuiGameGrid::Update(GuiTrigger * t) if (selected!=selectedOld){ delete titleTT; titleTT = new GuiTooltip(titlebuffer); - titleTT->SetAlpha(175); + titleTT->SetAlpha(THEME.tooltipAlpha); wait=0;wait1=0; } selectedOld=selected; diff --git a/source/menu.cpp b/source/menu.cpp index c30f5b0f..6e2d9d52 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -321,6 +321,7 @@ static int MenuDiscList() GuiTooltip installBtnTT(LANGUAGE.Installagame); if (Settings.wsprompt == yes) installBtnTT.SetWidescreen(CFG.widescreen); + installBtnTT.SetAlpha(THEME.tooltipAlpha); GuiImage installBtnImg(&btnInstall); GuiImage installBtnImgOver(&btnInstallOver); installBtnImg.SetWidescreen(CFG.widescreen); @@ -332,7 +333,7 @@ static int MenuDiscList() GuiTooltip settingsBtnTT(LANGUAGE.settings); if (Settings.wsprompt == yes) settingsBtnTT.SetWidescreen(CFG.widescreen); - + settingsBtnTT.SetAlpha(THEME.tooltipAlpha); GuiImage settingsBtnImg(&btnSettings); settingsBtnImg.SetWidescreen(CFG.widescreen); GuiImage settingsBtnImgOver(&btnSettingsOver); @@ -353,7 +354,7 @@ static int MenuDiscList() GuiTooltip poweroffBtnTT(LANGUAGE.PowerofftheWii); if (Settings.wsprompt == yes) poweroffBtnTT.SetWidescreen(CFG.widescreen); - + poweroffBtnTT.SetAlpha(THEME.tooltipAlpha); GuiImage poweroffBtnImg(&btnpwroff); GuiImage poweroffBtnImgOver(&btnpwroffOver); poweroffBtnImg.SetWidescreen(CFG.widescreen); @@ -364,7 +365,7 @@ static int MenuDiscList() GuiTooltip sdcardBtnTT(LANGUAGE.ReloadSD); if (Settings.wsprompt == yes) sdcardBtnTT.SetWidescreen(CFG.widescreen); - + sdcardBtnTT.SetAlpha(THEME.tooltipAlpha); GuiImage sdcardImg(&btnsdcard); sdcardImg.SetWidescreen(CFG.widescreen); GuiButton sdcardBtn(&sdcardImg,&sdcardImg, 0, 3, THEME.sdcard_x, THEME.sdcard_y, &trigA, &btnSoundOver, &btnClick,1,&sdcardBtnTT,15,-30,0,5); @@ -504,7 +505,7 @@ static int MenuDiscList() GuiTooltip DownloadBtnTT(LANGUAGE.ClicktoDownloadCovers); if (Settings.wsprompt == yes) DownloadBtnTT.SetWidescreen(CFG.widescreen); - + DownloadBtnTT.SetAlpha(THEME.tooltipAlpha); GuiButton DownloadBtn(160,224); DownloadBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP); DownloadBtn.SetPosition(THEME.cover_x,THEME.cover_y); diff --git a/source/settings/cfg.c b/source/settings/cfg.c index 41c2d98c..bc9ebb6b 100644 --- a/source/settings/cfg.c +++ b/source/settings/cfg.c @@ -245,6 +245,7 @@ void CFG_Default(int widescreen) // -1 = non forced Mode THEME.region_x = 68; THEME.region_y = 30; THEME.power_x = 576; + THEME.tooltipAlpha = 255; THEME.power_y = 355; THEME.home_x = 485;//215; THEME.home_y = 367; @@ -768,6 +769,12 @@ void theme_set(char *name, char *val) THEME.batteryUnused = x; } } + else if (strcmp(cfg_name, "tooltipAlpha") == 0) { + short x; + if (sscanf(val, "%hd", &x) == 1) { + THEME.tooltipAlpha = x; + } + } /* else if (strcmp(cfg_name, "maxcharacters") == 0) { diff --git a/source/settings/cfg.h b/source/settings/cfg.h index 076d289c..f111c10c 100644 --- a/source/settings/cfg.h +++ b/source/settings/cfg.h @@ -62,6 +62,7 @@ struct THEME int gamegrid_y; int gamegrid_w; int gamegrid_h; + int tooltipAlpha; int gamecarousel_x; int gamecarousel_y; int gamecarousel_w; diff --git a/source/usbloader/apploader.c b/source/usbloader/apploader.c index e5bfdd01..d8953d6c 100644 --- a/source/usbloader/apploader.c +++ b/source/usbloader/apploader.c @@ -324,7 +324,7 @@ s32 Apploader_Run(entry_point *entry, u8 cheat, u8 videoSelected, u8 vipatch, u8 /* Initialize apploader */ appldr_init(__noprint); - if(error002fix) { + if((error002fix) || (Settings.anti002fix == on)){ /* ERROR 002 fix (thanks to WiiPower for sharing this)*/ *(u32 *)0x80003140 = *(u32 *)0x80003188; } diff --git a/source/xml/xml.c b/source/xml/xml.c index 6f86013f..1e7df063 100644 --- a/source/xml/xml.c +++ b/source/xml/xml.c @@ -72,6 +72,10 @@ bool OpenXMLDatabase(char* xmlfilepath, char* argdblang, bool argJPtoEN, bool op if (xmlfilepath[strlen(xmlfilepath) - 1] != '/') snprintf(pathname, sizeof(pathname), "%s/",pathname); snprintf(pathname, sizeof(pathname), "%s%s", pathname, xmlcfg_filename); if (openfile) opensuccess = OpenXMLFile(pathname); + if (!opensuccess) { + snprintf(pathname, sizeof(pathname), "%swiitdb.zip", pathname); + if (openfile) opensuccess = OpenXMLFile(pathname); + } if (!opensuccess) { CloseXMLDatabase(); return false;