-only opening game info menu if gametdb is present

This commit is contained in:
fix94.1 2012-02-01 17:52:01 +00:00
parent 739d7892b3
commit 1a306fb2ed
3 changed files with 11 additions and 4 deletions

View File

@ -700,7 +700,7 @@ private:
int _config4(void);
int _configAdv(void);
int _configSnd(void);
void _game(bool launch = false);
void _game(bool launch = false, bool gametdb = false);
void _download(std::string gameId = std::string());
bool _code(char code[4], bool erase = false);
void _about(void);

View File

@ -284,7 +284,7 @@ static void setLanguage(int l)
configbytes[0] = 0xCD;
}
void CMenu::_game(bool launch)
void CMenu::_game(bool launch, bool gametdb)
{
m_gcfg1.load(sfmt("%s/gameconfig1.ini", m_settingsDir.c_str()).c_str());
if (!launch)
@ -321,7 +321,7 @@ void CMenu::_game(bool launch)
m_gameSound.Stop();
break;
}
else if (BTN_PLUS_PRESSED)
else if (BTN_PLUS_PRESSED && gametdb)
{
_hideGame();
m_gameSelected = true;

View File

@ -14,6 +14,7 @@
#include "disc.h"
#include "loader/cios.hpp"
#include "loader/alt_ios.h"
#include "GameTDB.hpp"
using namespace std;
@ -189,6 +190,12 @@ int CMenu::main(void)
SetupInput();
MusicPlayer::Instance()->Play();
GameTDB m_gametdb;
m_gametdb.OpenFile(sfmt("%s/wiitdb.xml", m_settingsDir.c_str()).c_str());
bool gametdbloaded=false;
if (m_gametdb.IsLoaded())
gametdbloaded=true;
m_gametdb.CloseFile();
m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
if (m_cfg.getBool("GENERAL", "update_cache", false))
{
@ -578,7 +585,7 @@ int CMenu::main(void)
if (m_cf.select())
{
_hideMain();
_game(BTN_B_HELD);
_game(BTN_B_HELD, gametdbloaded);
if(m_exit) break;
m_cf.cancel();
_showMain();