- sourceflow small_covers can now go in a subfolder with the same name as the theme. which makes them change when the theme is changed.

- added notification messages when you delete a cover or banner on manager cover banner menu.
- download cover menu changes: title is now 'Downloads'. removed 'missing' button and changed 'all' to 'download' because there was no difference between all and missing. it always downloads missing covers. in the future i plan to add custom banners download which will download all missing custom GC banners.
This commit is contained in:
Fledge68 2018-11-23 15:31:04 -06:00
parent 354bddc664
commit cef988d763
10 changed files with 544 additions and 604 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB

View File

@ -153,11 +153,7 @@ void writeStub()
DCFlushRange((void*)0x80001800, StubSize); DCFlushRange((void*)0x80001800, StubSize);
/* And free the memory again */ /* And free the memory again */
#ifdef APP_WIIFLOW if(Stub != NULL)
if(Stub != wfstub_bin)
#else
if(Stub != stub_bin)
#endif
free(Stub); free(Stub);
} }

View File

@ -1609,7 +1609,7 @@ void CMenu::_mainLoopCommon(bool withCF, bool adjusting)
if(m_thrdWorking) if(m_thrdWorking)
{ {
musicPaused = true; musicPaused = true;
MusicPlayer.Pause(); MusicPlayer.Pause();//note - bg music is paused but sound thread is still running. so banner gamesound still plays
m_btnMgr.tick(); m_btnMgr.tick();
m_vid.prepare(); m_vid.prepare();
m_vid.setup2DProjection(false, true); m_vid.setup2DProjection(false, true);
@ -2174,22 +2174,10 @@ void CMenu::_initCF(void)
if(!CoverFlow.empty()) if(!CoverFlow.empty())
{ {
bool path = false; bool path = false;
if((m_source_cnt > 1 && m_cfg.getInt("MULTI", "current_item_type", 1) == TYPE_PLUGIN) || m_sourceflow || m_current_view == COVERFLOW_HOMEBREW) if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW ||
(m_source_cnt > 1 && m_cfg.getInt("MULTI", "current_item_type", TYPE_PLUGIN) == TYPE_PLUGIN) ||
(m_source_cnt == 1 && m_current_view == COVERFLOW_PLUGIN && m_cfg.getInt(PLUGIN_DOMAIN, "current_item_type", TYPE_PLUGIN) == TYPE_PLUGIN))
path = true; path = true;
if(m_current_view == COVERFLOW_PLUGIN && !m_sourceflow && m_source_cnt == 1)
{
switch(m_cfg.getInt(PLUGIN_DOMAIN, "current_item_type", TYPE_PLUGIN))
{
case TYPE_CHANNEL:
case TYPE_EMUCHANNEL:
case TYPE_GC_GAME:
case TYPE_WII_GAME:
path = false;
break;
default:
path = true;
}
}
if(!CoverFlow.findId(m_cfg.getString(_domainFromView(), "current_item").c_str(), true, path)) if(!CoverFlow.findId(m_cfg.getString(_domainFromView(), "current_item").c_str(), true, path))
CoverFlow.defaultLoad(); CoverFlow.defaultLoad();
CoverFlow.startCoverLoader(); CoverFlow.startCoverLoader();
@ -2709,11 +2697,16 @@ const char *CMenu::getFrontPath(const dir_discHdr *element)
return NULL; return NULL;
const char *coverPath = fmt("%s/front_covers/%s", m_sourceDir.c_str(), coverImg); const char *coverPath = fmt("%s/front_covers/%s", m_sourceDir.c_str(), coverImg);
if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox") || !fsop_FileExist(coverPath)) if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "smallbox") || !fsop_FileExist(coverPath))
{
string themeName = m_cfg.getString("GENERAL", "theme", "default");
coverPath = fmt("%s/small_covers/%s/%s", m_sourceDir.c_str(), themeName.c_str(), coverImg);
if(!fsop_FileExist(coverPath))
{ {
coverPath = fmt("%s/small_covers/%s", m_sourceDir.c_str(), coverImg); coverPath = fmt("%s/small_covers/%s", m_sourceDir.c_str(), coverImg);
if(!fsop_FileExist(coverPath)) if(!fsop_FileExist(coverPath))
return element->path; return element->path;
} }
}
return coverPath; return coverPath;
} }
return fmt("%s/%s.png", m_picDir.c_str(), element->id); return fmt("%s/%s.png", m_picDir.c_str(), element->id);

View File

@ -313,8 +313,8 @@ private:
s16 m_downloadPrioVal; s16 m_downloadPrioVal;
enum CoverPrio enum CoverPrio
{ {
C_TYPE_PRIOA = (1<<0), C_TYPE_PRIOA = (1<<0),//C_TYPE_ACUSTM
C_TYPE_PRIOB = (1<<1), C_TYPE_PRIOB = (1<<1),//C_TYPE_BCUSTM
C_TYPE_EN = (1<<2), C_TYPE_EN = (1<<2),
C_TYPE_JA = (1<<3), C_TYPE_JA = (1<<3),
C_TYPE_FR = (1<<4), C_TYPE_FR = (1<<4),
@ -327,8 +327,8 @@ private:
C_TYPE_KO = (1<<11), C_TYPE_KO = (1<<11),
C_TYPE_ZHCN = (1<<12), C_TYPE_ZHCN = (1<<12),
C_TYPE_AU = (1<<13), C_TYPE_AU = (1<<13),
C_TYPE_ONOR = (1<<14), C_TYPE_ONOR = (1<<14),//C_TYPE_ONCU
C_TYPE_ONCU = (1<<15), C_TYPE_ONCU = (1<<15),//C_TYPE_ANB
}; };
enum CoverType enum CoverType
@ -722,7 +722,6 @@ private:
volatile bool m_thrdNetwork; volatile bool m_thrdNetwork;
float m_thrdStep; float m_thrdStep;
float m_thrdStepLen; float m_thrdStepLen;
string m_coverDLGameId;
mutex_t m_mutex; mutex_t m_mutex;
wstringEx m_thrdMessage; wstringEx m_thrdMessage;
volatile float m_thrdProgress; volatile float m_thrdProgress;
@ -1152,7 +1151,7 @@ private:
// //
void _setThrdMsg(const wstringEx &msg, float progress); void _setThrdMsg(const wstringEx &msg, float progress);
void _setDumpMsg(const wstringEx &msg, float progress, float fileprog); void _setDumpMsg(const wstringEx &msg, float progress, float fileprog);
int _coverDownloader(bool missingOnly); int _coverDownloader();
void _downloadProgress(void *obj, int size, int position); void _downloadProgress(void *obj, int size, int position);
int _gametdbDownloaderAsync(); int _gametdbDownloaderAsync();

View File

@ -85,6 +85,7 @@ void CMenu::_CoverBanner(void)
{ {
_hideCoverBanner(); _hideCoverBanner();
RemoveCover(id); RemoveCover(id);
error(_t("deltcover", L"Cover is deleted."));
_showCoverBanner(); _showCoverBanner();
} }
else if(m_btnMgr.selected(m_coverbnrBtnDlBanner)) else if(m_btnMgr.selected(m_coverbnrBtnDlBanner))
@ -105,6 +106,7 @@ void CMenu::_CoverBanner(void)
fsop_deleteFile(fmt("%s/%s.bnr", m_customBnrDir.c_str(), id)); fsop_deleteFile(fmt("%s/%s.bnr", m_customBnrDir.c_str(), id));
fsop_deleteFile(fmt("%s/%.3s.bnr", m_bnrCacheDir.c_str(), id)); fsop_deleteFile(fmt("%s/%.3s.bnr", m_bnrCacheDir.c_str(), id));
fsop_deleteFile(fmt("%s/%.3s.bnr", m_customBnrDir.c_str(), id)); fsop_deleteFile(fmt("%s/%.3s.bnr", m_customBnrDir.c_str(), id));
error(_t("deltbanner", L"Banner is deleted."));
m_newGame = true; m_newGame = true;
_showCoverBanner(); _showCoverBanner();
} }

View File

@ -31,6 +31,7 @@ static const char FMT_CPIC_URL[] = "http://art.gametdb.com/{console}/cover2/{loc
static block download = { 0, 0 }; static block download = { 0, 0 };
static bool settingsmenu = false; static bool settingsmenu = false;
static string m_coverDLGameId;
void CMenu::_hideSettings(bool instant) void CMenu::_hideSettings(bool instant)
{ {
@ -77,6 +78,7 @@ void CMenu::_showSettings()
if(m_downloadLblUser[i] != -1) if(m_downloadLblUser[i] != -1)
m_btnMgr.show(m_downloadLblUser[i]); m_btnMgr.show(m_downloadLblUser[i]);
m_btnMgr.show(m_downloadLblSetTitle); m_btnMgr.show(m_downloadLblSetTitle);
m_btnMgr.show(m_downloadBtnBack);
m_btnMgr.show(m_downloadLblCoverPrio); m_btnMgr.show(m_downloadLblCoverPrio);
m_btnMgr.show(m_downloadLblPrio); m_btnMgr.show(m_downloadLblPrio);
m_btnMgr.show(m_downloadBtnPrioM); m_btnMgr.show(m_downloadBtnPrioM);
@ -142,8 +144,7 @@ void CMenu::_showSettings()
else else
m_btnMgr.show(m_downloadBtnAU); m_btnMgr.show(m_downloadBtnAU);
m_btnMgr.show(m_downloadBtnBack); //
if( m_downloadPrioVal&C_TYPE_ONOR ) if( m_downloadPrioVal&C_TYPE_ONOR )
{ {
m_btnMgr.setText(m_downloadLblPrio, _t("dl24", L"Custom only")); m_btnMgr.setText(m_downloadLblPrio, _t("dl24", L"Custom only"));
@ -185,9 +186,9 @@ void CMenu::_showSettings()
void CMenu::_hideDownload(bool instant) void CMenu::_hideDownload(bool instant)
{ {
m_btnMgr.hide(m_downloadLblTitle, instant); m_btnMgr.hide(m_downloadLblTitle, instant);
m_btnMgr.hide(m_downloadBtnBack, instant);
m_btnMgr.hide(m_downloadBtnCancel, instant); m_btnMgr.hide(m_downloadBtnCancel, instant);
m_btnMgr.hide(m_downloadBtnAll, instant); m_btnMgr.hide(m_downloadBtnAll, instant);
m_btnMgr.hide(m_downloadBtnMissing, instant);
m_btnMgr.hide(m_downloadLblCoverSet, instant); m_btnMgr.hide(m_downloadLblCoverSet, instant);
m_btnMgr.hide(m_downloadBtnCoverSet, instant); m_btnMgr.hide(m_downloadBtnCoverSet, instant);
m_btnMgr.hide(m_downloadBtnGameTDBDownload, instant); m_btnMgr.hide(m_downloadBtnGameTDBDownload, instant);
@ -211,7 +212,6 @@ void CMenu::_showDownload(void)
m_btnMgr.show(m_downloadBtnBack); m_btnMgr.show(m_downloadBtnBack);
m_btnMgr.show(m_downloadLblCovers); m_btnMgr.show(m_downloadLblCovers);
m_btnMgr.show(m_downloadBtnAll); m_btnMgr.show(m_downloadBtnAll);
m_btnMgr.show(m_downloadBtnMissing);
m_btnMgr.show(m_downloadLblCoverSet); m_btnMgr.show(m_downloadLblCoverSet);
m_btnMgr.show(m_downloadBtnCoverSet); m_btnMgr.show(m_downloadBtnCoverSet);
m_btnMgr.show(m_downloadLblGameTDBDownload); m_btnMgr.show(m_downloadLblGameTDBDownload);
@ -229,7 +229,6 @@ void CMenu::_download(string gameId)
bool dl_finished = false; bool dl_finished = false;
SetupInput(); SetupInput();
_showDownload(); _showDownload();
m_btnMgr.setText(m_downloadBtnCancel, _t("dl1", L"Cancel"));
while(!m_exit) while(!m_exit)
{ {
@ -261,19 +260,17 @@ void CMenu::_download(string gameId)
m_btnMgr.down(); m_btnMgr.down();
if(BTN_A_PRESSED || !gameId.empty()) if(BTN_A_PRESSED || !gameId.empty())
{ {
if(m_btnMgr.selected(m_downloadBtnAll) || m_btnMgr.selected(m_downloadBtnMissing) || !gameId.empty()) if(m_btnMgr.selected(m_downloadBtnAll) || !gameId.empty())
{ {
m_refreshGameList = true;// not needed instead just initcf() m_refreshGameList = true;// not needed instead just initcf()
bool dlAll = m_btnMgr.selected(m_downloadBtnAll);
_hideSettings();
m_btnMgr.hide(m_downloadLblCovers); m_btnMgr.hide(m_downloadLblCovers);
m_btnMgr.hide(m_downloadBtnAll); m_btnMgr.hide(m_downloadBtnAll);
m_btnMgr.hide(m_downloadBtnMissing);
m_btnMgr.hide(m_downloadLblGameTDBDownload); m_btnMgr.hide(m_downloadLblGameTDBDownload);
m_btnMgr.hide(m_downloadBtnGameTDBDownload); m_btnMgr.hide(m_downloadBtnGameTDBDownload);
m_btnMgr.hide(m_downloadLblCoverSet); m_btnMgr.hide(m_downloadLblCoverSet);
m_btnMgr.hide(m_downloadBtnCoverSet); m_btnMgr.hide(m_downloadBtnCoverSet);
m_btnMgr.hide(m_downloadBtnBack);
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true); m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
m_btnMgr.setText(m_wbfsLblMessage, L"0%"); m_btnMgr.setText(m_wbfsLblMessage, L"0%");
@ -283,8 +280,10 @@ void CMenu::_download(string gameId)
m_btnMgr.show(m_wbfsLblDialog); m_btnMgr.show(m_wbfsLblDialog);
_start_pThread(); _start_pThread();
int ret = _coverDownloader(dlAll); int ret = _coverDownloader();
_stop_pThread(); _stop_pThread();
if(ret == 0)
{
if(countFlat == 0) if(countFlat == 0)
{ {
m_thrdMessage = wfmt(_fmt("dlmsg5", L"%i/%i files downloaded."), count, n); m_thrdMessage = wfmt(_fmt("dlmsg5", L"%i/%i files downloaded."), count, n);
@ -295,8 +294,8 @@ void CMenu::_download(string gameId)
m_thrdMessage = wfmt(_fmt("dlmsg9", L"%i/%i files downloaded. %i are front covers only."), count + countFlat, n, countFlat); m_thrdMessage = wfmt(_fmt("dlmsg9", L"%i/%i files downloaded. %i are front covers only."), count + countFlat, n, countFlat);
m_btnMgr.setText(m_wbfsLblDialog, m_thrdMessage); m_btnMgr.setText(m_wbfsLblDialog, m_thrdMessage);
} }
}
if(ret == -1) else if(ret == -1)
m_btnMgr.setText(m_wbfsLblDialog, _t("dlmsg27", L"Not enough memory!")); m_btnMgr.setText(m_wbfsLblDialog, _t("dlmsg27", L"Not enough memory!"));
else if(ret == -2) else if(ret == -2)
m_btnMgr.setText(m_wbfsLblDialog, _t("dlmsg2", L"Network initialization failed!")); m_btnMgr.setText(m_wbfsLblDialog, _t("dlmsg2", L"Network initialization failed!"));
@ -310,7 +309,6 @@ void CMenu::_download(string gameId)
else if(m_btnMgr.selected(m_downloadBtnGameTDBDownload)) else if(m_btnMgr.selected(m_downloadBtnGameTDBDownload))
{ {
m_refreshGameList = true;// to refresh titles m_refreshGameList = true;// to refresh titles
_hideSettings();
m_btnMgr.hide(m_downloadLblCovers); m_btnMgr.hide(m_downloadLblCovers);
m_btnMgr.hide(m_downloadBtnAll); m_btnMgr.hide(m_downloadBtnAll);
m_btnMgr.hide(m_downloadBtnMissing); m_btnMgr.hide(m_downloadBtnMissing);
@ -318,6 +316,7 @@ void CMenu::_download(string gameId)
m_btnMgr.hide(m_downloadBtnGameTDBDownload); m_btnMgr.hide(m_downloadBtnGameTDBDownload);
m_btnMgr.hide(m_downloadLblCoverSet); m_btnMgr.hide(m_downloadLblCoverSet);
m_btnMgr.hide(m_downloadBtnCoverSet); m_btnMgr.hide(m_downloadBtnCoverSet);
m_btnMgr.hide(m_downloadBtnBack);
m_btnMgr.setProgress(m_wbfsPBar, 0.f, true); m_btnMgr.setProgress(m_wbfsPBar, 0.f, true);
m_btnMgr.setText(m_wbfsLblMessage, L"0%"); m_btnMgr.setText(m_wbfsLblMessage, L"0%");
@ -554,11 +553,10 @@ void CMenu::_initDownloadMenu()
m_downloadLblTitle = _addTitle("DOWNLOAD/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE); m_downloadLblTitle = _addTitle("DOWNLOAD/TITLE", theme.titleFont, L"", 0, 10, 640, 60, theme.titleFontColor, FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE);
m_downloadLblCovers = _addLabel("DOWNLOAD/COVERS", theme.btnFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_downloadLblCovers = _addLabel("DOWNLOAD/COVERS", theme.btnFont, L"", 20, 125, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadBtnAll = _addButton("DOWNLOAD/ALL_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor); m_downloadBtnAll = _addButton("DOWNLOAD/ALL_BTN", theme.btnFont, L"", 420, 130, 200, 48, theme.btnFontColor);
m_downloadBtnMissing = _addButton("DOWNLOAD/MISSING_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor); m_downloadLblCoverSet = _addLabel("DOWNLOAD/COVERSSET", theme.btnFont, L"", 20, 185, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadLblCoverSet = _addLabel("DOWNLOAD/COVERSSET", theme.btnFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_downloadBtnCoverSet = _addButton("DOWNLOAD/COVERSET_BTN", theme.btnFont, L"", 420, 190, 200, 48, theme.btnFontColor);
m_downloadBtnCoverSet = _addButton("DOWNLOAD/COVERSET_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor); m_downloadLblGameTDBDownload = _addLabel("DOWNLOAD/GAMETDB_DOWNLOAD", theme.btnFont, L"", 20, 245, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadLblGameTDBDownload = _addLabel("DOWNLOAD/GAMETDB_DOWNLOAD", theme.btnFont, L"", 20, 305, 385, 56, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_downloadBtnGameTDBDownload = _addButton("DOWNLOAD/GAMETDB_DOWNLOAD_BTN", theme.btnFont, L"", 420, 250, 200, 48, theme.btnFontColor);
m_downloadBtnGameTDBDownload = _addButton("DOWNLOAD/GAMETDB_DOWNLOAD_BTN", theme.btnFont, L"", 420, 310, 200, 48, theme.btnFontColor);
m_downloadLblGameTDB = _addLabel("DOWNLOAD/GAMETDB", theme.lblFont, L"", 20, 390, 370, 60, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE); m_downloadLblGameTDB = _addLabel("DOWNLOAD/GAMETDB", theme.lblFont, L"", 20, 390, 370, 60, theme.lblFontColor, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE);
m_downloadBtnCancel = _addButton("DOWNLOAD/CANCEL_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor); m_downloadBtnCancel = _addButton("DOWNLOAD/CANCEL_BTN", theme.btnFont, L"", 420, 400, 200, 48, theme.btnFontColor);
m_downloadPBar = _addProgressBar("DOWNLOAD/PROGRESS_BAR", 40, 200, 560, 20); m_downloadPBar = _addProgressBar("DOWNLOAD/PROGRESS_BAR", 40, 200, 560, 20);
@ -602,7 +600,6 @@ void CMenu::_initDownloadMenu()
_setHideAnim(m_downloadLblTitle, "DOWNLOAD/TITLE", 0, 0, -2.f, 0.f); _setHideAnim(m_downloadLblTitle, "DOWNLOAD/TITLE", 0, 0, -2.f, 0.f);
_setHideAnim(m_downloadLblCovers, "DOWNLOAD/COVERS", 50, 0, -2.f, 0.f); _setHideAnim(m_downloadLblCovers, "DOWNLOAD/COVERS", 50, 0, -2.f, 0.f);
_setHideAnim(m_downloadBtnAll, "DOWNLOAD/ALL_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_downloadBtnAll, "DOWNLOAD/ALL_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_downloadBtnMissing, "DOWNLOAD/MISSING_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_downloadLblCoverSet, "DOWNLOAD/COVERSSET", 50, 0, -2.f, 0.f); _setHideAnim(m_downloadLblCoverSet, "DOWNLOAD/COVERSSET", 50, 0, -2.f, 0.f);
_setHideAnim(m_downloadBtnCoverSet, "DOWNLOAD/COVERSET_BTN", -50, 0, 1.f, 0.f); _setHideAnim(m_downloadBtnCoverSet, "DOWNLOAD/COVERSET_BTN", -50, 0, 1.f, 0.f);
_setHideAnim(m_downloadLblGameTDBDownload, "DOWNLOAD/GAMETDB_DOWNLOAD", 50, 0, -2.f, 0.f); _setHideAnim(m_downloadLblGameTDBDownload, "DOWNLOAD/GAMETDB_DOWNLOAD", 50, 0, -2.f, 0.f);
@ -652,10 +649,9 @@ void CMenu::_initDownloadMenu()
void CMenu::_textDownload(void) void CMenu::_textDownload(void)
{ {
m_btnMgr.setText(m_downloadLblTitle, _t("dl5", L"Download")); m_btnMgr.setText(m_downloadLblTitle, _t("dl5", L"Downloads"));
m_btnMgr.setText(m_downloadLblCovers, _t("dl8", L"Covers")); m_btnMgr.setText(m_downloadLblCovers, _t("dl8", L"Covers"));
m_btnMgr.setText(m_downloadBtnAll, _t("dl3", L"All")); m_btnMgr.setText(m_downloadBtnAll, _t("dl6", L"Download"));
m_btnMgr.setText(m_downloadBtnMissing, _t("dl4", L"Missing"));
m_btnMgr.setText(m_downloadLblCoverSet, _t("dl15", L"Cover download settings")); m_btnMgr.setText(m_downloadLblCoverSet, _t("dl15", L"Cover download settings"));
m_btnMgr.setText(m_downloadBtnCoverSet, _t("dl16", L"Set")); m_btnMgr.setText(m_downloadBtnCoverSet, _t("dl16", L"Set"));
m_btnMgr.setText(m_downloadLblGameTDBDownload, _t("dl12", L"GameTDB")); m_btnMgr.setText(m_downloadLblGameTDBDownload, _t("dl12", L"GameTDB"));
@ -829,7 +825,7 @@ static string makeURL(const string format, const string gameId, const string cou
return url; return url;
} }
/*
static bool checkPNGBuf(u8 *data) static bool checkPNGBuf(u8 *data)
{ {
if(data == NULL) if(data == NULL)
@ -856,7 +852,7 @@ static bool checkPNGFile(const char *filename)
} }
return ret; return ret;
} }
*/
void CMenu::_setThrdMsg(const wstringEx &msg, float progress) void CMenu::_setThrdMsg(const wstringEx &msg, float progress)
{ {
if (m_thrdStop) return; if (m_thrdStop) return;
@ -878,7 +874,7 @@ void CMenu::_downloadProgress(void *obj, int size, int position)
} }
} }
int CMenu::_coverDownloader(bool download_all) int CMenu::_coverDownloader()
{ {
count = 0; count = 0;
countFlat = 0; countFlat = 0;
@ -895,34 +891,17 @@ int CMenu::_coverDownloader(bool download_all)
vector<string> fmtURLCBox = stringToVector(m_cfg.getString("GENERAL", "url_custom_full_covers", FMT_CBPIC_URL), '|'); vector<string> fmtURLCBox = stringToVector(m_cfg.getString("GENERAL", "url_custom_full_covers", FMT_CBPIC_URL), '|');
vector<string> fmtURLCFlat = stringToVector(m_cfg.getString("GENERAL", "url_custom_flat_covers", FMT_CPIC_URL), '|'); vector<string> fmtURLCFlat = stringToVector(m_cfg.getString("GENERAL", "url_custom_flat_covers", FMT_CPIC_URL), '|');
char path[256];
char id[7];
vector<string> coverIDList; vector<string> coverIDList;
/* create list of cover ID's that need downloading */ /* create list of cover ID's that need downloading */
if(m_coverDLGameId.empty()) if(m_coverDLGameId.empty())
{ {
//coverIDList.reserve(m_gameList.size());
for(u32 i = 0; i < m_gameList.size(); ++i) for(u32 i = 0; i < m_gameList.size(); ++i)
{ {
m_thrdMessage = _t("dlmsg7", L"Listing covers to download...");
m_thrdMessageAdded = true;
memset(&path, 0, sizeof(path));
memset(&id, 0, sizeof(id));
if(m_gameList[i].type == TYPE_PLUGIN || m_gameList[i].type == TYPE_HOMEBREW) if(m_gameList[i].type == TYPE_PLUGIN || m_gameList[i].type == TYPE_HOMEBREW)
continue; continue;
else if(!fsop_FileExist(fmt("%s/%s.png", m_boxPicDir.c_str(), m_gameList[i].id)))
{ coverIDList.push_back(m_gameList[i].id);
strncpy(id, m_gameList[i].id, 6);
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), id), 255);
}
if(download_all || (strlen(path) > 0 && !fsop_FileExist(path)))
{
if(strlen(id) > 0)
coverIDList.push_back(id);
}
} }
} }
else else
@ -955,6 +934,7 @@ int CMenu::_coverDownloader(bool download_all)
/* download covers in the list */ /* download covers in the list */
u32 CoverType = 0; u32 CoverType = 0;
string url; string url;
char path[256];
for(u32 i = 0; i < coverIDList.size(); ++i) for(u32 i = 0; i < coverIDList.size(); ++i)
{ {
@ -990,12 +970,6 @@ int CMenu::_coverDownloader(bool download_all)
if(m_downloadPrioVal & C_TYPE_ONOR) if(m_downloadPrioVal & C_TYPE_ONOR)
original = false; original = false;
if(!success && original) if(!success && original)
{
memset(&path, 0, sizeof(path));
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
/* if cover png doesn't already exist download it */
if(strlen(path) > 0 && !checkPNGFile(path))
{ {
/* each fmtURL may have more than one URL */ /* each fmtURL may have more than one URL */
for(u8 j = 0; !success && j < fmtURLBox.size(); ++j) for(u8 j = 0; !success && j < fmtURLBox.size(); ++j)
@ -1100,7 +1074,6 @@ int CMenu::_coverDownloader(bool download_all)
download = downloadfile(url.c_str()); download = downloadfile(url.c_str());
} }
} }
/* if none of the downloads succeeded */ /* if none of the downloads succeeded */
if(download.data == NULL || download.size == 0)// || !checkPNGBuf(download.data)) if(download.data == NULL || download.size == 0)// || !checkPNGBuf(download.data))
continue; continue;
@ -1108,6 +1081,7 @@ int CMenu::_coverDownloader(bool download_all)
/* a download succeeded */ /* a download succeeded */
/* save cover png */ /* save cover png */
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
update_pThread(1); update_pThread(1);
m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path); m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path);
m_thrdMessageAdded = true; m_thrdMessageAdded = true;
@ -1126,19 +1100,12 @@ int CMenu::_coverDownloader(bool download_all)
success = true; success = true;
} }
} }
}
break; break;
case CBOX: case CBOX:
if(m_downloadPrioVal & C_TYPE_ONCU) if(m_downloadPrioVal & C_TYPE_ONCU)
custom = true; custom = true;
c_altCase = c_gameTDB.GetCaseVersions(coverID.c_str()); c_altCase = c_gameTDB.GetCaseVersions(coverID.c_str());
if(!success && c_gameTDB.IsLoaded() && c_altCase > 1 && custom) if(!success && c_gameTDB.IsLoaded() && c_altCase > 1 && custom)
{
memset(&path, 0, sizeof(path));
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
/* if cover png doesn't already exist download it */
if(strlen(path) > 0 && !checkPNGFile(path))
{ {
/* each fmtURL may have more than one URL */ /* each fmtURL may have more than one URL */
for(u8 j = 0; !success && j < fmtURLCBox.size(); ++j) for(u8 j = 0; !success && j < fmtURLCBox.size(); ++j)
@ -1252,6 +1219,7 @@ int CMenu::_coverDownloader(bool download_all)
/* a download succeeded */ /* a download succeeded */
/* save cover png */ /* save cover png */
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
update_pThread(1); update_pThread(1);
m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path); m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path);
m_thrdMessageAdded = true; m_thrdMessageAdded = true;
@ -1270,17 +1238,11 @@ int CMenu::_coverDownloader(bool download_all)
success = true; success = true;
} }
} }
}
break; break;
case FLAT: case FLAT:
if(m_downloadPrioVal & C_TYPE_ONOR) if(m_downloadPrioVal & C_TYPE_ONOR)
original = false; original = false;
if(!success && original) if(!success && original)
{
memset(&path, 0, sizeof(path));
strncpy(path, fmt("%s/%s.png", m_picDir.c_str(), coverID.c_str()), 255);
if(strlen(path) > 0 && !checkPNGFile(path))
{ {
for(u8 j = 0; !success && j < fmtURLFlat.size(); ++j) for(u8 j = 0; !success && j < fmtURLFlat.size(); ++j)
{ {
@ -1389,6 +1351,7 @@ int CMenu::_coverDownloader(bool download_all)
continue; continue;
/*download succeeded - save png */ /*download succeeded - save png */
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
update_pThread(1); update_pThread(1);
m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path); m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path);
m_thrdMessageAdded = true; m_thrdMessageAdded = true;
@ -1407,17 +1370,11 @@ int CMenu::_coverDownloader(bool download_all)
success = true; success = true;
} }
} }
}
break; break;
case CFLAT: case CFLAT:
if(m_downloadPrioVal & C_TYPE_ONCU) if(m_downloadPrioVal & C_TYPE_ONCU)
custom = true; custom = true;
if(!success && c_gameTDB.IsLoaded() && c_altCase > 1 && custom) if(!success && c_gameTDB.IsLoaded() && c_altCase > 1 && custom)
{
memset(&path, 0, sizeof(path));
strncpy(path, fmt("%s/%s.png", m_picDir.c_str(), coverID.c_str()), 255);
if(strlen(path) > 0 && !checkPNGFile(path))
{ {
for(u8 j = 0; !success && j < fmtURLCFlat.size(); ++j) for(u8 j = 0; !success && j < fmtURLCFlat.size(); ++j)
{ {
@ -1530,6 +1487,7 @@ int CMenu::_coverDownloader(bool download_all)
continue; continue;
/* save png */ /* save png */
strncpy(path, fmt("%s/%s.png", m_boxPicDir.c_str(), coverID.c_str()), 255);
update_pThread(1); update_pThread(1);
m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path); m_thrdMessage = wfmt(_fmt("dlmsg4", L"Saving %s"), path);
m_thrdMessageAdded = true; m_thrdMessageAdded = true;
@ -1548,7 +1506,6 @@ int CMenu::_coverDownloader(bool download_all)
success = true; success = true;
} }
} }
}
break; break;
} }
} }

View File

@ -266,20 +266,7 @@ void CMenu::_setCurrentItem(const dir_discHdr *hdr)
const char *title = CoverFlow.getFilenameId(hdr, true);// with extension const char *title = CoverFlow.getFilenameId(hdr, true);// with extension
m_cfg.setString(_domainFromView(), "current_item", title); m_cfg.setString(_domainFromView(), "current_item", title);
if(m_current_view == COVERFLOW_PLUGIN && m_source_cnt == 1) if(m_current_view == COVERFLOW_PLUGIN && m_source_cnt == 1)
{
m_cfg.setInt(PLUGIN_DOMAIN, "current_item_type", hdr->type); m_cfg.setInt(PLUGIN_DOMAIN, "current_item_type", hdr->type);
switch(hdr->type)
{
case TYPE_CHANNEL:
case TYPE_EMUCHANNEL:
case TYPE_GC_GAME:
case TYPE_WII_GAME:
m_cfg.setBool(PLUGIN_DOMAIN, "current_item_id", true);
break;
default:
m_cfg.setBool(PLUGIN_DOMAIN, "current_item_id", false);
}
}
if(m_source_cnt > 1) if(m_source_cnt > 1)
m_cfg.setInt("MULTI", "current_item_type", hdr->type); m_cfg.setInt("MULTI", "current_item_type", hdr->type);
} }

View File

@ -434,6 +434,7 @@ int CMenu::main(void)
if(strcmp(prevTheme, m_cfg.getString("GENERAL", "theme").c_str()) != 0) if(strcmp(prevTheme, m_cfg.getString("GENERAL", "theme").c_str()) != 0)
{ {
/* new theme - exit wiiflow and reload */ /* new theme - exit wiiflow and reload */
fsop_deleteFolder(fmt("%s/sourceflow", m_cacheDir.c_str()));
m_reload = true; m_reload = true;
break; break;
} }

View File

@ -7,6 +7,7 @@
* to complete a request * to complete a request
*/ */
const struct block emptyblock = {0, NULL}; const struct block emptyblock = {0, NULL};
//The maximum amount of bytes to send per net_write() call //The maximum amount of bytes to send per net_write() call
//#define NET_BUFFER_SIZE 1024 //#define NET_BUFFER_SIZE 1024
#define NET_BUFFER_SIZE 3600 #define NET_BUFFER_SIZE 3600
@ -16,7 +17,8 @@ static u8 retryloop = 0;
// Write our message to the server // Write our message to the server
static s32 send_message(s32 server, char *msg) static s32 send_message(s32 server, char *msg)
{ {
s32 bytes_transferred = 0, remaining = strlen(msg); s32 bytes_transferred = 0;
s32 remaining = strlen(msg);
while (remaining) while (remaining)
{ {
if((bytes_transferred = net_write(server, msg, remaining > NET_BUFFER_SIZE ? NET_BUFFER_SIZE : remaining)) > 0) if((bytes_transferred = net_write(server, msg, remaining > NET_BUFFER_SIZE ? NET_BUFFER_SIZE : remaining)) > 0)
@ -142,7 +144,8 @@ struct block read_message(s32 connection)
} }
/* Downloads the contents of a URL to memory /* Downloads the contents of a URL to memory
* This method is not threadsafe (because networking is not threadsafe on the Wii) */ * This method is not threadsafe (because networking is not threadsafe on the Wii)
*/
struct block downloadfile(const char *url) struct block downloadfile(const char *url)
{ {
//Check if the url starts with "http://", if not it is not considered a valid url //Check if the url starts with "http://", if not it is not considered a valid url

View File

@ -233,6 +233,8 @@ cheat4=Download not found.
commodore=Commodore 64 commodore=Commodore 64
custom=Custom custom=Custom
def=Default def=Default
deltcover=Cover is deleted.
deltbanner=Banner is deleted.
disabled=Disabled disabled=Disabled
dl1=Cancel dl1=Cancel
dl10=Please donate\nto GameTDB.com dl10=Please donate\nto GameTDB.com
@ -253,7 +255,7 @@ dl24=Custom only
dl25=All dl25=All
dl3=All dl3=All
dl4=Missing dl4=Missing
dl5=Download dl5=Downloads
dl6=Download dl6=Download
dl8=Covers dl8=Covers
dlmsg1=Initializing network... dlmsg1=Initializing network...