-added the ability to go back a source menu/flow tier by pressing minus controller button and plus controller button to go back to base tier.

This commit is contained in:
Fledge68 2018-10-08 13:21:56 -05:00
parent 1f463f9f50
commit 10f3429b29
4 changed files with 84 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -1077,6 +1077,7 @@ private:
void _sourceFlow();
int _getSrcFlow();
void _setSrcFlow(int version);
void _srcTierBack(bool home);
void _mainLoopCommon(bool withCF = false, bool adjusting = false);
void _netInit();
void _loadDefaultFont(void);

View File

@ -561,9 +561,25 @@ int CMenu::main(void)
else if(BTN_LEFT_REPEAT || RIGHT_STICK_LEFT)
CoverFlow.left();
else if(BTN_MINUS_PRESSED)
CoverFlow.pageUp();
{
if(!m_sourceflow)
CoverFlow.pageUp();
else
{
_srcTierBack(false);
_showCF(true);
}
}
else if(BTN_PLUS_PRESSED)
CoverFlow.pageDown();
{
if(!m_sourceflow)
CoverFlow.pageDown();
else
{
_srcTierBack(true);
_showCF(true);
}
}
/* change coverflow layout/mode */
else if(BTN_1_PRESSED || BTN_2_PRESSED)

View File

@ -25,6 +25,8 @@ static u8 i, j, k;
int curPage;
int numPages;
vector<string> magicNums;
vector<string> tiers;
vector<int> flows;
char btn_selected[16];
char current_btn[16];
int curflow = 1;
@ -100,7 +102,9 @@ void CMenu::_sourceFlow()
sm_tier = false;
else
sm_tier = true;
tiers.push_back(fn);
curflow = m_source.getInt(btn_selected, "flow", m_cfg.getInt(SOURCEFLOW_DOMAIN, "last_cf_mode", 1));
flows.push_back(curflow);
m_source.unload();
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn.c_str()));
/* get max source button # */
@ -141,6 +145,49 @@ void CMenu::_setSrcFlow(int version)
m_cfg.setInt(SOURCEFLOW_DOMAIN, "last_cf_mode", version);
}
void CMenu::_srcTierBack(bool home)
{
if(!sm_tier)
return;
string fn;
if(home)
{
fn = tiers[0];
tiers.erase(tiers.begin() + 1, tiers.end());
curflow = flows[0];
flows.erase(flows.begin() + 1, flows.end());
}
else
{
fn = tiers[tiers.size() - 2];
tiers.pop_back();
curflow = flows[flows.size() - 2];
flows.pop_back();
}
if(fn == SOURCE_FILENAME)
sm_tier = false;
else
sm_tier = true;
m_source.unload();
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn.c_str()));
/* get max source button # */
m_max_source_btn = 0;
const char *srcDomain = m_source.firstDomain().c_str();
while(1)
{
if(strlen(srcDomain) < 2)
break;
if(strrchr(srcDomain, '_') != NULL)
{
int srcBtnNumber = atoi(strrchr(srcDomain, '_') + 1);
if(srcBtnNumber > m_max_source_btn)
m_max_source_btn = srcBtnNumber;
}
srcDomain = m_source.nextDomain().c_str();
}
}
void CMenu::_hideSource(bool instant)
{
m_btnMgr.hide(m_sourceLblTitle, instant);
@ -350,8 +397,7 @@ bool CMenu::_Source()
m_btnMgr.up();
else if(BTN_DOWN_PRESSED)
m_btnMgr.down();
else if(((BTN_LEFT_PRESSED || BTN_MINUS_PRESSED) && numPages > 1)
|| (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM)))
else if((BTN_LEFT_PRESSED && numPages > 1) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM)))
{
curPage--;
if(curPage < 1)
@ -360,8 +406,7 @@ bool CMenu::_Source()
m_btnMgr.click(m_sourceBtnPageM);
_updateSourceBtns();
}
else if(((BTN_RIGHT_PRESSED || BTN_PLUS_PRESSED) && numPages > 1)
|| (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageP)))
else if((BTN_RIGHT_PRESSED && numPages > 1) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageP)))
{
curPage++;
if(curPage > numPages)
@ -370,6 +415,14 @@ bool CMenu::_Source()
m_btnMgr.click(m_sourceBtnPageP);
_updateSourceBtns();
}
else if((BTN_MINUS_PRESSED || BTN_PLUS_PRESSED) && sm_tier)
{
_srcTierBack(BTN_PLUS_PRESSED);
updateSource = true;
curPage = 1;
numPages = (m_max_source_btn / 12) + 1;
}
else if(BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnClear))
{
m_current_view = COVERFLOW_NONE;
@ -460,7 +513,9 @@ bool CMenu::_Source()
sm_tier = false;
else
sm_tier = true;
tiers.push_back(fn);
curflow = m_source.getInt(btn_selected, "flow", m_cfg.getInt(SOURCEFLOW_DOMAIN, "last_cf_mode", 1));
flows.push_back(curflow);
m_source.unload();
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn.c_str()));
exitSource = false;
@ -546,7 +601,9 @@ bool CMenu::_Source()
sm_tier = false;
else
sm_tier = true;
tiers.push_back(fn);
curflow = m_source.getInt(btn_selected, "flow", m_cfg.getInt(SOURCEFLOW_DOMAIN, "last_cf_mode", 1));
flows.push_back(curflow);
m_source.unload();
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn.c_str()));
exitSource = false;
@ -720,8 +777,12 @@ void CMenu::_initSourceMenu()
srcDomain = m_source.nextDomain().c_str();
}
tiers.clear();
tiers.push_back(SOURCE_FILENAME);
sm_tier = false;
curflow = m_cfg.getInt(SOURCEFLOW_DOMAIN, "last_cf_mode", 1);
flows.clear();
flows.push_back(curflow);
_addUserLabels(m_sourceLblUser, ARRAY_SIZE(m_sourceLblUser), "SOURCE");
m_sourceBg = _texture("SOURCE/BG", "texture", theme.bg, false);