- update for custom backgrounds. no longer add background= to source menu buttons. place backgrounds in wiiflow/backgrounds or wiiflow/backgrounds/{theme_name}. name them the same as the platform names under [PLUGINS] in platform ini. match case size. they can be png or jpg.

This commit is contained in:
Fledge68 2019-04-09 10:39:03 -05:00
parent 6236d9b93e
commit 71555c7c14
5 changed files with 42 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB

View File

@ -2699,8 +2699,6 @@ const char *CMenu::getBlankCoverPath(const dir_discHdr *element)
}
blankCoverTitle = m_platform.getString("PLUGINS", m_plugin.PluginMagicWord, "wii");
}
if(blankCoverTitle.find("multi") != string::npos && (blankCoverTitle.find("fceu") != string::npos || blankCoverTitle.find("nes") != string::npos))
blankCoverTitle = "nes";
snprintf(blankCoverPath, sizeof(blankCoverPath), "%s/blank_covers/%s.jpg", m_boxPicDir.c_str(), blankCoverTitle.c_str());
if(!fsop_FileExist(blankCoverPath))
snprintf(blankCoverPath, sizeof(blankCoverPath), "%s/blank_covers/%s.png", m_boxPicDir.c_str(), blankCoverTitle.c_str());

View File

@ -49,19 +49,55 @@ void CMenu::_setMainBg()
else
{
TexHandle.Cleanup(m_mainAltBg);
string fn = m_cfg.getString("general", "main_background", "");
string fn = "";
if(m_platform.loaded())
{
switch(m_current_view)
{
case COVERFLOW_CHANNEL:
strncpy(m_plugin.PluginMagicWord, "4E414E44", 9);
//EMUCHANNEL:
//strncpy(m_plugin.PluginMagicWord, "454E414E", 9);
break;
case COVERFLOW_HOMEBREW:
strncpy(m_plugin.PluginMagicWord, "48425257", 9);
break;
case COVERFLOW_GAMECUBE:
strncpy(m_plugin.PluginMagicWord, "4E47434D", 9);
break;
case COVERFLOW_PLUGIN:
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
{
if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i)))
{
strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8);
break;
}
}
break;
default:// wii
strncpy(m_plugin.PluginMagicWord, "4E574949", 9);
}
fn = m_platform.getString("PLUGINS", m_plugin.PluginMagicWord, "");
}
if(fn.length() > 0)
{
string themeName = m_cfg.getString("GENERAL", "theme", "default");
if(TexHandle.fromImageFile(m_mainAltBg, fmt("%s/backgrounds/%s/%s", m_dataDir.c_str(), themeName.c_str(), fn.c_str())) != TE_OK)
if(TexHandle.fromImageFile(m_mainAltBg, fmt("%s/backgrounds/%s/%s.png", m_dataDir.c_str(), themeName.c_str(), fn.c_str())) != TE_OK)
{
if(TexHandle.fromImageFile(m_mainAltBg, fmt("%s/backgrounds/%s", m_dataDir.c_str(), fn.c_str())) != TE_OK)
if(TexHandle.fromImageFile(m_mainAltBg, fmt("%s/backgrounds/%s/%s.jpg", m_dataDir.c_str(), themeName.c_str(), fn.c_str())) != TE_OK)
{
_setBg(m_mainBg, m_mainBgLQ);
return;
if(TexHandle.fromImageFile(m_mainAltBg, fmt("%s/backgrounds/%s.png", m_dataDir.c_str(), fn.c_str())) != TE_OK)
{
if(TexHandle.fromImageFile(m_mainAltBg, fmt("%s/backgrounds/%s.jpg", m_dataDir.c_str(), fn.c_str())) != TE_OK)
{
_setBg(m_mainBg, m_mainBgLQ);
return;
}
}
}
}
_setBg(m_mainAltBg, m_mainAltBg);
_setBg(m_mainAltBg, m_mainAltBg, true);
}
else
_setBg(m_mainBg, m_mainBgLQ);
@ -439,7 +475,6 @@ int CMenu::main(void)
m_source_cnt = 1;
m_cfg.setUInt("GENERAL", "sources", m_current_view);
m_catStartPage = 1;
m_cfg.remove("GENERAL", "main_background");
_setMainBg();
_showCF(true);
}

View File

@ -174,7 +174,6 @@ void CMenu::_PluginSettings()
m_cfg.setUInt("GENERAL", "sources", m_current_view);
m_source_cnt = 1;
m_catStartPage = 1;
m_cfg.remove("GENERAL", "main_background");
int channels_type = 0;
if(m_cfg.getBool(PLUGIN_ENABLED, "454E414E"))
channels_type |= CHANNELS_EMU;

View File

@ -703,7 +703,6 @@ bool CMenu::_Source()
void CMenu::_setSrcOptions(void)
{
m_cfg.setString("GENERAL", "main_background", m_source.getString(btn_selected, "background", ""));
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
u8 category = m_source.getInt(btn_selected, "category", 0);
if(category > 0)