mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
WX: Add the ability to uninstall WADs from the game list
Simple quality-of-life addition that allows "uninstalling" WADs (removing the corresponding installed title) from the NAND. The option is only enabled when the WAD can be uninstalled The motivation for this is actually to encourage proper usage of the WAD launch feature (installing it to the NAND first), so we can drop the "direct WAD title launch" hack.
This commit is contained in:
@ -53,6 +53,8 @@
|
||||
|
||||
#include "DiscIO/NANDContentLoader.h"
|
||||
#include "DiscIO/NANDImporter.h"
|
||||
#include "DiscIO/VolumeCreator.h"
|
||||
#include "DiscIO/VolumeWad.h"
|
||||
|
||||
#include "DolphinWX/AboutDolphin.h"
|
||||
#include "DolphinWX/Cheats/CheatsWindow.h"
|
||||
@ -1228,6 +1230,31 @@ void CFrame::OnInstallWAD(wxCommandEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::OnUninstallWAD(wxCommandEvent&)
|
||||
{
|
||||
const GameListItem* file = m_GameListCtrl->GetSelectedISO();
|
||||
if (!file)
|
||||
return;
|
||||
|
||||
if (!AskYesNoT("Uninstalling the WAD will remove the currently installed version "
|
||||
"of this title from the NAND without deleting its save data. Continue?"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const auto volume = DiscIO::CreateVolumeFromFilename(file->GetFileName());
|
||||
u64 title_id;
|
||||
volume->GetTitleID(&title_id);
|
||||
if (!DiscIO::CNANDContentManager::Access().RemoveTitle(title_id, Common::FROM_CONFIGURED_ROOT))
|
||||
{
|
||||
PanicAlertT("Failed to remove this title from the NAND.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (title_id == TITLEID_SYSMENU)
|
||||
UpdateLoadWiiMenuItem();
|
||||
}
|
||||
|
||||
void CFrame::OnImportBootMiiBackup(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if (!AskYesNoT("Merging a new NAND over your currently selected NAND will overwrite any channels "
|
||||
|
Reference in New Issue
Block a user