mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-27 13:44:15 +01:00
- added sub/tier source menu's. put all source menu ini's in dev:/wiiflow/source_menu. the first one must be named source_menu.ini. the others can be whatever you want. to access another source menu ini create a source button with source=new_source and set magic=filename.ini replacing filename with the one you want.
This commit is contained in:
parent
0c0fb2c3c5
commit
ecd02f27f4
BIN
out/boot.dol
BIN
out/boot.dol
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
@ -92,6 +92,31 @@ void CMenu::_sourceFlow()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(source =="new_source")
|
||||
{
|
||||
const char *fn = m_source.getString(btn_selected, "magic", "").c_str();
|
||||
if(fsop_FileExist(fmt("%s/%s", m_sourceDir.c_str(), fn)))
|
||||
{
|
||||
m_source.unload();
|
||||
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn));
|
||||
/* 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();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else //(source == "wii")
|
||||
m_current_view = COVERFLOW_WII;
|
||||
m_sourceflow = false;
|
||||
@ -143,18 +168,26 @@ void CMenu::_updateSourceBtns(void)
|
||||
m_btnMgr.show(m_sourceBtnPageM);
|
||||
m_btnMgr.show(m_sourceBtnPageP);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_btnMgr.hide(m_sourceLblPage);
|
||||
m_btnMgr.hide(m_sourceBtnPageM);
|
||||
m_btnMgr.hide(m_sourceBtnPageP);
|
||||
}
|
||||
|
||||
j = (curPage - 1) * 12;
|
||||
sourceBtn = 0;
|
||||
selectedBtns = 0;
|
||||
for(i = 0; i < ((numPages - 1) * 12 + 12); ++i)
|
||||
j = (curPage - 1) * 12;
|
||||
for(i = j; i < (j + 12); ++i)
|
||||
{
|
||||
if(i > m_max_source_btn)
|
||||
m_btnMgr.hide(m_sourceBtnSource[i -j]);
|
||||
else
|
||||
{
|
||||
memset(current_btn, 0, 16);
|
||||
strncpy(current_btn, fmt("BUTTON_%i", i), 15);
|
||||
string btnSource = m_source.getString(current_btn, "source", "");
|
||||
bool src_selected = false;
|
||||
//const char *btn_image = m_source.getString(current_btn,"image", "").c_str();
|
||||
//const char *btn_imageSel = m_source.getString(current_btn,"image_s", "").c_str();
|
||||
if(btnSource == "")
|
||||
continue;
|
||||
if(m_multisource)
|
||||
@ -213,10 +246,6 @@ void CMenu::_updateSourceBtns(void)
|
||||
else
|
||||
snprintf(btn_image, sizeof(btn_image), "%s", m_source.getString(current_btn,"image", "").c_str());
|
||||
|
||||
if(i >= j && i < (j + 12))
|
||||
{
|
||||
//m_btnMgr.hide(m_sourceBtnSource[i - j], true);
|
||||
//m_btnMgr.tick();
|
||||
TexData texConsoleImg;
|
||||
TexData texConsoleImgs;
|
||||
if(TexHandle.fromImageFile(texConsoleImg, fmt("%s/%s/%s", m_sourceDir.c_str(), themeName, btn_image)) != TE_OK)
|
||||
@ -405,6 +434,34 @@ bool CMenu::_Source()
|
||||
if(enabledPluginsCount == 0) // no magic #'s or invalid ones so default to first plugin in list
|
||||
m_plugin.SetEnablePlugin(m_cfg, 0, 2);
|
||||
}
|
||||
else if(source =="new_source")
|
||||
{
|
||||
const char *fn = m_source.getString(btn_selected, "magic", "").c_str();
|
||||
if(fsop_FileExist(fmt("%s/%s", m_sourceDir.c_str(), fn)))
|
||||
{
|
||||
m_source.unload();
|
||||
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn));
|
||||
exitSource = false;
|
||||
updateSource = true;
|
||||
curPage = 1;
|
||||
/* 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();
|
||||
}
|
||||
numPages = (m_max_source_btn / 12) + 1;
|
||||
}
|
||||
}
|
||||
else //if(source == "wii") or source is invalid or empty default to wii
|
||||
{
|
||||
m_current_view = COVERFLOW_WII;
|
||||
@ -458,6 +515,34 @@ bool CMenu::_Source()
|
||||
m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
|
||||
m_current_view = enabledPluginsCount > 0 ? (m_current_view | COVERFLOW_PLUGIN) : (m_current_view & ~COVERFLOW_PLUGIN);
|
||||
}
|
||||
else if(source =="new_source")
|
||||
{
|
||||
const char *fn = m_source.getString(btn_selected, "magic", "").c_str();
|
||||
if(fsop_FileExist(fmt("%s/%s", m_sourceDir.c_str(), fn)))
|
||||
{
|
||||
m_source.unload();
|
||||
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn));
|
||||
exitSource = false;
|
||||
updateSource = true;
|
||||
curPage = 1;
|
||||
/* 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();
|
||||
}
|
||||
numPages = (m_max_source_btn / 12) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(exitSource)
|
||||
|
Loading…
Reference in New Issue
Block a user