From 1bd07dc6dc2a2414e387df25d1c2569d3682cca6 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Fri, 25 May 2012 22:05:38 +0000 Subject: [PATCH] -fixed bin and iso files not displayed in emulator coverflow -removed hide settings button if no game found to reload cache --- source/list/list.cpp | 79 ++++++++++++++++++++------------------- source/menu/menu_main.cpp | 3 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/source/list/list.cpp b/source/list/list.cpp index 41de6609..144123a7 100644 --- a/source/list/list.cpp +++ b/source/list/list.cpp @@ -149,9 +149,47 @@ void CList::GetHeaders(vector pathlist, vector strncpy(tmp.path, (*itr).c_str(), sizeof(tmp.path)); tmp.hdr.index = headerlist.size(); tmp.hdr.casecolor = 1; - + bool wbfs = (*itr).rfind(".wbfs") != string::npos || (*itr).rfind(".WBFS") != string::npos; - if (wbfs || (*itr).rfind(".iso") != string::npos || (*itr).rfind(".ISO") != string::npos + + if(plugin.loaded()) + { + vector types = plugin.getStrings("PLUGIN","fileTypes",'|'); + if (types.size() > 0) + { + for(vector::iterator type_itr = types.begin(); type_itr != types.end(); type_itr++) + { + if(lowerCase(*itr).rfind((*type_itr).c_str()) != string::npos) + { + strncpy(tmp.path, (*itr).c_str(), sizeof(tmp.path)); + + int plugin_ccolor; + sscanf(plugin.getString("PLUGIN","coverColor","").c_str(), "%08x", &plugin_ccolor); + int ccolor = custom_titles.getColor("COVERS", (const char *) tmp.hdr.id, plugin_ccolor).intVal(); + tmp.hdr.casecolor = ccolor != plugin_ccolor ? ccolor : plugin_ccolor; + + char tempname[64]; + (*itr).assign(&(*itr)[(*itr).find_last_of('/') + 1]); + if((*itr).find_last_of('.') != string::npos) + (*itr).erase((*itr).find_last_of('.'), (*itr).size() - (*itr).find_last_of('.')); + strncpy(tempname, (*itr).c_str(), sizeof(tempname)); + //mbstowcs(tmp.title, tempname, sizeof(tmp.title)); + //Asciify(tmp.title); + wstringEx tmpString; + tmpString.fromUTF8(tempname); + wcsncpy(tmp.title, tmpString.c_str(), 64); + + gprintf("Found: %s\n", tmp.path); + sscanf(plugin.getString("PLUGIN","magic","").c_str(), "%08x", &tmp.hdr.magic); //Plugin magic + tmp.hdr.gc_magic = EMU_MAGIC; //Abusing gc_magic for general emu detection ;) + headerlist.push_back(tmp); + break; + } + } + } + continue; + } + else if (wbfs || (*itr).rfind(".iso") != string::npos || (*itr).rfind(".ISO") != string::npos || (*itr).rfind(".bin") != string::npos || (*itr).rfind(".BIN") != string::npos) { char* filename = &(*itr)[(*itr).find_last_of('/')+1]; @@ -418,43 +456,6 @@ void CList::GetHeaders(vector pathlist, vector } continue; } - else if(plugin.loaded()) - { - vector types = plugin.getStrings("PLUGIN","fileTypes",'|'); - if (types.size() > 0) - { - for(vector::iterator type_itr = types.begin(); type_itr != types.end(); type_itr++) - { - if(lowerCase(*itr).rfind((*type_itr).c_str()) != string::npos) - { - strncpy(tmp.path, (*itr).c_str(), sizeof(tmp.path)); - - int plugin_ccolor; - sscanf(plugin.getString("PLUGIN","coverColor","").c_str(), "%08x", &plugin_ccolor); - int ccolor = custom_titles.getColor("COVERS", (const char *) tmp.hdr.id, plugin_ccolor).intVal(); - tmp.hdr.casecolor = ccolor != plugin_ccolor ? ccolor : plugin_ccolor; - - char tempname[64]; - (*itr).assign(&(*itr)[(*itr).find_last_of('/') + 1]); - if((*itr).find_last_of('.') != string::npos) - (*itr).erase((*itr).find_last_of('.'), (*itr).size() - (*itr).find_last_of('.')); - strncpy(tempname, (*itr).c_str(), sizeof(tempname)); - //mbstowcs(tmp.title, tempname, sizeof(tmp.title)); - //Asciify(tmp.title); - wstringEx tmpString; - tmpString.fromUTF8(tempname); - wcsncpy(tmp.title, tmpString.c_str(), 64); - - gprintf("Found: %s\n", tmp.path); - sscanf(plugin.getString("PLUGIN","magic","").c_str(), "%08x", &tmp.hdr.magic); //Plugin magic - tmp.hdr.gc_magic = EMU_MAGIC; //Abusing gc_magic for general emu detection ;) - headerlist.push_back(tmp); - break; - } - } - } - continue; - } } if(gameTDB.IsLoaded()) diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index b2f8e202..ed1c98bc 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -173,7 +173,7 @@ void CMenu::_showMain(void) m_btnMgr.show(m_mainBtnInit2); m_btnMgr.show(m_mainLblInit); break; - } + } } } @@ -708,7 +708,6 @@ int CMenu::main(void) { m_btnMgr.hide(m_mainLblUser[0]); m_btnMgr.hide(m_mainLblUser[1]); - m_btnMgr.hide(m_mainBtnConfig); m_btnMgr.hide(m_mainBtnInfo); m_btnMgr.hide(m_mainBtnQuit); m_btnMgr.hide(m_mainBtnFavoritesOn);