mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-30 15:32:47 +00:00
minor correction to the tools menu, no longer uses uninitialized data when system menu is not installed
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7477 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
67c0f67be9
commit
f777aca3a6
@ -206,11 +206,20 @@ void CFrame::CreateMenu()
|
|||||||
|
|
||||||
toolsMenu->Append(IDM_INSTALLWAD, _("Install WAD"));
|
toolsMenu->Append(IDM_INSTALLWAD, _("Install WAD"));
|
||||||
|
|
||||||
int sysmenuVersion = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU).GetTitleVersion();
|
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, true);
|
||||||
char sysmenuRegion = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU).GetCountryChar();
|
if (SysMenu_Loader.IsValid())
|
||||||
|
{
|
||||||
|
int sysmenuVersion = SysMenu_Loader.GetTitleVersion();
|
||||||
|
char sysmenuRegion = SysMenu_Loader.GetCountryChar();
|
||||||
|
|
||||||
|
toolsMenu->Append(IDM_LOAD_WII_MENU)->SetItemLabel(wxString::Format(_("Load Wii System Menu %d%c"), sysmenuVersion, sysmenuRegion));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
toolsMenu->Append(IDM_LOAD_WII_MENU, _("Load Wii System Menu"));
|
||||||
|
toolsMenu->Enable(IDM_LOAD_WII_MENU, false);
|
||||||
|
}
|
||||||
|
|
||||||
toolsMenu->Append(IDM_LOAD_WII_MENU, wxString::Format(_("Load Wii System Menu %d%c"), sysmenuVersion, sysmenuRegion));
|
|
||||||
toolsMenu->Enable(IDM_LOAD_WII_MENU, DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU).IsValid());
|
|
||||||
|
|
||||||
|
|
||||||
toolsMenu->Append(IDM_FIFOPLAYER, _("Fifo Player"));
|
toolsMenu->Append(IDM_FIFOPLAYER, _("Fifo Player"));
|
||||||
@ -1346,15 +1355,19 @@ void CFrame::OnLoadWiiMenu(wxCommandEvent& event)
|
|||||||
u64 titleID = CBoot::Install_WiiWAD(path.mb_str());
|
u64 titleID = CBoot::Install_WiiWAD(path.mb_str());
|
||||||
if (titleID == TITLEID_SYSMENU)
|
if (titleID == TITLEID_SYSMENU)
|
||||||
{
|
{
|
||||||
const DiscIO::INANDContentLoader & _Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, true);
|
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, true);
|
||||||
if (_Loader.IsValid())
|
if (SysMenu_Loader.IsValid())
|
||||||
{
|
{
|
||||||
int sysmenuVersion = _Loader.GetTitleVersion();
|
int sysmenuVersion = SysMenu_Loader.GetTitleVersion();
|
||||||
char sysmenuRegion = _Loader.GetCountryChar();
|
char sysmenuRegion = SysMenu_Loader.GetCountryChar();
|
||||||
|
|
||||||
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable();
|
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable();
|
||||||
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->SetItemLabel(wxString::Format(_("Load Wii System Menu %d%c"), sysmenuVersion, sysmenuRegion));
|
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->SetItemLabel(wxString::Format(_("Load Wii System Menu %d%c"), sysmenuVersion, sysmenuRegion));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetMenuBar()->FindItem(IDM_LOAD_WII_MENU)->Enable(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user