-cleaned up startup code for main menu.

-fixed spelling mistakes in menu_cftheme.
This commit is contained in:
fledge68 2012-08-06 16:46:16 +00:00
parent 1d6b882f0d
commit c5a19ee450
3 changed files with 21 additions and 32 deletions

View File

@ -608,10 +608,6 @@ void CMenu::_loadCFCfg(SThemeData &theme)
m_cf.setFont(_font(theme.fontSet, domain, "font", TITLEFONT), m_theme.getColor(domain, "font_color", CColor(0xFFFFFFFF))); m_cf.setFont(_font(theme.fontSet, domain, "font", TITLEFONT), m_theme.getColor(domain, "font_color", CColor(0xFFFFFFFF)));
// Coverflow Count // Coverflow Count
m_numCFVersions = min(max(2, m_theme.getInt("_COVERFLOW", "number_of_modes", 2)), 15); m_numCFVersions = min(max(2, m_theme.getInt("_COVERFLOW", "number_of_modes", 2)), 15);
for (u32 i = 1; i <= m_numCFVersions; ++i)
_loadCFLayout(i);
_loadCFLayout(m_cfg.getInt(_domainFromView(), "last_cf_mode" , 1));
} }
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)

View File

@ -328,7 +328,7 @@ void CMenu::_cfTheme(void)
{ {
m_theme.clear(); m_theme.clear();
m_theme.unload(); m_theme.unload();
m_theme.load(fmt("%s/%s.ini", m_themeDir.c_str(), m_cfg.getString("GENERAL", "theme", "defaut").c_str())); m_theme.load(fmt("%s/%s.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)
@ -409,7 +409,7 @@ void CMenu::_cfTheme(void)
{ {
m_theme.clear(); m_theme.clear();
m_theme.unload(); m_theme.unload();
m_theme.load(fmt("%s/%s.ini", m_themeDir.c_str(), m_cfg.getString("GENERAL", "theme", "defaut").c_str())); m_theme.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))

View File

@ -191,7 +191,8 @@ void CMenu::LoadView(void)
_hideMain(true); _hideMain(true);
m_cf.clear(); m_cf.clear();
_showWaitMessage(); if(!m_vid.showingWaitMessage())
_showWaitMessage();
_loadList(); _loadList();
_showMain(); _showMain();
@ -253,16 +254,13 @@ int CMenu::main(void)
{ {
wstringEx curLetter; wstringEx curLetter;
string prevTheme = m_cfg.getString("GENERAL", "theme", "default"); string prevTheme = m_cfg.getString("GENERAL", "theme", "default");
bool use_grab = m_cfg.getBool("GENERAL", "use_grab", false); parental_homebrew = m_cfg.getBool("HOMEBREW", "parental", false);
show_homebrew = !m_cfg.getBool("HOMEBREW", "disable", false); show_homebrew = !m_cfg.getBool("HOMEBREW", "disable", false);
show_channel = !m_cfg.getBool("GENERAL", "hidechannel", false); show_channel = !m_cfg.getBool("GENERAL", "hidechannel", false);
show_emu = !m_cfg.getBool("EMULATOR", "disable", false); show_emu = !m_cfg.getBool("EMULATOR", "disable", false);
bool dpad_mode = m_cfg.getBool("GENERAL", "dpad_mode", false); bool dpad_mode = m_cfg.getBool("GENERAL", "dpad_mode", false);
bool b_lr_mode = m_cfg.getBool("GENERAL", "b_lr_mode", false); bool b_lr_mode = m_cfg.getBool("GENERAL", "b_lr_mode", false);
parental_homebrew = m_cfg.getBool("HOMEBREW", "parental", false); bool use_grab = m_cfg.getBool("GENERAL", "use_grab", false);
if(m_Emulator_boot)
m_current_view = COVERFLOW_EMU;
m_reload = false; m_reload = false;
static u32 disc_check = 0; static u32 disc_check = 0;
@ -282,28 +280,24 @@ int CMenu::main(void)
m_GameTDBLoaded=true; m_GameTDBLoaded=true;
m_gametdb.CloseFile(); m_gametdb.CloseFile();
} }
if (m_cfg.getBool("GENERAL", "startup_menu", false)) if(m_Emulator_boot)
{ m_current_view = COVERFLOW_EMU;
m_vid.hideWaitMessage();
_Source();
}
if (m_cfg.getBool("GENERAL", "update_cache", false)) if (m_cfg.getBool("GENERAL", "update_cache", false))
{ {
UpdateCache(); UpdateCache();
m_gameList.Update(); m_gameList.Update();
} }
_loadList(); LoadView();
if(m_Emulator_boot) if (m_cfg.getBool("GENERAL", "startup_menu", false))
{ {
_loadCFLayout(m_cfg.getInt(_domainFromView(), "last_cf_mode", 1)); _hideMain();
m_cf.applySettings(); if(!_Source())
LoadView();
else
_showMain();
} }
_showMain();
m_vid.CheckWaitThread(true);
m_curGameId.clear();
_initCF();
lwp_t coverStatus = LWP_THREAD_NULL; lwp_t coverStatus = LWP_THREAD_NULL;
unsigned int stack_size = (unsigned int)32768; unsigned int stack_size = (unsigned int)32768;
SmartBuf coverstatus_stack = smartMem2Alloc(stack_size); SmartBuf coverstatus_stack = smartMem2Alloc(stack_size);
@ -401,7 +395,7 @@ int CMenu::main(void)
{ {
_hideMain(); _hideMain();
_config(1); _config(1);
if(prevTheme != m_cfg.getString("GENERAL", "theme") || m_reload == true) if(prevTheme != m_cfg.getString("GENERAL", "theme"))
{ {
m_reload = true; m_reload = true;
break; break;
@ -412,8 +406,6 @@ int CMenu::main(void)
{ {
_hideMain(); _hideMain();
_about(); _about();
if(m_exit)
break;
_showMain(); _showMain();
} }
else if(m_btnMgr.selected(m_mainBtnDVD)) else if(m_btnMgr.selected(m_mainBtnDVD))
@ -708,7 +700,6 @@ int CMenu::main(void)
_hideMain(); _hideMain();
_CategorySettings(); _CategorySettings();
_showMain(); _showMain();
m_curGameId = m_cf.getId();
_initCF(); _initCF();
} }
if(use_grab) if(use_grab)
@ -829,10 +820,12 @@ int CMenu::main(void)
m_cf.mouse(m_vid, chan, -1, -1); m_cf.mouse(m_vid, chan, -1, -1);
} }
} }
if(m_reload)
_showWaitMessage();
gprintf("Saving configuration files\n"); gprintf("Saving configuration files\n");
m_cfg.save(); m_cfg.save();
m_cat.save(); m_cat.unload();
// m_loc.save(); // m_loc.save();
gprintf("Wait for dvd\n"); gprintf("Wait for dvd\n");
LWP_JoinThread(coverStatus, NULL); LWP_JoinThread(coverStatus, NULL);