-added sort by plugin magic, just press b and plus to

change until you come to by plugin magic, then it should
be sorted by emulator if in emulator coverflow
This commit is contained in:
fix94.1 2012-04-29 20:24:40 +00:00
parent 2a7489a216
commit 61d8ae8c69
3 changed files with 13 additions and 2 deletions

View File

@ -1701,6 +1701,11 @@ void CCoverFlow::_instantTarget(int i)
cvr.txtColor = cvr.txtTargetColor;
}
bool CCoverFlow::_sortByMagic(CItem item1, CItem item2)
{
return (item1.hdr->hdr.magic == item2.hdr->hdr.magic) ? _sortByAlpha(item1, item2) : item1.hdr->hdr.magic > item2.hdr->hdr.magic;
}
bool CCoverFlow::_sortByPlayCount(CItem item1, CItem item2)
{
return (item1.playcount == item2.playcount) ? _sortByAlpha(item1, item2) : item1.playcount > item2.playcount;
@ -1763,6 +1768,8 @@ bool CCoverFlow::start(const char *id)
// Sort items
if (m_sorting == SORT_ALPHA)
sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByAlpha);
else if (m_sorting == SORT_MAGIC)
sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByMagic);
else if (m_sorting == SORT_PLAYCOUNT)
sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByPlayCount);
else if (m_sorting == SORT_LASTPLAYED)

View File

@ -28,6 +28,7 @@ enum Sorting
SORT_LASTPLAYED,
SORT_WIFIPLAYERS,
SORT_PLAYERS,
SORT_MAGIC,
SORT_MAX,
SORT_ESRB,
SORT_CONTROLLERS,
@ -328,7 +329,8 @@ private:
void _stopSound(SmartGuiSound snd);
void _playSound(SmartGuiSound snd);
static bool _sortByMagic(CItem item1, CItem item2);
static bool _sortByPlayCount(CItem item1, CItem item2);
static bool _sortByLastPlayed(CItem item1, CItem item2);
static bool _sortByGameID(CItem item1, CItem item2);

View File

@ -372,7 +372,7 @@ int CMenu::main(void)
else if (BTN_PLUS_PRESSED && !m_locked)
{
u32 sort = 0;
sort = loopNum((m_cfg.getInt(domain, "sort", 0)) + 1, SORT_MAX - 1);
sort = loopNum((m_cfg.getInt(domain, "sort", 0)) + 1, SORT_MAX);
m_cf.setSorting((Sorting)sort);
m_cfg.setInt(domain, "sort", sort);
wstringEx curSort ;
@ -390,6 +390,8 @@ int CMenu::main(void)
curSort = m_loc.getWString(m_curLanguage, "bywifiplayers", L"By Wifi Players");
else if (sort == SORT_PLAYERS)
curSort = m_loc.getWString(m_curLanguage, "byplayers", L"By Players");
else if (sort == SORT_MAGIC)
curSort = m_loc.getWString(m_curLanguage, "bypluginmagic", L"By Plugin Magic");
else if (sort == SORT_CONTROLLERS)
curSort = m_loc.getWString(m_curLanguage, "bycontrollers", L"By Controllers");