diff --git a/source/gui/coverflow.cpp b/source/gui/coverflow.cpp index a63813d9..774dd63f 100644 --- a/source/gui/coverflow.cpp +++ b/source/gui/coverflow.cpp @@ -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) diff --git a/source/gui/coverflow.hpp b/source/gui/coverflow.hpp index 8079cf6b..92465b69 100644 --- a/source/gui/coverflow.hpp +++ b/source/gui/coverflow.hpp @@ -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); diff --git a/source/menu/menu_main.cpp b/source/menu/menu_main.cpp index 49d41862..e1260992 100644 --- a/source/menu/menu_main.cpp +++ b/source/menu/menu_main.cpp @@ -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");