v5.4.7 beta 4

- added wiiflow/covers/homebrew_small folder so when using homebrew smallbox mode you can use your own custom covers instead of the apps icon.png
- fixed music resample to 48k option on main settings to not crash wiiflow if only one song file in wiiflow music folder.
- fixed displaying music title when you only have one music file in wiiflow music folder.
- fixed saving and loading enabled plugins upon exit and startup. This stops the "no plugins selected" message upon returning to wiiflow when you previously used the Select Plugin Menu.
- fixed custom backgrounds after using the Select Plugin Menu.
- fixed the Source Menu to display source buttons properly when switching tiers or pages.
- fixed refreshing Source Menu buttons after using the options menu to hide them.
This commit is contained in:
Fledge68 2020-08-31 18:23:52 -05:00
parent e0445a0cc0
commit 9a8a752e6f
13 changed files with 92 additions and 28 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 MiB

After

Width:  |  Height:  |  Size: 4.1 MiB

View File

@ -1,6 +1,6 @@
#define APP_NAME "WiiFlow WFL" #define APP_NAME "WiiFlow WFL"
#define APP_VERSION "5.4.7 beta 1" #define APP_VERSION "5.4.7 beta 4"
#define APP_DATA_DIR "wiiflow" #define APP_DATA_DIR "wiiflow"
#define APPS_DIR "apps/wiiflow" #define APPS_DIR "apps/wiiflow"

View File

@ -339,8 +339,8 @@ bool CMenu::init(bool usb_mounted)
{ {
enabledPluginsCount++; enabledPluginsCount++;
m_plugin.SetEnablePlugin(pos, 2); m_plugin.SetEnablePlugin(pos, 2);
if(i == 0) if(enabledPluginsCount == 1)
enabledMagics = magics[0]; enabledMagics = magics[i];
else else
enabledMagics.append(',' + magics[i]); enabledMagics.append(',' + magics[i]);
} }
@ -2826,7 +2826,7 @@ const char *CMenu::getBoxPath(const dir_discHdr *element)
else else
return fmt("%s/%s.png", m_boxPicDir.c_str(), tempname); return fmt("%s/%s.png", m_boxPicDir.c_str(), tempname);
} }
else if(element->type == TYPE_HOMEBREW) else if(element->type == TYPE_HOMEBREW)// use folder name for the png name
return fmt("%s/homebrew/%s.png", m_boxPicDir.c_str(), strrchr(element->path, '/') + 1); return fmt("%s/homebrew/%s.png", m_boxPicDir.c_str(), strrchr(element->path, '/') + 1);
else if(element->type == TYPE_SOURCE)//sourceflow else if(element->type == TYPE_SOURCE)//sourceflow
{ {
@ -2854,7 +2854,13 @@ const char *CMenu::getFrontPath(const dir_discHdr *element)
else if(element->type == TYPE_HOMEBREW) else if(element->type == TYPE_HOMEBREW)
{ {
if(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox")) if(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox"))
return fmt("%s/icon.png", element->path); {
const char *coverPath = fmt("%s/homebrew_small/%s.png", m_picDir.c_str(), strrchr(element->path, '/') + 1);
if(!fsop_FileExist(coverPath))
return fmt("%s/icon.png", element->path);
else
return coverPath;
}
else else
return fmt("%s/homebrew/%s.png", m_picDir.c_str(), strrchr(element->path, '/') + 1); return fmt("%s/homebrew/%s.png", m_picDir.c_str(), strrchr(element->path, '/') + 1);
} }

View File

@ -246,8 +246,7 @@ int CMenu::_config7(int curPage)
m_cfg.setBool("general", "resample_to_48khz", val); m_cfg.setBool("general", "resample_to_48khz", val);
m_btnMgr.setText(m_config7Btn1, val ? _t("yes", L"Yes") : _t("no", L"No")); m_btnMgr.setText(m_config7Btn1, val ? _t("yes", L"Yes") : _t("no", L"No"));
MusicPlayer.SetResampleSetting(val); MusicPlayer.SetResampleSetting(val);
MusicPlayer.Stop(); MusicPlayer.ReLoadCurrentFile();
MusicPlayer.LoadCurrentFile();
} }
else if(m_btnMgr.selected(m_config7Btn2)) else if(m_btnMgr.selected(m_config7Btn2))
{ {

View File

@ -198,7 +198,10 @@ void CMenu::_launchPlugin(dir_discHdr *hdr)
if(strstr(hdr->path, ".pls") == NULL && strstr(hdr->path, ".m3u") == NULL) if(strstr(hdr->path, ".pls") == NULL && strstr(hdr->path, ".m3u") == NULL)
MusicPlayer.LoadFile(hdr->path, false); MusicPlayer.LoadFile(hdr->path, false);
else else
{
m_music_info = m_cfg.getBool("GENERAL", "display_music_info", false);
MusicPlayer.InitPlaylist(m_cfg, hdr->path, currentPartition);// maybe error msg if trouble loading playlist MusicPlayer.InitPlaylist(m_cfg, hdr->path, currentPartition);// maybe error msg if trouble loading playlist
}
return; return;
} }

View File

@ -504,6 +504,8 @@ int CMenu::main(void)
show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false); show_plugin = !m_cfg.getBool(PLUGIN_DOMAIN, "disable", false);
show_gamecube = !m_cfg.getBool(GC_DOMAIN, "disable", false); show_gamecube = !m_cfg.getBool(GC_DOMAIN, "disable", false);
show_homebrew = !m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false); show_homebrew = !m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false);
if(m_refreshGameList)
_getCustomBgTex();
_showMain(); _showMain();
} }
} }

View File

@ -237,7 +237,7 @@ void CMenu::_Paths(void)
m_cfg.setString("GENERAL", "dir_music", path); m_cfg.setString("GENERAL", "dir_music", path);
m_musicDir = path; m_musicDir = path;
MusicPlayer.Init(m_cfg, m_musicDir, fmt("%s/music", m_themeDataDir.c_str())); MusicPlayer.Init(m_cfg, m_musicDir, fmt("%s/music", m_themeDataDir.c_str()));
m_music_info = m_cfg.getBool("GENERAL", "display_music_info", false);
} }
_showPaths(); _showPaths();
} }

View File

@ -165,16 +165,25 @@ void CMenu::_PluginSettings()
} }
} }
_hidePluginSettings(); _hidePluginSettings();
int channels_type = 0;
string enabledMagics; string enabledMagics;
enabledPluginsCount = 0;
for(u8 i = 0; m_plugin.PluginExist(i); i++) for(u8 i = 0; m_plugin.PluginExist(i); i++)
{ {
if(m_plugin.GetEnabledStatus(i)) if(m_plugin.GetEnabledStatus(i))
{ {
enabledPluginsCount++;
string magic = sfmt("%08x", m_plugin.GetPluginMagic(i)); string magic = sfmt("%08x", m_plugin.GetPluginMagic(i));
if(i == 0) if(enabledPluginsCount == 1)
enabledMagics = magic; enabledMagics = magic;
else else
enabledMagics.append(',' + magic); enabledMagics.append(',' + magic);
if(magic == "454e414e")
channels_type |= CHANNELS_EMU;
else if(magic == "4e414e44")
channels_type |= CHANNELS_REAL;
} }
} }
m_cfg.setString(PLUGIN_DOMAIN, "enabled_plugins", enabledMagics); m_cfg.setString(PLUGIN_DOMAIN, "enabled_plugins", enabledMagics);
@ -184,11 +193,6 @@ void CMenu::_PluginSettings()
m_cfg.setUInt("GENERAL", "sources", m_current_view); m_cfg.setUInt("GENERAL", "sources", m_current_view);
m_source_cnt = 1; m_source_cnt = 1;
m_catStartPage = 1; m_catStartPage = 1;
int channels_type = 0;
if(m_cfg.getBool(PLUGIN_ENABLED, "454E414E"))
channels_type |= CHANNELS_EMU;
if(m_cfg.getBool(PLUGIN_ENABLED, "4E414E44"))
channels_type |= CHANNELS_REAL;
m_cfg.setInt(CHANNEL_DOMAIN, "channels_type", channels_type); m_cfg.setInt(CHANNEL_DOMAIN, "channels_type", channels_type);
} }
else else

View File

@ -295,6 +295,8 @@ void CMenu::_checkboxesMenu(u8 md)
plugin_ok = false; plugin_ok = false;
else if(strncasecmp(m_plugin.PluginMagicWord, "454E414E", 8) == 0)//ENAN else if(strncasecmp(m_plugin.PluginMagicWord, "454E414E", 8) == 0)//ENAN
plugin_ok = false; plugin_ok = false;
else if(strncasecmp(m_plugin.PluginMagicWord, "5343564D", 8) == 0)//scummvm
plugin_ok = false;
if(!plugin_ok) if(!plugin_ok)
{ {

View File

@ -85,8 +85,8 @@ void CMenu::_sourceFlow()
{ {
enabledPluginsCount++; enabledPluginsCount++;
m_plugin.SetEnablePlugin(pos, 2); m_plugin.SetEnablePlugin(pos, 2);
if(i == 0) if(enabledPluginsCount == 1)
enabledMagics = magicNums[0]; enabledMagics = magicNums[i];
else else
enabledMagics.append(',' + magicNums[i]); enabledMagics.append(',' + magicNums[i]);
} }
@ -187,16 +187,20 @@ void CMenu::_srcTierLoad(string fn)
{ {
m_source.unload(); m_source.unload();
m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn.c_str())); m_source.load(fmt("%s/%s", m_sourceDir.c_str(), fn.c_str()));
fn.replace(fn.find("."), 4, "_flow"); fn.replace(fn.find("."), 4, "_flow");
if(m_source.has("general", "flow")) if(m_source.has("general", "flow"))
curflow = m_source.getInt("general", "flow", 1); curflow = m_source.getInt("general", "flow", 1);
else else
curflow = m_cfg.getInt(SOURCEFLOW_DOMAIN, fn, m_cfg.getInt(SOURCEFLOW_DOMAIN, "last_cf_mode", 1)); curflow = m_cfg.getInt(SOURCEFLOW_DOMAIN, fn, m_cfg.getInt(SOURCEFLOW_DOMAIN, "last_cf_mode", 1));
if(m_source.has("general", "box_mode")) if(m_source.has("general", "box_mode"))
m_cfg.setBool(SOURCEFLOW_DOMAIN, "box_mode", m_source.getBool("general", "box_mode", true)); m_cfg.setBool(SOURCEFLOW_DOMAIN, "box_mode", m_source.getBool("general", "box_mode", true));
if(m_source.has("general", "smallbox")) if(m_source.has("general", "smallbox"))
m_cfg.setBool(SOURCEFLOW_DOMAIN, "smallbox", m_source.getBool("general", "smallbox", false)); m_cfg.setBool(SOURCEFLOW_DOMAIN, "smallbox", m_source.getBool("general", "smallbox", false));
SF_cacheCovers = true; SF_cacheCovers = true;
/* get max source button # */ /* get max source button # */
m_max_source_btn = 0; m_max_source_btn = 0;
const char *srcDomain = m_source.firstDomain().c_str(); const char *srcDomain = m_source.firstDomain().c_str();
@ -212,6 +216,7 @@ void CMenu::_srcTierLoad(string fn)
} }
srcDomain = m_source.nextDomain().c_str(); srcDomain = m_source.nextDomain().c_str();
} }
if(!m_sourceflow) if(!m_sourceflow)
{ {
nonHiddenSources.clear(); nonHiddenSources.clear();
@ -323,14 +328,14 @@ void CMenu::_updateSourceBtns(void)
} }
j = (curPage - 1) * 12; j = (curPage - 1) * 12;
for(i = j; i < (j + 12); ++i) for(i = 0; i < 12; ++i)
{ {
if(i >= nonHiddenSources.size()) if((i + j) >= nonHiddenSources.size())
m_btnMgr.hide(m_sourceBtnSource[i -j]); m_btnMgr.hide(m_sourceBtnSource[i]);
else else
{ {
memset(current_btn, 0, 16); memset(current_btn, 0, 16);
strncpy(current_btn, fmt("BUTTON_%i", nonHiddenSources[i]), 15); strncpy(current_btn, fmt("BUTTON_%i", nonHiddenSources[i + j]), 15);
string btnSource = m_source.getString(current_btn, "source", ""); string btnSource = m_source.getString(current_btn, "source", "");
if(btnSource == "") if(btnSource == "")
continue; continue;
@ -353,8 +358,8 @@ void CMenu::_updateSourceBtns(void)
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s", m_sourceDir.c_str(), btn_image_s)) != TE_OK) if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s", m_sourceDir.c_str(), btn_image_s)) != TE_OK)
TexHandle.fromImageFile(texConsoleImgs, fmt("%s/favoritesons.png", m_imgsDir.c_str())); TexHandle.fromImageFile(texConsoleImgs, fmt("%s/favoritesons.png", m_imgsDir.c_str()));
} }
m_btnMgr.setBtnTexture(m_sourceBtnSource[i - j], texConsoleImg, texConsoleImgs); m_btnMgr.setBtnTexture(m_sourceBtnSource[i], texConsoleImg, texConsoleImgs);
m_btnMgr.show(m_sourceBtnSource[i - j]); m_btnMgr.show(m_sourceBtnSource[i]);
} }
} }
} }
@ -389,6 +394,23 @@ bool CMenu::_Source()
{ {
_hideSource(); _hideSource();
_SM_Editor(); _SM_Editor();
nonHiddenSources.clear();
for(i = 0; i <= m_max_source_btn; i++)
{
if(!m_source.getBool(sfmt("BUTTON_%i", i), "hidden", false))
nonHiddenSources.push_back(i);
}
u8 num = stoi(sm_numbers[sm_numbers.size() - 1]);
curPage = 1;
for(i = 0; i < nonHiddenSources.size(); i++)
{
if(nonHiddenSources[i] == num)
{
curPage = i / 12 + 1;
break;
}
}
numPages = (nonHiddenSources.size() / 12) + 1;
_showSource(); _showSource();
_updateSourceBtns(); _updateSourceBtns();
} }
@ -427,7 +449,7 @@ bool CMenu::_Source()
if(m_btnMgr.selected(m_sourceBtnSource[i])) if(m_btnMgr.selected(m_sourceBtnSource[i]))
{ {
memset(btn_selected, 0, 16); memset(btn_selected, 0, 16);
strncpy(btn_selected, fmt("BUTTON_%i", i + j), 15); strncpy(btn_selected, fmt("BUTTON_%i", nonHiddenSources[i + j]), 15);
source = m_source.getString(btn_selected, "source", ""); source = m_source.getString(btn_selected, "source", "");
break; break;
} }
@ -474,8 +496,8 @@ bool CMenu::_Source()
{ {
enabledPluginsCount++; enabledPluginsCount++;
m_plugin.SetEnablePlugin(pos, 2); m_plugin.SetEnablePlugin(pos, 2);
if(i == 0) if(enabledPluginsCount == 1)
enabledMagics = magicNums[0]; enabledMagics = magicNums[i];
else else
enabledMagics.append(',' + magicNums[i]); enabledMagics.append(',' + magicNums[i]);
} }
@ -532,8 +554,23 @@ bool CMenu::_Source()
} }
srcDomain = m_source.nextDomain().c_str(); srcDomain = m_source.nextDomain().c_str();
} }
curPage = stoi(sm_numbers[sm_numbers.size() - 1]) / 12 + 1; nonHiddenSources.clear();
numPages = (m_max_source_btn / 12) + 1; for(i = 0; i <= m_max_source_btn; i++)
{
if(!m_source.getBool(sfmt("BUTTON_%i", i), "hidden", false))
nonHiddenSources.push_back(i);
}
u8 num = stoi(sm_numbers[sm_numbers.size() - 1]);
curPage = 1;
for(i = 0; i < nonHiddenSources.size(); i++)
{
if(nonHiddenSources[i] == num)
{
curPage = i / 12 + 1;
break;
}
}
numPages = (nonHiddenSources.size() / 12) + 1;
_updateSourceBtns(); _updateSourceBtns();
} }
} }

View File

@ -58,8 +58,8 @@ void Musicplayer::Init(Config &cfg, const string& musicDir, const string& themeM
FadeRate = cfg.getInt("GENERAL", "music_fade_rate", 8); FadeRate = cfg.getInt("GENERAL", "music_fade_rate", 8);
Volume = cfg.getInt("GENERAL", "sound_volume_music", 255); Volume = cfg.getInt("GENERAL", "sound_volume_music", 255);
SetVolume(0);
MusicFile.SetVoice(0); MusicFile.SetVoice(0);
SetVolume(0);
vector<string> Types = stringToVector(".mp3|.ogg", '|'); vector<string> Types = stringToVector(".mp3|.ogg", '|');
GetFiles(musicDir.c_str(), Types, FileNameAdder, false, MUSIC_DEPTH); GetFiles(musicDir.c_str(), Types, FileNameAdder, false, MUSIC_DEPTH);
@ -237,6 +237,16 @@ void Musicplayer::LoadFile(const char *name, bool display_change)
MusicChanged = display_change; MusicChanged = display_change;
} }
void Musicplayer::ReLoadCurrentFile()
{
char curFile[1024];
strcpy(curFile, MusicFile.GetName());
if(strlen(curFile) == 0)
return;
Stop();
LoadFile(curFile, false);
}
/* For our GUI */ /* For our GUI */
wstringEx Musicplayer::GetFileName() wstringEx Musicplayer::GetFileName()
{ {

View File

@ -56,6 +56,7 @@ public:
void LoadFile(const char *name, bool display_change = true); void LoadFile(const char *name, bool display_change = true);
void LoadCurrentFile(); void LoadCurrentFile();
void ReLoadCurrentFile();
protected: protected:
bool PosFromPrevFile(); bool PosFromPrevFile();