diff --git a/win32/rsrc/resource.h b/win32/rsrc/resource.h index a4016b4b..07389e60 100644 --- a/win32/rsrc/resource.h +++ b/win32/rsrc/resource.h @@ -157,9 +157,10 @@ #define IDC_KEYBOARD 1127 #define IDC_ALLOWLEFTRIGHT 1127 #define IDC_CHEAT_ADDRESS 1128 -#define IDC_CLEAR_CHEATS2 1128 #define IDC_SEARCH_DB 1128 #define IDC_CHEAT_BYTE 1129 +#define IDC_DELETE_CHEAT2 1129 +#define IDC_DELETE_ALL 1129 #define IDC_ADD_CHEAT 1130 #define IDC_CHEAT_LIST 1131 #define IDC_PICTURE 1132 diff --git a/win32/rsrc/snes9x.rc b/win32/rsrc/snes9x.rc index 7339d2d0..366169e6 100644 --- a/win32/rsrc/snes9x.rc +++ b/win32/rsrc/snes9x.rc @@ -253,9 +253,9 @@ FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN CONTROL "List1",IDC_CHEAT_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,5,291,125,WS_EX_CLIENTEDGE PUSHBUTTON "&Add",IDC_ADD_CHEAT,306,7,62,15,WS_DISABLED - PUSHBUTTON "&Delete",IDC_DELETE_CHEAT,306,27,62,15,WS_DISABLED - PUSHBUTTON "&Update",IDC_UPDATE_CHEAT,306,47,62,15,WS_DISABLED - PUSHBUTTON "C&lear",IDC_CLEAR_CHEATS,306,67,62,15 + PUSHBUTTON "&Delete",IDC_DELETE_CHEAT,306,66,62,15,WS_DISABLED + PUSHBUTTON "&Update",IDC_UPDATE_CHEAT,306,26,62,15,WS_DISABLED + PUSHBUTTON "C&lear",IDC_CLEAR_CHEATS,306,46,62,15 EDITTEXT IDC_CHEAT_CODE,86,134,206,15,ES_UPPERCASE | ES_AUTOHSCROLL EDITTEXT IDC_CHEAT_DESCRIPTION,86,154,206,15,ES_AUTOHSCROLL PUSHBUTTON "&OK",IDOK,99,174,50,15 @@ -263,6 +263,7 @@ BEGIN RTEXT "Enter Cheat Code:",IDC_LABEL_CHEAT_CODE,19,134,61,15,SS_CENTERIMAGE RTEXT "Cheat Description:",IDC_LABEL_CHEAT_DESCRIPTION,19,154,61,15,SS_CENTERIMAGE PUSHBUTTON "&Search Database",IDC_SEARCH_DB,306,115,62,15 + PUSHBUTTON "&Remove All",IDC_DELETE_ALL,306,85,62,15 END IDD_NETPLAYPROGRESS DIALOG 0, 0, 186, 61 diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index 41d44858..ebae3022 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -8810,6 +8810,19 @@ INT_PTR CALLBACK DlgCheater(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) ListView_DeleteItem(GetDlgItem(hDlg, IDC_CHEAT_LIST), sel_idx); break; + case IDC_DELETE_ALL: + if (MessageBox(hDlg, + TEXT("This will remove all cheats for this game."), + TEXT("Remove all"), + MB_OKCANCEL | MB_ICONWARNING) != IDOK) + { + break; + } + ListView_DeleteAllItems(GetDlgItem(hDlg, IDC_CHEAT_LIST)); + for (unsigned int j = 0; j < Cheat.g.size(); j++) + { + ct.state[j] = Deleted; + } case IDC_CLEAR_CHEATS: internal_change = true; SetDlgItemText(hDlg,IDC_CHEAT_CODE,TEXT(""));