Skip to content

Commit

Permalink
win32: default new cheat val to current cheat val, show error on empty
Browse files Browse the repository at this point in the history
new val (#918)
  • Loading branch information
OV2 committed May 9, 2024
1 parent 87f050f commit d62f142
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion win32/rsrc/snes9x.rc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ BEGIN
END

IDD_CHEATER DIALOGEX 0, 0, 378, 189
STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU
CAPTION "Cheat Entry and Editor"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
Expand Down
6 changes: 6 additions & 0 deletions win32/wsnes9x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10199,6 +10199,7 @@ INT_PTR CALLBACK DlgCheatSearchAdd(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
memset(buf,0,sizeof(TCHAR) * 12);
_stprintf(buf, TEXT("%u"), new_cheat->new_val);
SetDlgItemText(hDlg, IDC_NC_CURRVAL, buf);
SetDlgItemText(hDlg, IDC_NC_NEWVAL, buf);
memset(buf,0,sizeof(TCHAR) * 12);
_stprintf(buf, TEXT("%u"), new_cheat->saved_val);
SetDlgItemText(hDlg, IDC_NC_PREVVAL, buf);
Expand Down Expand Up @@ -10380,6 +10381,11 @@ INT_PTR CALLBACK DlgCheatSearchAdd(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP

ret=0;
}
else
{
MessageBox(hDlg, SEARCH_ERR_INVALIDNEWVALUE, SEARCH_TITLE_RANGEERROR, MB_OK);
return true;
}
}

case IDCANCEL:
Expand Down

0 comments on commit d62f142

Please sign in to comment.