Skip to content

Commit ee8fece

Browse files
twdarkehNekotekina
authored andcommitted
remove custom config (RPCS3#2574)
Add remove custom config to right click
1 parent 3bfe17a commit ee8fece

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

rpcs3/Gui/GameViewer.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ void GameViewer::InitPopupMenu()
6969
m_popup->Append(boot_item);
7070
m_popup->Append(1, _T("Configure"));
7171
m_popup->Append(2, _T("Remove Game"));
72+
m_popup->Append(3, _T("Remove Custom Configuration"));
7273

7374
Bind(wxEVT_MENU, &GameViewer::BootGame, this, 0);
7475
Bind(wxEVT_MENU, &GameViewer::ConfigureGame, this, 1);
7576
Bind(wxEVT_MENU, &GameViewer::RemoveGame, this, 2);
77+
Bind(wxEVT_MENU, &GameViewer::RemoveGameConfig, this, 3);
7678
}
7779

7880
void GameViewer::DoResize(wxSize size)
@@ -241,6 +243,22 @@ void GameViewer::RemoveGame(wxCommandEvent& event)
241243
Refresh();
242244
}
243245

246+
void GameViewer::RemoveGameConfig(wxCommandEvent& event)
247+
{
248+
long i = GetFirstSelected();
249+
if (i < 0) return;
250+
251+
if (fs::exists(fs::get_config_dir() + "data/" + m_game_data[i].serial + "/config.yml"))
252+
{
253+
if (wxMessageBox("Delete custom game configuration?", "Confirm Delete", wxYES_NO | wxNO_DEFAULT) == wxYES)
254+
{
255+
fs::remove_file(fs::get_config_dir() + "data/" + m_game_data[i].serial + "/config.yml");
256+
}
257+
}
258+
259+
Refresh();
260+
}
261+
244262
ColumnsArr::ColumnsArr()
245263
{
246264
Init();

rpcs3/Gui/GameViewer.h

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class GameViewer : public wxListView
8787
void BootGame(wxCommandEvent& event);
8888
void ConfigureGame(wxCommandEvent& event);
8989
void RemoveGame(wxCommandEvent& event);
90+
void RemoveGameConfig(wxCommandEvent& event);
9091

9192
private:
9293
virtual void DClick(wxListEvent& event);

0 commit comments

Comments
 (0)