Alright guys, after 3-4 Month of cleaning up the source, it's finally here:

USB Loader GX v2.0

A few cosmetic changes along on this rev:
*Removed unused resources
*Fix a compile warning
*Fixed crash on formatting drive to WBFS
*A few source/function movement from one file to another 
*Renamed global game settings to "Loader Settings"
This commit is contained in:
dimok321 2011-01-09 10:45:29 +00:00
parent f9b64b2241
commit 34692131a2
55 changed files with 796 additions and 760 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>1.0 r1035</version>
<release_date>201101081236</release_date>
<version>2.0 r1036</version>
<release_date>201101081426</release_date>
<no_ios_reload/>
<short_description>Loads games from USB-devices</short_description>
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: David Jelinek (djelinek@hotmail.com) e->e,r->r,u->u, c->c \n"
"Language-Team: r1000 - last version on http://djelinek.sweb.cz/_USBLoderGX/czech.lang \n"
@ -766,6 +766,9 @@ msgstr "Nahrát soubor z: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Spustit tento DOL jako náhradní DOL?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: dorf[dk]\n"
"Language-Team: dorf[dk]\n"
@ -766,6 +766,9 @@ msgstr "Indlæs fil fra %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Indlæs denne DOL som alternativ DOL?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2010-04-12 07:37+0100\n"
"Last-Translator: glowy\n"
"Language-Team: tj_cool, glowy\n"
@ -766,6 +766,9 @@ msgstr "Laad bestand van %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Deze DOL als alt DOL gebruiken?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -766,6 +766,9 @@ msgstr ""
msgid "Load this DOL as alternate DOL?"
msgstr ""
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: c64rmx\n"
"Language-Team: \n"
@ -766,6 +766,9 @@ msgstr "Lataa tiedosto: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Lataa tämä vaihtoehtoisesti tämä dol?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-06 19:58+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Andresayang, Cyan, jero\n"
"Language-Team: Badablek, Amour, ikya & Kin8\n"
@ -766,6 +766,9 @@ msgstr "Charger le fichier de: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Charger comme DOL alternatif ?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr "Chargement thème par défaut."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-06 19:58+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2010-07-03 17:35-0800\n"
"Last-Translator: TheRealVisitor\n"
"Language-Team: Bertilax, Snoozer, wishmasterf, ZEN.13, TheRealVisitor\n"
@ -766,6 +766,9 @@ msgstr "Datei von %s laden?"
msgid "Load this DOL as alternate DOL?"
msgstr "Diese DOL als Alternative DOL laden?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr "Lade Standardtheme"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-12-29 11:05+0100\n"
"Last-Translator: Springdale\n"
"Language-Team: Tusk, Springdale\n"
@ -766,6 +766,9 @@ msgstr "Fájl betöltése innen: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "DOL betöltése alternatív DOL-ként?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -1,12 +1,12 @@
# USB Loader GX language source file.
# italian.lang - v65 - r1033
# italian.lang - v66 - r1035
# don't delete/change this line (é).
msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"PO-Revision-Date: 2011-01-08 08:30+0200\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2011-01-09 02:30+0200\n"
"Last-Translator: Cambo \n"
"Language-Team: Cambo\n"
"MIME-Version: 1.0\n"
@ -182,10 +182,10 @@ msgid "Big thanks to:"
msgstr "Grazie mille a:"
msgid "Block IOS Reload"
msgstr "Blocca Ricarica IOS"
msgstr "Blocca Ricarica cIOS"
msgid "Boot/Standard"
msgstr "Riavvio/Standard"
msgstr "cIOS Predefinito"
msgid "Boot?"
msgstr "Vuoi riavviare?"
@ -584,19 +584,19 @@ msgid "GCT File created"
msgstr "File GCT creato"
msgid "GUI Settings"
msgstr "Impostazioni Loader"
msgstr "Interfaccia Grafica"
msgid "Game ID"
msgstr "ID Gioco"
msgid "Game IOS"
msgstr "IOS Gioco"
msgstr "cIOS Gioco"
msgid "Game Language"
msgstr "Lingua Gioco"
msgid "Game Load"
msgstr "Impostazioni Gioco"
msgstr "Caricamento Giochi"
msgid "Game Lock"
msgstr "Bloccaggio Gioco"
@ -766,6 +766,9 @@ msgstr "Vuoi caricare il file da: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Vuoi caricare questo DOL come DOL alternativo?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr "Sto caricando il tema predefinito."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: hosigumayuugi\n"
"Language-Team: hosigumayuugi\n"
@ -766,6 +766,9 @@ msgstr "%sからファイルをロードしますか"
msgid "Load this DOL as alternate DOL?"
msgstr "このDOLを代替DOLとしてロードしますか"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr "標準のテーマを読み込み中"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: nextos@korea.com\n"
"Language-Team: \n"
@ -766,6 +766,9 @@ msgstr "화일 로드는 %s 에서?"
msgid "Load this DOL as alternate DOL?"
msgstr "이 DOL화일을 alternate DOL로 로딩할까요?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: raschi\n"
"Language-Team: raschi\n"
@ -766,6 +766,9 @@ msgstr "Start fil fra: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Last denne DOL som alternativ DOL?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: ziom666 (zadania_prog@vp.pl)\n"
"Language-Team: \n"
@ -766,6 +766,9 @@ msgstr "Zaladowac plik z: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Zaladowac ten DOL jako alternatywnt?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-23 18:52+0200\n"
"Last-Translator: aniemotion\n"
"Language-Team: boto12, aniemotion\n"
@ -766,6 +766,9 @@ msgstr "Carregar arquivo de: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Carregar este DOL como DOL alternativo?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2010-03-22 10:55-0000\n"
"Last-Translator: Sky8000\n"
"Language-Team: Sky8000 <sky8000@hotmail.com>\n"
@ -766,6 +766,9 @@ msgstr "Carregar ficheiro de: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Carregar este DOL como DOL alternativo?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: nikolai_ca\n"
"Language-Team: Kir, alendit, nikolai_ca\n"
@ -766,6 +766,9 @@ msgstr "Загрузить файл из %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "Загрузить этот DOL в качестве альтернативного ?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-08 13:01+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: knife.hu kavid emul8ion\n"
"Language-Team: kavid\n"
@ -766,6 +766,9 @@ msgstr "从%s 加载文件?"
msgid "Load this DOL as alternate DOL?"
msgstr "加载这个 DOL 作为 ALT DOL?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr "正在加载默认主题."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: SirPalax\n"
"Language-Team: Penn, SirPalax\n"
@ -766,6 +766,9 @@ msgstr "¿Cargar el archivo desde: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "¿Cargar este DOL como DOL Alternativo?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2010-01-19 17:39+0200\n"
"Last-Translator: Katsurou\n"
"Language-Team: Katsurou, pirateX\n"
@ -766,6 +766,9 @@ msgstr "Ladda fil från: %s?"
msgid "Load this DOL as alternate DOL?"
msgstr "Ladda denna DOL som alternativ DOL?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-08 09:04+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2010-02-15 21:00+0800\n"
"Last-Translator: Jane.H\n"
"Language-Team: kyogc, Miller, Mika Li, Jane.H\n"
@ -395,7 +395,7 @@ msgid "Do you want to format:"
msgstr "是否格式化:"
msgid "Do you want to load the default theme?"
msgstr ""
msgstr "是否要載入預設佈景主題嗎?"
msgid "Do you want to load this theme?"
msgstr "是否要載入這佈景主題嗎?"
@ -766,6 +766,9 @@ msgstr "檔案載入位置: %s"
msgid "Load this DOL as alternate DOL?"
msgstr "載入這個 DOL 作為替代 DOL"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr "正在載入預設主題。"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Nitro_subzero \n"
"Language-Team: Nitro_subzero\n"
@ -766,6 +766,9 @@ msgstr "โหลดไฟล์จาก: %s ?"
msgid "Load this DOL as alternate DOL?"
msgstr "โหลด DOL นี้เป็น alternate DOL?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-07 14:00+0100\n"
"POT-Creation-Date: 2011-01-09 11:32+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: omercigingelini\n"
"Language-Team: omercigingelini\n"
@ -766,6 +766,9 @@ msgstr "Dosya %s 'ten yüklensin mi?"
msgid "Load this DOL as alternate DOL?"
msgstr "Bu DOL alternatif DOL olarak mı yüklensin?"
msgid "Loader Settings"
msgstr ""
msgid "Loading default theme."
msgstr ""

File diff suppressed because one or more lines are too long

View File

@ -191,9 +191,6 @@ extern const u32 settings_button_png_size;
extern const u8 settings_button_over_png[];
extern const u32 settings_button_over_png_size;
extern const u8 settings_menu_button_png[];
extern const u32 settings_menu_button_png_size;
extern const u8 wiimote_poweroff_png[];
extern const u32 wiimote_poweroff_png_size;
@ -275,15 +272,6 @@ 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;
extern const u8 arrow_previous_png[];
extern const u32 arrow_previous_png_size;
extern const u8 mp3_pause_png[];
extern const u32 mp3_pause_png_size;
extern const u8 exit_top_png[];
extern const u32 exit_top_png_size;
@ -299,9 +287,6 @@ extern const u32 exit_bottom_over_png_size;
extern const u8 exit_button_png[];
extern const u32 exit_button_png_size;
extern const u8 mp3_stop_png[];
extern const u32 mp3_stop_png_size;
extern const u8 favorite_png[];
extern const u32 favorite_png_size;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -19,7 +19,7 @@
#include "utils/ShowError.h"
#include "gecko.h"
static const char * LanguageFilesURL = "http://usbloader-gui.googlecode.com/svn/trunk/Languages/";
static const char * LanguageFilesURL = "http://usbloader-gui.googlecode.com/svn/tags/USBLoaderGX_v2/Languages/";
int DownloadAllLanguageFiles()
{

View File

@ -230,8 +230,8 @@ void GuiImage::SetImage(GuiImageData * img)
}
image = NULL;
width = NULL;
height = NULL;
width = 0;
height = 0;
imgType = IMAGE_DATA;
if(img)

View File

@ -18,7 +18,6 @@
#include "main.h"
#include "http.h"
#include "svnrev.h"
#include "buildtype.h"
#include "gecko.h"
#include "update.h"
@ -365,35 +364,6 @@ int NetworkWait()
return 1;
}
/****************************************************************************
* Update check
***************************************************************************/
int CheckUpdate()
{
if (!networkinitialized)
return -1;
int revnumber = 0;
int currentrev = atoi(GetRev());
#ifdef FULLCHANNEL
struct block file = downloadfile( "http://www.techjawa.com/usbloadergx/wadrev.txt" );
#else
struct block file = downloadfile("http://www.techjawa.com/usbloadergx/rev.txt");
#endif
if (file.data != NULL)
{
revnumber = atoi((char *) file.data);
free(file.data);
}
if (revnumber > currentrev)
return revnumber;
return -1;
}
/****************************************************************************
* HaltNetwork
***************************************************************************/

View File

@ -19,7 +19,6 @@ s32 network_request(s32 connection, const char * request, char * filename);
s32 network_read(s32 connection, u8 *buf, u32 len);
s32 download_request(const char * url, char * filename = NULL);
void CloseConnection();
int CheckUpdate();
char * HEAD_Request(const char * url);
void HaltNetworkThread();
void ResumeNetworkWait();

View File

@ -47,6 +47,8 @@
#include "prompts/PromptWindows.h"
#include "FileOperations/fileops.h"
#include "xml/WiiTDB.hpp"
#include "buildtype.h"
#include "svnrev.h"
static const char * WiiTDB_URL = "http://wiitdb.com/wiitdb.zip";
@ -196,6 +198,32 @@ static void UpdateMetaXml()
}
}
int CheckUpdate()
{
if (!IsNetworkInit())
return -1;
int revnumber = 0;
int currentrev = atoi(GetRev());
#ifdef FULLCHANNEL
struct block file = downloadfile( "http://www.techjawa.com/usbloadergx/wadrev.txt" );
#else
struct block file = downloadfile("http://www.techjawa.com/usbloadergx/rev.txt");
#endif
if (file.data != NULL)
{
revnumber = atoi((char *) file.data);
free(file.data);
}
if (revnumber > currentrev)
return revnumber;
return -1;
}
static int ApplicationDownload(int newrev)
{
bool update_error = false;

View File

@ -29,6 +29,7 @@
#ifndef _UPDATEOPS_H_
#define _UPDATEOPS_H_
int CheckUpdate();
int CheckForBetaUpdate();
int UpdateWiiTDB();
int UpdateApp();

View File

@ -241,14 +241,11 @@ void WindowCredits()
i++;
#ifdef FULLCHANNEL
char svnTmp[4];//did this to hide the M after the rev# that is made by altering it
//to be ready to be in a full channel
snprintf( svnTmp, sizeof( svnTmp ), "%s", GetRev() );
char SvnRev[30];
snprintf( SvnRev, sizeof( SvnRev ), "Rev%sc IOS%u (Rev %u)", svnTmp, IOS_GetVersion(), IOS_GetRevision() );
snprintf( SvnRev, sizeof( SvnRev ), "V2.0c IOS%u (Rev %u)", IOS_GetVersion(), IOS_GetRevision() );
#else
char SvnRev[30];
snprintf(SvnRev, sizeof(SvnRev), "Rev%s IOS%u (Rev %u)", GetRev(), IOS_GetVersion(), IOS_GetRevision());
snprintf(SvnRev, sizeof(SvnRev), "V2.0 IOS%u (Rev %u)", IOS_GetVersion(), IOS_GetRevision());
#endif
txt[i] = new GuiText(SvnRev, 16, ( GXColor ) {255, 255, 255, 255});

View File

@ -396,7 +396,7 @@ int MenuThemeSelect()
}
GuiButton defaultBtn( btnOutline.GetWidth(), btnOutline.GetHeight() );
defaultBtn.SetAlignment( ALIGN_CENTRE, ALIGN_TOP );
defaultBtn.SetPosition( 190, 400 );
defaultBtn.SetPosition( 0, 400 );
defaultBtn.SetLabel( &defaultBtnTxt );
defaultBtn.SetImage( &defaultBtnImg );
defaultBtn.SetSoundOver( btnSoundOver );
@ -427,6 +427,7 @@ int MenuThemeSelect()
w.Append( &backgroundImg );
w.Append( &pathBtn );
w.Append( &backBtn );
w.Append( &defaultBtn );
w.Append( &optionBrowser4 );
mainWindow->Append( &w );
@ -449,12 +450,13 @@ int MenuThemeSelect()
else if ( defaultBtn.GetState() == STATE_CLICKED )
{
choice = WindowPrompt( tr( "Loading default theme." ), 0, tr( "OK" ), tr( "Cancel" ) );
choice = WindowPrompt(0, tr( "Do you want to load the default theme?" ), tr( "OK" ), tr( "Cancel" ) );
if ( choice == 1 )
{
snprintf(Settings.theme_path, sizeof(Settings.theme_path), "%stheme/", Settings.ConfigPath);
strcpy(Settings.theme, "");
HaltGui();
Theme::SetDefault();
Theme::Reload();
ResumeGui();
Settings.Save();
returnVal = 1;
}
@ -508,13 +510,16 @@ int MenuThemeSelect()
if ( !CheckFile( Settings.theme ) )
{
WindowPrompt( tr( "File not found." ), tr( "Loading default theme." ), tr( "OK" ) );
HaltGui();
Theme::SetDefault();
strcpy(Settings.theme, "");
Theme::Reload();
ResumeGui();
}
else
{
HaltGui();
Theme::Load(Settings.theme);
Theme::Reload();
ResumeGui();
}
Settings.Save();

View File

@ -139,26 +139,8 @@ int CustomPathsSM::GetMenuInternal()
if(parent) parent->SetState(STATE_DEFAULT);
this->Append(optionBrowser);
if (res == 1)
{
HaltGui();
mainWindow->Remove(bgImg);
if(pointer[0]) delete pointer[0];
if(pointer[1]) delete pointer[1];
if(pointer[2]) delete pointer[2];
if(pointer[3]) delete pointer[3];
pointer[0] = Resources::GetImageData("player1_point.png");
pointer[1] = Resources::GetImageData("player2_point.png");
pointer[2] = Resources::GetImageData("player3_point.png");
pointer[3] = Resources::GetImageData("player4_point.png");
if(background) delete background;
background = Resources::GetImageData(Settings.widescreen ? "wbackground.png" : "background.png");
if(bgImg) delete bgImg;
bgImg = new GuiImage(background);
mainWindow->Append(bgImg);
ResumeGui();
return MENU_SETTINGS;
}
}
//! Settings: WiiTDB Path
else if (ret == ++Idx)

View File

@ -22,20 +22,14 @@
* distribution.
***************************************************************************/
#include <unistd.h>
#include "GameLoadSM.hpp"
#include "Controls/DeviceHandler.hpp"
#include <gccore.h>
#include "settings/CSettings.h"
#include "themes/CTheme.h"
#include "prompts/PromptWindows.h"
#include "prompts/DiscBrowser.h"
#include "language/gettext.h"
#include "wad/nandtitle.h"
#include "prompts/TitleBrowser.h"
#include "usbloader/GameList.h"
#include "usbloader/wbfs.h"
#include "usbloader/utils.h"
#include "system/IosLoader.h"
#include "settings/GameTitles.h"
#include "xml/xml.h"
#include "menu.h"
#include "GameLoadSM.hpp"
static const char * OnOffText[MAX_ON_OFF] =
{
@ -65,21 +59,7 @@ static const char * LanguageText[MAX_LANGUAGE] =
trNOOP( "SChinese" ),
trNOOP( "TChinese" ),
trNOOP( "Korean" ),
trNOOP( "Console Default" )
};
static const char * InstallToText[INSTALL_TO_MAX] =
{
trNOOP( "None" ),
trNOOP( "GAMEID_Gamename" ),
trNOOP( "Gamename [GAMEID]" )
};
static const char * SplitSizeText[INSTALL_TO_MAX] =
{
trNOOP( "No Splitting" ),
trNOOP( "Split each 2GB" ),
trNOOP( "Split each 4GB" ),
trNOOP( "Console Default" ),
};
static const char * Error002Text[3] =
@ -89,20 +69,87 @@ static const char * Error002Text[3] =
trNOOP( "Anti" )
};
static inline bool IsValidPartition(int fs_type, int cios)
static const char * ParentalText[5] =
{
if (IosLoader::IsWaninkokoIOS() && NandTitles.VersionOf(TITLE_ID(1, cios)) < 18)
trNOOP( "0 (Everyone)" ),
trNOOP( "1 (Child 7+)" ),
trNOOP( "2 (Teen 12+)" ),
trNOOP( "3 (Mature 16+)" ),
trNOOP( "4 (Adults Only 18+)" )
};
static const char * AlternateDOLText[] =
{
return fs_type == PART_FS_WBFS;
}
else
{
return fs_type == PART_FS_WBFS || fs_type == PART_FS_FAT || fs_type == PART_FS_NTFS || fs_type == PART_FS_EXT;
trNOOP( "OFF" ),
trNOOP( "Select a DOL from Game" ),
trNOOP( "Load From SD/USB" ),
};
GameLoadSM::GameLoadSM(const char * GameID)
: SettingsMenu(tr("Game Load"), &GuiOptions, MENU_NONE)
{
//! Setup default settings from global settings
snprintf(GameConfig.id, sizeof(GameConfig.id), "%s", (char *) GameID);
SetDefaultConfig();
GameCFG * existCFG = GameSettings.GetGameCFG(GameID);
//! Overwrite with existing if available
if (existCFG)
memcpy(&GameConfig, existCFG, sizeof(GameCFG));
if(!btnOutline)
btnOutline = Resources::GetImageData("button_dialogue_box.png");
if(!trigA)
trigA = new GuiTrigger();
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
saveBtnTxt = new GuiText(tr( "Save" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
saveBtnTxt->SetMaxWidth(btnOutline->GetWidth() - 30);
saveBtnImg = new GuiImage (btnOutline);
if (Settings.wsprompt == ON)
{
saveBtnTxt->SetWidescreen(Settings.widescreen);
saveBtnImg->SetWidescreen(Settings.widescreen);
}
saveBtn = new GuiButton(saveBtnImg, saveBtnImg, 2, 3, 180, 400, trigA, btnSoundOver, btnSoundClick2, 1);
saveBtn->SetLabel(saveBtnTxt);
Append(saveBtn);
SetOptionNames();
SetOptionValues();
}
GameLoadSM::GameLoadSM()
: SettingsMenu(tr("Game Load"), &GuiOptions, MENU_NONE)
GameLoadSM::~GameLoadSM()
{
HaltGui();
//! The rest is destroyed in SettingsMenu.cpp
Remove(saveBtn);
delete saveBtnTxt;
delete saveBtnImg;
delete saveBtn;
ResumeGui();
}
void GameLoadSM::SetDefaultConfig()
{
GameConfig.video = Settings.videomode;
GameConfig.language = Settings.language;
GameConfig.ocarina = Settings.ocarina;
GameConfig.vipatch = Settings.videopatch;
GameConfig.ios = Settings.cios;
GameConfig.parentalcontrol = 0;
GameConfig.errorfix002 = Settings.error002;
GameConfig.patchcountrystrings = Settings.patchcountrystrings;
GameConfig.loadalternatedol = OFF;
GameConfig.alternatedolstart = 0;
GameConfig.iosreloadblock = OFF;
strcpy(GameConfig.alternatedolname, "");
GameConfig.returnTo = 1;
GameConfig.Locked = 0;
}
void GameLoadSM::SetOptionNames()
{
int Idx = 0;
@ -111,32 +158,14 @@ GameLoadSM::GameLoadSM()
Options->SetName(Idx++, "%s", tr( "Game Language" ));
Options->SetName(Idx++, "%s", tr( "Patch Country Strings" ));
Options->SetName(Idx++, "%s", tr( "Ocarina" ));
Options->SetName(Idx++, "%s", tr( "Boot/Standard" ));
Options->SetName(Idx++, "%s", tr( "Partition" ));
Options->SetName(Idx++, "%s", tr( "Install directories" ));
Options->SetName(Idx++, "%s", tr( "Game Split Size" ));
Options->SetName(Idx++, "%s", tr( "Quick Boot" ));
Options->SetName(Idx++, "%s", tr( "Game IOS" ));
Options->SetName(Idx++, "%s", tr( "Parental Control" ));
Options->SetName(Idx++, "%s", tr( "Error 002 fix" ));
Options->SetName(Idx++, "%s", tr( "Install partitions" ));
Options->SetName(Idx++, "%s", tr( "Return To" ));
Options->SetName(Idx++, "%s", tr( "Messageboard Update" ));
SetOptionValues();
OldSettingsPartition = Settings.partition;
}
GameLoadSM::~GameLoadSM()
{
//! if partition has changed, Reinitialize it
if (Settings.partition != OldSettingsPartition)
{
WBFS_OpenPart(Settings.partition);
//! Reload the new game titles
gameList.ReadGameList();
GameTitles.LoadTitlesFromWiiTDB(Settings.titlestxt_path);
}
Options->SetName(Idx++, "%s", tr( "Alternate DOL" ));
Options->SetName(Idx++, "%s", tr( "Select DOL Offset" ));
Options->SetName(Idx++, "%s", tr( "Block IOS Reload" ));
Options->SetName(Idx++, "%s", tr( "Game Lock" ));
}
void GameLoadSM::SetOptionValues()
@ -144,65 +173,79 @@ void GameLoadSM::SetOptionValues()
int Idx = 0;
//! Settings: Video Mode
Options->SetValue(Idx++, "%s", tr(VideoModeText[Settings.videomode]));
Options->SetValue(Idx++, "%s", tr(VideoModeText[GameConfig.video]));
//! Settings: VIDTV Patch
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.videopatch] ));
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.vipatch]));
//! Settings: Game Language
Options->SetValue(Idx++, "%s", tr( LanguageText[Settings.language] ));
Options->SetValue(Idx++, "%s", tr(LanguageText[GameConfig.language]));
//! Settings: Patch Country Strings
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.patchcountrystrings] ));
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.patchcountrystrings]));
//! Settings: Ocarina
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.ocarina] ));
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.ocarina]));
//! Settings: Boot/Standard
if (Settings.godmode)
Options->SetValue(Idx++, "IOS %i", Settings.cios);
else
Options->SetValue(Idx++, "********");
//! Settings: Game IOS
Options->SetValue(Idx++, "%i", GameConfig.ios);
//! Settings: Partition
PartitionHandle * usbHandle = DeviceHandler::Instance()->GetUSBHandle();
// Get the partition name and it's size in GB's
Options->SetValue(Idx++, "%s (%.2fGB)", usbHandle->GetFSName(Settings.partition), usbHandle->GetSize(Settings.partition)/GB_SIZE);
//! Settings: Install directories
Options->SetValue(Idx++, "%s", tr( InstallToText[Settings.InstallToDir] ));
//! Settings: Game Split Size
Options->SetValue(Idx++, "%s", tr( SplitSizeText[Settings.GameSplit] ));
//! Settings: Quick Boot
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.quickboot] ));
//! Settings: Parental Control
Options->SetValue(Idx++, "%s", tr(ParentalText[GameConfig.parentalcontrol]));
//! Settings: Error 002 fix
Options->SetValue(Idx++, "%s", tr( Error002Text[Settings.error002] ));
//! Settings: Install partitions
if(Settings.InstallPartitions == ONLY_GAME_PARTITION)
Options->SetValue(Idx++, "%s", tr("Only Game Partition"));
else if(Settings.InstallPartitions == ALL_PARTITIONS)
Options->SetValue(Idx++, "%s", tr("All Partitions"));
else if(Settings.InstallPartitions == REMOVE_UPDATE_PARTITION)
Options->SetValue(Idx++, "%s", tr("Remove update"));
Options->SetValue(Idx++, "%s", tr(Error002Text[GameConfig.errorfix002]));
//! Settings: Return To
if(GameConfig.returnTo)
{
const char* TitleName = NULL;
int haveTitle = NandTitles.FindU32(Settings.returnTo);
if (haveTitle >= 0)
TitleName = NandTitles.NameFromIndex(haveTitle);
TitleName = TitleName ? TitleName : strlen(Settings.returnTo) > 0 ? Settings.returnTo : tr(OnOffText[0]);
Options->SetValue(Idx++, "%s", TitleName);
Options->SetValue(Idx++, "%s", TitleName ? TitleName : strlen(Settings.returnTo) > 0 ?
Settings.returnTo : tr( OnOffText[0] ));
}
else
{
Options->SetValue(Idx++, "%s", tr( OnOffText[0] ));
}
//! Settings: Messageboard Update
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.PlaylogUpdate] ));
//! Settings: Alternate DOL
Options->SetValue(Idx++, "%s", tr( AlternateDOLText[GameConfig.loadalternatedol] ));
//! Settings: Select DOL Offset
if(GameConfig.loadalternatedol != 1)
Options->SetValue(Idx++, tr("Not required"));
else
{
if(strcmp(GameConfig.alternatedolname, "") != 0)
Options->SetValue(Idx++, "%i <%s>", GameConfig.alternatedolstart, GameConfig.alternatedolname);
else
Options->SetValue(Idx++, "%i", GameConfig.alternatedolstart);
}
//! Settings: Block IOS Reload
Options->SetValue(Idx++, "%s", tr( OnOffText[GameConfig.iosreloadblock] ));
//! Settings: Game Lock
Options->SetValue(Idx++, "%s", tr( OnOffText[GameConfig.Locked] ));
}
int GameLoadSM::GetMenuInternal()
{
if (saveBtn->GetState() == STATE_CLICKED)
{
if (GameSettings.AddGame(GameConfig) && GameSettings.Save())
{
WindowPrompt(tr( "Successfully Saved" ), 0, tr( "OK" ));
}
else
WindowPrompt(tr( "Save Failed. No device inserted?" ), 0, tr( "OK" ));
saveBtn->ResetState();
}
int ret = optionBrowser->GetClickedOption();
if (ret < 0)
@ -213,140 +256,148 @@ int GameLoadSM::GetMenuInternal()
//! Settings: Video Mode
if (ret == ++Idx)
{
if (++Settings.videomode >= VIDEO_MODE_MAX) Settings.videomode = 0;
if (++GameConfig.video >= VIDEO_MODE_MAX) GameConfig.video = 0;
}
//! Settings: VIDTV Patch
else if (ret == ++Idx)
{
if (++Settings.videopatch >= MAX_ON_OFF) Settings.videopatch = 0;
if (++GameConfig.vipatch >= MAX_ON_OFF) GameConfig.vipatch = 0;
}
//! Settings: Game Language
else if (ret == ++Idx)
{
if (++Settings.language >= MAX_LANGUAGE) Settings.language = 0;
if (++GameConfig.language >= MAX_LANGUAGE) GameConfig.language = 0;
}
//! Settings: Patch Country Strings
else if (ret == ++Idx)
{
if (++Settings.patchcountrystrings >= MAX_ON_OFF) Settings.patchcountrystrings = 0;
if (++GameConfig.patchcountrystrings >= MAX_ON_OFF) GameConfig.patchcountrystrings = 0;
}
//! Settings: Ocarina
else if (ret == ++Idx)
{
if (++Settings.ocarina >= MAX_ON_OFF) Settings.ocarina = 0;
if (++GameConfig.ocarina >= MAX_ON_OFF) GameConfig.ocarina = 0;
}
//! Settings: Boot/Standard
//! Settings: Game IOS
else if (ret == ++Idx)
{
if(!Settings.godmode)
return MENU_NONE;
char entered[4];
snprintf(entered, sizeof(entered), "%i", Settings.cios);
snprintf(entered, sizeof(entered), "%i", GameConfig.ios);
if(OnScreenKeyboard(entered, sizeof(entered), 0))
{
Settings.cios = atoi(entered);
if(Settings.cios < 200) Settings.cios = 200;
else if(Settings.cios > 255) Settings.cios = 255;
GameConfig.ios = atoi(entered);
if(GameConfig.ios < 200) GameConfig.ios = 200;
else if(GameConfig.ios > 255) GameConfig.ios = 255;
if(NandTitles.IndexOf(TITLE_ID(1, Settings.cios)) < 0)
if(NandTitles.IndexOf(TITLE_ID(1, GameConfig.ios)) < 0)
{
WindowPrompt(tr("Warning:"), tr("This IOS was not found on the titles list. If you are sure you have it installed than ignore this warning."), tr("OK"));
}
else if(Settings.cios == 254)
else if(GameConfig.ios == 254)
{
WindowPrompt(tr("Warning:"), tr("This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning."), tr("OK"));
}
}
}
//! Settings: Partition
//! Settings: Parental Control
else if (ret == ++Idx)
{
if(DeviceHandler::Instance()->GetUSBHandle()->GetPartitionCount() < 2)
return MENU_NONE;
// Select the next valid partition, even if that's the same one
int fs_type = 0;
int ios = IOS_GetVersion();
int retries = 20;
do
{
Settings.partition = (Settings.partition + 1) % DeviceHandler::Instance()->GetUSBHandle()->GetPartitionCount();
fs_type = DeviceHandler::GetUSBFilesystemType(Settings.partition);
}
while (!IsValidPartition(fs_type, ios) && --retries > 0);
if(fs_type == PART_FS_FAT && Settings.GameSplit == GAMESPLIT_NONE)
Settings.GameSplit = GAMESPLIT_4GB;
}
//! Settings: Install directories
else if (ret == ++Idx)
{
if (++Settings.InstallToDir >= INSTALL_TO_MAX) Settings.InstallToDir = 0;
}
//! Settings: Game Split Size
else if (ret == ++Idx)
{
if (++Settings.GameSplit >= GAMESPLIT_MAX)
{
if(DeviceHandler::GetUSBFilesystemType(Settings.partition) == PART_FS_FAT)
Settings.GameSplit = GAMESPLIT_2GB;
else
Settings.GameSplit = GAMESPLIT_NONE;
}
}
//! Settings: Quick Boot
else if (ret == ++Idx)
{
if (++Settings.quickboot >= MAX_ON_OFF) Settings.quickboot = 0;
if (++GameConfig.parentalcontrol >= 5) GameConfig.parentalcontrol = 0;
}
//! Settings: Error 002 fix
else if (ret == ++Idx)
{
if (++Settings.error002 >= 3) Settings.error002 = 0;
}
//! Settings: Install partitions
else if (ret == ++Idx)
{
switch(Settings.InstallPartitions)
{
case ONLY_GAME_PARTITION:
Settings.InstallPartitions = ALL_PARTITIONS;
break;
case ALL_PARTITIONS:
Settings.InstallPartitions = REMOVE_UPDATE_PARTITION;
break;
default:
case REMOVE_UPDATE_PARTITION:
Settings.InstallPartitions = ONLY_GAME_PARTITION;
break;
}
if (++GameConfig.errorfix002 >= 3) GameConfig.errorfix002 = 0;
}
//! Settings: Return To
else if (ret == ++Idx)
{
char tidChar[10];
bool getChannel = TitleSelector(tidChar);
if (getChannel)
snprintf(Settings.returnTo, sizeof(Settings.returnTo), "%s", tidChar);
if (++GameConfig.returnTo >= MAX_ON_OFF) GameConfig.returnTo = 0;
}
//! Settings: Messageboard Update
//! Settings: Alternate DOL
else if (ret == ++Idx)
{
if (++Settings.PlaylogUpdate >= MAX_ON_OFF) Settings.PlaylogUpdate = 0;
if (++GameConfig.loadalternatedol > 2)
GameConfig.loadalternatedol = 0;
}
//! Settings: Select DOL Offset from Game
else if (ret == ++Idx && GameConfig.loadalternatedol == 1)
{
char filename[10];
snprintf(filename, 7, "%s", GameConfig.id);
//alt dol menu for games that require more than a single alt dol
int autodol = autoSelectDolMenu(filename, false);
if (autodol > 0)
{
GameConfig.alternatedolstart = autodol;
snprintf(GameConfig.alternatedolname, sizeof(GameConfig.alternatedolname), "%s <%i>", tr( "AUTO" ), autodol);
SetOptionValues();
return MENU_NONE;
}
else if (autodol == 0)
{
GameConfig.loadalternatedol = 0;
SetOptionValues();
return MENU_NONE;
}
//check to see if we already know the offset of the correct dol
autodol = autoSelectDol(filename, false);
//if we do know that offset ask if they want to use it
if (autodol > 0)
{
int dolchoice = WindowPrompt(0, tr( "Do you want to use the alternate DOL that is known to be correct?" ),
tr( "Yes" ), tr( "Pick from a list" ), tr( "Cancel" ));
if (dolchoice == 1)
{
GameConfig.alternatedolstart = autodol;
snprintf(GameConfig.alternatedolname, sizeof(GameConfig.alternatedolname), "%s <%i>", tr( "AUTO" ), autodol);
}
else if (dolchoice == 2) //they want to search for the correct dol themselves
{
int res = DiscBrowse(GameConfig.id, GameConfig.alternatedolname, sizeof(GameConfig.alternatedolname));
if (res >= 0)
GameConfig.alternatedolstart = res;
}
}
else
{
int res = DiscBrowse(GameConfig.id, GameConfig.alternatedolname, sizeof(GameConfig.alternatedolname));
if (res >= 0)
{
GameConfig.alternatedolstart = res;
char tmp[170];
snprintf(tmp, sizeof(tmp), "%s %s - %i", tr( "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." ), filename, GameConfig.alternatedolstart);
WindowPrompt(0, tmp, tr( "OK" ));
}
}
if(GameConfig.alternatedolstart == 0)
GameConfig.loadalternatedol = 0;
}
//! Settings: Block IOS Reload
else if (ret == ++Idx)
{
if (++GameConfig.iosreloadblock >= MAX_ON_OFF) GameConfig.iosreloadblock = 0;
}
//! Settings: Game Lock
else if (ret == ++Idx)
{
if (++GameConfig.Locked >= MAX_ON_OFF) GameConfig.Locked = 0;
}
SetOptionValues();

View File

@ -21,24 +21,30 @@
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef GAMELOADSM_HPP_
#define GAMELOADSM_HPP_
#ifndef GAMELOAD_SM_HPP
#define GAMELOAD_SM_HPP
#include "SettingsMenu.hpp"
#include "settings/CGameSettings.h"
class GameLoadSM : public SettingsMenu
{
public:
GameLoadSM();
GameLoadSM(const char * GameID);
~GameLoadSM();
virtual int GetType() { return CGameLoadSM; };
protected:
void SetDefaultConfig();
void SetOptionNames();
void SetOptionValues();
int GetMenuInternal();
int OldSettingsPartition;
GameCFG GameConfig;
OptionList GuiOptions;
GuiText * saveBtnTxt;
GuiImage * saveBtnImg;
GuiButton * saveBtn;
};

View File

@ -28,7 +28,7 @@
#include "language/gettext.h"
#include "wad/nandtitle.h"
#include "cheats/cheatmenu.h"
#include "IndGameLoadSM.hpp"
#include "GameLoadSM.hpp"
#include "UninstallSM.hpp"
GameSettingsMenu::GameSettingsMenu(struct discHdr * header)
@ -65,7 +65,7 @@ void GameSettingsMenu::CreateSettingsMenu(int menuNr)
{
HideMenu();
ResumeGui();
CurrentMenu = new IndGameLoadSM((const char *) DiscHeader->id);
CurrentMenu = new GameLoadSM((const char *) DiscHeader->id);
Append(CurrentMenu);
}
@ -107,8 +107,8 @@ void GameSettingsMenu::DeleteSettingsMenu()
switch(type)
{
case CIndGameLoadSM:
delete ((IndGameLoadSM *) CurrentMenu);
case CGameLoadSM:
delete ((GameLoadSM *) CurrentMenu);
break;
case CUninstallSM:
delete ((UninstallSM *) CurrentMenu);

View File

@ -27,7 +27,7 @@
#include "network/update.h"
#include "language/gettext.h"
#include "GUISettingsMenu.hpp"
#include "GameLoadSM.hpp"
#include "LoaderSettings.hpp"
#include "ParentalControlSM.hpp"
#include "SoundSettingsMenu.hpp"
#include "CustomPathsSM.hpp"
@ -52,7 +52,7 @@ void GlobalSettings::SetupMainButtons()
int pos = 0;
SetMainButton(pos++, tr( "GUI Settings" ), MainButtonImgData, MainButtonImgOverData);
SetMainButton(pos++, tr( "Game Load" ), MainButtonImgData, MainButtonImgOverData);
SetMainButton(pos++, tr( "Loader Settings" ), MainButtonImgData, MainButtonImgOverData);
SetMainButton(pos++, tr( "Parental Control" ), MainButtonImgData, MainButtonImgOverData);
SetMainButton(pos++, tr( "Sound" ), MainButtonImgData, MainButtonImgOverData);
SetMainButton(pos++, tr( "Custom Paths" ), MainButtonImgData, MainButtonImgOverData);
@ -82,7 +82,7 @@ void GlobalSettings::CreateSettingsMenu(int menuNr)
{
HideMenu();
ResumeGui();
CurrentMenu = new GameLoadSM();
CurrentMenu = new LoaderSettings();
Append(CurrentMenu);
}
//! Parental Control
@ -179,8 +179,8 @@ void GlobalSettings::DeleteSettingsMenu()
case CGUISettingsMenu:
delete ((GuiSettingsMenu *) CurrentMenu);
break;
case CGameLoadSM:
delete ((GameLoadSM *) CurrentMenu);
case CLoaderSettings:
delete ((LoaderSettings *) CurrentMenu);
break;
case CParentalControlSM:
delete ((ParentalControlSM *) CurrentMenu);

View File

@ -1,407 +0,0 @@
/****************************************************************************
* Copyright (C) 2010
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#include <unistd.h>
#include <gccore.h>
#include "settings/CSettings.h"
#include "themes/CTheme.h"
#include "prompts/PromptWindows.h"
#include "prompts/DiscBrowser.h"
#include "language/gettext.h"
#include "wad/nandtitle.h"
#include "IndGameLoadSM.hpp"
static const char * OnOffText[MAX_ON_OFF] =
{
trNOOP( "OFF" ),
trNOOP( "ON" )
};
static const char * VideoModeText[VIDEO_MODE_MAX] =
{
trNOOP( "System Default" ),
trNOOP( "Disc Default" ),
trNOOP( "Force PAL50" ),
trNOOP( "Force PAL60" ),
trNOOP( "Force NTSC" ),
trNOOP( "Region Patch" ),
};
static const char * LanguageText[MAX_LANGUAGE] =
{
trNOOP( "Japanese" ),
trNOOP( "English" ),
trNOOP( "German" ),
trNOOP( "French" ),
trNOOP( "Spanish" ),
trNOOP( "Italian" ),
trNOOP( "Dutch" ),
trNOOP( "SChinese" ),
trNOOP( "TChinese" ),
trNOOP( "Korean" ),
trNOOP( "Console Default" ),
};
static const char * Error002Text[3] =
{
trNOOP( "No" ),
trNOOP( "Yes" ),
trNOOP( "Anti" )
};
static const char * ParentalText[5] =
{
trNOOP( "0 (Everyone)" ),
trNOOP( "1 (Child 7+)" ),
trNOOP( "2 (Teen 12+)" ),
trNOOP( "3 (Mature 16+)" ),
trNOOP( "4 (Adults Only 18+)" )
};
static const char * AlternateDOLText[] =
{
trNOOP( "OFF" ),
trNOOP( "Select a DOL from Game" ),
trNOOP( "Load From SD/USB" ),
};
IndGameLoadSM::IndGameLoadSM(const char * GameID)
: SettingsMenu(tr("Game Load"), &GuiOptions, MENU_NONE)
{
//! Setup default settings from global settings
snprintf(GameConfig.id, sizeof(GameConfig.id), "%s", (char *) GameID);
SetDefaultConfig();
GameCFG * existCFG = GameSettings.GetGameCFG(GameID);
//! Overwrite with existing if available
if (existCFG)
memcpy(&GameConfig, existCFG, sizeof(GameCFG));
if(!btnOutline)
btnOutline = Resources::GetImageData("button_dialogue_box.png");
if(!trigA)
trigA = new GuiTrigger();
trigA->SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
saveBtnTxt = new GuiText(tr( "Save" ), 22, thColor("r=0 g=0 b=0 a=255 - prompt windows text color"));
saveBtnTxt->SetMaxWidth(btnOutline->GetWidth() - 30);
saveBtnImg = new GuiImage (btnOutline);
if (Settings.wsprompt == ON)
{
saveBtnTxt->SetWidescreen(Settings.widescreen);
saveBtnImg->SetWidescreen(Settings.widescreen);
}
saveBtn = new GuiButton(saveBtnImg, saveBtnImg, 2, 3, 180, 400, trigA, btnSoundOver, btnSoundClick2, 1);
saveBtn->SetLabel(saveBtnTxt);
Append(saveBtn);
SetOptionNames();
SetOptionValues();
}
IndGameLoadSM::~IndGameLoadSM()
{
HaltGui();
//! The rest is destroyed in SettingsMenu.cpp
Remove(saveBtn);
delete saveBtnTxt;
delete saveBtnImg;
delete saveBtn;
ResumeGui();
}
void IndGameLoadSM::SetDefaultConfig()
{
GameConfig.video = Settings.videomode;
GameConfig.language = Settings.language;
GameConfig.ocarina = Settings.ocarina;
GameConfig.vipatch = Settings.videopatch;
GameConfig.ios = Settings.cios;
GameConfig.parentalcontrol = 0;
GameConfig.errorfix002 = Settings.error002;
GameConfig.patchcountrystrings = Settings.patchcountrystrings;
GameConfig.loadalternatedol = OFF;
GameConfig.alternatedolstart = 0;
GameConfig.iosreloadblock = OFF;
strcpy(GameConfig.alternatedolname, "");
GameConfig.returnTo = 1;
GameConfig.Locked = 0;
}
void IndGameLoadSM::SetOptionNames()
{
int Idx = 0;
Options->SetName(Idx++, "%s", tr( "Video Mode" ));
Options->SetName(Idx++, "%s", tr( "VIDTV Patch" ));
Options->SetName(Idx++, "%s", tr( "Game Language" ));
Options->SetName(Idx++, "%s", tr( "Patch Country Strings" ));
Options->SetName(Idx++, "%s", tr( "Ocarina" ));
Options->SetName(Idx++, "%s", tr( "Game IOS" ));
Options->SetName(Idx++, "%s", tr( "Parental Control" ));
Options->SetName(Idx++, "%s", tr( "Error 002 fix" ));
Options->SetName(Idx++, "%s", tr( "Return To" ));
Options->SetName(Idx++, "%s", tr( "Alternate DOL" ));
Options->SetName(Idx++, "%s", tr( "Select DOL Offset" ));
Options->SetName(Idx++, "%s", tr( "Block IOS Reload" ));
Options->SetName(Idx++, "%s", tr( "Game Lock" ));
}
void IndGameLoadSM::SetOptionValues()
{
int Idx = 0;
//! Settings: Video Mode
Options->SetValue(Idx++, "%s", tr(VideoModeText[GameConfig.video]));
//! Settings: VIDTV Patch
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.vipatch]));
//! Settings: Game Language
Options->SetValue(Idx++, "%s", tr(LanguageText[GameConfig.language]));
//! Settings: Patch Country Strings
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.patchcountrystrings]));
//! Settings: Ocarina
Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.ocarina]));
//! Settings: Game IOS
Options->SetValue(Idx++, "%i", GameConfig.ios);
//! Settings: Parental Control
Options->SetValue(Idx++, "%s", tr(ParentalText[GameConfig.parentalcontrol]));
//! Settings: Error 002 fix
Options->SetValue(Idx++, "%s", tr(Error002Text[GameConfig.errorfix002]));
//! Settings: Return To
if(GameConfig.returnTo)
{
const char* TitleName = NULL;
int haveTitle = NandTitles.FindU32(Settings.returnTo);
if (haveTitle >= 0)
TitleName = NandTitles.NameFromIndex(haveTitle);
Options->SetValue(Idx++, "%s", TitleName ? TitleName : strlen(Settings.returnTo) > 0 ?
Settings.returnTo : tr( OnOffText[0] ));
}
else
{
Options->SetValue(Idx++, "%s", tr( OnOffText[0] ));
}
//! Settings: Alternate DOL
Options->SetValue(Idx++, "%s", tr( AlternateDOLText[GameConfig.loadalternatedol] ));
//! Settings: Select DOL Offset
if(GameConfig.loadalternatedol != 1)
Options->SetValue(Idx++, tr("Not required"));
else
{
if(strcmp(GameConfig.alternatedolname, "") != 0)
Options->SetValue(Idx++, "%i <%s>", GameConfig.alternatedolstart, GameConfig.alternatedolname);
else
Options->SetValue(Idx++, "%i", GameConfig.alternatedolstart);
}
//! Settings: Block IOS Reload
Options->SetValue(Idx++, "%s", tr( OnOffText[GameConfig.iosreloadblock] ));
//! Settings: Game Lock
Options->SetValue(Idx++, "%s", tr( OnOffText[GameConfig.Locked] ));
}
int IndGameLoadSM::GetMenuInternal()
{
if (saveBtn->GetState() == STATE_CLICKED)
{
if (GameSettings.AddGame(GameConfig) && GameSettings.Save())
{
WindowPrompt(tr( "Successfully Saved" ), 0, tr( "OK" ));
}
else
WindowPrompt(tr( "Save Failed. No device inserted?" ), 0, tr( "OK" ));
saveBtn->ResetState();
}
int ret = optionBrowser->GetClickedOption();
if (ret < 0)
return MENU_NONE;
int Idx = -1;
//! Settings: Video Mode
if (ret == ++Idx)
{
if (++GameConfig.video >= VIDEO_MODE_MAX) GameConfig.video = 0;
}
//! Settings: VIDTV Patch
else if (ret == ++Idx)
{
if (++GameConfig.vipatch >= MAX_ON_OFF) GameConfig.vipatch = 0;
}
//! Settings: Game Language
else if (ret == ++Idx)
{
if (++GameConfig.language >= MAX_LANGUAGE) GameConfig.language = 0;
}
//! Settings: Patch Country Strings
else if (ret == ++Idx)
{
if (++GameConfig.patchcountrystrings >= MAX_ON_OFF) GameConfig.patchcountrystrings = 0;
}
//! Settings: Ocarina
else if (ret == ++Idx)
{
if (++GameConfig.ocarina >= MAX_ON_OFF) GameConfig.ocarina = 0;
}
//! Settings: Game IOS
else if (ret == ++Idx)
{
char entered[4];
snprintf(entered, sizeof(entered), "%i", GameConfig.ios);
if(OnScreenKeyboard(entered, sizeof(entered), 0))
{
GameConfig.ios = atoi(entered);
if(GameConfig.ios < 200) GameConfig.ios = 200;
else if(GameConfig.ios > 255) GameConfig.ios = 255;
if(NandTitles.IndexOf(TITLE_ID(1, GameConfig.ios)) < 0)
{
WindowPrompt(tr("Warning:"), tr("This IOS was not found on the titles list. If you are sure you have it installed than ignore this warning."), tr("OK"));
}
else if(GameConfig.ios == 254)
{
WindowPrompt(tr("Warning:"), tr("This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning."), tr("OK"));
}
}
}
//! Settings: Parental Control
else if (ret == ++Idx)
{
if (++GameConfig.parentalcontrol >= 5) GameConfig.parentalcontrol = 0;
}
//! Settings: Error 002 fix
else if (ret == ++Idx)
{
if (++GameConfig.errorfix002 >= 3) GameConfig.errorfix002 = 0;
}
//! Settings: Return To
else if (ret == ++Idx)
{
if (++GameConfig.returnTo >= MAX_ON_OFF) GameConfig.returnTo = 0;
}
//! Settings: Alternate DOL
else if (ret == ++Idx)
{
if (++GameConfig.loadalternatedol > 2)
GameConfig.loadalternatedol = 0;
}
//! Settings: Select DOL Offset from Game
else if (ret == ++Idx && GameConfig.loadalternatedol == 1)
{
char filename[10];
snprintf(filename, 7, "%s", GameConfig.id);
//alt dol menu for games that require more than a single alt dol
int autodol = autoSelectDolMenu(filename, false);
if (autodol > 0)
{
GameConfig.alternatedolstart = autodol;
snprintf(GameConfig.alternatedolname, sizeof(GameConfig.alternatedolname), "%s <%i>", tr( "AUTO" ), autodol);
SetOptionValues();
return MENU_NONE;
}
else if (autodol == 0)
{
GameConfig.loadalternatedol = 0;
SetOptionValues();
return MENU_NONE;
}
//check to see if we already know the offset of the correct dol
autodol = autoSelectDol(filename, false);
//if we do know that offset ask if they want to use it
if (autodol > 0)
{
int dolchoice = WindowPrompt(0, tr( "Do you want to use the alternate DOL that is known to be correct?" ),
tr( "Yes" ), tr( "Pick from a list" ), tr( "Cancel" ));
if (dolchoice == 1)
{
GameConfig.alternatedolstart = autodol;
snprintf(GameConfig.alternatedolname, sizeof(GameConfig.alternatedolname), "%s <%i>", tr( "AUTO" ), autodol);
}
else if (dolchoice == 2) //they want to search for the correct dol themselves
{
int res = DiscBrowse(GameConfig.id, GameConfig.alternatedolname, sizeof(GameConfig.alternatedolname));
if (res >= 0)
GameConfig.alternatedolstart = res;
}
}
else
{
int res = DiscBrowse(GameConfig.id, GameConfig.alternatedolname, sizeof(GameConfig.alternatedolname));
if (res >= 0)
{
GameConfig.alternatedolstart = res;
char tmp[170];
snprintf(tmp, sizeof(tmp), "%s %s - %i", tr( "It seems that you have some information that will be helpful to us. Please pass this information along to the DEV team." ), filename, GameConfig.alternatedolstart);
WindowPrompt(0, tmp, tr( "OK" ));
}
}
if(GameConfig.alternatedolstart == 0)
GameConfig.loadalternatedol = 0;
}
//! Settings: Block IOS Reload
else if (ret == ++Idx)
{
if (++GameConfig.iosreloadblock >= MAX_ON_OFF) GameConfig.iosreloadblock = 0;
}
//! Settings: Game Lock
else if (ret == ++Idx)
{
if (++GameConfig.Locked >= MAX_ON_OFF) GameConfig.Locked = 0;
}
SetOptionValues();
return MENU_NONE;
}

View File

@ -0,0 +1,356 @@
/****************************************************************************
* Copyright (C) 2010
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#include <unistd.h>
#include "LoaderSettings.hpp"
#include "Controls/DeviceHandler.hpp"
#include "settings/CSettings.h"
#include "prompts/PromptWindows.h"
#include "language/gettext.h"
#include "wad/nandtitle.h"
#include "prompts/TitleBrowser.h"
#include "usbloader/GameList.h"
#include "usbloader/wbfs.h"
#include "usbloader/utils.h"
#include "system/IosLoader.h"
#include "settings/GameTitles.h"
#include "xml/xml.h"
#include "menu.h"
static const char * OnOffText[MAX_ON_OFF] =
{
trNOOP( "OFF" ),
trNOOP( "ON" )
};
static const char * VideoModeText[VIDEO_MODE_MAX] =
{
trNOOP( "System Default" ),
trNOOP( "Disc Default" ),
trNOOP( "Force PAL50" ),
trNOOP( "Force PAL60" ),
trNOOP( "Force NTSC" ),
trNOOP( "Region Patch" ),
};
static const char * LanguageText[MAX_LANGUAGE] =
{
trNOOP( "Japanese" ),
trNOOP( "English" ),
trNOOP( "German" ),
trNOOP( "French" ),
trNOOP( "Spanish" ),
trNOOP( "Italian" ),
trNOOP( "Dutch" ),
trNOOP( "SChinese" ),
trNOOP( "TChinese" ),
trNOOP( "Korean" ),
trNOOP( "Console Default" )
};
static const char * InstallToText[INSTALL_TO_MAX] =
{
trNOOP( "None" ),
trNOOP( "GAMEID_Gamename" ),
trNOOP( "Gamename [GAMEID]" )
};
static const char * SplitSizeText[INSTALL_TO_MAX] =
{
trNOOP( "No Splitting" ),
trNOOP( "Split each 2GB" ),
trNOOP( "Split each 4GB" ),
};
static const char * Error002Text[3] =
{
trNOOP( "No" ),
trNOOP( "Yes" ),
trNOOP( "Anti" )
};
static inline bool IsValidPartition(int fs_type, int cios)
{
if (IosLoader::IsWaninkokoIOS() && NandTitles.VersionOf(TITLE_ID(1, cios)) < 18)
{
return fs_type == PART_FS_WBFS;
}
else
{
return fs_type == PART_FS_WBFS || fs_type == PART_FS_FAT || fs_type == PART_FS_NTFS || fs_type == PART_FS_EXT;
}
}
LoaderSettings::LoaderSettings()
: SettingsMenu(tr("Loader Settings"), &GuiOptions, MENU_NONE)
{
int Idx = 0;
Options->SetName(Idx++, "%s", tr( "Video Mode" ));
Options->SetName(Idx++, "%s", tr( "VIDTV Patch" ));
Options->SetName(Idx++, "%s", tr( "Game Language" ));
Options->SetName(Idx++, "%s", tr( "Patch Country Strings" ));
Options->SetName(Idx++, "%s", tr( "Ocarina" ));
Options->SetName(Idx++, "%s", tr( "Boot/Standard" ));
Options->SetName(Idx++, "%s", tr( "Partition" ));
Options->SetName(Idx++, "%s", tr( "Install directories" ));
Options->SetName(Idx++, "%s", tr( "Game Split Size" ));
Options->SetName(Idx++, "%s", tr( "Quick Boot" ));
Options->SetName(Idx++, "%s", tr( "Error 002 fix" ));
Options->SetName(Idx++, "%s", tr( "Install partitions" ));
Options->SetName(Idx++, "%s", tr( "Return To" ));
Options->SetName(Idx++, "%s", tr( "Messageboard Update" ));
SetOptionValues();
OldSettingsPartition = Settings.partition;
}
LoaderSettings::~LoaderSettings()
{
//! if partition has changed, Reinitialize it
if (Settings.partition != OldSettingsPartition)
{
WBFS_OpenPart(Settings.partition);
//! Reload the new game titles
gameList.ReadGameList();
GameTitles.LoadTitlesFromWiiTDB(Settings.titlestxt_path);
}
}
void LoaderSettings::SetOptionValues()
{
int Idx = 0;
//! Settings: Video Mode
Options->SetValue(Idx++, "%s", tr(VideoModeText[Settings.videomode]));
//! Settings: VIDTV Patch
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.videopatch] ));
//! Settings: Game Language
Options->SetValue(Idx++, "%s", tr( LanguageText[Settings.language] ));
//! Settings: Patch Country Strings
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.patchcountrystrings] ));
//! Settings: Ocarina
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.ocarina] ));
//! Settings: Boot/Standard
if (Settings.godmode)
Options->SetValue(Idx++, "IOS %i", Settings.cios);
else
Options->SetValue(Idx++, "********");
//! Settings: Partition
PartitionHandle * usbHandle = DeviceHandler::Instance()->GetUSBHandle();
// Get the partition name and it's size in GB's
Options->SetValue(Idx++, "%s (%.2fGB)", usbHandle->GetFSName(Settings.partition), usbHandle->GetSize(Settings.partition)/GB_SIZE);
//! Settings: Install directories
Options->SetValue(Idx++, "%s", tr( InstallToText[Settings.InstallToDir] ));
//! Settings: Game Split Size
Options->SetValue(Idx++, "%s", tr( SplitSizeText[Settings.GameSplit] ));
//! Settings: Quick Boot
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.quickboot] ));
//! Settings: Error 002 fix
Options->SetValue(Idx++, "%s", tr( Error002Text[Settings.error002] ));
//! Settings: Install partitions
if(Settings.InstallPartitions == ONLY_GAME_PARTITION)
Options->SetValue(Idx++, "%s", tr("Only Game Partition"));
else if(Settings.InstallPartitions == ALL_PARTITIONS)
Options->SetValue(Idx++, "%s", tr("All Partitions"));
else if(Settings.InstallPartitions == REMOVE_UPDATE_PARTITION)
Options->SetValue(Idx++, "%s", tr("Remove update"));
//! Settings: Return To
const char* TitleName = NULL;
int haveTitle = NandTitles.FindU32(Settings.returnTo);
if (haveTitle >= 0)
TitleName = NandTitles.NameFromIndex(haveTitle);
TitleName = TitleName ? TitleName : strlen(Settings.returnTo) > 0 ? Settings.returnTo : tr(OnOffText[0]);
Options->SetValue(Idx++, "%s", TitleName);
//! Settings: Messageboard Update
Options->SetValue(Idx++, "%s", tr( OnOffText[Settings.PlaylogUpdate] ));
}
int LoaderSettings::GetMenuInternal()
{
int ret = optionBrowser->GetClickedOption();
if (ret < 0)
return MENU_NONE;
int Idx = -1;
//! Settings: Video Mode
if (ret == ++Idx)
{
if (++Settings.videomode >= VIDEO_MODE_MAX) Settings.videomode = 0;
}
//! Settings: VIDTV Patch
else if (ret == ++Idx)
{
if (++Settings.videopatch >= MAX_ON_OFF) Settings.videopatch = 0;
}
//! Settings: Game Language
else if (ret == ++Idx)
{
if (++Settings.language >= MAX_LANGUAGE) Settings.language = 0;
}
//! Settings: Patch Country Strings
else if (ret == ++Idx)
{
if (++Settings.patchcountrystrings >= MAX_ON_OFF) Settings.patchcountrystrings = 0;
}
//! Settings: Ocarina
else if (ret == ++Idx)
{
if (++Settings.ocarina >= MAX_ON_OFF) Settings.ocarina = 0;
}
//! Settings: Boot/Standard
else if (ret == ++Idx)
{
if(!Settings.godmode)
return MENU_NONE;
char entered[4];
snprintf(entered, sizeof(entered), "%i", Settings.cios);
if(OnScreenKeyboard(entered, sizeof(entered), 0))
{
Settings.cios = atoi(entered);
if(Settings.cios < 200) Settings.cios = 200;
else if(Settings.cios > 255) Settings.cios = 255;
if(NandTitles.IndexOf(TITLE_ID(1, Settings.cios)) < 0)
{
WindowPrompt(tr("Warning:"), tr("This IOS was not found on the titles list. If you are sure you have it installed than ignore this warning."), tr("OK"));
}
else if(Settings.cios == 254)
{
WindowPrompt(tr("Warning:"), tr("This IOS is the BootMii ios. If you are sure it is not BootMii and you have something else installed there than ignore this warning."), tr("OK"));
}
}
}
//! Settings: Partition
else if (ret == ++Idx)
{
if(DeviceHandler::Instance()->GetUSBHandle()->GetPartitionCount() < 2)
return MENU_NONE;
// Select the next valid partition, even if that's the same one
int fs_type = 0;
int ios = IOS_GetVersion();
int retries = 20;
do
{
Settings.partition = (Settings.partition + 1) % DeviceHandler::Instance()->GetUSBHandle()->GetPartitionCount();
fs_type = DeviceHandler::GetUSBFilesystemType(Settings.partition);
}
while (!IsValidPartition(fs_type, ios) && --retries > 0);
if(fs_type == PART_FS_FAT && Settings.GameSplit == GAMESPLIT_NONE)
Settings.GameSplit = GAMESPLIT_4GB;
}
//! Settings: Install directories
else if (ret == ++Idx)
{
if (++Settings.InstallToDir >= INSTALL_TO_MAX) Settings.InstallToDir = 0;
}
//! Settings: Game Split Size
else if (ret == ++Idx)
{
if (++Settings.GameSplit >= GAMESPLIT_MAX)
{
if(DeviceHandler::GetUSBFilesystemType(Settings.partition) == PART_FS_FAT)
Settings.GameSplit = GAMESPLIT_2GB;
else
Settings.GameSplit = GAMESPLIT_NONE;
}
}
//! Settings: Quick Boot
else if (ret == ++Idx)
{
if (++Settings.quickboot >= MAX_ON_OFF) Settings.quickboot = 0;
}
//! Settings: Error 002 fix
else if (ret == ++Idx )
{
if (++Settings.error002 >= 3) Settings.error002 = 0;
}
//! Settings: Install partitions
else if (ret == ++Idx)
{
switch(Settings.InstallPartitions)
{
case ONLY_GAME_PARTITION:
Settings.InstallPartitions = ALL_PARTITIONS;
break;
case ALL_PARTITIONS:
Settings.InstallPartitions = REMOVE_UPDATE_PARTITION;
break;
default:
case REMOVE_UPDATE_PARTITION:
Settings.InstallPartitions = ONLY_GAME_PARTITION;
break;
}
}
//! Settings: Return To
else if (ret == ++Idx)
{
char tidChar[10];
bool getChannel = TitleSelector(tidChar);
if (getChannel)
snprintf(Settings.returnTo, sizeof(Settings.returnTo), "%s", tidChar);
}
//! Settings: Messageboard Update
else if (ret == ++Idx )
{
if (++Settings.PlaylogUpdate >= MAX_ON_OFF) Settings.PlaylogUpdate = 0;
}
SetOptionValues();
return MENU_NONE;
}

View File

@ -21,30 +21,24 @@
* 3. This notice may not be removed or altered from any source
* distribution.
***************************************************************************/
#ifndef INDIVIDUAL_GAMELOAD_SM_HPP
#define INDIVIDUAL_GAMELOAD_SM_HPP
#ifndef LOADERSETTINGS_HPP_
#define LOADERSETTINGS_HPP_
#include "SettingsMenu.hpp"
#include "settings/CGameSettings.h"
class IndGameLoadSM : public SettingsMenu
class LoaderSettings : public SettingsMenu
{
public:
IndGameLoadSM(const char * GameID);
~IndGameLoadSM();
virtual int GetType() { return CIndGameLoadSM; };
LoaderSettings();
~LoaderSettings();
virtual int GetType() { return CLoaderSettings; };
protected:
void SetDefaultConfig();
void SetOptionNames();
void SetOptionValues();
int GetMenuInternal();
GameCFG GameConfig;
OptionList GuiOptions;
int OldSettingsPartition;
GuiText * saveBtnTxt;
GuiImage * saveBtnImg;
GuiButton * saveBtn;
OptionList GuiOptions;
};

View File

@ -32,11 +32,11 @@ enum
{
CSettingsMenu = 0,
CGUISettingsMenu,
CGameLoadSM,
CLoaderSettings,
CParentalControlSM,
CSoundSettingsMenu,
CCustomPathsSM,
CIndGameLoadSM,
CGameLoadSM,
CUninstallSM,
};

View File

@ -30,6 +30,7 @@
#include "libwiigui/gui.h"
#include "settings/CSettings.h"
#include "FileOperations/fileops.h"
#include "menu/menus.h"
#include "FreeTypeGX.h"
FreeTypeGX * fontSystem = NULL;
@ -38,6 +39,31 @@ static u32 MainFontSize = 0;
bool Theme::ShowTooltips = true;
void Theme::Reload()
{
HaltGui();
mainWindow->Remove(bgImg);
for(int i = 0; i < 4; ++i)
{
char image[50];
snprintf(image, sizeof(image), "player%i_point.png", i+1);
delete pointer[i];
pointer[i] = Resources::GetImageData(image);
}
delete btnSoundClick;
delete btnSoundClick2;
delete btnSoundOver;
btnSoundClick = new GuiSound(Resources::GetFile("button_click.wav"), Resources::GetFileSize("button_click.wav"), Settings.sfxvolume);
btnSoundClick2 = new GuiSound(Resources::GetFile("button_click2.wav"), Resources::GetFileSize("button_click2.wav"), Settings.sfxvolume);
btnSoundOver = new GuiSound(Resources::GetFile("button_over.wav"), Resources::GetFileSize("button_over.wav"), Settings.sfxvolume);
delete background;
background = Resources::GetImageData(Settings.widescreen ? "wbackground.png" : "background.png");
delete bgImg;
bgImg = new GuiImage(background);
mainWindow->Append(bgImg);
ResumeGui();
}
void Theme::CleanUp()
{
ThemeCleanUp();

View File

@ -16,6 +16,8 @@ class Theme
static bool Load(const char * path);
//!Load font data
static bool LoadFont(const char *path);
//!Reload the main images/sounds for the new theme
static void Reload();
//!Clear all image/font/theme data and free the memory
static void CleanUp();

View File

@ -55,7 +55,6 @@ RecourceFile Resources::RecourceFiles[] =
{"menu_button_over.png", menu_button_over_png, menu_button_over_png_size, NULL, 0},
{"settings_button.png", settings_button_png, settings_button_png_size, NULL, 0},
{"settings_button_over.png", settings_button_over_png, settings_button_over_png_size, NULL, 0},
{"settings_menu_button.png", settings_menu_button_png, settings_menu_button_png_size, NULL, 0},
{"wiimote_poweroff.png", wiimote_poweroff_png, wiimote_poweroff_png_size, NULL, 0},
{"dialogue_box.png", dialogue_box_png, dialogue_box_png_size, NULL, 0},
{"theme_box.png", theme_box_png, theme_box_png_size, NULL, 0},
@ -83,10 +82,6 @@ RecourceFile Resources::RecourceFiles[] =
{"battery_red.png", battery_red_png, battery_red_png_size, NULL, 0},
{"battery_bar_white.png", battery_bar_white_png, battery_bar_white_png_size, NULL, 0},
{"battery_bar_red.png", battery_bar_red_png, battery_bar_red_png_size, NULL, 0},
{"arrow_next.png", arrow_next_png, arrow_next_png_size, NULL, 0},
{"arrow_previous.png", arrow_previous_png, arrow_previous_png_size, NULL, 0},
{"mp3_pause.png", mp3_pause_png, mp3_pause_png_size, NULL, 0},
{"mp3_stop.png", mp3_stop_png, mp3_stop_png_size, NULL, 0},
{"exit_top.png", exit_top_png, exit_top_png_size, NULL, 0},
{"exit_top_over.png", exit_top_over_png, exit_top_over_png_size, NULL, 0},
{"exit_bottom.png", exit_bottom_png, exit_bottom_png_size, NULL, 0},

View File

@ -118,20 +118,7 @@ int ThemeDownloader::MainLoop()
{
HaltGui();
Theme::SetDefault();
mainWindow->Remove(bgImg);
if(pointer[0]) delete pointer[0];
if(pointer[1]) delete pointer[1];
if(pointer[2]) delete pointer[2];
if(pointer[3]) delete pointer[3];
pointer[0] = Resources::GetImageData("player1_point.png");
pointer[1] = Resources::GetImageData("player2_point.png");
pointer[2] = Resources::GetImageData("player3_point.png");
pointer[3] = Resources::GetImageData("player4_point.png");
if(background) delete background;
background = Resources::GetImageData(Settings.widescreen ? "wbackground.png" : "background.png");
if(bgImg) delete bgImg;
bgImg = new GuiImage(background);
mainWindow->Append(bgImg);
Theme::Reload();
ResumeGui();
return MENU_THEMEDOWNLOADER;
}

View File

@ -102,7 +102,9 @@ bool WBFS_Mounted()
s32 WBFS_Format(u32 lba, u32 size)
{
return current->Format();
Wbfs_Wbfs Part(wbfsDev, lba, size);
return Part.Format();
}
s32 WBFS_GetCount(u32 *count)

View File

@ -35,18 +35,9 @@ class Wbfs
virtual s32 RenameGame(u8 *, const void *) = 0;
virtual s32 ReIDGame(u8 *discid, const void *newID) = 0;
virtual f32 EstimateGameSize(void) = 0;
/*
static s32 OpenPart(u32 part_fat, u32 part_idx, u32 part_lba, u32 part_size, char *partition);
static s32 OpenNamed(char *partition);
static s32 OpenLBA(u32 lba, u32 size);
*/
protected:
static u32 nb_sectors;
/* WBFS HDD */
wbfs_t *hdd;
u32 device, lba, size;
private:

View File

@ -43,7 +43,7 @@ EOF
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>1.0 r$rev_new</version>
<version>2.0 r$rev_new</version>
<release_date>$rev_date</release_date>
<no_ios_reload/>
<short_description>Loads games from USB-devices</short_description>