- small changes for source menu/flow

This commit is contained in:
Fledge68 2019-11-20 12:45:17 -06:00
parent bf7fe691b6
commit 02f1d4ba8d
5 changed files with 27 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

@ -405,13 +405,6 @@ bool CMenu::init(bool usb_mounted)
MusicPlayer.Init(m_cfg, m_musicDir, fmt("%s/music", m_themeDataDir.c_str()));
m_music_info = m_cfg.getBool("GENERAL", "display_music_info", false);
/* Source Menu on start reset tiers before buid menus */
if(m_cfg.getBool("GENERAL", "source_on_start", false))
{
m_cfg.remove(SOURCEFLOW_DOMAIN, "tiers");
m_cfg.remove(SOURCEFLOW_DOMAIN, "numbers");
}
/* Init Button Manager and build the menus */
_buildMenus();

View File

@ -69,6 +69,8 @@ private:
vector<dir_discHdr> m_gameList;
vector<string> tiers;
vector<string> sm_numbers;
string sm_numbers_backup;
string sm_tiers_backup;
struct SZone
{

View File

@ -403,17 +403,22 @@ int CMenu::main(void)
{
if(!_srcTierBack(false))// back a tier
{
// not back a tier - exit sourceflow and return to coverflow
m_cfg.setString(SOURCEFLOW_DOMAIN, "numbers", sm_numbers_backup);// restore if no source chosen
m_cfg.setString(SOURCEFLOW_DOMAIN, "tiers", sm_tiers_backup);
m_sourceflow = false;// if not back a tier then exit sourceflow
_setMainBg();
}
_showCF(true);
continue;
}
if(m_use_source)//if source_menu enabled
else if(m_use_source)//if source_menu enabled
{
_hideMain();
if(m_cfg.getBool(SOURCEFLOW_DOMAIN, "enabled", false))//if sourceflow show it
{
sm_numbers_backup = m_cfg.getString(SOURCEFLOW_DOMAIN, "numbers");//backup for possible restore later
sm_tiers_backup = m_cfg.getString(SOURCEFLOW_DOMAIN, "tiers");
m_sourceflow = true;
_setSrcFlowBg();
_showCF(true);
@ -435,6 +440,8 @@ int CMenu::main(void)
{
if(!_srcTierBack(true))// if already on base tier exit sourceflow
{
m_cfg.setString(SOURCEFLOW_DOMAIN, "numbers", sm_numbers_backup);// restore if no source chosen
m_cfg.setString(SOURCEFLOW_DOMAIN, "tiers", sm_tiers_backup);
m_sourceflow = false;
_setMainBg();
}

View File

@ -330,6 +330,8 @@ bool CMenu::_Source()
curPage = stoi(sm_numbers[sm_numbers.size() - 1]) / 12 + 1;
numPages = (m_max_source_btn / 12) + 1;
channels_type = m_cfg.getInt(CHANNEL_DOMAIN, "channels_type", CHANNELS_REAL);
sm_numbers_backup = m_cfg.getString(SOURCEFLOW_DOMAIN, "numbers");//backup for possible restore later
sm_tiers_backup = m_cfg.getString(SOURCEFLOW_DOMAIN, "tiers");
SetupInput();
_showSource();
@ -341,12 +343,20 @@ bool CMenu::_Source()
if(BTN_HOME_PRESSED || BTN_B_PRESSED)
{
if(!_srcTierBack(BTN_HOME_PRESSED))
{
m_cfg.setString(SOURCEFLOW_DOMAIN, "numbers", sm_numbers_backup);// restore if no source chosen
m_cfg.setString(SOURCEFLOW_DOMAIN, "tiers", sm_tiers_backup);
break;
}
else
_updateSourceBtns();
}
if(BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnBack))
{
m_cfg.setString(SOURCEFLOW_DOMAIN, "numbers", sm_numbers_backup);// restore if no source chosen
m_cfg.setString(SOURCEFLOW_DOMAIN, "tiers", sm_tiers_backup);
break;
}
else if(BTN_UP_PRESSED)
m_btnMgr.up();
else if(BTN_DOWN_PRESSED)
@ -574,6 +584,13 @@ void CMenu::_initSourceMenu()
/* let wiiflow know source_menu.ini found and we will be using it */
m_use_source = true;
/* Source Menu on start reset tiers before buid menus */
if(m_cfg.getBool("GENERAL", "source_on_start", false))
{
m_cfg.remove(SOURCEFLOW_DOMAIN, "tiers");
m_cfg.remove(SOURCEFLOW_DOMAIN, "numbers");
}
sm_numbers.clear();
tiers.clear();
sm_numbers = m_cfg.getStrings(SOURCEFLOW_DOMAIN, "numbers");