mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2025-01-12 11:59:08 +01:00
- fixed categories for emu mode. backup categories.ini just in case.
This commit is contained in:
parent
f062eff356
commit
250bd63781
@ -1456,25 +1456,32 @@ void CMenu::_initCF(void)
|
|||||||
if(m_gamelistdump) m_dump.load(sfmt("%s/titlesdump.ini", m_settingsDir.c_str()).c_str());
|
if(m_gamelistdump) m_dump.load(sfmt("%s/titlesdump.ini", m_settingsDir.c_str()).c_str());
|
||||||
|
|
||||||
m_gcfg1.load(sfmt("%s/gameconfig1.ini", m_settingsDir.c_str()).c_str());
|
m_gcfg1.load(sfmt("%s/gameconfig1.ini", m_settingsDir.c_str()).c_str());
|
||||||
|
string id;
|
||||||
for (u32 i = 0; i < m_gameList.size(); ++i)
|
for (u32 i = 0; i < m_gameList.size(); ++i)
|
||||||
{
|
{
|
||||||
u64 chantitle = m_gameList[i].hdr.chantitle;
|
u64 chantitle = m_gameList[i].hdr.chantitle;
|
||||||
if (m_current_view == COVERFLOW_CHANNEL && chantitle == HBC_108)
|
if (m_current_view == COVERFLOW_CHANNEL && chantitle == HBC_108) strncpy((char *) m_gameList[i].hdr.id, "JODI", 6);
|
||||||
strncpy((char *) m_gameList[i].hdr.id, "JODI", 6);
|
|
||||||
|
|
||||||
string id = string((const char *)m_gameList[i].hdr.id, m_current_view == COVERFLOW_CHANNEL ? 4 : 6);
|
if (m_current_view == COVERFLOW_EMU)
|
||||||
if (m_current_view != COVERFLOW_EMU)
|
{
|
||||||
{
|
string tempname(m_gameList[i].path);
|
||||||
|
tempname.erase(0, tempname.find_first_of('/')+1);
|
||||||
|
string dirName = tempname.substr(0, tempname.find_first_of('/')+1);
|
||||||
|
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
|
||||||
|
if(tempname.find_last_of('.') != string::npos)
|
||||||
|
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
|
||||||
|
id = dirName+tempname;
|
||||||
|
}
|
||||||
|
else id = string((const char *)m_gameList[i].hdr.id, m_current_view == COVERFLOW_CHANNEL ? 4 : 6);
|
||||||
string idcats = m_cat.getString("CATEGORIES", id, "").c_str();
|
string idcats = m_cat.getString("CATEGORIES", id, "").c_str();
|
||||||
if (idcats.length() < 21 && idcats.length() > 0)
|
if (idcats.length() < 21 && idcats.length() > 0)
|
||||||
{
|
{
|
||||||
idcats.append((21-idcats.length()), '0');
|
idcats.append((21-idcats.length()), '0');
|
||||||
m_cat.setString("CATEGORIES", id, idcats);
|
m_cat.setString("CATEGORIES", id, idcats);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ((!m_favorites || m_gcfg1.getBool("FAVORITES", id, false)) && (!m_locked || !m_gcfg1.getBool("ADULTONLY", id, false)))
|
if ((!m_favorites || m_gcfg1.getBool("FAVORITES", id, false)) && (!m_locked || !m_gcfg1.getBool("ADULTONLY", id, false)))
|
||||||
{
|
{
|
||||||
if (catviews[0] == '0' && m_current_view != COVERFLOW_EMU)
|
if (catviews[0] == '0')
|
||||||
{
|
{
|
||||||
const char *idcats = m_cat.getString("CATEGORIES", id, "").c_str();
|
const char *idcats = m_cat.getString("CATEGORIES", id, "").c_str();
|
||||||
if (strlen(idcats) == 0) continue;
|
if (strlen(idcats) == 0) continue;
|
||||||
|
@ -48,7 +48,19 @@ void CMenu::_updateCheckboxes(void)
|
|||||||
m_btnMgr.hide(m_categoryBtn[i]);
|
m_btnMgr.hide(m_categoryBtn[i]);
|
||||||
m_btnMgr.hide(m_categoryLblCat[i]);
|
m_btnMgr.hide(m_categoryLblCat[i]);
|
||||||
}
|
}
|
||||||
string id(m_cf.getId());
|
string id;
|
||||||
|
if (m_current_view != COVERFLOW_EMU) id = m_cf.getId();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dir_discHdr *hdr = m_cf.getHdr();
|
||||||
|
string tempname(hdr->path);
|
||||||
|
tempname.erase(0, tempname.find_first_of('/')+1);
|
||||||
|
string dirName = tempname.substr(0, tempname.find_first_of('/')+1);
|
||||||
|
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
|
||||||
|
if(tempname.find_last_of('.') != string::npos)
|
||||||
|
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
|
||||||
|
id = dirName+tempname;
|
||||||
|
}
|
||||||
const char *catflags;
|
const char *catflags;
|
||||||
if (gameSet) catflags = m_cat.getString("CATEGORIES", id, "").c_str();
|
if (gameSet) catflags = m_cat.getString("CATEGORIES", id, "").c_str();
|
||||||
else catflags = m_cat.getString(_domainFromView(), "categories", "100000000000000000000").c_str();
|
else catflags = m_cat.getString(_domainFromView(), "categories", "100000000000000000000").c_str();
|
||||||
@ -82,7 +94,6 @@ void CMenu::_updateCheckboxes(void)
|
|||||||
|
|
||||||
void CMenu::_CategorySettings(bool fromGameSet)
|
void CMenu::_CategorySettings(bool fromGameSet)
|
||||||
{
|
{
|
||||||
if (m_current_view == COVERFLOW_EMU) return;
|
|
||||||
SetupInput();
|
SetupInput();
|
||||||
C_curPage = 1;
|
C_curPage = 1;
|
||||||
gameSet = fromGameSet;
|
gameSet = fromGameSet;
|
||||||
@ -92,7 +103,10 @@ void CMenu::_CategorySettings(bool fromGameSet)
|
|||||||
_mainLoopCommon();
|
_mainLoopCommon();
|
||||||
if (!m_btnMgr.selected(lastBtn)) m_btnMgr.noHover(false);
|
if (!m_btnMgr.selected(lastBtn)) m_btnMgr.noHover(false);
|
||||||
if (BTN_HOME_PRESSED || BTN_B_PRESSED)
|
if (BTN_HOME_PRESSED || BTN_B_PRESSED)
|
||||||
break;
|
{
|
||||||
|
m_cat.save();
|
||||||
|
break;
|
||||||
|
}
|
||||||
else if (BTN_UP_PRESSED)
|
else if (BTN_UP_PRESSED)
|
||||||
m_btnMgr.up();
|
m_btnMgr.up();
|
||||||
else if (BTN_DOWN_PRESSED)
|
else if (BTN_DOWN_PRESSED)
|
||||||
@ -116,7 +130,10 @@ void CMenu::_CategorySettings(bool fromGameSet)
|
|||||||
if (BTN_A_PRESSED)
|
if (BTN_A_PRESSED)
|
||||||
{
|
{
|
||||||
if (m_btnMgr.selected(m_categoryBtnBack))
|
if (m_btnMgr.selected(m_categoryBtnBack))
|
||||||
|
{
|
||||||
|
m_cat.save();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
for (int i = 0; i < 21; ++i)
|
for (int i = 0; i < 21; ++i)
|
||||||
{
|
{
|
||||||
if (m_btnMgr.selected(m_categoryBtn[i]))
|
if (m_btnMgr.selected(m_categoryBtn[i]))
|
||||||
@ -129,7 +146,19 @@ void CMenu::_CategorySettings(bool fromGameSet)
|
|||||||
char catflags[22];
|
char catflags[22];
|
||||||
memset(&catflags, 0, sizeof(catflags));
|
memset(&catflags, 0, sizeof(catflags));
|
||||||
memcpy(&catflags, &m_categories, sizeof(m_categories));
|
memcpy(&catflags, &m_categories, sizeof(m_categories));
|
||||||
string id(m_cf.getId());
|
string id;
|
||||||
|
if (m_current_view != COVERFLOW_EMU) id = m_cf.getId();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dir_discHdr *hdr = m_cf.getHdr();
|
||||||
|
string tempname(hdr->path);
|
||||||
|
tempname.erase(0, tempname.find_first_of('/')+1);
|
||||||
|
string dirName = tempname.substr(0, tempname.find_first_of('/')+1);
|
||||||
|
tempname.assign(&tempname[tempname.find_last_of('/') + 1]);
|
||||||
|
if(tempname.find_last_of('.') != string::npos)
|
||||||
|
tempname.erase(tempname.find_last_of('.'), tempname.size() - tempname.find_last_of('.'));
|
||||||
|
id = dirName+tempname;
|
||||||
|
}
|
||||||
if (string (catflags) == "000000000000000000000") catflags[0] = '1';
|
if (string (catflags) == "000000000000000000000") catflags[0] = '1';
|
||||||
if (gameSet) m_cat.setString("CATEGORIES", id, catflags);
|
if (gameSet) m_cat.setString("CATEGORIES", id, catflags);
|
||||||
else m_cat.setString(_domainFromView(), "categories", catflags);
|
else m_cat.setString(_domainFromView(), "categories", catflags);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user