Merge remote-tracking branch 'TasVideos/master'

This commit is contained in:
mjbudd77 2021-07-15 23:58:28 -04:00
commit 0cef9783ff
4 changed files with 23 additions and 16 deletions

View File

@ -23,6 +23,7 @@
#include "../../version.h" #include "../../version.h"
#include "main.h"
#include "common.h" #include "common.h"
#include "dinput.h" #include "dinput.h"
#include <windows.h> #include <windows.h>
@ -1205,14 +1206,15 @@ static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
nstr = MakeButtString(bc); nstr = MakeButtString(bc);
SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr); SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr);
free(nstr); free(nstr);
} }
{ {
int newkey; int newkey;
int meta = GetKeyMeta(key); int meta = GetKeyMeta(key);
KeyboardUpdateState(); KeyboardUpdateState();
if ((newkey = GetKeyPressed()) != 0) newkey = GetKeyPressed();
if ((newkey != 0) && (newkey != 0x80))
{ {
key = newkey | meta; key = newkey | meta;
ClearExtraMeta(&key); ClearExtraMeta(&key);
@ -1235,6 +1237,8 @@ static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
nstr = MakeButtString(bc); nstr = MakeButtString(bc);
bc->NumC--; bc->NumC--;
SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr); SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr);
/* workaround for enter and tab keys */
SetFocus(GetDlgItem(hwndDlg, LBL_DWBDIALOG_TEXT));
free(nstr); free(nstr);
} }
else if (NothingPressed() && key) else if (NothingPressed() && key)
@ -1256,6 +1260,8 @@ static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
nstr = MakeButtString(bc); nstr = MakeButtString(bc);
SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr); SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr);
/* workaround for enter and tab keys */
SetFocus(GetDlgItem(hwndDlg, LBL_DWBDIALOG_TEXT));
free(nstr); free(nstr);
key = 0; key = 0;
@ -1273,6 +1279,7 @@ static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SetWindowText(hwndDlg, (char*)DWBText); //mbg merge 7/17/06 added cast SetWindowText(hwndDlg, (char*)DWBText); //mbg merge 7/17/06 added cast
BeginJoyWait(hwndDlg); BeginJoyWait(hwndDlg);
KeyboardSetBackgroundAccess(true); KeyboardSetBackgroundAccess(true);
JoystickSetBackgroundAccess(true);
SetTimer(hwndDlg,666,25,0); //Every 25ms. SetTimer(hwndDlg,666,25,0); //Every 25ms.
if (DWBButtons->NumC) if (DWBButtons->NumC)
{ {
@ -1280,8 +1287,8 @@ static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr); SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr);
free(nstr); free(nstr);
} }
/* workaround for enter and tab keys */ /* actually using button instead of label because it's focusable */
SetFocus(NULL); SetFocus(GetDlgItem(hwndDlg, LBL_DWBDIALOG_TEXT));
break; break;
case WM_CLOSE: case WM_CLOSE:
@ -1293,21 +1300,19 @@ static INT_PTR CALLBACK DWBCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
case BTN_CLEAR: case BTN_CLEAR:
{ {
ButtConfig *bc = DWBButtons; ButtConfig *bc = DWBButtons;
char *nstr;
bc->NumC = 0; bc->NumC = 0;
nstr = MakeButtString(bc); SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, "Press a key or a button");
SetDlgItemText(hwndDlg, LBL_DWBDIALOG_TEXT, nstr);
free(nstr);
} }
break; break;
case BTN_CANCEL: case BTN_CANCEL:
memcpy(DWBButtons, &DWBButtonsBackup, sizeof(ButtConfig)); memcpy(DWBButtons, &DWBButtonsBackup, sizeof(ButtConfig));
goto gornk; goto gornk;
case BTN_CLOSE: case BTN_SAVE: /* using BTN_SAVE instead BTN_CLOSE to prevent close on enter key*/
gornk: gornk:
KillTimer(hwndDlg,666); KillTimer(hwndDlg,666);
EndJoyWait(hAppWnd); EndJoyWait(hAppWnd);
KeyboardSetBackgroundAccess(false); KeyboardSetBackgroundAccess(EnableBackgroundInput != 0);
JoystickSetBackgroundAccess(EnableBackgroundInput != 0);
EndDialog(hwndDlg, 0); EndDialog(hwndDlg, 0);
break; break;
} }

View File

@ -107,15 +107,15 @@ BEGIN
PUSHBUTTON "Cancel",BTN_CANCEL,239,230,56,14 PUSHBUTTON "Cancel",BTN_CANCEL,239,230,56,14
END END
DWBDIALOG DIALOGEX 33, 99, 250, 56 DWBDIALOG DIALOGEX 33, 99, 250, 53
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "DWB!" CAPTION "DWB!"
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN BEGIN
LTEXT "Press a key or a button",LBL_DWBDIALOG_TEXT,7,9,237,8 PUSHBUTTON "Press a key or a button",LBL_DWBDIALOG_TEXT,7,5,235,20
PUSHBUTTON "Clear",BTN_CLEAR,64,32,50,14 PUSHBUTTON "Clear",BTN_CLEAR,68,32,50,14
PUSHBUTTON "Cancel",BTN_CANCEL,126,32,50,14 PUSHBUTTON "Cancel",BTN_CANCEL,130,32,50,14
PUSHBUTTON "OK",BTN_CLOSE,188,32,50,14 PUSHBUTTON "OK",BTN_SAVE,192,32,50,14
END END
FKBDIALOG DIALOGEX 13, 72, 402, 194 FKBDIALOG DIALOGEX 13, 72, 402, 194

View File

@ -914,6 +914,7 @@
#define IDC_BINARY 1317 #define IDC_BINARY 1317
#define IDC_GAME_GENIE_ADDR 1501 #define IDC_GAME_GENIE_ADDR 1501
#define IDC_EDIT_SYMBOLIC_INIT 1502 #define IDC_EDIT_SYMBOLIC_INIT 1502
#define BTN_SAVE 1503
#define MENU_INESHEADEREDITOR 40001 #define MENU_INESHEADEREDITOR 40001
#define MENU_INPUT_BARCODE 40004 #define MENU_INPUT_BARCODE 40004
#define ID_BOOKMARKS_IMPORT 40005 #define ID_BOOKMARKS_IMPORT 40005

View File

@ -291,6 +291,7 @@ static void CheckHInfo(void) {
0x2b7103b7a27bd72fULL, /* AD&D Pool of Radiance */ 0x2b7103b7a27bd72fULL, /* AD&D Pool of Radiance */
0x498c10dc463cfe95ULL, /* Battle Fleet */ 0x498c10dc463cfe95ULL, /* Battle Fleet */
0x854d7947a3177f57ULL, /* Crystalis */ 0x854d7947a3177f57ULL, /* Crystalis */
0xfad22d265cd70820ULL, /* Downtown Special: Kunio-kun no Jidaigeki Dayo Zenin Shuugou! */
0x4a1f5336b86851b6ULL, /* DW */ 0x4a1f5336b86851b6ULL, /* DW */
0xb0bcc02c843c1b79ULL, /* DW */ 0xb0bcc02c843c1b79ULL, /* DW */
0x2dcf3a98c7937c22ULL, /* DW 2 */ 0x2dcf3a98c7937c22ULL, /* DW 2 */