*Fixed cover not being displayed when cover download block is active

*Added missing switch for parental control option (caused the next option to be switched)
*Changed GetGameCFG to return default cfg if none is set
*Fixed little bug preventing the automatic alt dol feature to work
This commit is contained in:
dimok321 2011-01-21 20:59:49 +00:00
parent e5db72b71d
commit 73b75e312f
6 changed files with 27 additions and 41 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>2.0 r1049</version>
<release_date>201101201831</release_date>
<version>2.0 r1050</version>
<release_date>201101211944</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

@ -114,9 +114,6 @@ int BootGame(const char * gameID)
int ret = 0;
GameCFG * game_cfg = GameSettings.GetGameCFG(gameHeader.id);
if(!game_cfg)
game_cfg = GameSettings.GetDefault();
u8 videoChoice = game_cfg->video;
u8 languageChoice = game_cfg->language;
u8 ocarinaChoice = game_cfg->ocarina;

View File

@ -282,6 +282,10 @@ GameBrowseMenu::GameBrowseMenu()
DownloadBtn->SetTrigger(1, trig1);
DownloadBtn->SetToolTip(DownloadBtnTT, 205, -30);
gameCoverImg = new GuiImage();
gameCoverImg->SetPosition(thInt("26 - cover/download btn pos x"), thInt("58 - cover/download btn pos y"));
gameCoverImg->SetWidescreen(Settings.widescreen);
IDBtnTT = new GuiTooltip(tr( "Click to change game ID" ));
if (Settings.wsprompt) IDBtnTT->SetWidescreen(Settings.widescreen);
IDBtnTT->SetAlpha(thInt("255 - tooltip alpha"));
@ -608,7 +612,6 @@ void GameBrowseMenu::ReloadBrowser()
}
else if (Settings.gameDisplay == GRID_MODE)
{
DownloadBtn->SetImage(NULL);
DownloadBtn->SetSize(0, 0);
UpdateGameInfoText(NULL);
gridBtn->SetImage(gridBtnImg);
@ -641,7 +644,6 @@ void GameBrowseMenu::ReloadBrowser()
}
else if (Settings.gameDisplay == CAROUSEL_MODE)
{
DownloadBtn->SetImage(NULL);
DownloadBtn->SetSize(0, 0);
UpdateGameInfoText(NULL);
carouselBtn->SetImage(carouselBtnImg);
@ -683,6 +685,7 @@ void GameBrowseMenu::ReloadBrowser()
Append(gameInfo);
Append(homeBtn);
Append(settingsBtn);
Append(gameCoverImg);
if (Settings.godmode || !(Settings.ParentalBlocks & BLOCK_HBC_MENU))
Append(homebrewBtn);
@ -1253,9 +1256,6 @@ int GameBrowseMenu::OpenClickedGame()
char IDfull[7];
snprintf(IDfull, sizeof(IDfull), "%s", (char *) header->id);
u8 alternatedol = OFF;
u8 ocarinaChoice = Settings.ocarina;
bool returnHere = true;// prompt to start game
int choice = -1;
@ -1288,23 +1288,18 @@ int GameBrowseMenu::OpenClickedGame()
wiilight(0);
GameCFG* game_cfg = GameSettings.GetGameCFG(header->id);
if (game_cfg)
{
alternatedol = game_cfg->loadalternatedol;
ocarinaChoice = game_cfg->ocarina;
}
if (alternatedol == 2)
if (game_cfg->loadalternatedol == 2)
CheckAlternativeDOL(IDfull);
else if(alternatedol == 3 && WDMMenu::Show(header) == 0)
else if(game_cfg->loadalternatedol == 3 && WDMMenu::Show(header) == 0)
{
RunGame = false;
returnHere = true;
}
else if(alternatedol == 4)
else if(game_cfg->loadalternatedol == 4)
defaultDolPrompt((char *) header->id);
if (RunGame && ocarinaChoice != OFF)
if (RunGame && game_cfg->ocarina != OFF)
CheckOcarina(IDfull);
if(RunGame)
@ -1337,19 +1332,12 @@ int GameBrowseMenu::OpenClickedGame()
void GameBrowseMenu::LoadCover(struct discHdr *header)
{
DownloadBtn->SetImage(NULL);
if(gameCover)
delete gameCover;
gameCoverImg->SetImage(NULL);
delete gameCover;
gameCover = LoadCoverImage(header);
if (gameCoverImg)
delete gameCoverImg;
gameCoverImg = new GuiImage(gameCover);
gameCoverImg->SetWidescreen(Settings.widescreen);
DownloadBtn->SetImage(gameCoverImg);// put the new image on the download button
gameCoverImg->SetImage(gameCover);// put the new image on the download button
}
void GameBrowseMenu::CheckOcarina(const char * IDfull)

View File

@ -46,7 +46,7 @@ CGameSettings::~CGameSettings()
GameCFG * CGameSettings::GetGameCFG(const char * id)
{
if(!id)
return NULL;
return GetDefault();
for(u32 i = 0; i < GameList.size(); ++i)
{
@ -56,7 +56,10 @@ GameCFG * CGameSettings::GetGameCFG(const char * id)
}
}
return NULL;
GameCFG *defaultCFG = GetDefault();
memcpy(defaultCFG->id, id, 6);
return defaultCFG;
}
bool CGameSettings::AddGame(const GameCFG & NewGame)
@ -418,7 +421,7 @@ GameCFG * CGameSettings::GetDefault()
DefaultConfig.loadalternatedol = ALT_DOL_DEFAULT;
DefaultConfig.alternatedolstart = 0;
DefaultConfig.iosreloadblock = OFF;
memset(DefaultConfig.alternatedolname, 0, sizeof(DefaultConfig.alternatedolname));
DefaultConfig.alternatedolname[0] = '\0';
DefaultConfig.returnTo = 1;
DefaultConfig.Locked = OFF;

View File

@ -91,15 +91,7 @@ static const char * AlternateDOLText[] =
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));
memcpy(&GameConfig, GameSettings.GetGameCFG(GameID), sizeof(GameCFG));
if(!btnOutline)
btnOutline = Resources::GetImageData("button_dialogue_box.png");

View File

@ -232,6 +232,12 @@ int ParentalControlSM::GetMenuInternal()
Settings.ParentalBlocks ^= BLOCK_LOADER_SETTINGS;
}
//! Settings: Block Parental Settings
else if (ret == ++Idx)
{
Settings.ParentalBlocks ^= BLOCK_PARENTAL_SETTINGS;
}
//! Settings: Block Sound Settings
else if (ret == ++Idx)
{