mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2024-12-22 20:06:22 +01:00
key mapper dialog, ready.
This commit is contained in:
parent
2da95a2e8a
commit
12066963f0
8 changed files with 311 additions and 50 deletions
Binary file not shown.
|
@ -212,26 +212,26 @@ BEGIN
|
|||
LTEXT "Components:",176,2,3,43,8
|
||||
END
|
||||
|
||||
KEYMAPPER DIALOG 2, 9, 284, 183
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU
|
||||
KEYMAPPER DIALOGEX 2, 9, 284, 183
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "3D Pinball: Player Controls"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x0
|
||||
BEGIN
|
||||
PUSHBUTTON "OK",1,119,163,50,14
|
||||
PUSHBUTTON "Cancel",2,173,163,50,14
|
||||
PUSHBUTTON "&Default",501,227,163,50,14
|
||||
PUSHBUTTON "OK",KEYMAPPER_Ok,119,163,50,14
|
||||
PUSHBUTTON "Cancel",KEYMAPPER_Cancel,173,163,50,14
|
||||
PUSHBUTTON "&Default",KEYMAPPER_Default,227,163,50,14
|
||||
LTEXT "&Left Flipper",901,20,87,39,10
|
||||
COMBOBOX 401,66,85,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX KEYMAPPER_FlipperL,66,85,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Right &Flipper",902,146,87,44,10
|
||||
COMBOBOX 402,192,85,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX KEYMAPPER_FlipperR,192,85,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Left &Table Bump",904,20,107,34,17
|
||||
COMBOBOX 404,66,108,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX KEYMAPPER_BumpLeft,66,108,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "&Right Table Bump",905,146,107,38,19
|
||||
COMBOBOX 405,192,108,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX KEYMAPPER_BumpRight,192,108,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "&BottomTable Bump",906,20,131,41,18
|
||||
COMBOBOX 406,66,133,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX KEYMAPPER_BumpBottom,66,133,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "&Plunger",903,146,136,39,8
|
||||
COMBOBOX 403,192,133,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX KEYMAPPER_Plunger,192,133,53,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "To change game controls, choose the control options you want, click the Arrow buttons to change specific keys, and then choose OK.",801,14,17,249,18
|
||||
LTEXT "To restore 3D Pinball to its original settings, choose Default, and then choose OK. To use the Arrow keys on the numeric keypad, make sure NUMLOCK is off.",802,14,38,256,25
|
||||
GROUPBOX "Control Options",908,7,71,269,87
|
||||
|
@ -313,6 +313,10 @@ BEGIN
|
|||
"DLG_HIGHSCORES", DIALOG
|
||||
BEGIN
|
||||
END
|
||||
|
||||
"KEYMAPPER", DIALOG
|
||||
BEGIN
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
@ -327,6 +331,11 @@ BEGIN
|
|||
0
|
||||
END
|
||||
|
||||
KEYMAPPER AFX_DIALOG_LAYOUT
|
||||
BEGIN
|
||||
0
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "fullscrn.h"
|
||||
#include "memory.h"
|
||||
#include "options.h"
|
||||
#include "pinball.h"
|
||||
#include "resource.h"
|
||||
#include "winmain.h"
|
||||
|
||||
|
@ -14,7 +13,7 @@ int high_score::position;
|
|||
LPCSTR high_score::default_name;
|
||||
high_score_struct* high_score::dlg_hst;
|
||||
|
||||
winhelp_entry high_score::winHelpArgs[21]
|
||||
winhelp_entry high_score::help[21]
|
||||
{
|
||||
winhelp_entry{0x70, 0x3E9},
|
||||
winhelp_entry{0x191, 0x3EB},
|
||||
|
@ -201,10 +200,11 @@ INT_PTR __stdcall high_score::HighScore(HWND hWnd, UINT msg, WPARAM wParam, LPAR
|
|||
SendMessageA(hWnd, WM_COMMAND, WM_DESTROY, 0);
|
||||
break;
|
||||
case WM_HELP:
|
||||
WinHelpA(*(HWND*)(lParam + 12), "pinball.hlp", HELP_WM_HELP, (ULONG_PTR)winHelpArgs);
|
||||
WinHelpA(static_cast<HWND>(reinterpret_cast<HELPINFO*>(lParam)->hItemHandle), "pinball.hlp", HELP_WM_HELP,
|
||||
(ULONG_PTR)help);
|
||||
break;
|
||||
case WM_CONTEXTMENU:
|
||||
WinHelpA((HWND)wParam, "pinball.hlp", HELP_CONTEXTMENU, (ULONG_PTR)winHelpArgs);
|
||||
WinHelpA((HWND)wParam, "pinball.hlp", HELP_CONTEXTMENU, (ULONG_PTR)help);
|
||||
break;
|
||||
case WM_INITDIALOG:
|
||||
show_high_scores(hWnd, dlg_hst);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include "pinball.h"
|
||||
|
||||
struct high_score_struct
|
||||
{
|
||||
|
@ -6,12 +7,6 @@ struct high_score_struct
|
|||
int Score;
|
||||
};
|
||||
|
||||
struct winhelp_entry
|
||||
{
|
||||
int ControlId;
|
||||
int ContextId;
|
||||
};
|
||||
|
||||
|
||||
class high_score
|
||||
{
|
||||
|
@ -34,5 +29,5 @@ private :
|
|||
static int position;
|
||||
static LPCSTR default_name;
|
||||
static high_score_struct* dlg_hst;
|
||||
static winhelp_entry winHelpArgs[21];
|
||||
static winhelp_entry help[21];
|
||||
};
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "fullscrn.h"
|
||||
#include "memory.h"
|
||||
#include "midi.h"
|
||||
#include "pinball.h"
|
||||
#include "resource.h"
|
||||
#include "Sound.h"
|
||||
#include "winmain.h"
|
||||
|
@ -14,6 +13,60 @@ LPSTR options::OptionsRegPathCur;
|
|||
HMENU options::MenuHandle;
|
||||
optionsStruct options::Options;
|
||||
|
||||
winhelp_entry options::keymap_help[18]
|
||||
{
|
||||
winhelp_entry{0x1F5, 0x3EA},
|
||||
winhelp_entry{0x191, 0x3EC},
|
||||
winhelp_entry{0x192, 0x3ED},
|
||||
winhelp_entry{0x193, 0x3F1},
|
||||
winhelp_entry{0x194, 0x3EE},
|
||||
winhelp_entry{0x195, 0x3EF},
|
||||
winhelp_entry{0x196, 0x3F0},
|
||||
winhelp_entry{0x385, 0x3EC},
|
||||
winhelp_entry{0x386, 0x3ED},
|
||||
winhelp_entry{0x387, 0x3F1},
|
||||
winhelp_entry{0x388, 0x3EE},
|
||||
winhelp_entry{0x389, 0x3EF},
|
||||
winhelp_entry{0x38A, 0x3F0},
|
||||
winhelp_entry{0x38C, -1},
|
||||
winhelp_entry{0x38D, -1},
|
||||
winhelp_entry{0x321, -1},
|
||||
winhelp_entry{0x322, -1},
|
||||
winhelp_entry{0, 0},
|
||||
};
|
||||
|
||||
short options::vk_list[28]
|
||||
{
|
||||
0x8041,
|
||||
0x5A,
|
||||
0x8030,
|
||||
0x39,
|
||||
0x402E,
|
||||
0x402F,
|
||||
0x403B,
|
||||
0x4027,
|
||||
0x405B,
|
||||
0x405D,
|
||||
0x20,
|
||||
0x0D,
|
||||
0x9,
|
||||
0x14,
|
||||
0x25,
|
||||
0x27,
|
||||
0x26,
|
||||
0x28,
|
||||
0x2D,
|
||||
0x2E,
|
||||
0x24,
|
||||
0x23,
|
||||
0x21,
|
||||
0x22,
|
||||
0x90,
|
||||
0x91,
|
||||
0x13,
|
||||
-1
|
||||
};
|
||||
|
||||
void options::init(HMENU menuHandle)
|
||||
{
|
||||
MenuHandle = menuHandle;
|
||||
|
@ -22,25 +75,25 @@ void options::init(HMENU menuHandle)
|
|||
Options.FullScreen = 0;
|
||||
Options.Average = 5;
|
||||
Options.PriorityAdj = 2;
|
||||
Options.LeftFlipperKey2 = 90;
|
||||
Options.RightFlipperKey2 = 191;
|
||||
Options.PlungerKey2 = 32;
|
||||
Options.LeftTableBumpKey2 = 88;
|
||||
Options.RightTableBumpKey2 = 190;
|
||||
Options.BottomTableBumpKey2 = 38;
|
||||
pinball::get_rc_int(159, &Options.LeftFlipperKey2);
|
||||
pinball::get_rc_int(160, &Options.RightFlipperKey2);
|
||||
pinball::get_rc_int(161, &Options.PlungerKey2);
|
||||
pinball::get_rc_int(162, &Options.LeftTableBumpKey2);
|
||||
pinball::get_rc_int(163, &Options.RightTableBumpKey2);
|
||||
pinball::get_rc_int(164, &Options.BottomTableBumpKey2);
|
||||
Options.LeftFlipperKey = Options.LeftFlipperKey2;
|
||||
Options.RightFlipperKey = Options.RightFlipperKey2;
|
||||
Options.PlungerKey = Options.PlungerKey2;
|
||||
Options.LeftTableBumpKey = Options.LeftTableBumpKey2;
|
||||
Options.RightTableBumpKey = Options.RightTableBumpKey2;
|
||||
Options.LeftFlipperKeyDft = 90;
|
||||
Options.RightFlipperKeyDft = 191;
|
||||
Options.PlungerKeyDft = 32;
|
||||
Options.LeftTableBumpKeyDft = 88;
|
||||
Options.RightTableBumpKeyDft = 190;
|
||||
Options.BottomTableBumpKeyDft = 38;
|
||||
pinball::get_rc_int(159, &Options.LeftFlipperKeyDft);
|
||||
pinball::get_rc_int(160, &Options.RightFlipperKeyDft);
|
||||
pinball::get_rc_int(161, &Options.PlungerKeyDft);
|
||||
pinball::get_rc_int(162, &Options.LeftTableBumpKeyDft);
|
||||
pinball::get_rc_int(163, &Options.RightTableBumpKeyDft);
|
||||
pinball::get_rc_int(164, &Options.BottomTableBumpKeyDft);
|
||||
Options.LeftFlipperKey = Options.LeftFlipperKeyDft;
|
||||
Options.RightFlipperKey = Options.RightFlipperKeyDft;
|
||||
Options.PlungerKey = Options.PlungerKeyDft;
|
||||
Options.LeftTableBumpKey = Options.LeftTableBumpKeyDft;
|
||||
Options.RightTableBumpKey = Options.RightTableBumpKeyDft;
|
||||
Options.Players = 1;
|
||||
Options.BottomTableBumpKey = Options.BottomTableBumpKey2;
|
||||
Options.BottomTableBumpKey = Options.BottomTableBumpKeyDft;
|
||||
Options.Sounds = get_int(nullptr, "Sounds", Options.Sounds);
|
||||
Options.Music = get_int(nullptr, "Music", Options.Music);
|
||||
Options.Average = get_int(nullptr, "Average", Options.Average);
|
||||
|
@ -261,5 +314,189 @@ void options::keyboard()
|
|||
|
||||
INT_PTR _stdcall options::KeyMapDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
char keyName[20];
|
||||
int keyBindings[6];
|
||||
char rcString[256];
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_HELP:
|
||||
WinHelpA(static_cast<HWND>(reinterpret_cast<HELPINFO*>(lParam)->hItemHandle), "pinball.hlp", HELP_WM_HELP,
|
||||
(ULONG_PTR)keymap_help);
|
||||
return 1;
|
||||
case WM_CONTEXTMENU:
|
||||
WinHelpA((HWND)wParam, "pinball.hlp", HELP_CONTEXTMENU, (ULONG_PTR)keymap_help);
|
||||
return 1;
|
||||
case WM_INITDIALOG:
|
||||
for (auto vkPtr = vk_list; *vkPtr != -1; vkPtr++)
|
||||
{
|
||||
short vk = *vkPtr;
|
||||
auto vk2And = vk & 0x4000;
|
||||
auto vkChar = static_cast<unsigned __int8>(vk);
|
||||
unsigned short maxVk;
|
||||
|
||||
if (vk2And)
|
||||
{
|
||||
auto index = 128;
|
||||
do
|
||||
{
|
||||
if (vkChar == MapVirtualKeyA(index, MAPVK_VK_TO_CHAR))
|
||||
break;
|
||||
++index;
|
||||
}
|
||||
while (index < 256);
|
||||
|
||||
if (index == 256)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
keyName[0] = static_cast<char>(vkChar);
|
||||
keyName[1] = 0;
|
||||
vkChar = index;
|
||||
maxVk = index;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vk >= 0)
|
||||
{
|
||||
maxVk = vkChar;
|
||||
}
|
||||
else
|
||||
{
|
||||
++vkPtr;
|
||||
maxVk = *vkPtr;
|
||||
}
|
||||
if (vkChar > maxVk)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
for (int curVK = vkChar; curVK <= maxVk; curVK++)
|
||||
{
|
||||
if (vk2And || get_vk_key_name(curVK, keyName))
|
||||
{
|
||||
auto ind = SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperL,CB_INSERTSTRING, -1, (LPARAM)keyName);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperL, CB_SETITEMDATA, ind, curVK);
|
||||
if (curVK == Options.LeftFlipperKey)
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperL, CB_SETCURSEL, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperR, CB_INSERTSTRING, -1, (LPARAM)keyName);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperR, CB_SETITEMDATA, ind, curVK);
|
||||
if (curVK == Options.RightFlipperKey)
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperR, CB_SETCURSEL, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_Plunger, CB_INSERTSTRING, -1, (LPARAM)keyName);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_Plunger, CB_SETITEMDATA, ind, curVK);
|
||||
if (curVK == Options.PlungerKey)
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_Plunger, CB_SETCURSEL, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpLeft, CB_INSERTSTRING, -1, (LPARAM)keyName);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpLeft, CB_SETITEMDATA, ind, curVK);
|
||||
if (curVK == Options.LeftTableBumpKey)
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpLeft, CB_SETCURSEL, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpRight, CB_INSERTSTRING, -1, (LPARAM)keyName);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpRight, CB_SETITEMDATA, ind, curVK);
|
||||
if (curVK == Options.RightTableBumpKey)
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpRight, CB_SETCURSEL, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpBottom, CB_INSERTSTRING, -1, (LPARAM)keyName);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpBottom, CB_SETITEMDATA, ind, curVK);
|
||||
if (curVK == Options.BottomTableBumpKey)
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpBottom, CB_SETCURSEL, ind, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
case WM_COMMAND:
|
||||
switch (wParam)
|
||||
{
|
||||
case KEYMAPPER_Ok:
|
||||
{
|
||||
auto ind = SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperL, CB_GETCURSEL, 0, 0);
|
||||
keyBindings[0] = SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperL, CB_GETITEMDATA, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperR, CB_GETCURSEL, 0, 0);
|
||||
keyBindings[1] = SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperR, CB_GETITEMDATA, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_Plunger, CB_GETCURSEL, 0, 0);
|
||||
keyBindings[2] = SendDlgItemMessageA(hDlg, KEYMAPPER_Plunger, CB_GETITEMDATA, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpLeft, CB_GETCURSEL, 0, 0);
|
||||
keyBindings[3] = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpLeft, CB_GETITEMDATA, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpRight, CB_GETCURSEL, 0, 0);
|
||||
keyBindings[4] = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpRight, CB_GETITEMDATA, ind, 0);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpBottom, CB_GETCURSEL, 0, 0);
|
||||
keyBindings[5] = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpBottom, CB_GETITEMDATA, ind, 0);
|
||||
|
||||
auto sameKeyBound = 0;
|
||||
auto index = 1;
|
||||
auto optPtr = keyBindings;
|
||||
while (!sameKeyBound)
|
||||
{
|
||||
for (auto keyInd = index; keyInd < 6; keyInd++)
|
||||
{
|
||||
if (sameKeyBound)
|
||||
break;
|
||||
if (*optPtr == keyBindings[keyInd])
|
||||
{
|
||||
lstrcpyA(rcString, pinball::get_rc_string(43, 0));
|
||||
MessageBoxA(hDlg, pinball::get_rc_string(39, 0), rcString, 0x2000u);
|
||||
sameKeyBound = 1;
|
||||
}
|
||||
}
|
||||
++index;
|
||||
++optPtr;
|
||||
if (index - 1 >= 5)
|
||||
{
|
||||
if (sameKeyBound)
|
||||
return 1;
|
||||
Options.LeftFlipperKey = keyBindings[0];
|
||||
Options.RightFlipperKey = keyBindings[1];
|
||||
Options.PlungerKey = keyBindings[2];
|
||||
Options.LeftTableBumpKey = keyBindings[3];
|
||||
Options.RightTableBumpKey = keyBindings[4];
|
||||
Options.BottomTableBumpKey = keyBindings[5];
|
||||
EndDialog(hDlg, wParam);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
case KEYMAPPER_Cancel:
|
||||
EndDialog(hDlg, wParam);
|
||||
return 1;
|
||||
case KEYMAPPER_Default:
|
||||
{
|
||||
auto name = (LPARAM)get_vk_key_name(Options.LeftFlipperKeyDft, keyName);
|
||||
auto ind = SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperL, CB_FINDSTRINGEXACT, 0, name);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperL, CB_SETCURSEL, ind, 0);
|
||||
name = (LPARAM)get_vk_key_name(Options.RightFlipperKeyDft, keyName);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperR, CB_FINDSTRINGEXACT, 0, name);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_FlipperR, CB_SETCURSEL, ind, 0);
|
||||
name = (LPARAM)get_vk_key_name(Options.PlungerKeyDft, keyName);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_Plunger, CB_FINDSTRINGEXACT, 0, name);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_Plunger, CB_SETCURSEL, ind, 0);
|
||||
name = (LPARAM)get_vk_key_name(Options.LeftTableBumpKeyDft, keyName);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpLeft, CB_FINDSTRINGEXACT, 0, name);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpLeft, CB_SETCURSEL, ind, 0);
|
||||
name = (LPARAM)get_vk_key_name(Options.RightTableBumpKeyDft, keyName);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpRight, CB_FINDSTRINGEXACT, 0, name);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpRight, CB_SETCURSEL, ind, 0);
|
||||
name = (LPARAM)get_vk_key_name(Options.BottomTableBumpKeyDft, keyName);
|
||||
ind = SendDlgItemMessageA(hDlg, KEYMAPPER_BumpBottom, CB_FINDSTRINGEXACT, 0, name);
|
||||
SendDlgItemMessageA(hDlg, KEYMAPPER_BumpBottom, CB_SETCURSEL, ind, 0);
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LPSTR options::get_vk_key_name(unsigned __int16 vk, LPSTR keyName)
|
||||
{
|
||||
LONG scanCode = MapVirtualKeyA(vk, MAPVK_VK_TO_VSC) << 16;
|
||||
if (vk >= 0x21u && vk <= 0x2Eu)
|
||||
scanCode |= 0x1000000u;
|
||||
return GetKeyNameTextA(scanCode, keyName, 19) != 0 ? keyName : nullptr;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include "pinball.h"
|
||||
|
||||
struct __declspec(align(4)) optionsStruct
|
||||
{
|
||||
|
@ -14,12 +15,12 @@ struct __declspec(align(4)) optionsStruct
|
|||
int LeftTableBumpKey;
|
||||
int RightTableBumpKey;
|
||||
int BottomTableBumpKey;
|
||||
int LeftFlipperKey2;
|
||||
int RightFlipperKey2;
|
||||
int PlungerKey2;
|
||||
int LeftTableBumpKey2;
|
||||
int RightTableBumpKey2;
|
||||
int BottomTableBumpKey2;
|
||||
int LeftFlipperKeyDft;
|
||||
int RightFlipperKeyDft;
|
||||
int PlungerKeyDft;
|
||||
int LeftTableBumpKeyDft;
|
||||
int RightTableBumpKeyDft;
|
||||
int BottomTableBumpKeyDft;
|
||||
};
|
||||
|
||||
|
||||
|
@ -37,8 +38,10 @@ public:
|
|||
static void menu_check(UINT uIDCheckItem, int check);
|
||||
static void menu_set(UINT uIDEnableItem, int enable);
|
||||
static void toggle(UINT uIDCheckItem);
|
||||
|
||||
static void keyboard();
|
||||
static INT_PTR _stdcall KeyMapDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static LPSTR get_vk_key_name(unsigned __int16 vk, LPSTR keyName);
|
||||
|
||||
static optionsStruct Options;
|
||||
private:
|
||||
|
@ -47,4 +50,6 @@ private:
|
|||
static LPCSTR path(LPCSTR regPath);
|
||||
static void path_free();
|
||||
static HMENU MenuHandle;
|
||||
static winhelp_entry keymap_help[18];
|
||||
static short vk_list[28];
|
||||
};
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
#pragma once
|
||||
#include "TTextBox.h"
|
||||
|
||||
struct winhelp_entry
|
||||
{
|
||||
int ControlId;
|
||||
int ContextId;
|
||||
};
|
||||
|
||||
class pinball
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -5,8 +5,10 @@
|
|||
#define IDS_STRING101 0
|
||||
#define IDS_STRING102 1
|
||||
#define DLG_HIGHSCORES_Ok 1
|
||||
#define KEYMAPPER_Ok 1
|
||||
#define IDS_STRING103 2
|
||||
#define DLG_HIGHSCORES_Cancel 2
|
||||
#define KEYMAPPER_Cancel 2
|
||||
#define IDS_STRING104 3
|
||||
#define IDS_STRING105 4
|
||||
#define IDS_STRING106 5
|
||||
|
@ -203,20 +205,27 @@
|
|||
#define Menu1_Help_Topics 301
|
||||
#define Menu1_Launch_Ball 401
|
||||
#define DLG_HIGHSCORES_StaticName1 401
|
||||
#define KEYMAPPER_FlipperL 401
|
||||
#define Menu1_Pause_Resume_Game 402
|
||||
#define DLG_HIGHSCORES_StaticName2 402
|
||||
#define KEYMAPPER_FlipperR 402
|
||||
#define Menu1_Full_Screen 403
|
||||
#define DLG_HIGHSCORES_StaticName3 403
|
||||
#define KEYMAPPER_Plunger 403
|
||||
#define Menu1_Demo 404
|
||||
#define DLG_HIGHSCORES_StaticName4 404
|
||||
#define KEYMAPPER_BumpLeft 404
|
||||
#define Menu1_Select_Table 405
|
||||
#define DLG_HIGHSCORES_StaticName5 405
|
||||
#define KEYMAPPER_BumpRight 405
|
||||
#define Menu1_Player_Controls 406
|
||||
#define KEYMAPPER_BumpBottom 406
|
||||
#define Menu1_1Player 408
|
||||
#define Menu1_2Players 409
|
||||
#define Menu1_3Players 410
|
||||
#define Menu1_4Players 411
|
||||
#define DLG_HIGHSCORES_Score1 501
|
||||
#define KEYMAPPER_Default 501
|
||||
#define DLG_HIGHSCORES_Score2 502
|
||||
#define DLG_HIGHSCORES_Score3 503
|
||||
#define DLG_HIGHSCORES_Score4 504
|
||||
|
@ -231,9 +240,9 @@
|
|||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 203
|
||||
#define _APS_NEXT_RESOURCE_VALUE 204
|
||||
#define _APS_NEXT_COMMAND_VALUE 40004
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue