- made some changes to the plugin rom info display.

- changed the font smaller.
- added developer:, publisher:, genre:, etc... before each item.
- made the rom info scroll-able if by any chance it doesn't all fit on the screen.
- made some adjustments to position of the images and fixed a little issue with setting the image texture position.
- need to fix the overlays for handheld consoles but personally i would rather just have bigger images and remove the overlays.
This commit is contained in:
Fledge68 2019-01-10 17:13:13 -06:00
parent 232c9b2888
commit 13585275ed
5 changed files with 670 additions and 568 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -13,7 +13,7 @@ const u8 WFB_HASH[] = {0x4f, 0xad, 0x97, 0xfd, 0x4a, 0x28, 0x8c, 0x47, 0xe0, 0
#define TITLEFONT_PT_SZ 24u #define TITLEFONT_PT_SZ 24u
#define BTNFONT_PT_SZ 20u #define BTNFONT_PT_SZ 20u
#define LBLFONT_PT_SZ 20u #define LBLFONT_PT_SZ 20u
#define TEXTFONT_PT_SZ 16u #define TEXTFONT_PT_SZ 14u
#define TITLEFONT TITLEFONT_PT_SZ, TITLEFONT_PT_SZ - 4, FONT_NOBOLD, 1, "title_font" #define TITLEFONT TITLEFONT_PT_SZ, TITLEFONT_PT_SZ - 4, FONT_NOBOLD, 1, "title_font"
#define BUTTONFONT BTNFONT_PT_SZ, BTNFONT_PT_SZ - 4, FONT_NOBOLD, 1, "button_font" #define BUTTONFONT BTNFONT_PT_SZ, BTNFONT_PT_SZ - 4, FONT_NOBOLD, 1, "button_font"

View File

@ -250,8 +250,12 @@ void CButtonsMgr::setTexture(s16 id, TexData &bg, int width, int height)
case GUIELT_LABEL: case GUIELT_LABEL:
lbl = (SLabel*)m_elts[id]; lbl = (SLabel*)m_elts[id];
lbl->texBg = bg;//change texture lbl->texBg = bg;//change texture
lbl->x = lbl->x - lbl->w / 2;
lbl->y = lbl->y - lbl->h / 2;
lbl->w = width; lbl->w = width;
lbl->h = height; lbl->h = height;
lbl->x = lbl->x + width / 2;
lbl->y = lbl->y + height / 2;
break; break;
case GUIELT_PROGRESS: case GUIELT_PROGRESS:
break; break;

View File

@ -5,12 +5,16 @@
#include "plugin/plugin.hpp" #include "plugin/plugin.hpp"
#include "plugin/crc32.h" #include "plugin/crc32.h"
s16 m_gameinfoLblRomInfo;
wstringEx gameinfo_Synopsis_w; wstringEx gameinfo_Synopsis_w;
wstringEx gameinfo_Title_w; wstringEx gameinfo_Title_w;
bool tdb_found = false; bool tdb_found = false;
u8 cnt_controlsreq = 0, cnt_controls = 0; u8 cnt_controlsreq = 0, cnt_controls = 0;
int synopsis_h; int synopsis_h;
int rominfo_h;
int rominfo_th = 0;
void CMenu::_gameinfo(void) void CMenu::_gameinfo(void)
{ {
@ -28,7 +32,9 @@ void CMenu::_gameinfo(void)
_mainLoopCommon(); _mainLoopCommon();
if(BTN_HOME_PRESSED || BTN_B_PRESSED || !tdb_found) if(BTN_HOME_PRESSED || BTN_B_PRESSED || !tdb_found)
break; break;
if((BTN_DOWN_PRESSED || BTN_DOWN_HELD) && page == 2 && synopsis_th > synopsis_h) if((BTN_DOWN_PRESSED || BTN_DOWN_HELD))
{
if(page == 2 && synopsis_th > synopsis_h)
{ {
if((synopsis_th - amount_of_skips * pixels_to_skip) >= synopsis_h) if((synopsis_th - amount_of_skips * pixels_to_skip) >= synopsis_h)
{ {
@ -41,7 +47,23 @@ void CMenu::_gameinfo(void)
m_btnMgr.moveBy(m_gameinfoLblSynopsis, 0, -xtra_skips); m_btnMgr.moveBy(m_gameinfoLblSynopsis, 0, -xtra_skips);
} }
} }
else if((BTN_UP_PRESSED || BTN_UP_HELD) && page == 2) else if(page == 1 && rominfo_th > rominfo_h)
{
if((rominfo_th - amount_of_skips * pixels_to_skip) >= rominfo_h)
{
m_btnMgr.moveBy(m_gameinfoLblRomInfo, 0, -pixels_to_skip);
amount_of_skips++;
}
else if((rominfo_th - amount_of_skips * pixels_to_skip) < rominfo_h && xtra_skips == 0)
{
xtra_skips = pixels_to_skip - ((rominfo_th - amount_of_skips * pixels_to_skip) - rominfo_h);
m_btnMgr.moveBy(m_gameinfoLblRomInfo, 0, -xtra_skips);
}
}
}
else if((BTN_UP_PRESSED || BTN_UP_HELD))
{
if(page == 2)
{ {
if(xtra_skips > 0) if(xtra_skips > 0)
{ {
@ -54,10 +76,25 @@ void CMenu::_gameinfo(void)
amount_of_skips--; amount_of_skips--;
} }
} }
else // page 1
{
if(xtra_skips > 0)
{
m_btnMgr.moveBy(m_gameinfoLblRomInfo, 0, xtra_skips);
xtra_skips = 0;
}
else if (amount_of_skips > 0)
{
m_btnMgr.moveBy(m_gameinfoLblRomInfo, 0, pixels_to_skip);
amount_of_skips--;
}
}
}
else if(BTN_RIGHT_PRESSED && page == 1 && !gameinfo_Synopsis_w.empty()) else if(BTN_RIGHT_PRESSED && page == 1 && !gameinfo_Synopsis_w.empty())
{ {
page = 2; page = 2;
amount_of_skips = 0; amount_of_skips = 0;
xtra_skips = 0;
m_btnMgr.hide(m_gameinfoLblID, true); m_btnMgr.hide(m_gameinfoLblID, true);
m_btnMgr.hide(m_gameinfoLblDev, true); m_btnMgr.hide(m_gameinfoLblDev, true);
@ -70,6 +107,7 @@ void CMenu::_gameinfo(void)
m_btnMgr.hide(m_gameinfoLblSnap, true); m_btnMgr.hide(m_gameinfoLblSnap, true);
m_btnMgr.hide(m_gameinfoLblCartDisk, true); m_btnMgr.hide(m_gameinfoLblCartDisk, true);
m_btnMgr.hide(m_gameinfoLblOverlay, true); m_btnMgr.hide(m_gameinfoLblOverlay, true);
m_btnMgr.hide(m_gameinfoLblRomInfo, true);
for(u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblControlsReq); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblControlsReq); ++i)
if(m_gameinfoLblControlsReq[i] != -1) if(m_gameinfoLblControlsReq[i] != -1)
@ -91,20 +129,35 @@ void CMenu::_gameinfo(void)
m_btnMgr.getTotalHeight(m_gameinfoLblSynopsis, synopsis_th); m_btnMgr.getTotalHeight(m_gameinfoLblSynopsis, synopsis_th);
m_btnMgr.moveBy(m_gameinfoLblSynopsis, 0, -1); m_btnMgr.moveBy(m_gameinfoLblSynopsis, 0, -1);
} }
else if(BTN_LEFT_PRESSED) else if(BTN_LEFT_PRESSED && page == 2)
{ {
page = 1; page = 1;
m_btnMgr.show(m_gameinfoLblID); amount_of_skips = 0;
m_btnMgr.show(m_gameinfoLblDev); xtra_skips = 0;
m_btnMgr.show(m_gameinfoLblRegion);
m_btnMgr.show(m_gameinfoLblPublisher); m_btnMgr.hide(m_gameinfoLblSynopsis,true);
m_btnMgr.show(m_gameinfoLblRlsdate);
m_btnMgr.show(m_gameinfoLblGenre); if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
m_btnMgr.show(m_gameinfoLblRating); {
m_btnMgr.show(m_gameinfoLblWifiplayers); m_btnMgr.reset(m_gameinfoLblRomInfo);
m_btnMgr.show(m_gameinfoLblRomInfo, false);
m_btnMgr.getTotalHeight(m_gameinfoLblRomInfo, rominfo_th);
m_btnMgr.moveBy(m_gameinfoLblRomInfo, 0, -1);
m_btnMgr.show(m_gameinfoLblSnap); m_btnMgr.show(m_gameinfoLblSnap);
m_btnMgr.show(m_gameinfoLblCartDisk); m_btnMgr.show(m_gameinfoLblCartDisk);
m_btnMgr.show(m_gameinfoLblOverlay); m_btnMgr.show(m_gameinfoLblOverlay);
}
else
{
m_btnMgr.show(m_gameinfoLblID);
m_btnMgr.show(m_gameinfoLblRating);
m_btnMgr.show(m_gameinfoLblRegion);
m_btnMgr.show(m_gameinfoLblDev);
m_btnMgr.show(m_gameinfoLblPublisher);
m_btnMgr.show(m_gameinfoLblRlsdate);
m_btnMgr.show(m_gameinfoLblGenre);
m_btnMgr.show(m_gameinfoLblWifiplayers);
}
for(u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblControlsReq); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblControlsReq); ++i)
if(m_gameinfoLblControlsReq[i] != -1 && i < cnt_controlsreq) if(m_gameinfoLblControlsReq[i] != -1 && i < cnt_controlsreq)
@ -120,8 +173,6 @@ void CMenu::_gameinfo(void)
m_btnMgr.show(m_gameinfoLblUser[i]); m_btnMgr.show(m_gameinfoLblUser[i]);
else else
m_btnMgr.hide(m_gameinfoLblUser[i], true); m_btnMgr.hide(m_gameinfoLblUser[i], true);
m_btnMgr.hide(m_gameinfoLblSynopsis,true);
} }
} }
_hideGameInfo(false); _hideGameInfo(false);
@ -142,6 +193,7 @@ void CMenu::_hideGameInfo(bool instant)
m_btnMgr.hide(m_gameinfoLblSnap, instant); m_btnMgr.hide(m_gameinfoLblSnap, instant);
m_btnMgr.hide(m_gameinfoLblCartDisk, instant); m_btnMgr.hide(m_gameinfoLblCartDisk, instant);
m_btnMgr.hide(m_gameinfoLblOverlay, instant); m_btnMgr.hide(m_gameinfoLblOverlay, instant);
m_btnMgr.hide(m_gameinfoLblRomInfo, instant);
for(u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblControlsReq); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblControlsReq); ++i)
if(m_gameinfoLblControlsReq[i] != -1) if(m_gameinfoLblControlsReq[i] != -1)
@ -163,8 +215,21 @@ void CMenu::_showGameInfo(void)
if(tdb_found) if(tdb_found)
{ {
m_btnMgr.show(m_gameinfoLblID);
m_btnMgr.show(m_gameinfoLblTitle); m_btnMgr.show(m_gameinfoLblTitle);
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
{
m_btnMgr.reset(m_gameinfoLblRomInfo);
m_btnMgr.show(m_gameinfoLblRomInfo, false);
m_btnMgr.getTotalHeight(m_gameinfoLblRomInfo, rominfo_th);
m_btnMgr.moveBy(m_gameinfoLblRomInfo, 0, -1);
m_btnMgr.show(m_gameinfoLblSnap);
m_btnMgr.show(m_gameinfoLblCartDisk);
m_btnMgr.show(m_gameinfoLblOverlay);
}
else
{
m_btnMgr.show(m_gameinfoLblID);
m_btnMgr.show(m_gameinfoLblRating); m_btnMgr.show(m_gameinfoLblRating);
m_btnMgr.show(m_gameinfoLblRegion); m_btnMgr.show(m_gameinfoLblRegion);
m_btnMgr.show(m_gameinfoLblDev); m_btnMgr.show(m_gameinfoLblDev);
@ -172,12 +237,6 @@ void CMenu::_showGameInfo(void)
m_btnMgr.show(m_gameinfoLblRlsdate); m_btnMgr.show(m_gameinfoLblRlsdate);
m_btnMgr.show(m_gameinfoLblGenre); m_btnMgr.show(m_gameinfoLblGenre);
m_btnMgr.show(m_gameinfoLblWifiplayers); m_btnMgr.show(m_gameinfoLblWifiplayers);
if(m_current_view == COVERFLOW_PLUGIN)
{
m_btnMgr.show(m_gameinfoLblSnap);
m_btnMgr.show(m_gameinfoLblCartDisk);
m_btnMgr.show(m_gameinfoLblOverlay);
} }
for(u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblUser); ++i) for(u8 i = 0; i < ARRAY_SIZE(m_gameinfoLblUser); ++i)
@ -211,10 +270,11 @@ void CMenu::_initGameInfoMenu()
m_gameinfoLblRegion = _addLabel("GAMEINFO/REGION", theme.txtFont, L"", 40, 260, 460, 56, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_gameinfoLblRegion = _addLabel("GAMEINFO/REGION", theme.txtFont, L"", 40, 260, 460, 56, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP);
m_gameinfoLblRating = _addLabel("GAMEINFO/RATING", theme.txtFont, L"", 550, 380, 48, 60, theme.txtFontColor, 0, m_rating); m_gameinfoLblRating = _addLabel("GAMEINFO/RATING", theme.txtFont, L"", 550, 380, 48, 60, theme.txtFontColor, 0, m_rating);
m_gameinfoLblSynopsis = _addLabel("GAMEINFO/SYNOPSIS", theme.txtFont, L"", 40, 80, 560, 280, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP); m_gameinfoLblSynopsis = _addLabel("GAMEINFO/SYNOPSIS", theme.txtFont, L"", 40, 80, 560, 280, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP);
m_gameinfoLblWifiplayers = _addLabel("GAMEINFO/WIFIPLAYERS", theme.txtFont, L"", 550, 110, 68, 60, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP,m_wifi); m_gameinfoLblWifiplayers = _addLabel("GAMEINFO/WIFIPLAYERS", theme.txtFont, L"", 550, 110, 68, 60, theme.txtFontColor, 0, m_wifi);
m_gameinfoLblSnap = _addLabel("GAMEINFO/SNAP", theme.titleFont, L"", 485, 200, m_snap.width, m_snap.height, theme.titleFontColor, 0, m_snap); m_gameinfoLblSnap = _addLabel("GAMEINFO/SNAP", theme.txtFont, L"", 350, 80, 100, 100, theme.txtFontColor, 0, m_snap);
m_gameinfoLblOverlay = _addLabel("GAMEINFO/OVERLAY", theme.txtFont, L"", 485, 200, m_snap.width, m_snap.height, theme.titleFontColor, 0, m_overlay); m_gameinfoLblOverlay = _addLabel("GAMEINFO/OVERLAY", theme.txtFont, L"", 370, 80, 100, 100, theme.txtFontColor, 0, m_overlay);
m_gameinfoLblCartDisk = _addLabel("GAMEINFO/CART", theme.txtFont, L"", 435, 364, m_cart.width, m_cart.height, theme.txtFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE,m_cart); m_gameinfoLblCartDisk = _addLabel("GAMEINFO/CART", theme.txtFont, L"", 400, 320, 100, 100, theme.txtFontColor, 0, m_cart);
m_gameinfoLblRomInfo = _addLabel("GAMEINFO/ROMINFO", theme.txtFont, L"", 40, 80, 300, 300, theme.txtFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP);
_addUserLabels(m_gameinfoLblUser, 1, 1, "GAMEINFO"); _addUserLabels(m_gameinfoLblUser, 1, 1, "GAMEINFO");
_addUserLabels(m_gameinfoLblUser, 3, 2, "GAMEINFO"); _addUserLabels(m_gameinfoLblUser, 3, 2, "GAMEINFO");
@ -248,18 +308,24 @@ void CMenu::_initGameInfoMenu()
_setHideAnim(m_gameinfoLblSnap, "GAMEINFO/SNAP", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblSnap, "GAMEINFO/SNAP", 0, -100, 0.f, 0.f);
_setHideAnim(m_gameinfoLblCartDisk, "GAMEINFO/CART", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblCartDisk, "GAMEINFO/CART", 0, -100, 0.f, 0.f);
_setHideAnim(m_gameinfoLblOverlay, "GAMEINFO/OVERLAY", 0, -100, 0.f, 0.f); _setHideAnim(m_gameinfoLblOverlay, "GAMEINFO/OVERLAY", 0, -100, 0.f, 0.f);
_setHideAnim(m_gameinfoLblRomInfo, "GAMEINFO/ROMINFO", 0, -100, 0.f, 0.f);
// //
_hideGameInfo(true); _hideGameInfo(true);
synopsis_h = m_theme.getInt("GAMEINFO/SYNOPSIS", "height", 280); synopsis_h = m_theme.getInt("GAMEINFO/SYNOPSIS", "height", 280);
rominfo_h = m_theme.getInt("GAMEINFO/ROMINFO", "height", 300);
} }
void CMenu::_textGameInfo(void) void CMenu::_textGameInfo(void)
{ {
cnt_controlsreq = 0; cnt_controlsreq = 0;
cnt_controls = 0; cnt_controls = 0;
char GameID[7];
GameTDB gametdb; GameID[6] = '\0';
char platformName[264]; char platformName[264];
const char *TMP_Char = NULL;
tdb_found = false;
GameTDB gametdb;
TexData emptyTex;
if(CoverFlow.getHdr()->type == TYPE_PLUGIN) if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
{ {
@ -267,60 +333,60 @@ void CMenu::_textGameInfo(void)
// We can't use magic # directly since it'd require hardcoding values and a # can be several systems(genplus) // We can't use magic # directly since it'd require hardcoding values and a # can be several systems(genplus)
// We can't rely on coverfolder either. Different systems can share the same folder. Or combined plugins used for the same system. // We can't rely on coverfolder either. Different systems can share the same folder. Or combined plugins used for the same system.
Config m_platform; Config m_platform;
m_platform.unload();
m_platform.load(fmt("%s/platform.ini", m_pluginDataDir.c_str()) ); m_platform.load(fmt("%s/platform.ini", m_pluginDataDir.c_str()) );
if(!m_platform.loaded())
return;// no platform.ini found
snprintf(platformName, sizeof(platformName), "%s", m_platform.getString("PLUGINS", m_plugin.PluginMagicWord).c_str()); snprintf(platformName, sizeof(platformName), "%s", m_platform.getString("PLUGINS", m_plugin.PluginMagicWord).c_str());
m_platform.unload(); m_platform.unload();
if(strlen(platformName) == 0)
return;// no platform name found to match plugin magic #
gametdb.OpenFile(fmt("%s/%s/%s.xml", m_pluginDataDir.c_str(), platformName, platformName)); gametdb.OpenFile(fmt("%s/%s/%s.xml", m_pluginDataDir.c_str(), platformName, platformName));
} tdb_found = gametdb.IsLoaded();
else if(!tdb_found)
{ return;// no platform xml found
gametdb.OpenFile(fmt("%s/wiitdb.xml", m_settingsDir.c_str()));
}
gametdb.SetLanguageCode(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str()); gametdb.SetLanguageCode(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
const char *TMP_Char = NULL;
tdb_found = gametdb.IsLoaded();
if(tdb_found)
{
char GameID[7];
GameID[6] = '\0';
string ShortName;
// Clear text and textures
TexData emptyTex;
gameinfo_Synopsis_w.fromUTF8("");
m_btnMgr.setText(m_gameinfoLblDev, wfmt(_fmt("",L"")), true);
m_btnMgr.setText(m_gameinfoLblPublisher, wfmt(_fmt("",L"")), true);
m_btnMgr.setText(m_gameinfoLblRegion, wfmt(_fmt("",L"")), true);
m_btnMgr.setText(m_gameinfoLblRating, wfmt(_fmt("",L"")), true);
m_btnMgr.setTexture(m_gameinfoLblRating, emptyTex);
m_btnMgr.setTexture(m_gameinfoLblSnap, emptyTex);
m_btnMgr.setTexture(m_gameinfoLblCartDisk, emptyTex);
m_btnMgr.setTexture(m_gameinfoLblOverlay, emptyTex);
// Get Game ID // Get Game ID
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
{
const dir_discHdr *GameHdr = CoverFlow.getHdr(); const dir_discHdr *GameHdr = CoverFlow.getHdr();
ShortName = m_plugin.GetRomName(GameHdr); string ShortName = m_plugin.GetRomName(GameHdr);
strncpy(GameID, m_plugin.GetRomId(GameHdr, m_pluginDataDir.c_str(), platformName, ShortName).c_str(), 6); string romID = m_plugin.GetRomId(GameHdr, m_pluginDataDir.c_str(), platformName, ShortName);
} if(romID.empty())// no romID. possibly no platfromName.ini or not found in ini or other problem.
else
{ {
strncpy(GameID, CoverFlow.getId(), 6); tdb_found = false;
gametdb.CloseFile();
return;
} }
strncpy(GameID, romID.c_str(), 6);
// Get title
if(gametdb.GetTitle(GameID, TMP_Char)) if(gametdb.GetTitle(GameID, TMP_Char))
{ {
gameinfo_Title_w.fromUTF8(TMP_Char); gameinfo_Title_w.fromUTF8(TMP_Char);
m_btnMgr.setText(m_gameinfoLblTitle, gameinfo_Title_w); m_btnMgr.setText(m_gameinfoLblTitle, gameinfo_Title_w);
}
if(CoverFlow.getHdr()->type == TYPE_PLUGIN) else
{ {
// Try to find images by game's name tdb_found = false;
gametdb.CloseFile();// gameID not found in xml
return;
}
if(gametdb.GetSynopsis(GameID, TMP_Char))
gameinfo_Synopsis_w.fromUTF8(TMP_Char);
else
gameinfo_Synopsis_w.fromUTF8("");
m_btnMgr.setText(m_gameinfoLblSynopsis, gameinfo_Synopsis_w);
// Clear textures
m_btnMgr.setTexture(m_gameinfoLblSnap, emptyTex);
m_btnMgr.setTexture(m_gameinfoLblCartDisk, emptyTex);
m_btnMgr.setTexture(m_gameinfoLblOverlay, emptyTex);
// Try to find images by game's xml name
if(gametdb.GetName(GameID, TMP_Char)) if(gametdb.GetName(GameID, TMP_Char))
{ {
const char *snap_path = NULL; const char *snap_path = NULL;
@ -355,16 +421,12 @@ void CMenu::_textGameInfo(void)
TexHandle.fromImageFile(m_snap, snap_path); TexHandle.fromImageFile(m_snap, snap_path);
m_btnMgr.setTexture(m_gameinfoLblSnap, m_snap, m_snap.width, m_snap.height); m_btnMgr.setTexture(m_gameinfoLblSnap, m_snap, m_snap.width, m_snap.height);
TexHandle.fromImageFile(m_cart, cart_path);
TexHandle.fromImageFile(m_cart, cart_path);
if(m_cart.height > 112) if(m_cart.height > 112)
{
m_btnMgr.setTexture(m_gameinfoLblCartDisk, m_cart, 114, 128); m_btnMgr.setTexture(m_gameinfoLblCartDisk, m_cart, 114, 128);
}
else else
{
m_btnMgr.setTexture(m_gameinfoLblCartDisk, m_cart, 160, 112); m_btnMgr.setTexture(m_gameinfoLblCartDisk, m_cart, 160, 112);
}
overlay_path = fmt("%s/%s_overlay.png", m_snapDir.c_str(), platformName); overlay_path = fmt("%s/%s_overlay.png", m_snapDir.c_str(), platformName);
@ -378,44 +440,118 @@ void CMenu::_textGameInfo(void)
m_btnMgr.setTexture(m_gameinfoLblOverlay, emptyTex); m_btnMgr.setTexture(m_gameinfoLblOverlay, emptyTex);
} }
} }
// Create Rom Info
wstringEx rom_info;
rom_info = wfmt(_fmt("gameinfo7",L"GameID: %s"), GameID);
if(gametdb.GetDeveloper(GameID, TMP_Char))
{
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo1",L"Developer: %s"), TMP_Char));
}
if(gametdb.GetPublisher(GameID, TMP_Char))
{
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo2",L"Publisher: %s"), TMP_Char));
}
if(gametdb.GetRegion(GameID, TMP_Char))
{
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo3",L"Region: %s"), TMP_Char));
}
if(gametdb.GetGenres(GameID, TMP_Char))
{
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo5",L"Genre: %s"), TMP_Char));
}
int PublishDate = gametdb.GetPublishDate(GameID);
int year = PublishDate >> 16;
int day = PublishDate & 0xFF;
int month = (PublishDate >> 8) & 0xFF;
if(day == 0 && month == 0)
{
// Only display year or nothing if there's no date at all
if(year != 0)
{
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo8",L"Released: %i"), year));
} }
} }
else else
{ {
tdb_found = false; switch(CONF_GetRegion())
{
case 0:
case 4:
case 5:
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), year, month, day));
break;
case 1:
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), month, day, year));
break;
case 2:
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), day, month, year));
break;
}
}
//m_btnMgr.setText(m_gameinfoLblRomInfo, rom_info);
//
u8 players = gametdb.GetPlayers(GameID);
if(players > 0)
{
rom_info.append(L"\n\n");
rom_info.append(wfmt(_fmt("gameinfo9",L"Players: %i"), players));
}
m_btnMgr.setText(m_gameinfoLblRomInfo, rom_info);
/*
if(players == 1)
TexHandle.fromImageFile(m_controlsreq[0], fmt("%s/wiimote1.png", m_imgsDir.c_str()));
else if(players == 2)
TexHandle.fromImageFile(m_controlsreq[0], fmt("%s/wiimote2.png", m_imgsDir.c_str()));
else if(players == 3)
TexHandle.fromImageFile(m_controlsreq[0], fmt("%s/wiimote3.png", m_imgsDir.c_str()));
else if(players == 4)
TexHandle.fromImageFile(m_controlsreq[0], fmt("%s/wiimote4.png", m_imgsDir.c_str()));
else if(players == 5)
TexHandle.fromImageFile(m_controlsreq[0], fmt("%s/wiimote5.png", m_imgsDir.c_str()));
else if(players == 6)
TexHandle.fromImageFile(m_controlsreq[0], fmt("%s/wiimote6.png", m_imgsDir.c_str()));
else if(players == 8)
TexHandle.fromImageFile(m_controlsreq[0], fmt("%s/wiimote8.png", m_imgsDir.c_str()));
m_btnMgr.setTexture(m_gameinfoLblControlsReq[0] ,m_controlsreq[0], 20, 60);*/
cnt_controlsreq = 0;
gametdb.CloseFile(); gametdb.CloseFile();
return; return;
} }
/******************* Wii and GameCube game infos **********************/
gametdb.OpenFile(fmt("%s/wiitdb.xml", m_settingsDir.c_str()));
tdb_found = gametdb.IsLoaded();
if(!tdb_found)
return;
gametdb.SetLanguageCode(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
strncpy(GameID, CoverFlow.getId(), 6);
if(gametdb.GetTitle(GameID, TMP_Char))
{
gameinfo_Title_w.fromUTF8(TMP_Char);
m_btnMgr.setText(m_gameinfoLblTitle, gameinfo_Title_w);
}
if(gametdb.GetSynopsis(GameID, TMP_Char)) if(gametdb.GetSynopsis(GameID, TMP_Char))
{ {
gameinfo_Synopsis_w.fromUTF8(TMP_Char); gameinfo_Synopsis_w.fromUTF8(TMP_Char);
m_btnMgr.setText(m_gameinfoLblSynopsis, gameinfo_Synopsis_w); m_btnMgr.setText(m_gameinfoLblSynopsis, gameinfo_Synopsis_w);
} }
m_btnMgr.setText(m_gameinfoLblID, wfmt(L"GameID: %s", GameID), true);
// Only show retrieved data else the text is often underneath the snapshot. m_btnMgr.setText(m_gameinfoLblID, wfmt(_fmt("gameinfo7",L"GameID: %s"), GameID), true);
// It's still too long sometimes. Maybe, we should cut the string at a max length.
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
{
if(gametdb.GetDeveloper(GameID, TMP_Char))
m_btnMgr.setText(m_gameinfoLblDev, wfmt(_fmt("",L"%s"), TMP_Char), true);
if(gametdb.GetPublisher(GameID, TMP_Char))
m_btnMgr.setText(m_gameinfoLblPublisher, wfmt(_fmt("",L"%s"), TMP_Char), true);
if(gametdb.GetRegion(GameID, TMP_Char))
m_btnMgr.setText(m_gameinfoLblRegion, wfmt(_fmt("gameinfo3",L"Region: %s"), TMP_Char), true);
if(gametdb.GetGenres(GameID, TMP_Char))
{
m_btnMgr.setText(m_gameinfoLblGenre, wfmt(_fmt("",L"%s"), TMP_Char), true);
}
else
{
// Genre not found, show nothing.
m_btnMgr.setText(m_gameinfoLblGenre, wfmt(_fmt("",L"")), true);
}
}
else
{
if(gametdb.GetDeveloper(GameID, TMP_Char)) if(gametdb.GetDeveloper(GameID, TMP_Char))
m_btnMgr.setText(m_gameinfoLblDev, wfmt(_fmt("gameinfo1",L"Developer: %s"), TMP_Char), true); m_btnMgr.setText(m_gameinfoLblDev, wfmt(_fmt("gameinfo1",L"Developer: %s"), TMP_Char), true);
if(gametdb.GetPublisher(GameID, TMP_Char)) if(gametdb.GetPublisher(GameID, TMP_Char))
@ -434,7 +570,6 @@ void CMenu::_textGameInfo(void)
} }
m_btnMgr.setText(m_gameinfoLblGenre, wfmt(_fmt("gameinfo5",L"Genre: %s"), s.c_str()), true); m_btnMgr.setText(m_gameinfoLblGenre, wfmt(_fmt("gameinfo5",L"Genre: %s"), s.c_str()), true);
} }
}
int PublishDate = gametdb.GetPublishDate(GameID); int PublishDate = gametdb.GetPublishDate(GameID);
int year = PublishDate >> 16; int year = PublishDate >> 16;
@ -445,34 +580,16 @@ void CMenu::_textGameInfo(void)
case 0: case 0:
case 4: case 4:
case 5: case 5:
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("",L"%i-%i-%i"), year, month, day), true);
else
m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), year, month, day), true); m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), year, month, day), true);
break; break;
case 1: case 1:
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("",L"%i-%i-%i"), month, day, year), true);
else
m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), month, day, year), true); m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), month, day, year), true);
break; break;
case 2: case 2:
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("",L"%i-%i-%i"), day, month, year), true);
else
m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), day, month, year), true); m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("gameinfo4",L"Release Date: %i-%i-%i"), day, month, year), true);
break; break;
} }
// Only display year or nothing if there's no date at all
if(day == 0 && month == 0)
{
if(year != 0)
m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("",L"%i"), year), true);
else
m_btnMgr.setText(m_gameinfoLblRlsdate, wfmt(_fmt("",L"")), true);
}
//Ratings //Ratings
TexHandle.fromImageFile(m_rating, fmt("%s/norating.png", m_imgsDir.c_str())); TexHandle.fromImageFile(m_rating, fmt("%s/norating.png", m_imgsDir.c_str()));
const char *RatingValue = NULL; const char *RatingValue = NULL;
@ -532,26 +649,8 @@ void CMenu::_textGameInfo(void)
break; break;
} }
} }
// Display the user's mark /20 instead because most of the rating data is missing.
if(CoverFlow.getHdr()->type == TYPE_PLUGIN)
{
if(gametdb.GetRatingValue(GameID, RatingValue))
{
if(RatingValue[0] != '\0')
{
m_btnMgr.setText(m_gameinfoLblRating, wfmt(_fmt("",L"%s/20"), RatingValue), true);
}
}
else
{
m_btnMgr.setText(m_gameinfoLblRating, wfmt(_fmt("",L"")), true);
}
}
else
{
m_btnMgr.setText(m_gameinfoLblRating, wfmt(_fmt("",L"")), true);
m_btnMgr.setTexture(m_gameinfoLblRating, m_rating); m_btnMgr.setTexture(m_gameinfoLblRating, m_rating);
}
//Wifi players //Wifi players
int WifiPlayers = gametdb.GetWifiPlayers(GameID); int WifiPlayers = gametdb.GetWifiPlayers(GameID);
if(WifiPlayers == 1) if(WifiPlayers == 1)
@ -820,9 +919,5 @@ void CMenu::_textGameInfo(void)
x++; x++;
} }
cnt_controls = x; cnt_controls = x;
}
else
m_btnMgr.setText(m_gameinfoLblTitle, wfmt(_fmt("gameinfo6",L"No Gameinfo"), true));
gametdb.CloseFile(); gametdb.CloseFile();
} }

View File

@ -339,6 +339,9 @@ gameinfo3=Region: %s
gameinfo4=Release Date: %i.%i.%i gameinfo4=Release Date: %i.%i.%i
gameinfo5=Genre: %s gameinfo5=Genre: %s
gameinfo6=No Gameinfo gameinfo6=No Gameinfo
gameinfo7=GameID: %s
gameinfo8=Released: %i
gameinfo9=Players: %i
gametdb_code=EN gametdb_code=EN
GC_Def=Default GC_Def=Default
GC_DM=DIOS-MIOS GC_DM=DIOS-MIOS