-added sort by button numbers for sourceflow. hold 'b' and press '+' to change from alpha to by button numbers and back.

This commit is contained in:
Fledge68 2018-10-01 06:48:52 -05:00
parent d37b77e2d7
commit 4af2936db7
5 changed files with 29 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -1846,6 +1846,12 @@ bool CCoverFlow::_sortByWifiPlayers(CItem item1, CItem item2)
return item1.hdr->wifi < item2.hdr->wifi;
}
bool CCoverFlow::_sortByBtnNumbers(CItem item1, CItem item2)
{
if(item1.hdr->settings[0] == item2.hdr->settings[0]) return _sortByAlpha(item1, item2);
return item1.hdr->settings[0] < item2.hdr->settings[0];
}
bool CCoverFlow::start(const string &m_imgsDir)
{
if (m_items.empty()) return true;
@ -1863,6 +1869,8 @@ bool CCoverFlow::start(const string &m_imgsDir)
sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByPlayers);
else if (m_sorting == SORT_WIFIPLAYERS)
sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByWifiPlayers);
else if (m_sorting == SORT_BTN_NUMBERS)
sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByBtnNumbers);
// Load resident textures
if(!m_dvdskin_loaded)
@ -2254,7 +2262,7 @@ void CCoverFlow::_completeJump(void)
void CCoverFlow::nextLetter(wchar_t *c)
{
if (m_covers == NULL)
if (m_covers == NULL || m_sorting == SORT_BTN_NUMBERS)
{
c[0] = L'\0';
return;
@ -2293,7 +2301,7 @@ void CCoverFlow::nextLetter(wchar_t *c)
void CCoverFlow::prevLetter(wchar_t *c)
{
if (m_covers == NULL)
if (m_covers == NULL || m_sorting == SORT_BTN_NUMBERS)
{
c[0] = L'\0';
return;

View File

@ -29,6 +29,7 @@ enum Sorting
SORT_MAX,
SORT_ESRB,
SORT_CONTROLLERS,
SORT_BTN_NUMBERS,
};
class CCoverFlow
@ -357,6 +358,7 @@ private:
static bool _sortByAlpha(CItem item1, CItem item2);
static bool _sortByPlayers(CItem item1, CItem item2);
static bool _sortByWifiPlayers(CItem item1, CItem item2);
static bool _sortByBtnNumbers(CItem item1, CItem item2);
private:
static void * _coverLoader(void *obj);

View File

@ -596,15 +596,24 @@ int CMenu::main(void)
MusicPlayer.Next();
}
/* change sorting with btn B and + */
else if(BTN_PLUS_PRESSED && !m_locked && !m_sourceflow && m_current_view < 8)
else if(BTN_PLUS_PRESSED && !m_locked && (m_current_view < 8 || m_sourceflow))// <8 excludes plugins and homebrew
{
bUsed = true;
u32 sort = 0;
sort = loopNum((m_cfg.getInt(domain, "sort", 0)) + 1, SORT_MAX);
//if((m_current_view == COVERFLOW_HOMEBREW || m_current_view == COVERFLOW_PLUGIN) && sort > SORT_LASTPLAYED)
// sort = SORT_ALPHA;
u8 sort = 0;
if(m_sourceflow)
{
sort = m_cfg.getInt(SOURCEFLOW_DOMAIN, "sort", SORT_ALPHA);
if(sort == SORT_ALPHA)
sort = SORT_BTN_NUMBERS;
else
sort = SORT_ALPHA;
}
else
sort = loopNum((m_cfg.getInt(domain, "sort", 0)) + 1, SORT_MAX);
m_cfg.setInt(domain, "sort", sort);
/* set coverflow to new sorting */
_initCF();
/* set text to display */
wstringEx curSort ;
if(sort == SORT_ALPHA)
curSort = m_loc.getWString(m_curLanguage, "alphabetically", L"Alphabetically");
@ -618,6 +627,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_BTN_NUMBERS)
curSort = m_loc.getWString(m_curLanguage, "bybtnnumbers", L"By Button Numbers");
m_showtimer = 120;
m_btnMgr.setText(m_mainLblNotice, curSort);
m_btnMgr.show(m_mainLblNotice);

View File

@ -21,6 +21,7 @@ bylastplayed=By Last Played
byplaycount=By Play Count
byplayers=By Players
bywifiplayers=By Wifi Players
bybtnnumbers=By Button Numbers
cat1=Select Categories
cat2=Clear
cd1=Back