@@ -69,10 +69,12 @@ void GameViewer::InitPopupMenu()
69
69
m_popup->Append (boot_item);
70
70
m_popup->Append (1 , _T (" Configure" ));
71
71
m_popup->Append (2 , _T (" Remove Game" ));
72
+ m_popup->Append (3 , _T (" Remove Custom Configuration" ));
72
73
73
74
Bind (wxEVT_MENU, &GameViewer::BootGame, this , 0 );
74
75
Bind (wxEVT_MENU, &GameViewer::ConfigureGame, this , 1 );
75
76
Bind (wxEVT_MENU, &GameViewer::RemoveGame, this , 2 );
77
+ Bind (wxEVT_MENU, &GameViewer::RemoveGameConfig, this , 3 );
76
78
}
77
79
78
80
void GameViewer::DoResize (wxSize size)
@@ -241,6 +243,22 @@ void GameViewer::RemoveGame(wxCommandEvent& event)
241
243
Refresh ();
242
244
}
243
245
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
+
244
262
ColumnsArr::ColumnsArr ()
245
263
{
246
264
Init ();
0 commit comments