- fixed issues #37 and #38 to prevent a crash if you don't have a source_menu.init

- now each plugin can remember the last game selected unless you select multiple plugins at once.
This commit is contained in:
Fledge68 2018-12-01 18:39:33 -06:00
parent bfdde07fc1
commit 3d774c105c
7 changed files with 57 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -2174,11 +2174,38 @@ void CMenu::_initCF(void)
if(!CoverFlow.empty())
{
bool path = false;
if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW ||
(m_source_cnt > 1 && m_cfg.getInt("MULTI", "current_item_type", TYPE_PLUGIN) == TYPE_PLUGIN) ||
(m_source_cnt == 1 && m_current_view == COVERFLOW_PLUGIN && m_cfg.getInt(PLUGIN_DOMAIN, "current_item_type", TYPE_PLUGIN) == TYPE_PLUGIN))
char cur_item[64];
cur_item[63] = '\0';
if(m_current_view == COVERFLOW_PLUGIN)
{
strncpy(m_plugin.PluginMagicWord, m_cfg.getString(PLUGIN_DOMAIN, "cur_magic").c_str(), 8);
if(!m_cfg.getBool("PLUGINS_ENABLED", m_plugin.PluginMagicWord, false))
{
for(u8 i = 0; m_plugin.PluginExist(i); ++i)
{
if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i)))// sets m_plugin.PluginMagicWord
{
m_cfg.setString(PLUGIN_DOMAIN, "cur_magic", m_plugin.PluginMagicWord);
break;
}
}
}
path = true;
if(!CoverFlow.findId(m_cfg.getString(_domainFromView(), "current_item").c_str(), true, path))
if(strncasecmp(m_plugin.PluginMagicWord, "4E47434D", 8) == 0)//NGCM
path = false;
if(strncasecmp(m_plugin.PluginMagicWord, "4E574949", 8) == 0)//NWII
path = false;
if(strncasecmp(m_plugin.PluginMagicWord, "4E414E44", 8) == 0)//NAND
path = false;
strncpy(cur_item, m_cfg.getString("plugin_item", m_plugin.PluginMagicWord).c_str(), 63);
}
else
{
if(m_sourceflow || m_current_view == COVERFLOW_HOMEBREW || (m_source_cnt > 1 && m_cfg.getInt("MULTI", "current_item_type", TYPE_PLUGIN) == TYPE_PLUGIN))
path = true;
strncpy(cur_item, m_cfg.getString(_domainFromView(), "current_item").c_str(), 63);
}
if(!CoverFlow.findId(cur_item, true, path))
CoverFlow.defaultLoad();
CoverFlow.startCoverLoader();
}

View File

@ -25,7 +25,6 @@ void CMenu::error(const wstringEx &msg)
_hideCategorySettings();
_hideGameInfo();
_hideGameSettings();
_hideSource();
_hideWaitMessage();
m_btnMgr.setText(m_errorLblMessage, msg, true);
_showError();

View File

@ -264,11 +264,28 @@ void CMenu::_extractBnr(const dir_discHdr *hdr)
void CMenu::_setCurrentItem(const dir_discHdr *hdr)
{
const char *title = CoverFlow.getFilenameId(hdr, true);// with extension
m_cfg.setString(_domainFromView(), "current_item", title);
if(m_current_view == COVERFLOW_PLUGIN && m_source_cnt == 1)
m_cfg.setInt(PLUGIN_DOMAIN, "current_item_type", hdr->type);
if(m_source_cnt > 1)
m_cfg.setInt("MULTI", "current_item_type", hdr->type);
if(m_current_view == COVERFLOW_PLUGIN)
{
if(hdr->type == TYPE_PLUGIN)
strncpy(m_plugin.PluginMagicWord, fmt("%08x", hdr->settings[0]), 8);
else
{
if(hdr->type == TYPE_WII_GAME)
strncpy(m_plugin.PluginMagicWord, "4E574949", 9);
else if(hdr->type == TYPE_GC_GAME)
strncpy(m_plugin.PluginMagicWord, "4E47434D", 9);
else
strncpy(m_plugin.PluginMagicWord, "4E414E44", 9);
}
m_cfg.setString(PLUGIN_DOMAIN, "cur_magic", m_plugin.PluginMagicWord);
m_cfg.setString("plugin_item", m_plugin.PluginMagicWord, title);
}
else
{
m_cfg.setString(_domainFromView(), "current_item", title);
if(m_source_cnt > 1)
m_cfg.setInt("MULTI", "current_item_type", hdr->type);
}
}
void CMenu::_hideGame(bool instant)

View File

@ -472,6 +472,7 @@ bool CMenu::_Source()
{
if(m_locked && m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false))
{
_hideSource();
error(_t("errsource1", L"Homebrew locked!"));
exitSource = false;
_showSource();
@ -565,6 +566,7 @@ bool CMenu::_Source()
m_current_view ^= COVERFLOW_CHANNEL;
else if(source == "homebrew")
{
_hideSource();
error(_t("errsource2", L"Homebrew in multisource not allowed!"));
updateSource = false;
_showSource();

File diff suppressed because one or more lines are too long

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="true"></e><e p="Wiiflow\source\wstringEx" x="false"></e><e p="Wiiflow\source\gc" x="false"></e><e p="Wiiflow\source\list" x="true"></e><e p="Wiiflow\source\music" x="false"></e><e p="Wiiflow\source\banner" x="false"></e><e p="Wiiflow\source\config" x="true"></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>
<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="true"></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>