- backgrounds for sourceflow tiers and selected sources are now working properly.

- added option to use theme subfolders for the backgrounds. put a folder named the theme in the backgrounds folders and put your images in it. these backgrounds will only load if using that theme.
This commit is contained in:
Fledge68 2019-02-04 12:08:18 -06:00
parent 8a11bc5cbc
commit ce60043630
4 changed files with 28 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -42,19 +42,29 @@ void CMenu::_hideMain(bool instant)
}
void CMenu::_setMainBg()
{
if(m_sourceflow)
_setSrcFlowBg();
else
{
string fn = m_cfg.getString("general", "main_background", "");
if(fn.length() > 0)
{
TexHandle.Cleanup(m_mainAltBg);
if(TexHandle.fromImageFile(m_mainAltBg, fmt("%s/backgrounds/%s", m_dataDir.c_str(), fn.c_str())) == TE_OK)
_setBg(m_mainAltBg, m_mainAltBg, true);
else
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", m_dataDir.c_str(), fn.c_str())) != TE_OK)
{
_setBg(m_mainBg, m_mainBgLQ);
return;
}
}
_setBg(m_mainAltBg, m_mainAltBg);
}
else
_setBg(m_mainBg, m_mainBgLQ);
}
}
void CMenu::_showMain()
{
@ -356,7 +366,6 @@ int CMenu::main(void)
}
else //show source menu
{
m_refreshGameList = _Source();
if(BTN_B_HELD)
bUsed = true;
@ -382,8 +391,6 @@ int CMenu::main(void)
{
m_sourceflow = false;
m_refreshGameList = true;
//_showMain();
//continue;
}
_showMain();
}

View File

@ -125,7 +125,6 @@ void CMenu::_sourceFlow()
}
srcDomain = m_source.nextDomain().c_str();
}
_setSrcFlowBg();
return;
}
}
@ -197,11 +196,16 @@ void CMenu::_setSrcFlowBg(void)
string fn = m_source.getString("general", "background", "");
if(fn.length() > 0)
{
TexHandle.Cleanup(sfbgimg);
if(TexHandle.fromImageFile(sfbgimg, fmt("%s/backgrounds/%s", m_sourceDir.c_str(), fn.c_str())) == TE_OK)
_setBg(sfbgimg, sfbgimg, true);
else
string themeName = m_cfg.getString("GENERAL", "theme", "default");
if(TexHandle.fromImageFile(sfbgimg, fmt("%s/backgrounds/%s/%s", m_sourceDir.c_str(), themeName.c_str(), fn.c_str())) != TE_OK)
{
if(TexHandle.fromImageFile(sfbgimg, fmt("%s/backgrounds/%s", m_sourceDir.c_str(), fn.c_str())) != TE_OK)
{
_setBg(m_mainBg, m_mainBgLQ);
return;
}
}
_setBg(sfbgimg, sfbgimg, true);
}
else
_setBg(m_mainBg, m_mainBgLQ);

View File

@ -1 +1 @@
<pd><ViewState><e p="Wiiflow\portlibs" x="false"></e><e p="Wiiflow\source\cheats" x="false"></e><e p="Wiiflow\docs" x="false"></e><e p="Wiiflow\source\fileOps" x="false"></e><e p="Wiiflow\source\gecko" x="false"></e><e p="Wiiflow\source\homebrew" x="false"></e><e p="Wiiflow\source\loader" x="false"></e><e p="Wiiflow\source\wstringEx" x="false"></e><e p="Wiiflow\source\gc" x="false"></e><e p="Wiiflow\source\list" x="false"></e><e p="Wiiflow\source\music" x="false"></e><e p="Wiiflow\source\banner" x="false"></e><e p="Wiiflow\source\config" x="false"></e><e p="Wiiflow\source\libwbfs" x="false"></e><e p="Wiiflow\source\memory" x="false"></e><e p="Wiiflow\source\sicksaxis-wrapper" x="false"></e><e p="Wiiflow\source" x="true"></e><e p="Wiiflow\source\channel" x="false"></e><e p="Wiiflow\source\hw" x="false"></e><e p="Wiiflow\source\menu" x="true"></e><e p="Wiiflow\source\network" x="false"></e><e p="Wiiflow\source\plugin" x="false"></e><e p="Wiiflow\source\unzip" x="false"></e><e p="Wiiflow\wii" x="false"></e><e p="Wiiflow\data" x="false"></e><e p="Wiiflow\resources" x="false"></e><e p="Wiiflow\scripts" x="false"></e><e p="Wiiflow\source\booter" x="false"></e><e p="Wiiflow\source\devicemounter" x="false"></e><e p="Wiiflow\source\gui" x="false"></e><e p="Wiiflow" x="true"></e></ViewState></pd>
<pd><ViewState><e p="Wiiflow\portlibs" x="false"></e><e p="Wiiflow\source\cheats" x="false"></e><e p="Wiiflow\docs" x="false"></e><e p="Wiiflow\source\fileOps" x="false"></e><e p="Wiiflow\source\gecko" x="false"></e><e p="Wiiflow\source\homebrew" x="false"></e><e p="Wiiflow\source\loader" x="false"></e><e p="Wiiflow\source\wstringEx" x="false"></e><e p="Wiiflow\source\gc" x="false"></e><e p="Wiiflow\source\list" x="false"></e><e p="Wiiflow\source\music" x="false"></e><e p="Wiiflow\source\banner" x="false"></e><e p="Wiiflow\source\config" x="false"></e><e p="Wiiflow\source\libwbfs" x="false"></e><e p="Wiiflow\source\memory" x="false"></e><e p="Wiiflow\source\sicksaxis-wrapper" x="false"></e><e p="Wiiflow\source" x="true"></e><e p="Wiiflow\source\channel" x="false"></e><e p="Wiiflow\source\hw" x="false"></e><e p="Wiiflow\source\menu" x="true"></e><e p="Wiiflow\source\network" x="false"></e><e p="Wiiflow\source\plugin" x="false"></e><e p="Wiiflow\source\unzip" x="false"></e><e p="Wiiflow\wii" x="false"></e><e p="Wiiflow\data" x="false"></e><e p="Wiiflow\resources" x="false"></e><e p="Wiiflow\scripts" x="false"></e><e p="Wiiflow\source\booter" x="false"></e><e p="Wiiflow\source\devicemounter" x="false"></e><e p="Wiiflow\source\gui" x="true"></e><e p="Wiiflow" x="true"></e></ViewState></pd>