win32: default new cheat val to current cheat val, show error on empty

new val (#918)
This commit is contained in:
OV2 2024-05-10 00:29:19 +02:00
parent 87f050feba
commit d62f14212e
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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);
@ -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: