- Add uDraw icons to game info screen

- Clear old game info so it does not show for games without any gameTDB info.
- Only allow Update to show if not in parental lock mode.
This commit is contained in:
yardape8000 2012-05-03 01:34:56 +00:00
parent 1cb8a493d9
commit 40f3a44fef
5 changed files with 53 additions and 30 deletions

BIN
data/images/udraw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

BIN
data/images/udrawR.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -488,9 +488,10 @@ bool GameTDB::FindTitle(char * data, string & title, string langCode)
bool GameTDB::GetTitle(const char * id, string & title)
{
if(!id) return false;
title = "";
if(!id) return false;
char * data = GetGameNode(id);
char * data = GetGameNode(id);
if(!data) return false;
bool retval = FindTitle(data, title, LangCode);
@ -502,9 +503,10 @@ bool GameTDB::GetTitle(const char * id, string & title)
bool GameTDB::GetSynopsis(const char * id, string & synopsis)
{
if(!id) return false;
synopsis = "";
if(!id) return false;
char * data = GetGameNode(id);
char * data = GetGameNode(id);
if(!data) return false;
char * language = SeekLang(data, LangCode.c_str());
@ -534,9 +536,10 @@ bool GameTDB::GetSynopsis(const char * id, string & synopsis)
bool GameTDB::GetRegion(const char * id, string & region)
{
if(!id) return false;
region = "";
if(!id) return false;
char * data = GetGameNode(id);
char * data = GetGameNode(id);
if(!data) return false;
char * the_region = GetNodeText(data, "<region>", "</region>");
@ -555,9 +558,10 @@ bool GameTDB::GetRegion(const char * id, string & region)
bool GameTDB::GetDeveloper(const char * id, string & dev)
{
if(!id) return false;
dev = "";
if(!id) return false;
char * data = GetGameNode(id);
char * data = GetGameNode(id);
if(!data) return false;
char * the_dev = GetNodeText(data, "<developer>", "</developer>");
@ -576,9 +580,10 @@ bool GameTDB::GetDeveloper(const char * id, string & dev)
bool GameTDB::GetPublisher(const char * id, string & pub)
{
if(!id) return false;
pub = "";
if(!id) return false;
char * data = GetGameNode(id);
char * data = GetGameNode(id);
if(!data) return false;
char * the_pub = GetNodeText(data, "<publisher>", "</publisher>");
@ -644,7 +649,8 @@ bool GameTDB::GetGenres(const char * id, string & gen)
{
safe_vector<string> genre;
if(!id) return false;
gen = "";
if(!id) return false;
char * data = GetGameNode(id);
if(!data) return false;
@ -738,7 +744,8 @@ int GameTDB::GetRating(const char * id)
bool GameTDB::GetRatingValue(const char * id, string & rating_value)
{
if(!id) return false;
rating_value = "";
if(!id) return false;
char * data = GetGameNode(id);
if(!data) return false;
@ -766,6 +773,7 @@ bool GameTDB::GetRatingValue(const char * id, string & rating_value)
int GameTDB::GetRatingDescriptors(const char * id, safe_vector<string> & desc_list)
{
desc_list.clear();
if(!id)
return -1;
@ -781,7 +789,6 @@ int GameTDB::GetRatingDescriptors(const char * id, safe_vector<string> & desc_li
}
unsigned int list_num = 0;
desc_list.clear();
while(*descriptor_text != '\0')
{
@ -833,6 +840,7 @@ int GameTDB::GetWifiPlayers(const char * id)
int GameTDB::GetWifiFeatures(const char * id, safe_vector<string> & feat_list)
{
feat_list.clear();
if(!id)
return -1;
@ -848,7 +856,6 @@ int GameTDB::GetWifiFeatures(const char * id, safe_vector<string> & feat_list)
}
unsigned int list_num = 0;
feat_list.clear();
while(*feature_text != '\0')
{
@ -905,6 +912,7 @@ int GameTDB::GetPlayers(const char * id)
int GameTDB::GetAccessories(const char * id, safe_vector<Accessory> & acc_list)
{
acc_list.clear();
if(!id)
return -1;
@ -920,7 +928,6 @@ int GameTDB::GetAccessories(const char * id, safe_vector<Accessory> & acc_list)
}
unsigned int list_num = 0;
acc_list.clear();
while(ControlsNode && *ControlsNode != '\0')
{

View File

@ -95,7 +95,8 @@ void CMenu::_showAbout(void)
m_btnMgr.show(m_aboutLblTitle);
m_btnMgr.show(m_aboutLblIOS);
m_btnMgr.show(m_aboutLblInfo,false,true);
m_btnMgr.show(m_aboutBtnSystem);
if (!m_locked)
m_btnMgr.show(m_aboutBtnSystem);
for (u32 i = 0; i < ARRAY_SIZE(m_aboutLblUser); ++i)
if (m_aboutLblUser[i] != -1u)
m_btnMgr.show(m_aboutLblUser[i]);

View File

@ -40,6 +40,8 @@ extern const u8 drums_png[];
extern const u8 drumsR_png[];
extern const u8 motionplus_png[];
extern const u8 motionplusR_png[];
extern const u8 udraw_png[];
extern const u8 udrawR_png[];
extern const u8 wheel_png[];
extern const u8 zapper_png[];
extern const u8 keyboard_png[];
@ -336,6 +338,7 @@ void CMenu::_textGameInfo(void)
}
//Ratings
m_rating.fromPNG(norating_png);
switch(gameinfo.RatingType)
{
case 0:
@ -350,8 +353,6 @@ void CMenu::_textGameInfo(void)
m_rating.fromPNG(cero_c_png);
else if (gameinfo.RatingValue == "Z")
m_rating.fromPNG(cero_z_png);
else
m_rating.fromPNG(norating_png);
break;
case 1:
//ESRB
@ -367,8 +368,6 @@ void CMenu::_textGameInfo(void)
m_rating.fromPNG(esrb_t_png);
else if (gameinfo.RatingValue == "M")
m_rating.fromPNG(esrb_m_png);
else
m_rating.fromPNG(norating_png);
break;
case 2:
//PEGI
@ -382,8 +381,6 @@ void CMenu::_textGameInfo(void)
m_rating.fromPNG(pegi_16_png);
else if (gameinfo.RatingValue == "18")
m_rating.fromPNG(pegi_18_png);
else
m_rating.fromPNG(norating_png);
break;
default:
break;
@ -419,16 +416,17 @@ void CMenu::_textGameInfo(void)
u8 wiimote=0,
nunchuk=0,
classiccontroller=0,
balanceboard=0,
dancepad=0,
guitar=0,
gamecube=0,
motionplus=0,
drums=0,
classiccontroller=0,
balanceboard=0,
dancepad=0,
guitar=0,
gamecube=0,
motionplus=0,
drums=0,
microphone=0,
wheel=0,
keyboard,
keyboard=0,
udraw = 0,
zapper=0;
//check required controlls
@ -452,6 +450,8 @@ void CMenu::_textGameInfo(void)
microphone=1;
else if (strcmp((acc_itr->Name).c_str(), "balanceboard") == 0)
balanceboard=1;
else if (strcmp((acc_itr->Name).c_str(), "udraw") == 0)
udraw = 1;
}
u8 x = 0;
@ -521,6 +521,12 @@ void CMenu::_textGameInfo(void)
m_btnMgr.setTexture(m_gameinfoLblControlsReq[x] ,m_controlsreq[x], 52, 60);
x++;
}
if(udraw && x < max_controlsReq)
{
m_controlsreq[x].fromPNG(udrawR_png);
m_btnMgr.setTexture(m_gameinfoLblControlsReq[x] ,m_controlsreq[x], 52, 60);
x++;
}
cnt_controlsreq = x;
@ -540,6 +546,7 @@ void CMenu::_textGameInfo(void)
microphone=0,
wheel=0,
keyboard=0,
udraw = 0,
zapper=0;
for (safe_vector<Accessory>::iterator acc_itr = gameinfo.Accessories.begin(); acc_itr != gameinfo.Accessories.end(); acc_itr++)
@ -570,6 +577,8 @@ void CMenu::_textGameInfo(void)
zapper=1;
else if (strcmp((acc_itr->Name).c_str(), "wheel") == 0)
wheel=1;
else if (strcmp((acc_itr->Name).c_str(), "udraw") == 0)
udraw = 1;
}
x = 0;
@ -635,6 +644,12 @@ void CMenu::_textGameInfo(void)
m_btnMgr.setTexture(m_gameinfoLblControls[x] ,m_controls[x], 52, 60);
x++;
}
if(udraw && x < max_controls)
{
m_controls[x].fromPNG(udraw_png);
m_btnMgr.setTexture(m_gameinfoLblControls[x] ,m_controls[x], 52, 60);
x++;
}
if(zapper && x < max_controls)
{
m_controls[x].fromPNG(zapper_png);