WX: Disable a few menu items when a Wii title is running

Unsafe and keeping them enabled would allow inaccurate behaviour that
can break games.
This commit is contained in:
Léo Lam
2017-03-29 15:47:04 +02:00
parent 4c0a392698
commit d8089a457f
3 changed files with 34 additions and 4 deletions

View File

@ -514,7 +514,7 @@ void MainMenuBar::RefreshMenuLabels() const
{
RefreshPlayMenuLabel();
RefreshSaveStateMenuLabels();
RefreshWiiSystemMenuLabel();
RefreshWiiToolsLabels();
}
void MainMenuBar::RefreshPlayMenuLabel() const
@ -545,6 +545,21 @@ void MainMenuBar::RefreshSaveStateMenuLabels() const
}
}
void MainMenuBar::RefreshWiiToolsLabels() const
{
RefreshWiiSystemMenuLabel();
// The Install WAD option should not be enabled while emulation is running, because
// having unexpected title changes can confuse emulated software; and of course, this is
// not possible on a real Wii and won't be if we have IOS LLE (or simply more accurate IOS HLE).
//
// For similar reasons, it should not be possible to export or import saves, because this can
// result in the emulated software being confused, or even worse, exported saves having
// inconsistent data.
for (const int index : {IDM_MENU_INSTALL_WAD, IDM_EXPORT_ALL_SAVE, IDM_IMPORT_SAVE})
FindItem(index)->Enable(!Core::IsRunning() || !SConfig::GetInstance().bWii);
}
void MainMenuBar::RefreshWiiSystemMenuLabel() const
{
auto* const item = FindItem(IDM_LOAD_WII_MENU);