- PHASE 2 (finally!)

- New Coverflow theme format. no more emuflow, coverflow, brewflow. now we have coverflow, shortflow, sideflow, and smallflow.
- coverflow is the normal coverflow.
- shortflow is automatically used for plugins if all selected plugins require a short CD style cover such as GB, GBC, GBA, and playstation. if there's more let me know and i can add them.
- sideflow is automatically used for plugins if all selected plugins require a cover on its side such as SNES and Nintendo 64.
- smallflow is used if smallbox is set for homebrew and sourceflow.
- no more need for emuflow= with a source btn in the source menu. it is done automatically now using the plugins magic#
- each flow has its own number of modes/layouts. so now coveflow can have 8, smallfow 1, sideflow, 6, and shortflow 4 or whatever you want.
- adjust coverflow works with no problems. just choose the view first before entering the adjust coverflow menu.
- other minor code changes here and there.
- remember themes are now in themes_lite and the coverflow part is seperated and put in the coverflows folder with the same name as the theme or you can use a default coverflow named default.ini for all themes.
This commit is contained in:
fledge68 2016-05-11 17:58:36 +00:00
parent 0c5f06972c
commit 6b1aab7c2d
19 changed files with 493 additions and 537 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

After

Width:  |  Height:  |  Size: 3.1 MiB

View File

@ -1140,7 +1140,7 @@ Vector3D CCoverFlow::_cameraMoves(void)
cos(tick * lo.cameraOscSpeed.z) * lo.cameraOscAmp.z); cos(tick * lo.cameraOscSpeed.z) * lo.cameraOscAmp.z);
} }
Vector3D CCoverFlow::_coverMovesA(void) Vector3D CCoverFlow::_coverMovesA(void)//angle
{ {
SLayout &lo = m_selected ? m_loSelected : m_loNormal; SLayout &lo = m_selected ? m_loSelected : m_loNormal;
float tick = (float)m_tickCount * 0.005f; float tick = (float)m_tickCount * 0.005f;
@ -1149,7 +1149,7 @@ Vector3D CCoverFlow::_coverMovesA(void)
cos(tick * lo.coverOscASpeed.z) * lo.coverOscAAmp.z); cos(tick * lo.coverOscASpeed.z) * lo.coverOscAAmp.z);
} }
Vector3D CCoverFlow::_coverMovesP(void) Vector3D CCoverFlow::_coverMovesP(void)//position
{ {
SLayout &lo = m_selected ? m_loSelected : m_loNormal; SLayout &lo = m_selected ? m_loSelected : m_loNormal;
float tick = (float)m_tickCount * 0.005f; float tick = (float)m_tickCount * 0.005f;

View File

@ -34,7 +34,7 @@ bool CFanart::load(Config &m_globalConfig, const char *path, const char *id)
{ {
bool retval = false; bool retval = false;
if(!m_globalConfig.getBool("FANART", "enable_fanart", true)) if(!m_globalConfig.getBool("FANART", "enable_fanart", false))
return retval; return retval;
unload(); unload();

View File

@ -258,7 +258,6 @@ void CMenu::init()
m_languagesDir = m_cfg.getString("GENERAL", "dir_languages", fmt("%s/languages", m_dataDir.c_str())); m_languagesDir = m_cfg.getString("GENERAL", "dir_languages", fmt("%s/languages", m_dataDir.c_str()));
m_boxPicDir = m_cfg.getString("GENERAL", "dir_box_covers", fmt("%s/boxcovers", m_dataDir.c_str())); m_boxPicDir = m_cfg.getString("GENERAL", "dir_box_covers", fmt("%s/boxcovers", m_dataDir.c_str()));
m_picDir = m_cfg.getString("GENERAL", "dir_flat_covers", fmt("%s/covers", m_dataDir.c_str())); m_picDir = m_cfg.getString("GENERAL", "dir_flat_covers", fmt("%s/covers", m_dataDir.c_str()));
//m_themeDir = m_cfg.getString("GENERAL", "dir_themes", fmt("%s/themes", m_dataDir.c_str()));
m_themeDir = m_cfg.getString("GENERAL", "dir_themes_lite", fmt("%s/themes_lite", m_dataDir.c_str())); m_themeDir = m_cfg.getString("GENERAL", "dir_themes_lite", fmt("%s/themes_lite", m_dataDir.c_str()));
m_musicDir = m_cfg.getString("GENERAL", "dir_music", fmt("%s/music", m_dataDir.c_str())); m_musicDir = m_cfg.getString("GENERAL", "dir_music", fmt("%s/music", m_dataDir.c_str()));
m_videoDir = m_cfg.getString("GENERAL", "dir_trailers", fmt("%s/trailers", m_dataDir.c_str())); m_videoDir = m_cfg.getString("GENERAL", "dir_trailers", fmt("%s/trailers", m_dataDir.c_str()));
@ -286,6 +285,7 @@ void CMenu::init()
fsop_MakeFolder(m_boxPicDir.c_str()); fsop_MakeFolder(m_boxPicDir.c_str());
fsop_MakeFolder(m_picDir.c_str()); fsop_MakeFolder(m_picDir.c_str());
fsop_MakeFolder(m_themeDir.c_str()); fsop_MakeFolder(m_themeDir.c_str());
fsop_MakeFolder(fmt("%s/coverflows", m_themeDir.c_str()));
fsop_MakeFolder(m_musicDir.c_str()); fsop_MakeFolder(m_musicDir.c_str());
fsop_MakeFolder(m_videoDir.c_str()); fsop_MakeFolder(m_videoDir.c_str());
fsop_MakeFolder(m_fanartDir.c_str()); fsop_MakeFolder(m_fanartDir.c_str());
@ -325,10 +325,6 @@ void CMenu::init()
m_coverflow.load(fmt("%s/coverflows/%s.ini", m_themeDir.c_str(), themeName.c_str())); m_coverflow.load(fmt("%s/coverflows/%s.ini", m_themeDir.c_str(), themeName.c_str()));
if(!m_coverflow.loaded()) if(!m_coverflow.loaded())
m_coverflow.load(fmt("%s/coverflows/default.ini", m_themeDir.c_str())); m_coverflow.load(fmt("%s/coverflows/default.ini", m_themeDir.c_str()));
/*
m_coverflow.load(fmt("%s/coverflow.ini", m_themeDataDir.c_str()));
if(!m_coverflow.loaded())
m_coverflow.load(fmt("%s/default/coverflow.ini", m_themeDir.c_str()));*/
/*Get plugin ini files if plugin view enabled*/ /*Get plugin ini files if plugin view enabled*/
if(!m_cfg.getBool(PLUGIN_DOMAIN, "disable", false)) if(!m_cfg.getBool(PLUGIN_DOMAIN, "disable", false))
@ -631,20 +627,20 @@ void CMenu::_loadCFCfg()
CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20)); CoverFlow.setBufferSize(m_cfg.getInt("GENERAL", "cover_buffer", 20));
// Coverflow Sounds // Coverflow Sounds
CoverFlow.setSounds( CoverFlow.setSounds(
new GuiSound(fmt("%s/%s", m_themeDataDir.c_str(), m_coverflow.getString(domain, "sound_flip").c_str())), new GuiSound(fmt("%s/%s", m_themeDataDir.c_str(), m_theme.getString(domain, "sound_flip").c_str())),
_sound(theme.soundSet, m_coverflow.getString(domain, "sound_hover", "").c_str(), hover_wav, hover_wav_size, "default_btn_hover", false), _sound(theme.soundSet, m_theme.getString(domain, "sound_hover", "").c_str(), hover_wav, hover_wav_size, "default_btn_hover", false),
_sound(theme.soundSet, m_coverflow.getString(domain, "sound_select", "").c_str(), click_wav, click_wav_size, "default_btn_click", false), _sound(theme.soundSet, m_theme.getString(domain, "sound_select", "").c_str(), click_wav, click_wav_size, "default_btn_click", false),
new GuiSound(fmt("%s/%s", m_themeDataDir.c_str(), m_coverflow.getString(domain, "sound_cancel").c_str())) new GuiSound(fmt("%s/%s", m_themeDataDir.c_str(), m_theme.getString(domain, "sound_cancel").c_str()))
); );
// Textures // Textures
string texLoading = fmt("%s/%s", m_themeDataDir.c_str(), m_coverflow.getString(domain, "loading_cover_box").c_str()); string texLoading = fmt("%s/%s", m_themeDataDir.c_str(), m_theme.getString(domain, "loading_cover_box").c_str());
string texNoCover = fmt("%s/%s", m_themeDataDir.c_str(), m_coverflow.getString(domain, "missing_cover_box").c_str()); string texNoCover = fmt("%s/%s", m_themeDataDir.c_str(), m_theme.getString(domain, "missing_cover_box").c_str());
string texLoadingFlat = fmt("%s/%s", m_themeDataDir.c_str(), m_coverflow.getString(domain, "loading_cover_flat").c_str()); string texLoadingFlat = fmt("%s/%s", m_themeDataDir.c_str(), m_theme.getString(domain, "loading_cover_flat").c_str());
string texNoCoverFlat = fmt("%s/%s", m_themeDataDir.c_str(), m_coverflow.getString(domain, "missing_cover_flat").c_str()); string texNoCoverFlat = fmt("%s/%s", m_themeDataDir.c_str(), m_theme.getString(domain, "missing_cover_flat").c_str());
CoverFlow.setTextures(texLoading, texLoadingFlat, texNoCover, texNoCoverFlat); CoverFlow.setTextures(texLoading, texLoadingFlat, texNoCover, texNoCoverFlat);
// Font // Font
CoverFlow.setFont(_font(domain, "font", TITLEFONT), m_coverflow.getColor(domain, "font_color", CColor(0xFFFFFFFF))); CoverFlow.setFont(_font(domain, "font", TITLEFONT), m_theme.getColor(domain, "font_color", CColor(0xFFFFFFFF)));
} }
Vector3D CMenu::_getCFV3D(const string &domain, const string &key, const Vector3D &def, bool otherScrnFmt) Vector3D CMenu::_getCFV3D(const string &domain, const string &key, const Vector3D &def, bool otherScrnFmt)
@ -700,16 +696,11 @@ float CMenu::_getCFFloat(const string &domain, const string &key, float def, boo
void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt) void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
{ {
bool homebrew = m_sourceflow || m_current_view == COVERFLOW_HOMEBREW; string domain = fmt("%s_%i", cf_domain, version);
bool smallbox = (homebrew || m_current_view == COVERFLOW_PLUGIN) && m_cfg.getBool(_domainFromView(), "smallbox", true);
string domain = ((homebrew && smallbox) ? fmt("_BREWFLOW_%i", version) : (m_current_view == COVERFLOW_PLUGIN && !m_sourceflow) ?
fmt("_EMUFLOW_%i", version) : fmt("_COVERFLOW_%i", version));
string domainSel = ((homebrew && smallbox) ? fmt("_BREWFLOW_%i_S", version) : (m_current_view == COVERFLOW_PLUGIN && !m_sourceflow) ?
fmt("_EMUFLOW_%i_S", version) : fmt("_COVERFLOW_%i_S", version));
/*string domain = fmt("%s_%i", cf_domain, version);
string domainSel = fmt("%s_%i_S", cf_domain, version); string domainSel = fmt("%s_%i_S", cf_domain, version);
bool smallflow = !strcmp(cf_domain, "_SMALLFLOW"); bool smallflow = (strcmp(cf_domain, "_SMALLFLOW") == 0);
bool shortflow = !strcmp(cf_domain, "_SHORTFLOW"); */ bool shortflow = (strcmp(cf_domain, "_SHORTFLOW") == 0);
bool sideflow = (strcmp(cf_domain, "_SIDEFLOW") == 0);
bool sf = otherScrnFmt; bool sf = otherScrnFmt;
int max_fsaa = m_coverflow.getInt(domain, "max_fsaa", 3); int max_fsaa = m_coverflow.getInt(domain, "max_fsaa", 3);
@ -719,39 +710,45 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
m_coverflow.getInt(domain, "tex_aniso", 2), m_coverflow.getInt(domain, "tex_aniso", 2),
m_coverflow.getBool(domain, "tex_edge_lod", true)); m_coverflow.getBool(domain, "tex_edge_lod", true));
CoverFlow.setRange(_getCFInt(domain, "rows", (smallbox && homebrew) ? 5 : 1, sf), _getCFInt(domain, "columns", 9, sf)); CoverFlow.setRange(_getCFInt(domain, "rows", (smallflow ? 5 : 1), sf), _getCFInt(domain, "columns", 11, sf));
CoverFlow.setCameraPos(false, CoverFlow.setCameraPos(false,
_getCFV3D(domain, "camera_pos", Vector3D(0.f, 1.5f, 5.f), sf), _getCFV3D(domain, "camera_pos", Vector3D(0.f, 0.f, 5.f), sf),
_getCFV3D(domain, "camera_aim", Vector3D(0.f, 0.f, -1.f), sf)); _getCFV3D(domain, "camera_aim", Vector3D(0.f, 0.f, 0.f), sf));
CoverFlow.setCameraPos(true, CoverFlow.setCameraPos(true,
_getCFV3D(domainSel, "camera_pos", Vector3D(0.f, 1.5f, 5.f), sf), _getCFV3D(domainSel, "camera_pos", Vector3D(0.f, 0.f, 5.f), sf),
_getCFV3D(domainSel, "camera_aim", Vector3D(0.f, 0.f, -1.f), sf)); _getCFV3D(domainSel, "camera_aim", Vector3D(0.f, 0.f, 0.f), sf));
CoverFlow.setCameraOsc(false, CoverFlow.setCameraOsc(false,
_getCFV3D(domain, "camera_osc_speed", Vector3D(2.f, 1.1f, 1.3f), sf), _getCFV3D(domain, "camera_osc_speed", Vector3D(2.f, 0.f, 0.f), sf),
_getCFV3D(domain, "camera_osc_amp", Vector3D(0.1f, 0.2f, 0.1f), sf)); _getCFV3D(domain, "camera_osc_amp", Vector3D(0.1f, 0.f, 0.f), sf));
CoverFlow.setCameraOsc(true, CoverFlow.setCameraOsc(true,
_getCFV3D(domainSel, "camera_osc_speed", Vector3D(), sf), _getCFV3D(domainSel, "camera_osc_speed", Vector3D(), sf),
_getCFV3D(domainSel, "camera_osc_amp", Vector3D(), sf)); _getCFV3D(domainSel, "camera_osc_amp", Vector3D(), sf));
float def_cvr_posX = (smallbox && homebrew) ? 1.f : 1.6f; float def_cvr_posX = smallflow ? 1.f : 1.6f;
float def_cvr_posY = (smallbox && homebrew) ? -0.6f : 0.f; float def_cvr_posY = smallflow ? -0.8f : -1.f;
float def_cvr_posX1 = sideflow ? .10f : 0.f;
CoverFlow.setCoverPos(false, CoverFlow.setCoverPos(false,
_getCFV3D(domain, "left_pos", Vector3D(-def_cvr_posX, def_cvr_posY, 0.f), sf), _getCFV3D(domain, "left_pos", Vector3D(-def_cvr_posX, def_cvr_posY, 0.f), sf),
_getCFV3D(domain, "right_pos", Vector3D(def_cvr_posX, def_cvr_posY, 0.f), sf), _getCFV3D(domain, "right_pos", Vector3D(def_cvr_posX, def_cvr_posY, 0.f), sf),
_getCFV3D(domain, "center_pos", Vector3D(0.f, def_cvr_posY, 1.f), sf), _getCFV3D(domain, "center_pos", Vector3D(def_cvr_posX1, def_cvr_posY, 1.f), sf),
_getCFV3D(domain, "row_center_pos", Vector3D(0.f, def_cvr_posY, 0.f), sf)); _getCFV3D(domain, "row_center_pos", Vector3D(0.f, def_cvr_posY, 0.f), sf));
def_cvr_posX = (smallbox && homebrew) ? 1.f : 4.6f; if(smallflow)
float def_cvr_posX1 = (smallbox && homebrew) ? 0.f : -0.6f;
CoverFlow.setCoverPos(true, CoverFlow.setCoverPos(true,
_getCFV3D(domainSel, "left_pos", Vector3D(-def_cvr_posX, def_cvr_posY, 0.f), sf), _getCFV3D(domainSel, "left_pos", Vector3D(-4.05f, -0.6f, -1.f), sf),
_getCFV3D(domainSel, "right_pos", Vector3D(def_cvr_posX, def_cvr_posY, 0.f), sf), _getCFV3D(domainSel, "right_pos", Vector3D(3.35f, -0.6f, -1.f), sf),
_getCFV3D(domainSel, "center_pos", Vector3D(def_cvr_posX1, 0.f, 2.6f), sf), _getCFV3D(domainSel, "center_pos", Vector3D(-0.5f, -0.8f, 2.6f), sf),
_getCFV3D(domainSel, "row_center_pos", Vector3D(0.f, def_cvr_posY, 0.f), sf)); _getCFV3D(domainSel, "row_center_pos", Vector3D(-3.05f, -0.6f, -1.f), sf));
else
CoverFlow.setCoverPos(true,
_getCFV3D(domainSel, "left_pos", Vector3D(-4.7f, -1.f, 0.f), sf),
_getCFV3D(domainSel, "right_pos", Vector3D(4.7f, -1.f, 0.f), sf),
_getCFV3D(domainSel, "center_pos", Vector3D(-0.6f, -1.f, 2.6f), sf),
_getCFV3D(domainSel, "row_center_pos", Vector3D(0.f, 0.f, 0.f), sf));
CoverFlow.setCoverAngleOsc(false, CoverFlow.setCoverAngleOsc(false,
m_coverflow.getVector3D(domain, "cover_osc_speed", Vector3D(2.f, 2.f, 0.f)), m_coverflow.getVector3D(domain, "cover_osc_speed", Vector3D(2.f, 2.f, 0.f)),
@ -769,7 +766,7 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
m_coverflow.getVector3D(domainSel, "cover_pos_osc_speed"), m_coverflow.getVector3D(domainSel, "cover_pos_osc_speed"),
m_coverflow.getVector3D(domainSel, "cover_pos_osc_amp")); m_coverflow.getVector3D(domainSel, "cover_pos_osc_amp"));
float spacerX = (smallbox && homebrew) ? 1.f : 0.35f; float spacerX = smallflow ? 1.f : 0.35f;
CoverFlow.setSpacers(false, CoverFlow.setSpacers(false,
m_coverflow.getVector3D(domain, "left_spacer", Vector3D(-spacerX, 0.f, 0.f)), m_coverflow.getVector3D(domain, "left_spacer", Vector3D(-spacerX, 0.f, 0.f)),
m_coverflow.getVector3D(domain, "right_spacer", Vector3D(spacerX, 0.f, 0.f))); m_coverflow.getVector3D(domain, "right_spacer", Vector3D(spacerX, 0.f, 0.f)));
@ -786,23 +783,24 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
m_coverflow.getVector3D(domainSel, "left_delta_angle"), m_coverflow.getVector3D(domainSel, "left_delta_angle"),
m_coverflow.getVector3D(domainSel, "right_delta_angle")); m_coverflow.getVector3D(domainSel, "right_delta_angle"));
float angleY = (smallbox && homebrew) ? 0.f : 70.f; float angleY = smallflow ? 0.f : 70.f;
float angleZ = sideflow ? 90.f : 0.f;
CoverFlow.setAngles(false, CoverFlow.setAngles(false,
m_coverflow.getVector3D(domain, "left_angle", Vector3D(0.f, angleY, 0.f)), m_coverflow.getVector3D(domain, "left_angle", Vector3D(0.f, angleY, 0.f)),
m_coverflow.getVector3D(domain, "right_angle", Vector3D(0.f, -angleY, 0.f)), m_coverflow.getVector3D(domain, "right_angle", Vector3D(0.f, -angleY, 0.f)),
m_coverflow.getVector3D(domain, "center_angle"), m_coverflow.getVector3D(domain, "center_angle", Vector3D(0.f, 0.f, angleZ)),
m_coverflow.getVector3D(domain, "row_center_angle")); m_coverflow.getVector3D(domain, "row_center_angle"));
angleY = (smallbox && homebrew) ? 0.f : 90.f; angleY = smallflow ? 0.f : 90.f;
float angleY1 = (smallbox && homebrew) ? 0.f : 380.f; float angleY1 = smallflow ? 0.f : 360.f;
float angleX = (smallbox && homebrew) ? 0.f : -45.f; float angleX = smallflow ? 0.f : -45.f;
CoverFlow.setAngles(true, CoverFlow.setAngles(true,
m_coverflow.getVector3D(domainSel, "left_angle", Vector3D(angleX, angleY, 0.f)), m_coverflow.getVector3D(domainSel, "left_angle", Vector3D(angleX, angleY, 0.f)),
m_coverflow.getVector3D(domainSel, "right_angle", Vector3D(angleX, -angleY, 0.f)), m_coverflow.getVector3D(domainSel, "right_angle", Vector3D(angleX, -angleY, 0.f)),
m_coverflow.getVector3D(domainSel, "center_angle", Vector3D(0.f, angleY1, 0.f)), m_coverflow.getVector3D(domainSel, "center_angle", Vector3D(0.f, angleY1, angleZ)),
m_coverflow.getVector3D(domainSel, "row_center_angle")); m_coverflow.getVector3D(domainSel, "row_center_angle"));
angleX = smallbox ? 0.f : 55.f; angleX = smallflow ? 0.f : 20.f;
CoverFlow.setTitleAngles(false, CoverFlow.setTitleAngles(false,
_getCFFloat(domain, "text_left_angle", -angleX, sf), _getCFFloat(domain, "text_left_angle", -angleX, sf),
_getCFFloat(domain, "text_right_angle", angleX, sf), _getCFFloat(domain, "text_right_angle", angleX, sf),
@ -813,15 +811,17 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
_getCFFloat(domainSel, "text_right_angle", angleX, sf), _getCFFloat(domainSel, "text_right_angle", angleX, sf),
_getCFFloat(domainSel, "text_center_angle", 0.f, sf)); _getCFFloat(domainSel, "text_center_angle", 0.f, sf));
def_cvr_posX = smallflow ? 2.f : 1.f;
CoverFlow.setTitlePos(false, CoverFlow.setTitlePos(false,
_getCFV3D(domain, "text_left_pos", Vector3D(-4.f, 0.f, 1.3f), sf), _getCFV3D(domain, "text_left_pos", Vector3D(-def_cvr_posX, 0.8f, 2.6f), sf),
_getCFV3D(domain, "text_right_pos", Vector3D(4.f, 0.f, 1.3f), sf), _getCFV3D(domain, "text_right_pos", Vector3D(def_cvr_posX, 0.8f, 2.6f), sf),
_getCFV3D(domain, "text_center_pos", Vector3D(0.f, 0.f, 2.6f), sf)); _getCFV3D(domain, "text_center_pos", Vector3D(0.f, 0.8f, 2.6f), sf));
def_cvr_posX = smallflow ? .6f : 2.1f;
CoverFlow.setTitlePos(true, CoverFlow.setTitlePos(true,
_getCFV3D(domainSel, "text_left_pos", Vector3D(-4.f, 0.f, 1.3f), sf), _getCFV3D(domainSel, "text_left_pos", Vector3D(-4.f, 0.f, 1.3f), sf),
_getCFV3D(domainSel, "text_right_pos", Vector3D(4.f, 0.f, 1.3f), sf), _getCFV3D(domainSel, "text_right_pos", Vector3D(4.f, 0.f, 1.3f), sf),
_getCFV3D(domainSel, "text_center_pos", Vector3D(1.7f, 1.8f, 1.6f), sf)); _getCFV3D(domainSel, "text_center_pos", Vector3D(def_cvr_posX, 1.f, 1.6f), sf));
CoverFlow.setTitleWidth(false, CoverFlow.setTitleWidth(false,
_getCFFloat(domain, "text_side_wrap_width", 500.f, sf), _getCFFloat(domain, "text_side_wrap_width", 500.f, sf),
@ -829,15 +829,15 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
CoverFlow.setTitleWidth(true, CoverFlow.setTitleWidth(true,
_getCFFloat(domainSel, "text_side_wrap_width", 500.f, sf), _getCFFloat(domainSel, "text_side_wrap_width", 500.f, sf),
_getCFFloat(domainSel, "text_center_wrap_width", 310.f, sf)); _getCFFloat(domainSel, "text_center_wrap_width", 390.f, sf));
CoverFlow.setTitleStyle(false, CoverFlow.setTitleStyle(false,
_textStyle(domain.c_str(), "text_side_style", FTGX_ALIGN_MIDDLE | FTGX_JUSTIFY_CENTER), _textStyle(domain.c_str(), "text_side_style", FTGX_ALIGN_MIDDLE | FTGX_JUSTIFY_CENTER, true),
_textStyle(domain.c_str(), "text_center_style", FTGX_ALIGN_MIDDLE | FTGX_JUSTIFY_CENTER)); _textStyle(domain.c_str(), "text_center_style", FTGX_ALIGN_MIDDLE | FTGX_JUSTIFY_CENTER, true));
CoverFlow.setTitleStyle(true, CoverFlow.setTitleStyle(true,
_textStyle(domainSel.c_str(), "text_side_style", FTGX_ALIGN_MIDDLE | FTGX_JUSTIFY_CENTER), _textStyle(domainSel.c_str(), "text_side_style", FTGX_ALIGN_MIDDLE | FTGX_JUSTIFY_CENTER, true),
_textStyle(domainSel.c_str(), "text_center_style", FTGX_ALIGN_TOP | FTGX_JUSTIFY_RIGHT)); _textStyle(domainSel.c_str(), "text_center_style", FTGX_ALIGN_TOP | FTGX_JUSTIFY_RIGHT, true));
CoverFlow.setColors(false, CoverFlow.setColors(false,
m_coverflow.getColor(domain, "color_beg", 0xCFFFFFFF), m_coverflow.getColor(domain, "color_beg", 0xCFFFFFFF),
@ -849,7 +849,7 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
m_coverflow.getColor(domainSel, "color_end", 0x1FFFFFFF), m_coverflow.getColor(domainSel, "color_end", 0x1FFFFFFF),
m_coverflow.getColor(domain, "color_off", 0x7FFFFFFF)); // Mouse not used once a selection has been made m_coverflow.getColor(domain, "color_off", 0x7FFFFFFF)); // Mouse not used once a selection has been made
CoverFlow.setMirrorAlpha(m_coverflow.getFloat(domain, "mirror_alpha", 0.25f), m_coverflow.getFloat(domain, "title_mirror_alpha", 0.2f)); // Doesn't depend on selection CoverFlow.setMirrorAlpha(m_coverflow.getFloat(domain, "mirror_alpha", 0.15f), m_coverflow.getFloat(domain, "title_mirror_alpha", 0.03f)); // Doesn't depend on selection
CoverFlow.setMirrorBlur(m_coverflow.getBool(domain, "mirror_blur", true)); // Doesn't depend on selection CoverFlow.setMirrorBlur(m_coverflow.getBool(domain, "mirror_blur", true)); // Doesn't depend on selection
@ -869,7 +869,7 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
m_coverflow.getFloat(domain, "shadow_x"), m_coverflow.getFloat(domain, "shadow_x"),
m_coverflow.getFloat(domain, "shadow_y")); m_coverflow.getFloat(domain, "shadow_y"));
float spacerY = (smallbox && homebrew) ? 0.60f : 2.f; float spacerY = smallflow ? 0.60f : 2.f;
CoverFlow.setRowSpacers(false, CoverFlow.setRowSpacers(false,
m_coverflow.getVector3D(domain, "top_spacer", Vector3D(0.f, spacerY, 0.f)), m_coverflow.getVector3D(domain, "top_spacer", Vector3D(0.f, spacerY, 0.f)),
m_coverflow.getVector3D(domain, "bottom_spacer", Vector3D(0.f, -spacerY, 0.f))); m_coverflow.getVector3D(domain, "bottom_spacer", Vector3D(0.f, -spacerY, 0.f)));
@ -894,10 +894,9 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
m_coverflow.getVector3D(domainSel, "top_angle"), m_coverflow.getVector3D(domainSel, "top_angle"),
m_coverflow.getVector3D(domainSel, "bottom_angle")); m_coverflow.getVector3D(domainSel, "bottom_angle"));
Vector3D def_cvr_scale = smallbox ? (homebrew ? Vector3D def_cvr_scale = smallflow ? Vector3D(0.66f, 0.25f, 1.f)
Vector3D(0.667f, 0.25f, 1.f) : (shortflow ? Vector3D(1.f, 0.66f, 1.f)
: Vector3D(1.f, 0.5f, 1.f)) : Vector3D(1.f, 1.f, 1.f));
: Vector3D(1.f, 1.f, 1.f);
CoverFlow.setCoverScale(false, CoverFlow.setCoverScale(false,
m_coverflow.getVector3D(domain, "left_scale", def_cvr_scale), m_coverflow.getVector3D(domain, "left_scale", def_cvr_scale),
@ -911,11 +910,11 @@ void CMenu::_loadCFLayout(int version, bool forceAA, bool otherScrnFmt)
m_coverflow.getVector3D(domainSel, "center_scale", def_cvr_scale), m_coverflow.getVector3D(domainSel, "center_scale", def_cvr_scale),
m_coverflow.getVector3D(domainSel, "row_center_scale", def_cvr_scale)); m_coverflow.getVector3D(domainSel, "row_center_scale", def_cvr_scale));
float flipX = (smallbox && homebrew) ? 359.f : 180.f; float flipX = smallflow ? 360.f : 180.f;
CoverFlow.setCoverFlipping( CoverFlow.setCoverFlipping(
_getCFV3D(domainSel, "flip_pos", Vector3D(), sf), _getCFV3D(domainSel, "flip_pos", Vector3D(), sf),
_getCFV3D(domainSel, "flip_angle", Vector3D(0.f, flipX, 0.f), sf), _getCFV3D(domainSel, "flip_angle", Vector3D(0.f, flipX, 0.f), sf),
_getCFV3D(domainSel, "flip_scale", def_cvr_scale, sf)); _getCFV3D(domainSel, "flip_scale", Vector3D(1.f, 1.f, 1.f), sf));
CoverFlow.setBlur( CoverFlow.setBlur(
m_coverflow.getInt(domain, "blur_resolution", 1), m_coverflow.getInt(domain, "blur_resolution", 1),
@ -1451,10 +1450,14 @@ GuiSound *CMenu::_sound(CMenu::SoundSet &soundSet, const char *domain, const cha
return i->second; return i->second;
} }
u16 CMenu::_textStyle(const char *domain, const char *key, u16 def) u16 CMenu::_textStyle(const char *domain, const char *key, u16 def, bool coverflow)
{ {
u16 textStyle = 0; u16 textStyle = 0;
string style(m_theme.getString(domain, key)); string style;
if(coverflow)
style = m_coverflow.getString(domain, key);
else
style = m_theme.getString(domain, key);
if (style.empty()) return def; if (style.empty()) return def;
if (style.find_first_of("Cc") != string::npos) if (style.find_first_of("Cc") != string::npos)
@ -2144,8 +2147,7 @@ bool CMenu::_loadList(void)
NANDemuView = false; NANDemuView = false;
gprintf("Creating Gamelist\n"); gprintf("Creating Gamelist\n");
if((m_current_view == COVERFLOW_PLUGIN && !m_cfg.has(PLUGIN_DOMAIN, "source")) || if(m_current_view == COVERFLOW_PLUGIN || (m_combined_view && m_cfg.getBool(PLUGIN_DOMAIN, "source")))
m_cfg.getBool(PLUGIN_DOMAIN, "source"))
{ {
m_current_view = COVERFLOW_PLUGIN; m_current_view = COVERFLOW_PLUGIN;
_loadPluginList(); _loadPluginList();
@ -2153,8 +2155,7 @@ bool CMenu::_loadList(void)
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++) for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
combinedList.push_back(*tmp_itr); combinedList.push_back(*tmp_itr);
} }
if((m_current_view == COVERFLOW_WII && !m_cfg.has(WII_DOMAIN, "source")) || if(m_current_view == COVERFLOW_WII || (m_combined_view && m_cfg.getBool(WII_DOMAIN, "source")))
m_cfg.getBool(WII_DOMAIN, "source"))
{ {
m_current_view = COVERFLOW_WII; m_current_view = COVERFLOW_WII;
_loadWiiList(); _loadWiiList();
@ -2162,8 +2163,7 @@ bool CMenu::_loadList(void)
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++) for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
combinedList.push_back(*tmp_itr); combinedList.push_back(*tmp_itr);
} }
if((m_current_view == COVERFLOW_CHANNEL && !m_cfg.has(CHANNEL_DOMAIN, "source")) || if(m_current_view == COVERFLOW_CHANNEL || (m_combined_view && m_cfg.getBool(CHANNEL_DOMAIN, "source")))
m_cfg.getBool(CHANNEL_DOMAIN, "source"))
{ {
m_current_view = COVERFLOW_CHANNEL; m_current_view = COVERFLOW_CHANNEL;
_loadChannelList(); _loadChannelList();
@ -2171,8 +2171,7 @@ bool CMenu::_loadList(void)
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++) for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
combinedList.push_back(*tmp_itr); combinedList.push_back(*tmp_itr);
} }
if((m_current_view == COVERFLOW_GAMECUBE && !m_cfg.has(GC_DOMAIN, "source")) || if(m_current_view == COVERFLOW_GAMECUBE || (m_combined_view && m_cfg.getBool(GC_DOMAIN, "source")))
m_cfg.getBool(GC_DOMAIN, "source"))
{ {
m_current_view = COVERFLOW_GAMECUBE; m_current_view = COVERFLOW_GAMECUBE;
_loadGamecubeList(); _loadGamecubeList();
@ -2180,8 +2179,7 @@ bool CMenu::_loadList(void)
for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++) for(vector<dir_discHdr>::iterator tmp_itr = m_gameList.begin(); tmp_itr != m_gameList.end(); tmp_itr++)
combinedList.push_back(*tmp_itr); combinedList.push_back(*tmp_itr);
} }
if((m_current_view == COVERFLOW_HOMEBREW && !m_cfg.has(HOMEBREW_DOMAIN, "source")) || if(m_current_view == COVERFLOW_HOMEBREW || (m_combined_view && m_cfg.getBool(HOMEBREW_DOMAIN, "source")))
m_cfg.getBool(HOMEBREW_DOMAIN, "source"))
{ {
m_current_view = COVERFLOW_HOMEBREW; m_current_view = COVERFLOW_HOMEBREW;
_loadHomebrewList(); _loadHomebrewList();

View File

@ -77,6 +77,7 @@ private:
Config m_coverflow; Config m_coverflow;
Config m_titles; Config m_titles;
Config m_version; Config m_version;
vector<string> m_homebrewArgs; vector<string> m_homebrewArgs;
u8 *m_base_font; u8 *m_base_font;
u32 m_base_font_size; u32 m_base_font_size;
@ -85,23 +86,22 @@ private:
u8 *m_file; u8 *m_file;
u8 *m_buffer; u8 *m_buffer;
u8 m_aa; u8 m_aa;
u8 m_numCFVersions;
u8 m_numPlugins; u8 m_numPlugins;
//const char *cf_domain; const char *cf_domain;
bool m_use_source;
bool m_multisource;
bool m_sourceflow;
bool m_load_view;
bool m_bnr_settings; bool m_bnr_settings;
bool m_directLaunch; bool m_directLaunch;
bool m_locked; bool m_locked;
bool m_favorites; bool m_favorites;
bool m_music_info; bool m_music_info;
bool m_use_source;
bool m_allow_random; bool m_allow_random;
bool m_multisource;
bool m_load_view;
bool m_sourceflow;
s16 m_showtimer; s16 m_showtimer;
string m_curLanguage; string m_curLanguage;
u8 m_numCFVersions;
string m_sourceDir; string m_sourceDir;
string m_themeDataDir; string m_themeDataDir;
string m_appDir; string m_appDir;
@ -659,8 +659,6 @@ private:
bool enable_wmote_roll; bool enable_wmote_roll;
time_t no_input_time; time_t no_input_time;
bool m_cfNeedsUpdate;
void SetupInput(bool reset_pos = false); void SetupInput(bool reset_pos = false);
void ScanInput(void); void ScanInput(void);
u32 NoInputTime(void); u32 NoInputTime(void);
@ -1000,6 +998,9 @@ private:
void _showPaths(void); void _showPaths(void);
void _showFTP(void); void _showFTP(void);
void _setSrcOptions(void);
bool _sideCover(const char *magic);
bool _shortCover(const char *magic);
void _clearSources(void); void _clearSources(void);
void _updateSourceBtns(void); void _updateSourceBtns(void);
void _updatePluginText(void); void _updatePluginText(void);
@ -1075,7 +1076,6 @@ private:
void _netInit(); void _netInit();
bool _loadFile(u8 * &buffer, u32 &size, const char *path, const char *file); bool _loadFile(u8 * &buffer, u32 &size, const char *path, const char *file);
int _loadIOS(u8 ios, int userIOS, string id, bool RealNAND_Channels = false); int _loadIOS(u8 ios, int userIOS, string id, bool RealNAND_Channels = false);
bool _QF_Game(const char *game_id);
void _launch(const dir_discHdr *hdr); void _launch(const dir_discHdr *hdr);
void _launchGame(dir_discHdr *hdr, bool dvd); void _launchGame(dir_discHdr *hdr, bool dvd);
void _launchChannel(dir_discHdr *hdr); void _launchChannel(dir_discHdr *hdr);
@ -1124,7 +1124,7 @@ private:
GuiSound *_sound(CMenu::SoundSet &soundSet, const char *filename, const u8 * snd, u32 len, const char *name, bool isAllocated); GuiSound *_sound(CMenu::SoundSet &soundSet, const char *filename, const u8 * snd, u32 len, const char *name, bool isAllocated);
GuiSound *_sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const char *name); GuiSound *_sound(CMenu::SoundSet &soundSet, const char *domain, const char *key, const char *name);
u16 _textStyle(const char *domain, const char *key, u16 def); u16 _textStyle(const char *domain, const char *key, u16 def, bool coverflow = false);
s16 _addButton(const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color); s16 _addButton(const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color);
s16 _addPicButton(const char *domain, TexData &texNormal, TexData &texSelected, int x, int y, u32 width, u32 height); s16 _addPicButton(const char *domain, TexData &texNormal, TexData &texSelected, int x, int y, u32 width, u32 height);
s16 _addTitle(const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color, s16 style); s16 _addTitle(const char *domain, SFont font, const wstringEx &text, int x, int y, u32 width, u32 height, const CColor &color, s16 style);

View File

@ -19,7 +19,7 @@ s16 m_categoryLblUser[4];
TexData m_categoryBg; TexData m_categoryBg;
vector<char> m_categories; vector<char> m_categories;
u8 curPage; static u8 curPage;
u8 lastBtn; u8 lastBtn;
const char *catSettings; const char *catSettings;
string id; string id;

View File

@ -43,7 +43,7 @@ const CMenu::SCFParamDesc CMenu::_cfParams[] = {
{ { CMenu::SCFParamDesc::PDT_FLOAT, CMenu::SCFParamDesc::PDT_FLOAT, CMenu::SCFParamDesc::PDT_TXTSTYLE, CMenu::SCFParamDesc::PDT_TXTSTYLE }, { { CMenu::SCFParamDesc::PDT_FLOAT, CMenu::SCFParamDesc::PDT_FLOAT, CMenu::SCFParamDesc::PDT_TXTSTYLE, CMenu::SCFParamDesc::PDT_TXTSTYLE },
CMenu::SCFParamDesc::PDD_BOTH, true, "Title Width", { "Center", "Side", "Center Style", "Side Style" }, CMenu::SCFParamDesc::PDD_BOTH, true, "Title Width", { "Center", "Side", "Center Style", "Side Style" },
{ "text_center_wrap_width", "text_side_wrap_width", "text_center_style", "text_side_style" }, { "text_center_wrap_width", "text_side_wrap_width", "text_center_style", "text_side_style" },
{ 1.f, 1.f, 1.f, 1.f }, { 10.f, 10.f, 1.f, 1.f },
{ { 50.f, 3000.f }, { 50.f, 3000.f }, { 0.f, 8.f }, { 0.f, 8.f } } }, { { 50.f, 3000.f }, { 50.f, 3000.f }, { 0.f, 8.f }, { 0.f, 8.f } } },
{ { CMenu::SCFParamDesc::PDT_INT, CMenu::SCFParamDesc::PDT_INT, CMenu::SCFParamDesc::PDT_EMPTY, CMenu::SCFParamDesc::PDT_EMPTY }, { { CMenu::SCFParamDesc::PDT_INT, CMenu::SCFParamDesc::PDT_INT, CMenu::SCFParamDesc::PDT_EMPTY, CMenu::SCFParamDesc::PDT_EMPTY },
CMenu::SCFParamDesc::PDD_NORMAL, true, "Dimensions", { "Rows", "Columns", "", "" }, CMenu::SCFParamDesc::PDD_NORMAL, true, "Dimensions", { "Rows", "Columns", "", "" },
@ -170,10 +170,8 @@ void CMenu::_showCFTheme(u32 curParam, int version, bool wide)
{ {
const CMenu::SCFParamDesc &p = CMenu::_cfParams[curParam]; const CMenu::SCFParamDesc &p = CMenu::_cfParams[curParam];
bool selected = CoverFlow.selected(); bool selected = CoverFlow.selected();
string domUnsel(fmt(_cfDomain(), version)); string domUnsel(fmt("%s_%i", cf_domain, version));
string domSel(fmt(_cfDomain(true), version)); string domSel(fmt("%s_%i_S", cf_domain, version));
//string domUnsel(fmt("%s_%i", cf_domain, version));
//string domSel(fmt("%s_%i_S", cf_domain, version));
CoverFlow.simulateOtherScreenFormat(p.scrnFmt && wide != m_vid.wide()); CoverFlow.simulateOtherScreenFormat(p.scrnFmt && wide != m_vid.wide());
_setBg(m_mainBg, m_mainBgLQ); _setBg(m_mainBg, m_mainBgLQ);
@ -289,7 +287,7 @@ void CMenu::_showCFTheme(u32 curParam, int version, bool wide)
m_btnMgr.show(m_cfThemeBtnValP[k]); m_btnMgr.show(m_cfThemeBtnValP[k]);
break; break;
case CMenu::SCFParamDesc::PDT_TXTSTYLE: case CMenu::SCFParamDesc::PDT_TXTSTYLE:
m_btnMgr.setText(m_cfThemeLblVal[k], styleToTxt(_textStyle(domain.c_str(), key.c_str(), CoverFlow.selected() ? FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_TOP : FTGX_JUSTIFY_CENTER | FTGX_ALIGN_BOTTOM))); m_btnMgr.setText(m_cfThemeLblVal[k], styleToTxt(_textStyle(domain.c_str(), key.c_str(), CoverFlow.selected() ? FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_TOP : FTGX_JUSTIFY_CENTER | FTGX_ALIGN_BOTTOM, true)));
for (int j = 1; j < 4; ++j) for (int j = 1; j < 4; ++j)
{ {
m_btnMgr.hide(m_cfThemeLblVal[k + j]); m_btnMgr.hide(m_cfThemeLblVal[k + j]);
@ -329,7 +327,6 @@ void CMenu::_cfTheme(void)
m_coverflow.load(fmt("%s/coverflows/%s.ini", m_themeDir.c_str(), m_cfg.getString("GENERAL", "theme", "default").c_str())); m_coverflow.load(fmt("%s/coverflows/%s.ini", m_themeDir.c_str(), m_cfg.getString("GENERAL", "theme", "default").c_str()));
if(!m_coverflow.loaded()) if(!m_coverflow.loaded())
m_coverflow.load(fmt("%s/coverflows/default.ini", m_themeDir.c_str())); m_coverflow.load(fmt("%s/coverflows/default.ini", m_themeDir.c_str()));
//m_coverflow.load(fmt("%s/%s/coverflow.ini", m_themeDir.c_str(), m_cfg.getString("GENERAL", "theme", "default").c_str()));
break; break;
} }
else if(BTN_UP_PRESSED) else if(BTN_UP_PRESSED)
@ -419,7 +416,6 @@ void CMenu::_cfTheme(void)
m_coverflow.load(fmt("%s/coverflows/%s.ini", m_themeDir.c_str(), m_cfg.getString("GENERAL", "theme", "default").c_str())); m_coverflow.load(fmt("%s/coverflows/%s.ini", m_themeDir.c_str(), m_cfg.getString("GENERAL", "theme", "default").c_str()));
if(!m_coverflow.loaded()) if(!m_coverflow.loaded())
m_coverflow.load(fmt("%s/coverflows/default.ini", m_themeDir.c_str())); m_coverflow.load(fmt("%s/coverflows/default.ini", m_themeDir.c_str()));
//m_coverflow.load(fmt("%s/%s.ini", m_themeDir.c_str(), m_cfg.getString("GENERAL", "theme", "default").c_str()));
break; break;
} }
else if (m_btnMgr.selected(m_cfThemeBtnAlt)) else if (m_btnMgr.selected(m_cfThemeBtnAlt))
@ -567,7 +563,7 @@ void CMenu::_cfParam(bool inc, int i, const CMenu::SCFParamDesc &p, int cfVersio
} }
case CMenu::SCFParamDesc::PDT_TXTSTYLE: case CMenu::SCFParamDesc::PDT_TXTSTYLE:
{ {
int i = styleToIdx(_textStyle(domain.c_str(), key.c_str(), CoverFlow.selected() ? FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_TOP : FTGX_JUSTIFY_CENTER | FTGX_ALIGN_BOTTOM)); int i = styleToIdx(_textStyle(domain.c_str(), key.c_str(), CoverFlow.selected() ? FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_TOP : FTGX_JUSTIFY_CENTER | FTGX_ALIGN_BOTTOM, true));
i = loopNum(i + (int)step, 9); i = loopNum(i + (int)step, 9);
m_coverflow.setString(domain, key, styleToTxt(g_txtStyles[i])); m_coverflow.setString(domain, key, styleToTxt(g_txtStyles[i]));
break; break;
@ -577,8 +573,8 @@ void CMenu::_cfParam(bool inc, int i, const CMenu::SCFParamDesc &p, int cfVersio
const char *CMenu::_cfDomain(bool selected) const char *CMenu::_cfDomain(bool selected)
{ {
//return selected ? fmt("%s_%%i_S", cf_domain) : fmt("%s_%%i", cf_domain); return selected ? fmt("%s_%%i_S", cf_domain) : fmt("%s_%%i", cf_domain);
switch(m_current_view) /*switch(m_current_view)
{ {
case COVERFLOW_PLUGIN: case COVERFLOW_PLUGIN:
return selected ? "_EMUFLOW_%i_S" : "_EMUFLOW_%i"; return selected ? "_EMUFLOW_%i_S" : "_EMUFLOW_%i";
@ -586,7 +582,7 @@ const char *CMenu::_cfDomain(bool selected)
return selected ? "_BREWFLOW_%i_S" : "_BREWFLOW_%i"; return selected ? "_BREWFLOW_%i_S" : "_BREWFLOW_%i";
default: default:
return selected ? "_COVERFLOW_%i_S" : "_COVERFLOW_%i"; return selected ? "_COVERFLOW_%i_S" : "_COVERFLOW_%i";
} }*/
} }
void CMenu::_initCFThemeMenu() void CMenu::_initCFThemeMenu()

View File

@ -67,7 +67,7 @@ void CMenu::_showConfig(void)
const char *partitionname = disable ? CHANNEL_DOMAIN : DeviceName[m_emuSaveNand ? m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0)) : m_cfg.getInt(_domainFromView(), "partition", 0)]; const char *partitionname = disable ? CHANNEL_DOMAIN : DeviceName[m_emuSaveNand ? m_cfg.getInt(WII_DOMAIN, "savepartition", m_cfg.getInt(CHANNEL_DOMAIN, "partition", 0)) : m_cfg.getInt(_domainFromView(), "partition", 0)];
m_btnMgr.setText(m_configLblPartition, upperCase(partitionname)); m_btnMgr.setText(m_configLblPartition, upperCase(partitionname));
if(m_current_view == COVERFLOW_CHANNEL || m_current_view == COVERFLOW_WII) if(m_current_view != COVERFLOW_HOMEBREW && m_current_view != COVERFLOW_GAMECUBE && m_current_view != COVERFLOW_MAX)
{ {
m_btnMgr.show(m_configLblCfg4); m_btnMgr.show(m_configLblCfg4);
m_btnMgr.show(m_configBtnCfg4); m_btnMgr.show(m_configBtnCfg4);
@ -79,7 +79,6 @@ void CMenu::_showConfig(void)
void CMenu::_config(int page) void CMenu::_config(int page)
{ {
m_cfNeedsUpdate = false;
int change = CONFIG_PAGE_NO_CHANGE; int change = CONFIG_PAGE_NO_CHANGE;
while(!m_exit) while(!m_exit)
{ {
@ -116,11 +115,6 @@ void CMenu::_config(int page)
page = _nbCfgPages; page = _nbCfgPages;
} }
} }
if(m_cfNeedsUpdate)
{
m_cfg.save();
_initCF();
}
} }
int CMenu::_configCommon(void) int CMenu::_configCommon(void)
@ -164,15 +158,12 @@ int CMenu::_config1(void)
break; break;
if (BTN_HOME_PRESSED || BTN_B_PRESSED) if (BTN_HOME_PRESSED || BTN_B_PRESSED)
{
_setPartition();
break; break;
}
if (BTN_A_PRESSED) if (BTN_A_PRESSED)
{ {
if (m_btnMgr.selected(m_configBtnDownload)) if (m_btnMgr.selected(m_configBtnDownload))
{ {
m_cfNeedsUpdate = true; m_load_view = true;
CoverFlow.stopCoverLoader(true); CoverFlow.stopCoverLoader(true);
_hideConfig(); _hideConfig();
_download(); _download();
@ -185,7 +176,7 @@ int CMenu::_config1(void)
_hideConfig(); _hideConfig();
if (_code(code) && memcmp(code, m_cfg.getString("GENERAL", "parent_code", "").c_str(), 4) == 0) if (_code(code) && memcmp(code, m_cfg.getString("GENERAL", "parent_code", "").c_str(), 4) == 0)
{ {
m_cfNeedsUpdate = true; m_load_view = true;
m_locked = false; m_locked = false;
} }
else else
@ -198,7 +189,7 @@ int CMenu::_config1(void)
_hideConfig(); _hideConfig();
if (_code(code, true)) if (_code(code, true))
{ {
m_cfNeedsUpdate = true; m_load_view = true;
m_cfg.setString("GENERAL", "parent_code", string(code, 4).c_str()); m_cfg.setString("GENERAL", "parent_code", string(code, 4).c_str());
m_locked = true; m_locked = true;
} }
@ -208,12 +199,11 @@ int CMenu::_config1(void)
{ {
s8 direction = m_btnMgr.selected(m_configBtnPartitionP) ? 1 : -1; s8 direction = m_btnMgr.selected(m_configBtnPartitionP) ? 1 : -1;
_setPartition(direction); _setPartition(direction);
m_load_view = true;
_showConfig(); _showConfig();
} }
else if (m_btnMgr.selected(m_configBtnCfg4) && m_current_view != COVERFLOW_MAX) else if (m_btnMgr.selected(m_configBtnCfg4))
{ {
m_cfNeedsUpdate = true; m_load_view = true;
CoverFlow.stopCoverLoader(true); CoverFlow.stopCoverLoader(true);
_hideConfig(); _hideConfig();
if(m_current_view != COVERFLOW_PLUGIN) if(m_current_view != COVERFLOW_PLUGIN)
@ -226,13 +216,8 @@ int CMenu::_config1(void)
} }
} }
if(currentPartition != bCurrentPartition) if(currentPartition != bCurrentPartition)
{ m_load_view = true;
_showWaitMessage();
_loadList();
_hideWaitMessage();
}
_hideConfig(); _hideConfig();
return change; return change;
} }

View File

@ -121,6 +121,7 @@ int CMenu::_config4(void)
_hideConfig4(); _hideConfig4();
_Paths(); _Paths();
_showConfig4(); _showConfig4();
m_load_view = true;
break; break;
} }
else if (m_btnMgr.selected(m_config4BtnReturnToP)) else if (m_btnMgr.selected(m_config4BtnReturnToP))

View File

@ -123,7 +123,7 @@ int CMenu::_configAdv(void)
s8 direction = m_btnMgr.selected(m_configAdvBtnCurThemeP) ? 1 : -1; s8 direction = m_btnMgr.selected(m_configAdvBtnCurThemeP) ? 1 : -1;
curTheme = loopNum(curTheme + direction, (int)themes.size()); curTheme = loopNum(curTheme + direction, (int)themes.size());
m_cfg.setString("GENERAL", "theme", themes[curTheme]); m_cfg.setString("GENERAL", "theme", themes[curTheme]);
m_cfg.setInt(_domainFromView(), "last_cf_mode", 1); //m_cfg.setInt(_domainFromView(), "last_cf_mode", 1);
_showConfigAdv(); _showConfigAdv();
} }
else if(m_btnMgr.selected(m_configAdvBtnLanguage)) else if(m_btnMgr.selected(m_configAdvBtnLanguage))
@ -134,7 +134,7 @@ int CMenu::_configAdv(void)
} }
else if(m_btnMgr.selected(m_configAdvBtnCFTheme)) else if(m_btnMgr.selected(m_configAdvBtnCFTheme))
{ {
m_cfNeedsUpdate = true; m_load_view = true;
_hideConfigAdv(); _hideConfigAdv();
_cfTheme(); _cfTheme();
_showConfigAdv(); _showConfigAdv();
@ -142,14 +142,8 @@ int CMenu::_configAdv(void)
} }
} }
_hideConfigAdv(); _hideConfigAdv();
if (m_gameList.empty() || lang_changed) if(lang_changed)
{ m_load_view = true;
//if(lang_changed)
//m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
_loadList();
}
lang_changed = false;
return change; return change;
} }

View File

@ -450,7 +450,7 @@ void CMenu::_showGameSettings(void)
if(GameHdr->type == TYPE_GC_GAME) if(GameHdr->type == TYPE_GC_GAME)
{ {
//widescreen is shared by all, in the future might seperate them //widescreen is shared by all, in the future might seperate them
m_btnMgr.setText(m_gameSettingsBtnWidescreen, _optBoolToString(m_gcfg2.getOptBool(id, "widescreen", m_cfg.getBool(GC_DOMAIN, "dm_widescreen", 0)))); m_btnMgr.setText(m_gameSettingsBtnWidescreen, _optBoolToString(m_gcfg2.getOptBool(id, "widescreen", m_cfg.getBool(GC_DOMAIN, "widescreen", 0))));
m_btnMgr.setText(m_gameSettingsBtnDevoMemcardEmu, _optBoolToString(m_gcfg2.getOptBool(id, "devo_memcard_emu", 0))); m_btnMgr.setText(m_gameSettingsBtnDevoMemcardEmu, _optBoolToString(m_gcfg2.getOptBool(id, "devo_memcard_emu", 0)));
m_btnMgr.setText(m_gameSettingsBtnUSB_HID, _optBoolToString(m_gcfg2.getOptBool(id, "USB_HID", m_cfg.getBool(GC_DOMAIN, "USB_HID", 0)))); m_btnMgr.setText(m_gameSettingsBtnUSB_HID, _optBoolToString(m_gcfg2.getOptBool(id, "USB_HID", m_cfg.getBool(GC_DOMAIN, "USB_HID", 0))));
m_btnMgr.setText(m_gameSettingsBtnNATIVE_CTL, _optBoolToString(m_gcfg2.getOptBool(id, "NATIVE_CTL", m_cfg.getBool(GC_DOMAIN, "NATIVE_CTL", 0)))); m_btnMgr.setText(m_gameSettingsBtnNATIVE_CTL, _optBoolToString(m_gcfg2.getOptBool(id, "NATIVE_CTL", m_cfg.getBool(GC_DOMAIN, "NATIVE_CTL", 0))));

View File

@ -2026,8 +2026,9 @@ int CMenu::_gametdbDownloaderAsync()
m_GameTDBLoaded = true; m_GameTDBLoaded = true;
_loadList(); m_load_view = true;
_initCF(); //_loadList();
//_initCF();
} }
} }
} }

View File

@ -75,7 +75,7 @@ bool CMenu::_Home(void)
{ {
//m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str()); //m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str());
UpdateCache(m_current_view); UpdateCache(m_current_view);
LoadView(); m_load_view = true;
break; break;
} }
else if(m_btnMgr.selected(m_homeBtnUpdate) && !m_locked) else if(m_btnMgr.selected(m_homeBtnUpdate) && !m_locked)

View File

@ -275,9 +275,6 @@ bool CMenu::_LangSettings(void)
} }
} }
_hideLangSettings(); _hideLangSettings();
if(lang_changed)
m_cfNeedsUpdate = true;
if(lang_list_mem != NULL) if(lang_list_mem != NULL)
free(lang_list_mem); free(lang_list_mem);
lang_list_mem = NULL; lang_list_mem = NULL;

View File

@ -171,8 +171,45 @@ void CMenu::LoadView(void)
if(m_cfg.getBool("GENERAL", "save_favorites_mode", false)) if(m_cfg.getBool("GENERAL", "save_favorites_mode", false))
m_favorites = m_cfg.getBool(_domainFromView(), "favorites", false); m_favorites = m_cfg.getBool(_domainFromView(), "favorites", false);
cf_domain = "_COVERFLOW";
if(m_current_view == COVERFLOW_HOMEBREW && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", false))
cf_domain = "_SMALLFLOW";
if(m_current_view == COVERFLOW_PLUGIN)
{
vector<bool> pluginsEnabled = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(pluginsEnabled.size() > 0)
{
int sdc = 0;
int shc = 0;
for(u8 i = 0; i < pluginsEnabled.size(); ++i)
{
if(pluginsEnabled[i] == true)
{
strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8);
if(enabledPluginsCount == 1)
{
currentPartition = m_cfg.getInt("PLUGINS_PARTITION", m_plugin.PluginMagicWord, 1);
m_cfg.setInt(PLUGIN_DOMAIN, "partition", currentPartition);
}
if(_sideCover(m_plugin.PluginMagicWord))
sdc++;
else if(_shortCover(m_plugin.PluginMagicWord))
shc++;
}
}
if(sdc == enabledPluginsCount)
cf_domain = "_SIDEFLOW";
else if(shc == enabledPluginsCount)
cf_domain = "_SHORTFLOW";
}
}
if(m_sourceflow) if(m_sourceflow)
{ {
if(m_cfg.getBool(_domainFromView(), "smallbox", true))
cf_domain = "_SMALLFLOW";
else
cf_domain = "_COVERFLOW";
m_gameList.clear(); m_gameList.clear();
string cacheDir(fmt("%s/sourceflow.db", m_listCacheDir.c_str())); string cacheDir(fmt("%s/sourceflow.db", m_listCacheDir.c_str()));
bool updateCache = m_cfg.getBool("SOURCEFLOW", "update_cache"); bool updateCache = m_cfg.getBool("SOURCEFLOW", "update_cache");
@ -219,11 +256,10 @@ void CMenu::LoadView(void)
m_source_autoboot = false; m_source_autoboot = false;
} }
// Coverflow Count // Coverflow Count
//m_numCFVersions = min(max(2, m_coverflow.getInt(cf_domain, "number_of_modes", 2)), 15); m_numCFVersions = min(max(1, m_coverflow.getInt(cf_domain, "number_of_modes", 1)), 15);
m_numCFVersions = min(max(2, m_coverflow.getInt("_COVERFLOW", "number_of_modes", 2)), 15);
_showMain(); _showMain();
_initCF(); _initCF();
_loadCFLayout(m_cfg.getInt(_domainFromView(), "last_cf_mode", 1)); _loadCFLayout(min(max(1, m_cfg.getInt(_domainFromView(), "last_cf_mode", 1)), (int)m_numCFVersions));
CoverFlow.applySettings(); CoverFlow.applySettings();
if(m_sourceflow) if(m_sourceflow)
@ -253,7 +289,7 @@ void CMenu::exitHandler(int ExitTo)
int CMenu::main(void) int CMenu::main(void)
{ {
//cf_domain = "_COVERFLOW"; cf_domain = "_COVERFLOW";
wstringEx curLetter; wstringEx curLetter;
string prevTheme = m_cfg.getString("GENERAL", "theme", "default"); string prevTheme = m_cfg.getString("GENERAL", "theme", "default");
parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false); parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
@ -326,10 +362,6 @@ int CMenu::main(void)
if(m_cfg.getBool("SOURCEFLOW", "enabled", false))//if sourceflow show it if(m_cfg.getBool("SOURCEFLOW", "enabled", false))//if sourceflow show it
{ {
m_sourceflow = true; m_sourceflow = true;
/*if(m_cfg.getBool(_domainFromView(), "smallbox", true))
cf_domain = "_SMALLFLOW";
else
cf_domain = "_COVERFLOW";*/
LoadView(); LoadView();
} }
else //show source menu else //show source menu
@ -359,7 +391,6 @@ int CMenu::main(void)
LoadView(); LoadView();
continue; continue;
} }
//_showMain();
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(m_load_view) if(m_load_view)
@ -371,9 +402,12 @@ int CMenu::main(void)
{ {
if(_Home()) //exit wiiflow if(_Home()) //exit wiiflow
break; break;
_showMain();
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(m_load_view)
LoadView();
else
_showMain();
} }
} }
else if(BTN_A_PRESSED) else if(BTN_A_PRESSED)
@ -387,9 +421,12 @@ int CMenu::main(void)
_hideMain(); _hideMain();
if(_Home()) //exit wiiflow if(_Home()) //exit wiiflow
break; break;
_showMain();
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
if(m_load_view)
LoadView();
else
_showMain();
} }
else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnWii) || m_btnMgr.selected(m_mainBtnGamecube) || m_btnMgr.selected(m_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnPlugin)) else if(m_btnMgr.selected(m_mainBtnChannel) || m_btnMgr.selected(m_mainBtnWii) || m_btnMgr.selected(m_mainBtnGamecube) || m_btnMgr.selected(m_mainBtnHomebrew) || m_btnMgr.selected(m_mainBtnPlugin))
{ {
@ -405,15 +442,11 @@ int CMenu::main(void)
m_current_view = COVERFLOW_WII; m_current_view = COVERFLOW_WII;
_clearSources(); _clearSources();
m_cfg.setBool(_domainFromView(), "source", true); m_cfg.setBool(_domainFromView(), "source", true);
/*if(m_current_view == COVERFLOW_HOMEBREW && m_cfg.getBool(_domainFromView(), "smallbox", true))
cf_domain = "_SMALLFLOW";
else
cf_domain = "_COVERFLOW";*/
m_catStartPage = 1; m_catStartPage = 1;
m_combined_view = false; m_combined_view = false;
LoadView(); LoadView();
} }
else if(m_btnMgr.selected(m_mainBtnInstall)) else if(m_btnMgr.selected(m_mainBtnInstall))//used when no games found
{ {
if(!m_locked) if(!m_locked)
{ {
@ -424,7 +457,7 @@ int CMenu::main(void)
bUsed = true; bUsed = true;
} }
} }
else if(m_btnMgr.selected(m_mainBtnSelPart)) else if(m_btnMgr.selected(m_mainBtnSelPart))//used when no games found
{ {
_hideMain(); _hideMain();
_config(1); _config(1);
@ -504,6 +537,9 @@ int CMenu::main(void)
if(BTN_B_HELD) if(BTN_B_HELD)
bUsed = true; bUsed = true;
CoverFlow.cancel(); CoverFlow.cancel();
if(m_load_view)
LoadView();
else
_showMain(); _showMain();
} }
} }
@ -671,22 +707,23 @@ int CMenu::main(void)
else if(BTN_MINUS_PRESSED && !m_locked && !m_sourceflow) else if(BTN_MINUS_PRESSED && !m_locked && !m_sourceflow)
{ {
bUsed = true; bUsed = true;
const char *partition = NULL; //const char *partition = NULL;
_showWaitMessage(); //_showWaitMessage();
_hideMain(); //_hideMain();
_setPartition(1); _setPartition(1);
if(m_current_view == COVERFLOW_CHANNEL && (!m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false) || neek2o())) /*if(m_current_view == COVERFLOW_CHANNEL && (!m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand", false) || neek2o()))
partition = "NAND"; partition = "NAND";
else else
partition = DeviceName[currentPartition]; partition = DeviceName[currentPartition];*/
//gprintf("Next item: %s\n", partition); LoadView();
/*//gprintf("Next item: %s\n", partition);
_loadList(); _loadList();
_showMain(); _showMain();
_initCF(); _initCF();
/* refresh AFTER reloading */ refresh AFTER reloading
m_showtimer = 120; m_showtimer = 120;
m_btnMgr.setText(m_mainLblNotice, sfmt("%s (%u) [%s]", _domainFromView(), m_gameList.size(), upperCase(partition).c_str())); m_btnMgr.setText(m_mainLblNotice, sfmt("%s (%u) [%s]", _domainFromView(), m_gameList.size(), upperCase(partition).c_str()));
m_btnMgr.show(m_mainLblNotice); m_btnMgr.show(m_mainLblNotice);*/
} }
} }

View File

@ -112,9 +112,9 @@ void CMenu::_PluginSettings()
while(!m_exit) while(!m_exit)
{ {
_mainLoopCommon(); _mainLoopCommon();
if(BTN_HOME_PRESSED || BTN_B_PRESSED) if(BTN_HOME_PRESSED || BTN_B_PRESSED || (BTN_A_PRESSED && m_btnMgr.selected(m_pluginBtnBack)))
{ {
m_cfg.save(); //m_cfg.save();
break; break;
} }
else if(BTN_UP_PRESSED) else if(BTN_UP_PRESSED)
@ -141,11 +141,6 @@ void CMenu::_PluginSettings()
} }
if(BTN_A_PRESSED) if(BTN_A_PRESSED)
{ {
if(m_btnMgr.selected(m_pluginBtnBack))
{
m_cfg.save();
break;
}
u32 IteratorHelp = (Plugin_curPage - 1) * 10; u32 IteratorHelp = (Plugin_curPage - 1) * 10;
for(u8 i = 0; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; ++i) for(u8 i = 0; i < min(IteratorHelp+10, (u32)m_max_plugins)-IteratorHelp+1; ++i)
{ {
@ -166,7 +161,8 @@ void CMenu::_PluginSettings()
} }
} }
_hidePluginSettings(); _hidePluginSettings();
_loadList(); //_loadList();
m_load_view = true;
} }
void CMenu::_initPluginSettingsMenu() void CMenu::_initPluginSettingsMenu()

View File

@ -22,14 +22,97 @@ static bool show_channel = true;
static bool show_plugin = true; static bool show_plugin = true;
static bool show_gamecube = true; static bool show_gamecube = true;
string source, themeName;
bool exitSource = false; bool exitSource = false;
u8 sourceBtn; u8 sourceBtn;
u8 selectedBtns; u8 selectedBtns;
int source_curPage; static u8 i, j, k;
int source_Pages; int curPage;
string themeName; int numPages;
vector<string> magicNums; vector<string> magicNums;
char btn_selected[256]; char btn_selected[16];
char current_btn[16];
void CMenu::_sourceFlow()
{
const dir_discHdr *hdr = CoverFlow.getHdr();
if(m_cfg.getBool("SOURCEFLOW", "remember_last_item", true))
m_cfg.setString("SOURCEFLOW", "current_item", strrchr(hdr->path, '/') + 1);
else
m_cfg.remove("SOURCEFLOW", "current_item");
memset(btn_selected, 0, 16);
strncpy(btn_selected, fmt("BUTTON_%i", hdr->settings[0]), 15);
source = m_source.getString(btn_selected, "source", "");
cf_domain = "_COVERFLOW";
_clearSources();// may have to move this
/*if(source == "wii")
{
m_cfg.setBool(WII_DOMAIN, "source", true);
if(sf_mode == 0)
{
m_current_view = COVERFLOW_WII;
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
}
}*/
if(source == "wii")
{
m_current_view = COVERFLOW_WII;
m_cfg.setBool(WII_DOMAIN, "source", true);
}
else if(source == "dml")
{
m_current_view = COVERFLOW_GAMECUBE;
m_cfg.setBool(GC_DOMAIN, "source", true);
}
else if(source == "emunand")
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
}
else if(source == "realnand")
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
}
else if(source == "homebrew")
{
m_current_view = COVERFLOW_HOMEBREW;
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
if(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true))
cf_domain = "_SMALLFLOW";
}
else if(source == "allplugins")
{
m_current_view = COVERFLOW_PLUGIN;
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
}
else if(source == "plugin")
{
magicNums.clear();
magicNums = m_source.getStrings(btn_selected, "magic", ',');
if(magicNums.size() > 0 )
{
m_current_view = COVERFLOW_PLUGIN;
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{
s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16));
if(exist >= 0)
m_plugin.SetEnablePlugin(m_cfg, exist, 2);
}
}
}
m_sourceflow = false;// do something with this when in muilti
//no autoboot if multi mode. may have to make sure autoboot plugins are hidden from flow when multi is on.
_setSrcOptions();
}
void CMenu::_hideSource(bool instant) void CMenu::_hideSource(bool instant)
{ {
@ -40,7 +123,6 @@ void CMenu::_hideSource(bool instant)
m_btnMgr.hide(m_sourceBtnPageP, instant); m_btnMgr.hide(m_sourceBtnPageP, instant);
m_btnMgr.hide(m_sourceBtnBack, instant); m_btnMgr.hide(m_sourceBtnBack, instant);
u8 i;
for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i) for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
{ {
if(m_sourceLblUser[i] != -1) if(m_sourceLblUser[i] != -1)
@ -58,7 +140,7 @@ void CMenu::_showSource(void)
{ {
_setBg(m_sourceBg, m_sourceBg); _setBg(m_sourceBg, m_sourceBg);
for(u8 i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i) for(i = 0; i < ARRAY_SIZE(m_sourceLblUser); ++i)
{ {
if(m_sourceLblUser[i] != -1) if(m_sourceLblUser[i] != -1)
m_btnMgr.show(m_sourceLblUser[i]); m_btnMgr.show(m_sourceLblUser[i]);
@ -70,97 +152,82 @@ void CMenu::_showSource(void)
void CMenu::_updateSourceBtns(void) void CMenu::_updateSourceBtns(void)
{ {
if (source_Pages > 1) if(numPages > 1)
{ {
m_btnMgr.setText(m_sourceLblPage, wfmt(L"%i / %i", source_curPage, source_Pages)); m_btnMgr.setText(m_sourceLblPage, wfmt(L"%i / %i", curPage, numPages));
m_btnMgr.show(m_sourceLblPage); m_btnMgr.show(m_sourceLblPage);
m_btnMgr.show(m_sourceBtnPageM); m_btnMgr.show(m_sourceBtnPageM);
m_btnMgr.show(m_sourceBtnPageP); m_btnMgr.show(m_sourceBtnPageP);
} }
const char *ImgName = NULL; j = (curPage - 1) * 12;
const char *ImgSelName = NULL;
u8 j = (source_curPage - 1) * 12;
sourceBtn = 0; sourceBtn = 0;
selectedBtns = 0; selectedBtns = 0;
for(u8 i = 0; i < ((source_Pages - 1) * 12 + 12); ++i) for(i = 0; i < ((numPages - 1) * 12 + 12); ++i)
{ {
if(i < 12) if(i < 12)
m_btnMgr.hide(m_sourceBtnSource[i], true); m_btnMgr.hide(m_sourceBtnSource[i], true);
string btnSource = m_source.getString(fmt("BUTTON_%i", i), "source", ""); memset(current_btn, 0, 16);
strncpy(current_btn, fmt("BUTTON_%i", i), 15);
string btnSource = m_source.getString(current_btn, "source", "");
const char *btn_image = m_source.getString(current_btn,"image", "").c_str();
const char *btn_imageSel = m_source.getString(current_btn,"image_s", "").c_str();
if(btnSource == "") if(btnSource == "")
continue; continue;
else if(m_multisource == false) if(m_multisource)
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image", "").c_str(); {
else if(btnSource == "allplugins") if(btnSource == "allplugins")
{ {
const vector<bool> &EnabledPlugins = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount); const vector<bool> &EnabledPlugins = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(EnabledPlugins.size() == 0) if(EnabledPlugins.size() == 0)//all plugns enabled
{ {
sourceBtn = i; sourceBtn = i;
selectedBtns++; selectedBtns++;
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image_s", "").c_str(); btn_image = btn_imageSel;
} }
else
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image", "").c_str();
} }
else if(btnSource == "plugin") else if(btnSource == "plugin")
{ {
magicNums.clear(); magicNums.clear();
magicNums = m_source.getStrings(fmt("BUTTON_%i", i), "magic", ','); magicNums = m_source.getStrings(current_btn, "magic", ',');
u32 magic = strtoul(magicNums.at(0).c_str(), NULL, 16); u32 magic = strtoul(magicNums.at(0).c_str(), NULL, 16);
if(m_cfg.getBool(PLUGIN_DOMAIN, "source", false) && m_plugin.GetEnableStatus(m_cfg, magic)) if(m_cfg.getBool(PLUGIN_DOMAIN, "source", false) && m_plugin.GetEnableStatus(m_cfg, magic))
{ {
sourceBtn = i; sourceBtn = i;
selectedBtns++; selectedBtns++;
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image_s", "").c_str(); btn_image = btn_imageSel;
} }
else
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image", "").c_str();
} }
else if(btnSource == "realnand" || btnSource == "emunand") else if(((btnSource == "realnand" && !m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand")) ||
{ (btnSource == "emunand" && m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand"))) && m_cfg.getBool(CHANNEL_DOMAIN, "source", false))
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image", "").c_str();
if(m_cfg.getBool(CHANNEL_DOMAIN, "source", false) && !m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand") && btnSource == "realnand")
{ {
sourceBtn = i; sourceBtn = i;
selectedBtns++; selectedBtns++;
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image_s", "").c_str(); btn_image = btn_imageSel;
} }
else if(m_cfg.getBool(CHANNEL_DOMAIN, "source", false) && m_cfg.getBool(CHANNEL_DOMAIN, "emu_nand") && btnSource == "emunand") else if(btnSource == "dml" || btnSource == "homebrew" || btnSource == "wii")
{
sourceBtn = i;
selectedBtns++;
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image_s", "").c_str();
}
}
else if(btnSource != "realnand" && btnSource != "emunand" && btnSource != "plugin" && btnSource != "allplugins")
{ {
string domain = (btnSource == "dml" ? GC_DOMAIN : (btnSource == "homebrew" ? HOMEBREW_DOMAIN : WII_DOMAIN)); string domain = (btnSource == "dml" ? GC_DOMAIN : (btnSource == "homebrew" ? HOMEBREW_DOMAIN : WII_DOMAIN));
if(m_cfg.getBool(domain, "source", false)) if(m_cfg.getBool(domain, "source", false))
{ {
sourceBtn = i; sourceBtn = i;
selectedBtns++; selectedBtns++;
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image_s", "").c_str(); btn_image = btn_imageSel;
}
} }
else
ImgName = m_source.getString(fmt("BUTTON_%i", i),"image", "").c_str();
} }
ImgSelName = m_source.getString(fmt("BUTTON_%i", i),"image_s", "").c_str();
if(i >= j && i < (j + 12)) if(i >= j && i < (j + 12))
{ {
TexData texConsoleImg; TexData texConsoleImg;
TexData texConsoleImgs; TexData texConsoleImgs;
if(TexHandle.fromImageFile(texConsoleImg, fmt("%s/%s/%s", m_sourceDir.c_str(), themeName.c_str(), ImgName)) != TE_OK) if(TexHandle.fromImageFile(texConsoleImg, fmt("%s/%s/%s", m_sourceDir.c_str(), themeName.c_str(), btn_image)) != TE_OK)
{ {
if(TexHandle.fromImageFile(texConsoleImg, fmt("%s/%s", m_sourceDir.c_str(), ImgName)) != TE_OK) if(TexHandle.fromImageFile(texConsoleImg, fmt("%s/%s", m_sourceDir.c_str(), btn_image)) != TE_OK)
TexHandle.fromImageFile(texConsoleImg, fmt("%s/favoriteson.png", m_imgsDir.c_str())); TexHandle.fromImageFile(texConsoleImg, fmt("%s/favoriteson.png", m_imgsDir.c_str()));
} }
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s/%s", m_sourceDir.c_str(), themeName.c_str(), ImgSelName)) != TE_OK) if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s/%s", m_sourceDir.c_str(), themeName.c_str(), btn_imageSel)) != TE_OK)
{ {
if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s", m_sourceDir.c_str(), ImgSelName)) != TE_OK) if(TexHandle.fromImageFile(texConsoleImgs, fmt("%s/%s", m_sourceDir.c_str(), btn_imageSel)) != 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 - j], texConsoleImg, texConsoleImgs);
@ -176,154 +243,8 @@ void CMenu::_showSourceNotice(void)
exitSource = false; exitSource = false;
} }
void CMenu::_sourceFlow()
{
u8 k;
const dir_discHdr *hdr = CoverFlow.getHdr();
if(m_cfg.getBool("SOURCEFLOW", "remember_last_item", true))
m_cfg.setString("SOURCEFLOW", "current_item", strrchr(hdr->path, '/') + 1);
else
m_cfg.remove("SOURCEFLOW", "current_item");
memset(btn_selected, 0, 256);
strncpy(btn_selected, fmt("BUTTON_%i", hdr->settings[0]), 255);
string source = m_source.getString(btn_selected, "source", "");
_clearSources();// may have to move this
/*if(source == "wii")
{
m_cfg.setBool(WII_DOMAIN, "source", true);
if(sf_mode == 0)
{
m_current_view = COVERFLOW_WII;
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
}
}*/
if(source == "wii")
{
m_current_view = COVERFLOW_WII;
m_cfg.setBool(WII_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
}
else if(source == "dml")
{
m_current_view = COVERFLOW_GAMECUBE;
m_cfg.setBool(GC_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
}
else if(source == "emunand")
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
}
else if(source == "realnand")
{
m_current_view = COVERFLOW_CHANNEL;
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
}
else if(source == "homebrew")
{
m_current_view = COVERFLOW_HOMEBREW;
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
/*if(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true))
cf_domain = "_SMALLFLOW";
else
cf_domain = "_COVERFLOW";*/
}
else if(source == "allplugins")
{
m_current_view = COVERFLOW_PLUGIN;
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
}
else if(source == "plugin")
{
magicNums.clear();
magicNums = m_source.getStrings(btn_selected, "magic", ',');
u32 plugin_magic_nums = magicNums.size();
if(plugin_magic_nums != 0)
{
m_current_view = COVERFLOW_PLUGIN;
m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{
s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16));
if(exist >= 0)
m_plugin.SetEnablePlugin(m_cfg, exist, 2);
if(plugin_magic_nums == 1)
{
currentPartition = m_cfg.getInt("PLUGINS_PARTITION", itr->c_str(), 1);
//currentPartition = m_pluginscfg.getInt(itr->c_str(), "partition", 1);
m_cfg.setInt(PLUGIN_DOMAIN, "partition", currentPartition);
//cf_domain = m_pluginscfg.getString(itr->c_str(), "flow", "_COVERFLOW").c_str();
}
}
}
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
//cf_domain = m_pluginscfg.getString(btn_selected, "flow", "_COVERFLOW").c_str();
int layout = m_source.getInt(btn_selected, "emuflow", 0);
if(layout > 0)
m_cfg.setInt(PLUGIN_DOMAIN, "last_cf_mode", layout);
int category = m_source.getInt(btn_selected, "category", 0);
if(category > 0)
{
m_cat.remove("GENERAL", "selected_categories");
m_cat.remove("GENERAL", "required_categories");
char cCh = static_cast<char>(category + 32);
string newSelCats(1, cCh);
m_cat.setString("GENERAL", "selected_categories", newSelCats);
m_clearCats = false;
}
}
m_sourceflow = false;// do something with this when in muilti
//no autoboot if multi mode. may have to make sure autoboot plugins are hidden from flow when multi is on.
/* autoboot */
const char *autoboot = m_source.getString(btn_selected, "autoboot", "").c_str();
if(autoboot != NULL && autoboot[0] != '\0')
{
m_source_autoboot = true;
memset(&m_autoboot_hdr, 0, sizeof(dir_discHdr));
if(source == "emunand" || source == "realnand")
{
m_autoboot_hdr.type = TYPE_CHANNEL;
memcpy(m_autoboot_hdr.id, autoboot, 4);
}
else if(source == "wii")
{
m_autoboot_hdr.type = TYPE_WII_GAME;
memcpy(m_autoboot_hdr.id, autoboot, 6);
}
else if(source == "dml")
{
m_autoboot_hdr.type = TYPE_GC_GAME;
memcpy(m_autoboot_hdr.id, autoboot, 6);
}
else if(source == "homebrew")
{
m_autoboot_hdr.type = TYPE_HOMEBREW;
mbstowcs(m_autoboot_hdr.title, autoboot, 63);
}
else if(source == "plugin")
{
m_autoboot_hdr.type = TYPE_PLUGIN;
mbstowcs(m_autoboot_hdr.title, autoboot, 63);
}
else
m_source_autoboot = false;
}
}
bool CMenu::_Source() bool CMenu::_Source()
{ {
u8 i, j, k;
parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false); parental_homebrew = m_cfg.getBool(HOMEBREW_DOMAIN, "parental", false);
show_homebrew = (!m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) && (parental_homebrew || !m_locked)); show_homebrew = (!m_cfg.getBool(HOMEBREW_DOMAIN, "disable", false) && (parental_homebrew || !m_locked));
show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false); show_channel = !m_cfg.getBool(CHANNEL_DOMAIN, "disable", false);
@ -333,8 +254,8 @@ bool CMenu::_Source()
bool updateSource = false; bool updateSource = false;
exitSource = false; exitSource = false;
m_showtimer = 0; m_showtimer = 0;
source_curPage = 1; curPage = 1;
source_Pages = 1; numPages = 1;
SetupInput(); SetupInput();
_showSource(); _showSource();
@ -343,9 +264,9 @@ bool CMenu::_Source()
for(i = m_cfg.getInt("GENERAL", "max_source_buttons", 71); i > 11; --i) for(i = m_cfg.getInt("GENERAL", "max_source_buttons", 71); i > 11; --i)
{ {
string source = m_source.getString(fmt("BUTTON_%i", i), "source", ""); string source = m_source.getString(fmt("BUTTON_%i", i), "source", "");
if (!source.empty()) if(!source.empty())
{ {
source_Pages = (i / 12) + 1; numPages = (i / 12) + 1;
break; break;
} }
} }
@ -366,96 +287,89 @@ bool CMenu::_Source()
} }
if((BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnBack)) || BTN_B_PRESSED) if((BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnBack)) || BTN_B_PRESSED)
{ {
if(selectedBtns == 1) if(!m_multisource) break;
{ cf_domain = "_COVERFLOW";
m_catStartPage = m_source.getInt(fmt("BUTTON_%i", sourceBtn), "cat_page", 1); m_combined_view = false;
if(m_source.getString(fmt("BUTTON_%i", sourceBtn), "source") == "plugin")
{
//cf_domain = m_source.getString(fmt("BUTTON_%i", sourceBtn), "flow", "_COVERFLOW").c_str();
int layout = m_source.getInt(fmt("BUTTON_%i", sourceBtn), "emuflow", 0);
if(layout > 0)
m_cfg.setInt(PLUGIN_DOMAIN, "last_cf_mode", layout);
int category = m_source.getInt(fmt("BUTTON_%i", sourceBtn), "category", 0);
if(category > 0)
{
m_cat.remove("GENERAL", "selected_categories");
m_cat.remove("GENERAL", "required_categories");
char cCh = static_cast<char>(category + 32);
string newSelCats(1, cCh);
m_cat.setString("GENERAL", "selected_categories", newSelCats);
m_clearCats = false;
}
}
/*if(m_source.getString(fmt("BUTTON_%i", sourceBtn), "source") == "homebrew" && m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true))
cf_domain = "_SMALLFLOW";
else
cf_domain = "_COVERFLOW";*/
}
if(selectedBtns == 0) if(selectedBtns == 0)
{
m_cfg.setBool(WII_DOMAIN, "source", true); m_cfg.setBool(WII_DOMAIN, "source", true);
m_current_view = COVERFLOW_WII;
vector<bool> plugin_list = m_plugin.GetEnabledPlugins(m_cfg, &enabledPluginsCount);
if(enabledPluginsCount == 1)
{
u8 i = 0;
for(i = 0; i < plugin_list.size(); ++i)
{
if(plugin_list[i] == true)
break; break;
} }
strncpy(m_plugin.PluginMagicWord, fmt("%08x", m_plugin.getPluginMagic(i)), 8); if(selectedBtns == 1)
currentPartition = m_cfg.getInt("PLUGINS_PARTITION", m_plugin.PluginMagicWord, 1); {
m_cfg.setInt(PLUGIN_DOMAIN, "partition", currentPartition); memset(btn_selected, 0, 16);
strncpy(btn_selected, fmt("BUTTON_%i", sourceBtn), 15);
_setSrcOptions();
//break;
} }
u8 sourceCount = 0; u8 sourceCount = 0;
if(m_cfg.getBool(WII_DOMAIN, "source", false)) if(m_cfg.getBool(WII_DOMAIN, "source", false))
{
sourceCount++; sourceCount++;
m_current_view = COVERFLOW_WII;
}
if(m_cfg.getBool(GC_DOMAIN, "source", false)) if(m_cfg.getBool(GC_DOMAIN, "source", false))
{
sourceCount++; sourceCount++;
m_current_view = COVERFLOW_GAMECUBE;
}
if(m_cfg.getBool(CHANNEL_DOMAIN, "source", false)) if(m_cfg.getBool(CHANNEL_DOMAIN, "source", false))
{
sourceCount++; sourceCount++;
m_current_view = COVERFLOW_CHANNEL;
}
if(m_cfg.getBool(HOMEBREW_DOMAIN, "source", false)) if(m_cfg.getBool(HOMEBREW_DOMAIN, "source", false))
{
sourceCount++; sourceCount++;
m_current_view = COVERFLOW_HOMEBREW;
}
if(m_cfg.getBool(PLUGIN_DOMAIN, "source", false)) if(m_cfg.getBool(PLUGIN_DOMAIN, "source", false))
{
sourceCount++; sourceCount++;
m_current_view = COVERFLOW_PLUGIN;
}
if(sourceCount > 1) if(sourceCount > 1)
{
m_combined_view = true; m_combined_view = true;
m_current_view = COVERFLOW_MAX;
}
break; break;
} }
else if(BTN_UP_PRESSED) else if(BTN_UP_PRESSED)
m_btnMgr.up(); m_btnMgr.up();
else if(BTN_DOWN_PRESSED) else if(BTN_DOWN_PRESSED)
m_btnMgr.down(); m_btnMgr.down();
else if(((BTN_LEFT_PRESSED || (!m_multisource && BTN_MINUS_PRESSED)) && source_Pages > 1) else if(((BTN_LEFT_PRESSED || (!m_multisource && BTN_MINUS_PRESSED)) && numPages > 1)
|| (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM))) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageM)))
{ {
source_curPage--; curPage--;
if(source_curPage < 1) if(curPage < 1)
source_curPage = source_Pages; curPage = numPages;
if(!BTN_A_PRESSED) if(!BTN_A_PRESSED)
m_btnMgr.click(m_sourceBtnPageM); m_btnMgr.click(m_sourceBtnPageM);
_updateSourceBtns(); _updateSourceBtns();
} }
else if(((BTN_RIGHT_PRESSED || (!m_multisource && BTN_PLUS_PRESSED)) && source_Pages > 1) else if(((BTN_RIGHT_PRESSED || (!m_multisource && BTN_PLUS_PRESSED)) && numPages > 1)
|| (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageP))) || (BTN_A_PRESSED && m_btnMgr.selected(m_sourceBtnPageP)))
{ {
source_curPage++; curPage++;
if(source_curPage > source_Pages) if(curPage > numPages)
source_curPage = 1; curPage = 1;
if (!BTN_A_PRESSED) if(!BTN_A_PRESSED)
m_btnMgr.click(m_sourceBtnPageP); m_btnMgr.click(m_sourceBtnPageP);
_updateSourceBtns(); _updateSourceBtns();
} }
else if(BTN_A_PRESSED || (BTN_PLUS_PRESSED && m_multisource)) else if(BTN_A_PRESSED || (BTN_PLUS_PRESSED && m_multisource))
{ {
j = (source_curPage - 1) * 12; j = (curPage - 1) * 12;
for(i = 0; i < 12; ++i) for(i = 0; i < 12; ++i)
{ {
if(m_btnMgr.selected(m_sourceBtnSource[i])) if(m_btnMgr.selected(m_sourceBtnSource[i]))
{ {
memset(btn_selected, 0, 256); memset(btn_selected, 0, 16);
strncpy(btn_selected, fmt("BUTTON_%i", i + j), 255); strncpy(btn_selected, fmt("BUTTON_%i", i + j), 15);
string source = m_source.getString(btn_selected, "source", ""); source = m_source.getString(btn_selected, "source", "");
if(BTN_A_PRESSED) if(BTN_A_PRESSED)
{ {
_clearSources(); _clearSources();
@ -464,7 +378,8 @@ bool CMenu::_Source()
if(source == "wii") if(source == "wii")
{ {
m_cfg.setBool(WII_DOMAIN, "source", true); m_cfg.setBool(WII_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1); m_current_view = COVERFLOW_WII;
_setSrcOptions();
} }
else if(source == "dml") else if(source == "dml")
{ {
@ -473,29 +388,23 @@ bool CMenu::_Source()
else else
{ {
m_cfg.setBool(GC_DOMAIN, "source", true); m_cfg.setBool(GC_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1); m_current_view = COVERFLOW_GAMECUBE;
_setSrcOptions();
} }
} }
else if(source == "emunand") else if(source == "emunand" || source == "realnand")
{ {
if(!show_channel) if(!show_channel)
_showSourceNotice(); _showSourceNotice();
else else
{ {
if(source == "emunand")
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true); m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", true);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
}
}
else if(source == "realnand")
{
if(!show_channel)
_showSourceNotice();
else else
{
m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false); m_cfg.setBool(CHANNEL_DOMAIN, "emu_nand", false);
m_cfg.setBool(CHANNEL_DOMAIN, "source", true); m_cfg.setBool(CHANNEL_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1); m_current_view = COVERFLOW_CHANNEL;
_setSrcOptions();
} }
} }
else if(source == "homebrew") else if(source == "homebrew")
@ -505,11 +414,8 @@ bool CMenu::_Source()
else else
{ {
m_cfg.setBool(HOMEBREW_DOMAIN, "source", true); m_cfg.setBool(HOMEBREW_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1); m_current_view = COVERFLOW_HOMEBREW;
/*if(m_cfg.getBool(HOMEBREW_DOMAIN, "smallbox", true)) _setSrcOptions();
cf_domain = "_SMALLFLOW";
else
cf_domain = "_COVERFLOW";*/
} }
} }
else if(source == "allplugins") else if(source == "allplugins")
@ -519,9 +425,10 @@ bool CMenu::_Source()
else else
{ {
m_cfg.setBool(PLUGIN_DOMAIN, "source", true); m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1); m_current_view = COVERFLOW_PLUGIN;
for(k = 0; k < m_numPlugins; ++k) for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */ m_plugin.SetEnablePlugin(m_cfg, k, 2); /* force enable */
_setSrcOptions();
} }
} }
else if(source == "plugin") else if(source == "plugin")
@ -532,80 +439,25 @@ bool CMenu::_Source()
{ {
magicNums.clear(); magicNums.clear();
magicNums = m_source.getStrings(btn_selected, "magic", ','); magicNums = m_source.getStrings(btn_selected, "magic", ',');
u32 plugin_magic_nums = magicNums.size(); if(magicNums.size() > 0)//may need to handle if zero magic #s
if(plugin_magic_nums != 0)
{ {
m_cfg.setBool(PLUGIN_DOMAIN, "source", true); m_cfg.setBool(PLUGIN_DOMAIN, "source", true);
m_current_view = COVERFLOW_PLUGIN;
_setSrcOptions();
for(k = 0; k < m_numPlugins; ++k) for(k = 0; k < m_numPlugins; ++k)
m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */ m_plugin.SetEnablePlugin(m_cfg, k, 1); /* force disable */
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++) for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{ {
s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16)); s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16));
if(exist >= 0) if(exist >= 0)
{
m_plugin.SetEnablePlugin(m_cfg, exist, 2); m_plugin.SetEnablePlugin(m_cfg, exist, 2);
if(plugin_magic_nums == 1)
{
currentPartition = m_cfg.getInt("PLUGINS_PARTITION", itr->c_str(), 1);
m_cfg.setInt(PLUGIN_DOMAIN, "partition", currentPartition);
} }
} }
} }
} }
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1); break;//what if source string was invalid or empty?
//cf_domain = m_source.getString(fmt("BUTTON_%i", sourceBtn), "flow", "_COVERFLOW").c_str();
int layout = m_source.getInt(btn_selected, "emuflow", 0);
if(layout > 0)
m_cfg.setInt(PLUGIN_DOMAIN, "last_cf_mode", layout);
int category = m_source.getInt(btn_selected, "category", 0);
if(category > 0)
{
m_cat.remove("GENERAL", "selected_categories");
m_cat.remove("GENERAL", "required_categories");
char cCh = static_cast<char>(category + 32);
string newSelCats(1, cCh);
m_cat.setString("GENERAL", "selected_categories", newSelCats);
m_clearCats = false;
} }
} else /* m_multisource */
}
/* autoboot */
const char *autoboot = m_source.getString(btn_selected, "autoboot", "").c_str();
if(autoboot != NULL && autoboot[0] != '\0')
{
m_source_autoboot = true;
memset(&m_autoboot_hdr, 0, sizeof(dir_discHdr));
if(source == "emunand" || source == "realnand")
{
m_autoboot_hdr.type = TYPE_CHANNEL;
memcpy(m_autoboot_hdr.id, autoboot, 4);
}
else if(source == "wii")
{
m_autoboot_hdr.type = TYPE_WII_GAME;
memcpy(m_autoboot_hdr.id, autoboot, 6);
}
else if(source == "dml")
{
m_autoboot_hdr.type = TYPE_GC_GAME;
memcpy(m_autoboot_hdr.id, autoboot, 6);
}
else if(source == "homebrew")
{
m_autoboot_hdr.type = TYPE_HOMEBREW;
mbstowcs(m_autoboot_hdr.title, autoboot, 63);
}
else if(source == "plugin")
{
m_autoboot_hdr.type = TYPE_PLUGIN;
mbstowcs(m_autoboot_hdr.title, autoboot, 63);
}
else
m_source_autoboot = false;
}
break;
}
else
{ {
updateSource = true; updateSource = true;
if(source == "wii") if(source == "wii")
@ -658,13 +510,12 @@ bool CMenu::_Source()
{ {
for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++) for(vector<string>::iterator itr = magicNums.begin(); itr != magicNums.end(); itr++)
{ {
u32 cur_magic = strtoul(itr->c_str(), NULL, 16); s8 exist = m_plugin.GetPluginPosition(strtoul(itr->c_str(), NULL, 16));
s8 exist = m_plugin.GetPluginPosition(cur_magic);
if(exist >= 0) if(exist >= 0)
{ {
bool enabled = m_plugin.GetEnableStatus(m_cfg, cur_magic); bool enabled = m_plugin.GetEnableStatus(m_cfg, strtoul(itr->c_str(), NULL, 16));
m_plugin.SetEnablePlugin(m_cfg, exist, enabled ? 1 : 2); m_plugin.SetEnablePlugin(m_cfg, exist, enabled ? 1 : 2);
break; //break;
} }
} }
} }
@ -698,6 +549,103 @@ bool CMenu::_Source()
return noChanges; return noChanges;
} }
//letters in lower case only
static const char sideCovers[4][9] = {
"534e5854", //Snes9X-Next
"534e4553", //SNES9xGX
"4e4f3634", //Not64
"57493634" //Wii64
};
static const char shortCovers[12][9] = {
"474d4254", //Gambatte
"474d4264", //Gambatte GB
"474d4274", //Gambatte GBC
"56425854", //VBA-Next
"56424158", //VbaGX
"56424168", //VbaGX GB
"56424178", //VbaGX GBC
"56424188", //VbaGX GBA
"4d45445e", //WiiMednafen GB
"4d45446e", //WiiMednafen GBC
"4d45447e", //WiiMednafen GBA
"57495358" //WiiSX - playstation
};
bool CMenu::_sideCover(const char *magic)
{
if(magic == NULL)
return false;
for(i = 0; i < 4; i++)
{
if(memcmp(magic, sideCovers[i], 9) == 0)
return true;
}
return false;
}
bool CMenu::_shortCover(const char *magic)
{
if(magic == NULL)
return false;
for(i = 0; i < 12; i++)
{
if(memcmp(magic, shortCovers[i], 9) == 0)
return true;
}
return false;
}
void CMenu::_setSrcOptions(void)
{
m_catStartPage = m_source.getInt(btn_selected, "cat_page", 1);
int category = m_source.getInt(btn_selected, "category", 0);
if(category > 0)
{
m_cat.remove("GENERAL", "selected_categories");
m_cat.remove("GENERAL", "required_categories");
char cCh = static_cast<char>(category + 32);
string newSelCats(1, cCh);
m_cat.setString("GENERAL", "selected_categories", newSelCats);
m_clearCats = false;
}
if(m_multisource) return;
/* autoboot */
const char *autoboot = m_source.getString(btn_selected, "autoboot", "").c_str();
if(autoboot != NULL && autoboot[0] != '\0')
{
m_source_autoboot = true;
memset(&m_autoboot_hdr, 0, sizeof(dir_discHdr));
if(source == "emunand" || source == "realnand")
{
m_autoboot_hdr.type = TYPE_CHANNEL;
memcpy(m_autoboot_hdr.id, autoboot, 4);
}
else if(source == "wii")
{
m_autoboot_hdr.type = TYPE_WII_GAME;
memcpy(m_autoboot_hdr.id, autoboot, 6);
}
else if(source == "dml")
{
m_autoboot_hdr.type = TYPE_GC_GAME;
memcpy(m_autoboot_hdr.id, autoboot, 6);
}
else if(source == "homebrew")
{
m_autoboot_hdr.type = TYPE_HOMEBREW;
mbstowcs(m_autoboot_hdr.title, autoboot, 63);
}
else if(source == "plugin")
{
m_autoboot_hdr.type = TYPE_PLUGIN;
mbstowcs(m_autoboot_hdr.title, autoboot, 63);
}
else
m_source_autoboot = false;
}
}
void CMenu::_clearSources(void) void CMenu::_clearSources(void)
{ {
m_cfg.setBool(WII_DOMAIN, "source", false); m_cfg.setBool(WII_DOMAIN, "source", false);
@ -734,7 +682,7 @@ void CMenu::_initSourceMenu()
int col; int col;
string ImgName; string ImgName;
for(u8 i = 0; i < 12; ++i) for(i = 0; i < 12; ++i)
{ {
TexData texConsoleImg; TexData texConsoleImg;
TexData texConsoleImgs; TexData texConsoleImgs;

View File

@ -4,7 +4,8 @@
#include "lockMutex.hpp" #include "lockMutex.hpp"
#include "loader/wbfs.h" #include "loader/wbfs.h"
int version_num = 0, num_versions = 0, i; int version_num = 0, num_versions = 0;
static int i;
const int CMenu::SVN_REV_NUM = atoi(SVN_REV); const int CMenu::SVN_REV_NUM = atoi(SVN_REV);
int CMenu::_version[9] = {0, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM}; int CMenu::_version[9] = {0, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM};

View File

@ -518,10 +518,11 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
UpdateCache(COVERFLOW_PLUGIN); UpdateCache(COVERFLOW_PLUGIN);
if(upd_chan) if(upd_chan)
UpdateCache(COVERFLOW_CHANNEL); UpdateCache(COVERFLOW_CHANNEL);
_loadList(); //_loadList();
_hideWaitMessage(); _hideWaitMessage();
_initCF(); //_initCF();
CoverFlow.findId(cfPos, true); //CoverFlow.findId(cfPos, true);
m_load_view = true;
Close_Inputs(); Close_Inputs();
Open_Inputs(); Open_Inputs();
for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--) for(int chan = WPAD_MAX_WIIMOTES-1; chan >= 0; chan--)
@ -535,8 +536,9 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op)
currentPartition = SD; currentPartition = SD;
UpdateCache(COVERFLOW_GAMECUBE); UpdateCache(COVERFLOW_GAMECUBE);
} }
_loadList(); //_loadList();
_initCF(); //_initCF();
m_load_view = true;
} }
return done; return done;
} }