diff --git a/out/boot.dol b/out/boot.dol index 07999c6f..5954a2a7 100644 Binary files a/out/boot.dol and b/out/boot.dol differ diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 17930766..8b6fe596 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -2163,23 +2163,61 @@ void CMenu::_initCF(void) else if(m_current_view == COVERFLOW_PLUGIN) { m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount); - if(enabledPluginsCount == 1 && m_cfg.getBool(PLUGIN_ENABLED, "48425257"))// homebrew plugin + if(enabledPluginsCount == 1)// only one plugin enabled { - CoverFlow.setBoxMode(m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode", true)); - CoverFlow.setSmallBoxMode(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", false)); + if(m_cfg.getBool(PLUGIN_ENABLED, "48425257"))// homebrew plugin + { + CoverFlow.setBoxMode(m_cfg.getBool(HOMEBREW_DOMAIN, "box_mode", true)); + CoverFlow.setSmallBoxMode(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", false)); + } + else + { + s8 bm = -1; + for(u8 i = 0; m_plugin.PluginExist(i); ++i)// get plugins box mode value + { + if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i))) + { + bm = m_plugin.GetBoxMode(i); + break; + } + } + if(bm < 0)// if negative then use default setting + CoverFlow.setBoxMode(m_cfg.getBool("GENERAL", "box_mode", true)); + else + CoverFlow.setBoxMode(bm == 0 ? false : true); + CoverFlow.setSmallBoxMode(false); + } } - else + else // more than 1 plugin enabled { - int boxmode_cnt = 0; - for(u8 i = 0; m_plugin.PluginExist(i); ++i) + s8 bm1 = -1; + s8 bm2 = -1; + u8 i; + for(i = 0; m_plugin.PluginExist(i); ++i)// get first enabled plugins box mode { if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i))) { - if(m_plugin.GetBoxMode(i)) - boxmode_cnt++; + bm1 = m_plugin.GetBoxMode(i); + if(bm1 < 0) + bm1 = m_cfg.getBool("GENERAL", "box_mode", true); + break; } } - CoverFlow.setBoxMode(boxmode_cnt > 0); + for(i = 0; m_plugin.PluginExist(i); ++i)// check all other enabled are the same + { + if(m_plugin.GetEnableStatus(m_cfg, m_plugin.getPluginMagic(i))) + { + bm2 = m_plugin.GetBoxMode(i); + if(bm2 < 0) + bm2 = m_cfg.getBool("GENERAL", "box_mode", true); + if(bm2 != bm1) + break; + } + } + if(m_plugin.PluginExist(i))// broke out of loop because not all the same so use default + CoverFlow.setBoxMode(m_cfg.getBool("GENERAL", "box_mode", true)); + else // made it thru loop so they all match + CoverFlow.setBoxMode(bm1 == 0 ? false : true); CoverFlow.setSmallBoxMode(false); } } diff --git a/source/plugin/plugin.cpp b/source/plugin/plugin.cpp index c14f9d2c..6f5066a6 100644 --- a/source/plugin/plugin.cpp +++ b/source/plugin/plugin.cpp @@ -78,7 +78,7 @@ bool Plugin::AddPlugin(Config &plugin) NewPlugin.romDir = plugin.getString(PLUGIN, "romDir"); NewPlugin.fileTypes = plugin.getString(PLUGIN, "fileTypes"); NewPlugin.Args = plugin.getStrings(PLUGIN, "arguments", '|'); - NewPlugin.boxMode = plugin.getBool(PLUGIN, "boxmode", 1); + NewPlugin.boxMode = plugin.getInt(PLUGIN, "boxmode", -1); string PluginName = plugin.getString(PLUGIN, "displayname"); if(PluginName.size() < 2) { @@ -163,7 +163,7 @@ u32 Plugin::GetCaseColor(u8 pos) return Plugins[pos].caseColor; } -bool Plugin::GetBoxMode(u8 pos) +s8 Plugin::GetBoxMode(u8 pos) { return Plugins[pos].boxMode; } @@ -308,12 +308,11 @@ string Plugin::GetRomName(const dir_discHdr *gameHeader) else { // ScummVM - char title[1024]; + char title[64]; wcstombs(title, gameHeader->title, 63); + title[63] = '\0'; string FullName = title; - if(FullName.empty()) - return NULL; string ShortName = FullName.substr(0, FullName.find(" (")).substr(0, FullName.find(" [")); return ShortName; diff --git a/source/plugin/plugin.hpp b/source/plugin/plugin.hpp index 60845a2a..58a7a55d 100644 --- a/source/plugin/plugin.hpp +++ b/source/plugin/plugin.hpp @@ -53,7 +53,7 @@ struct PluginOptions u32 BannerSoundSize; vector Args; wstringEx DisplayName; - bool boxMode; + s8 boxMode; }; class Plugin @@ -72,7 +72,7 @@ public: wstringEx GetPluginName(u8 pos); u32 getPluginMagic(u8 pos); s8 GetPluginPosition(u32 magic); - bool GetBoxMode(u8 pos); + s8 GetBoxMode(u8 pos); void init(const string& m_pluginsDir); bool AddPlugin(Config &plugin);