From 40f3a44fef72918f335f993fe77b042f5dd2e5dd Mon Sep 17 00:00:00 2001 From: yardape8000 Date: Thu, 3 May 2012 01:34:56 +0000 Subject: [PATCH] - 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. --- data/images/udraw.png | Bin 0 -> 806 bytes data/images/udrawR.png | Bin 0 -> 1438 bytes source/gui/GameTDB.cpp | 37 +++++++++++++++++------------ source/menu/menu_about.cpp | 3 ++- source/menu/menu_gameinfo.cpp | 43 +++++++++++++++++++++++----------- 5 files changed, 53 insertions(+), 30 deletions(-) create mode 100644 data/images/udraw.png create mode 100644 data/images/udrawR.png diff --git a/data/images/udraw.png b/data/images/udraw.png new file mode 100644 index 0000000000000000000000000000000000000000..4056a9a03a5756cac168ddcffed9cdb90ab7177a GIT binary patch literal 806 zcmV+>1KIqEP)Px#0%A)?L;(MXkIcUS000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyb;5fl;9 zQ)$%z0013nR9JLFZ*6U5Zgc_CX>@2HM@dakWG-a~0007kNkloNb#Tu3{emY3mn*yMFifl<@50w7&gEnJA{G*3Wykl zQ3xPeOzs#t^i*|OxMN~rY}^wI>a40%>iX+Go%`NB)hYZp%GBT*T!U-ykjh~@-qTi$ z`PG3^&zv{Yp%woSw^SNquc@!^C70ZHBYulRz~8&0k_n|!H70DO>7pyHn783eyPy0G zoIACDlSyL&cP)5bZr+-6Zo9F1@OkBRIGj0v`v8hfS zjeX?Q+bPvkW)1#-f=3(ii{q2TKWW?JBaA-V!+{gleLB*Bn}!AVkNNS@r%`rfEXt3b z78;W`S3-#CyE-3}mrsjN;78>IPRLN1cR|l{9-Cw4+h?`)J#99n!2Nh<0^hj^9jmUUN0Y?E kC#n8xpa$3A8a%B21aywUYir^v+yDRo07*qoM6N<$f~aM0QUCw| literal 0 HcmV?d00001 diff --git a/data/images/udrawR.png b/data/images/udrawR.png new file mode 100644 index 0000000000000000000000000000000000000000..44d9f467cf9d0e21aa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GameTDB.cpp b/source/gui/GameTDB.cpp index 0d6b97ab..516986da 100644 --- a/source/gui/GameTDB.cpp +++ b/source/gui/GameTDB.cpp @@ -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, "", ""); @@ -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, "", ""); @@ -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, "", ""); @@ -644,7 +649,8 @@ bool GameTDB::GetGenres(const char * id, string & gen) { safe_vector 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 & desc_list) { + desc_list.clear(); if(!id) return -1; @@ -781,7 +789,6 @@ int GameTDB::GetRatingDescriptors(const char * id, safe_vector & 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 & feat_list) { + feat_list.clear(); if(!id) return -1; @@ -848,7 +856,6 @@ int GameTDB::GetWifiFeatures(const char * id, safe_vector & 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 & acc_list) { + acc_list.clear(); if(!id) return -1; @@ -920,7 +928,6 @@ int GameTDB::GetAccessories(const char * id, safe_vector & acc_list) } unsigned int list_num = 0; - acc_list.clear(); while(ControlsNode && *ControlsNode != '\0') { diff --git a/source/menu/menu_about.cpp b/source/menu/menu_about.cpp index c4a0877b..5a89cd33 100644 --- a/source/menu/menu_about.cpp +++ b/source/menu/menu_about.cpp @@ -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]); diff --git a/source/menu/menu_gameinfo.cpp b/source/menu/menu_gameinfo.cpp index 911f0fd0..04ccb5a5 100644 --- a/source/menu/menu_gameinfo.cpp +++ b/source/menu/menu_gameinfo.cpp @@ -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::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);