|
|
|
@ -282,7 +282,7 @@ void LeftMouseCmd(bool bShift) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void LeftMouseDown(int wParam) |
|
|
|
void LeftMouseDown(uint16_t modState) |
|
|
|
{ |
|
|
|
{ |
|
|
|
LastMouseButtonAction = MouseActionType::None; |
|
|
|
LastMouseButtonAction = MouseActionType::None; |
|
|
|
|
|
|
|
|
|
|
|
@ -318,8 +318,8 @@ void LeftMouseDown(int wParam) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool isShiftHeld = (wParam & DVL_MK_SHIFT) != 0; |
|
|
|
const bool isShiftHeld = (modState & KMOD_SHIFT) != 0; |
|
|
|
bool isCtrlHeld = (wParam & DVL_MK_CTRL) != 0; |
|
|
|
const bool isCtrlHeld = (modState & KMOD_CTRL) != 0; |
|
|
|
|
|
|
|
|
|
|
|
if (!GetMainPanel().contains(MousePosition)) { |
|
|
|
if (!GetMainPanel().contains(MousePosition)) { |
|
|
|
if (!gmenu_is_active() && !TryIconCurs()) { |
|
|
|
if (!gmenu_is_active() && !TryIconCurs()) { |
|
|
|
@ -361,16 +361,17 @@ void LeftMouseDown(int wParam) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void LeftMouseUp(int wParam) |
|
|
|
void LeftMouseUp(uint16_t modState) |
|
|
|
{ |
|
|
|
{ |
|
|
|
gmenu_left_mouse(false); |
|
|
|
gmenu_left_mouse(false); |
|
|
|
control_release_talk_btn(); |
|
|
|
control_release_talk_btn(); |
|
|
|
bool isShiftHeld = (wParam & (DVL_MK_SHIFT | DVL_MK_LBUTTON)) != 0; |
|
|
|
|
|
|
|
if (panbtndown) |
|
|
|
if (panbtndown) |
|
|
|
CheckBtnUp(); |
|
|
|
CheckBtnUp(); |
|
|
|
CheckStashButtonRelease(MousePosition); |
|
|
|
CheckStashButtonRelease(MousePosition); |
|
|
|
if (chrbtnactive) |
|
|
|
if (chrbtnactive) { |
|
|
|
|
|
|
|
const bool isShiftHeld = (modState & KMOD_SHIFT) != 0; |
|
|
|
ReleaseChrBtns(isShiftHeld); |
|
|
|
ReleaseChrBtns(isShiftHeld); |
|
|
|
|
|
|
|
} |
|
|
|
if (lvlbtndown) |
|
|
|
if (lvlbtndown) |
|
|
|
ReleaseLvlBtn(); |
|
|
|
ReleaseLvlBtn(); |
|
|
|
if (stextflag != STORE_NONE) |
|
|
|
if (stextflag != STORE_NONE) |
|
|
|
@ -410,9 +411,9 @@ void RightMouseDown(bool isShiftHeld) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool PressSysKey(int wParam) |
|
|
|
bool PressSysKey(SDL_Keycode wParam) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (gmenu_is_active() || wParam != DVL_VK_F10) |
|
|
|
if (gmenu_is_active() || wParam != SDLK_F10) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
DiabloHotkeyMsg(1); |
|
|
|
DiabloHotkeyMsg(1); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
@ -440,9 +441,9 @@ void ClosePanels() |
|
|
|
QuestLogIsOpen = false; |
|
|
|
QuestLogIsOpen = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PressKey(int vkey) |
|
|
|
void PressKey(SDL_Keycode vkey) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (vkey == DVL_VK_PAUSE) { |
|
|
|
if (vkey == SDLK_PAUSE) { |
|
|
|
diablo_pause_game(); |
|
|
|
diablo_pause_game(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -455,19 +456,19 @@ void PressKey(int vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
sgOptions.Keymapper.KeyPressed(vkey); |
|
|
|
sgOptions.Keymapper.KeyPressed(vkey); |
|
|
|
if (vkey == DVL_VK_RETURN) { |
|
|
|
if (vkey == SDLK_RETURN || vkey == SDLK_KP_ENTER) { |
|
|
|
if (GetAsyncKeyState(DVL_VK_MENU)) { |
|
|
|
if ((SDL_GetModState() & KMOD_ALT) != 0) { |
|
|
|
sgOptions.Graphics.fullscreen.SetValue(!IsFullScreen()); |
|
|
|
sgOptions.Graphics.fullscreen.SetValue(!IsFullScreen()); |
|
|
|
SaveOptions(); |
|
|
|
SaveOptions(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
control_type_message(); |
|
|
|
control_type_message(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (vkey != DVL_VK_ESCAPE) { |
|
|
|
if (vkey != SDLK_ESCAPE) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (vkey == DVL_VK_ESCAPE) { |
|
|
|
if (vkey == SDLK_ESCAPE) { |
|
|
|
if (!PressEscKey()) { |
|
|
|
if (!PressEscKey()) { |
|
|
|
LastMouseButtonAction = MouseActionType::None; |
|
|
|
LastMouseButtonAction = MouseActionType::None; |
|
|
|
gamemenu_on(); |
|
|
|
gamemenu_on(); |
|
|
|
@ -482,15 +483,15 @@ void PressKey(int vkey) |
|
|
|
sgOptions.Keymapper.KeyPressed(vkey); |
|
|
|
sgOptions.Keymapper.KeyPressed(vkey); |
|
|
|
|
|
|
|
|
|
|
|
if (PauseMode == 2) { |
|
|
|
if (PauseMode == 2) { |
|
|
|
if (vkey == DVL_VK_RETURN && GetAsyncKeyState(DVL_VK_MENU)) { |
|
|
|
if ((vkey == SDLK_RETURN || vkey == SDLK_KP_ENTER) && (SDL_GetModState() & KMOD_ALT) != 0) { |
|
|
|
sgOptions.Graphics.fullscreen.SetValue(!IsFullScreen()); |
|
|
|
sgOptions.Graphics.fullscreen.SetValue(!IsFullScreen()); |
|
|
|
SaveOptions(); |
|
|
|
SaveOptions(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (vkey == DVL_VK_RETURN) { |
|
|
|
if (vkey == SDLK_RETURN || vkey == SDLK_KP_ENTER) { |
|
|
|
if (GetAsyncKeyState(DVL_VK_MENU)) { |
|
|
|
if ((SDL_GetModState() & KMOD_ALT) != 0) { |
|
|
|
sgOptions.Graphics.fullscreen.SetValue(!IsFullScreen()); |
|
|
|
sgOptions.Graphics.fullscreen.SetValue(!IsFullScreen()); |
|
|
|
SaveOptions(); |
|
|
|
SaveOptions(); |
|
|
|
} else if (stextflag != STORE_NONE) { |
|
|
|
} else if (stextflag != STORE_NONE) { |
|
|
|
@ -500,7 +501,7 @@ void PressKey(int vkey) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
control_type_message(); |
|
|
|
control_type_message(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (vkey == DVL_VK_UP) { |
|
|
|
} else if (vkey == SDLK_UP) { |
|
|
|
if (stextflag != STORE_NONE) { |
|
|
|
if (stextflag != STORE_NONE) { |
|
|
|
StoreUp(); |
|
|
|
StoreUp(); |
|
|
|
} else if (QuestLogIsOpen) { |
|
|
|
} else if (QuestLogIsOpen) { |
|
|
|
@ -514,7 +515,7 @@ void PressKey(int vkey) |
|
|
|
} else if (IsStashOpen) { |
|
|
|
} else if (IsStashOpen) { |
|
|
|
Stash.PreviousPage(); |
|
|
|
Stash.PreviousPage(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (vkey == DVL_VK_DOWN) { |
|
|
|
} else if (vkey == SDLK_DOWN) { |
|
|
|
if (stextflag != STORE_NONE) { |
|
|
|
if (stextflag != STORE_NONE) { |
|
|
|
StoreDown(); |
|
|
|
StoreDown(); |
|
|
|
} else if (QuestLogIsOpen) { |
|
|
|
} else if (QuestLogIsOpen) { |
|
|
|
@ -528,23 +529,23 @@ void PressKey(int vkey) |
|
|
|
} else if (IsStashOpen) { |
|
|
|
} else if (IsStashOpen) { |
|
|
|
Stash.NextPage(); |
|
|
|
Stash.NextPage(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (vkey == DVL_VK_PRIOR) { |
|
|
|
} else if (vkey == SDLK_PAGEUP) { |
|
|
|
if (stextflag != STORE_NONE) { |
|
|
|
if (stextflag != STORE_NONE) { |
|
|
|
StorePrior(); |
|
|
|
StorePrior(); |
|
|
|
} else if (ChatLogFlag) { |
|
|
|
} else if (ChatLogFlag) { |
|
|
|
ChatLogScrollTop(); |
|
|
|
ChatLogScrollTop(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (vkey == DVL_VK_NEXT) { |
|
|
|
} else if (vkey == SDLK_PAGEDOWN) { |
|
|
|
if (stextflag != STORE_NONE) { |
|
|
|
if (stextflag != STORE_NONE) { |
|
|
|
StoreNext(); |
|
|
|
StoreNext(); |
|
|
|
} else if (ChatLogFlag) { |
|
|
|
} else if (ChatLogFlag) { |
|
|
|
ChatLogScrollBottom(); |
|
|
|
ChatLogScrollBottom(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (vkey == DVL_VK_LEFT) { |
|
|
|
} else if (vkey == SDLK_LEFT) { |
|
|
|
if (AutomapActive && !talkflag) { |
|
|
|
if (AutomapActive && !talkflag) { |
|
|
|
AutomapLeft(); |
|
|
|
AutomapLeft(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (vkey == DVL_VK_RIGHT) { |
|
|
|
} else if (vkey == SDLK_RIGHT) { |
|
|
|
if (AutomapActive && !talkflag) { |
|
|
|
if (AutomapActive && !talkflag) { |
|
|
|
AutomapRight(); |
|
|
|
AutomapRight(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -567,11 +568,11 @@ void PressChar(char vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (dropGoldFlag) { |
|
|
|
if (dropGoldFlag) { |
|
|
|
control_drop_gold(vkey); |
|
|
|
control_drop_gold(static_cast<SDL_Keycode>(vkey)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (IsWithdrawGoldOpen) { |
|
|
|
if (IsWithdrawGoldOpen) { |
|
|
|
WithdrawGoldKeyPress(vkey); |
|
|
|
WithdrawGoldKeyPress(static_cast<SDL_Keycode>(vkey)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -599,25 +600,25 @@ void PressChar(char vkey) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void GetMousePos(int32_t lParam) |
|
|
|
void GetMousePos(uint32_t lParam) |
|
|
|
{ |
|
|
|
{ |
|
|
|
MousePosition = { (std::int16_t)(lParam & 0xffff), (std::int16_t)((lParam >> 16) & 0xffff) }; |
|
|
|
MousePosition = { (std::int16_t)(lParam & 0xffff), (std::int16_t)((lParam >> 16) & 0xffff) }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void GameEventHandler(uint32_t uMsg, int32_t wParam, int32_t lParam) |
|
|
|
void GameEventHandler(uint32_t uMsg, uint32_t wParam, uint32_t lParam) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (uMsg) { |
|
|
|
switch (uMsg) { |
|
|
|
case DVL_WM_KEYDOWN: |
|
|
|
case DVL_WM_KEYDOWN: |
|
|
|
PressKey(wParam); |
|
|
|
PressKey(static_cast<SDL_Keycode>(wParam)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_KEYUP: |
|
|
|
case DVL_WM_KEYUP: |
|
|
|
ReleaseKey(wParam); |
|
|
|
ReleaseKey(static_cast<SDL_Keycode>(wParam)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_CHAR: |
|
|
|
case DVL_WM_CHAR: |
|
|
|
PressChar((char)wParam); |
|
|
|
PressChar(static_cast<char>(wParam)); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_SYSKEYDOWN: |
|
|
|
case DVL_WM_SYSKEYDOWN: |
|
|
|
if (PressSysKey(wParam)) |
|
|
|
if (PressSysKey(static_cast<SDL_Keycode>(wParam))) |
|
|
|
return; |
|
|
|
return; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case DVL_WM_SYSCOMMAND: |
|
|
|
case DVL_WM_SYSCOMMAND: |
|
|
|
@ -635,7 +636,7 @@ void GameEventHandler(uint32_t uMsg, int32_t wParam, int32_t lParam) |
|
|
|
GetMousePos(lParam); |
|
|
|
GetMousePos(lParam); |
|
|
|
if (sgbMouseDown == CLICK_NONE) { |
|
|
|
if (sgbMouseDown == CLICK_NONE) { |
|
|
|
sgbMouseDown = CLICK_LEFT; |
|
|
|
sgbMouseDown = CLICK_LEFT; |
|
|
|
LeftMouseDown(wParam); |
|
|
|
LeftMouseDown(DecodeMouseModState(wParam)); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_LBUTTONUP: |
|
|
|
case DVL_WM_LBUTTONUP: |
|
|
|
@ -643,14 +644,14 @@ void GameEventHandler(uint32_t uMsg, int32_t wParam, int32_t lParam) |
|
|
|
if (sgbMouseDown == CLICK_LEFT) { |
|
|
|
if (sgbMouseDown == CLICK_LEFT) { |
|
|
|
LastMouseButtonAction = MouseActionType::None; |
|
|
|
LastMouseButtonAction = MouseActionType::None; |
|
|
|
sgbMouseDown = CLICK_NONE; |
|
|
|
sgbMouseDown = CLICK_NONE; |
|
|
|
LeftMouseUp(wParam); |
|
|
|
LeftMouseUp(DecodeMouseModState(wParam)); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_RBUTTONDOWN: |
|
|
|
case DVL_WM_RBUTTONDOWN: |
|
|
|
GetMousePos(lParam); |
|
|
|
GetMousePos(lParam); |
|
|
|
if (sgbMouseDown == CLICK_NONE) { |
|
|
|
if (sgbMouseDown == CLICK_NONE) { |
|
|
|
sgbMouseDown = CLICK_RIGHT; |
|
|
|
sgbMouseDown = CLICK_RIGHT; |
|
|
|
RightMouseDown((wParam & DVL_MK_SHIFT) != 0); |
|
|
|
RightMouseDown((DecodeMouseModState(wParam) & KMOD_SHIFT) != 0); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_RBUTTONUP: |
|
|
|
case DVL_WM_RBUTTONUP: |
|
|
|
@ -661,22 +662,22 @@ void GameEventHandler(uint32_t uMsg, int32_t wParam, int32_t lParam) |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_MBUTTONDOWN: |
|
|
|
case DVL_WM_MBUTTONDOWN: |
|
|
|
sgOptions.Keymapper.KeyPressed(DVL_VK_MBUTTON); |
|
|
|
sgOptions.Keymapper.KeyPressed(SDL_BUTTON_MIDDLE | KeymapperMouseButtonMask); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_MBUTTONUP: |
|
|
|
case DVL_WM_MBUTTONUP: |
|
|
|
sgOptions.Keymapper.KeyReleased(DVL_VK_MBUTTON); |
|
|
|
sgOptions.Keymapper.KeyReleased(SDL_BUTTON_MIDDLE | KeymapperMouseButtonMask); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_X1BUTTONDOWN: |
|
|
|
case DVL_WM_X1BUTTONDOWN: |
|
|
|
sgOptions.Keymapper.KeyPressed(DVL_VK_X1BUTTON); |
|
|
|
sgOptions.Keymapper.KeyPressed(SDL_BUTTON_X1 | KeymapperMouseButtonMask); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_X1BUTTONUP: |
|
|
|
case DVL_WM_X1BUTTONUP: |
|
|
|
sgOptions.Keymapper.KeyReleased(DVL_VK_X1BUTTON); |
|
|
|
sgOptions.Keymapper.KeyReleased(SDL_BUTTON_X1 | KeymapperMouseButtonMask); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_X2BUTTONDOWN: |
|
|
|
case DVL_WM_X2BUTTONDOWN: |
|
|
|
sgOptions.Keymapper.KeyPressed(DVL_VK_X2BUTTON); |
|
|
|
sgOptions.Keymapper.KeyPressed(SDL_BUTTON_X2 | KeymapperMouseButtonMask); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_X2BUTTONUP: |
|
|
|
case DVL_WM_X2BUTTONUP: |
|
|
|
sgOptions.Keymapper.KeyReleased(DVL_VK_X2BUTTON); |
|
|
|
sgOptions.Keymapper.KeyReleased(SDL_BUTTON_X2 | KeymapperMouseButtonMask); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case DVL_WM_CAPTURECHANGED: |
|
|
|
case DVL_WM_CAPTURECHANGED: |
|
|
|
sgbMouseDown = CLICK_NONE; |
|
|
|
sgbMouseDown = CLICK_NONE; |
|
|
|
@ -1277,7 +1278,7 @@ void GameLogic() |
|
|
|
gGameLogicStep = GameLogicStep::None; |
|
|
|
gGameLogicStep = GameLogicStep::None; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
if (DebugScrollViewEnabled && GetAsyncKeyState(DVL_VK_SHIFT)) { |
|
|
|
if (DebugScrollViewEnabled && (SDL_GetModState() & KMOD_SHIFT) != 0) { |
|
|
|
ScrollView(); |
|
|
|
ScrollView(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
@ -1479,7 +1480,7 @@ void InitKeymapActions() |
|
|
|
"QuickSpell{}", |
|
|
|
"QuickSpell{}", |
|
|
|
N_("Quick spell {}"), |
|
|
|
N_("Quick spell {}"), |
|
|
|
N_("Hotkey for skill or spell."), |
|
|
|
N_("Hotkey for skill or spell."), |
|
|
|
i < 4 ? DVL_VK_F5 + i : DVL_VK_INVALID, |
|
|
|
i < 4 ? static_cast<uint32_t>(SDLK_F5) + i : static_cast<uint32_t>(SDLK_UNKNOWN), |
|
|
|
[i]() { |
|
|
|
[i]() { |
|
|
|
if (spselflag) { |
|
|
|
if (spselflag) { |
|
|
|
SetSpeedSpell(i); |
|
|
|
SetSpeedSpell(i); |
|
|
|
@ -1506,7 +1507,7 @@ void InitKeymapActions() |
|
|
|
"QuickSave", |
|
|
|
"QuickSave", |
|
|
|
N_("Quick save"), |
|
|
|
N_("Quick save"), |
|
|
|
N_("Saves the game."), |
|
|
|
N_("Saves the game."), |
|
|
|
DVL_VK_F2, |
|
|
|
SDLK_F2, |
|
|
|
[] { gamemenu_save_game(false); }, |
|
|
|
[] { gamemenu_save_game(false); }, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
[&]() { return !gbIsMultiplayer && CanPlayerTakeAction(); }); |
|
|
|
[&]() { return !gbIsMultiplayer && CanPlayerTakeAction(); }); |
|
|
|
@ -1514,7 +1515,7 @@ void InitKeymapActions() |
|
|
|
"QuickLoad", |
|
|
|
"QuickLoad", |
|
|
|
N_("Quick load"), |
|
|
|
N_("Quick load"), |
|
|
|
N_("Loads the game."), |
|
|
|
N_("Loads the game."), |
|
|
|
DVL_VK_F3, |
|
|
|
SDLK_F3, |
|
|
|
[] { gamemenu_load_game(false); }, |
|
|
|
[] { gamemenu_load_game(false); }, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
[&]() { return !gbIsMultiplayer && gbValidSaveFile && stextflag == STORE_NONE && IsGameRunning(); }); |
|
|
|
[&]() { return !gbIsMultiplayer && gbValidSaveFile && stextflag == STORE_NONE && IsGameRunning(); }); |
|
|
|
@ -1523,14 +1524,14 @@ void InitKeymapActions() |
|
|
|
"QuitGame", |
|
|
|
"QuitGame", |
|
|
|
N_("Quit game"), |
|
|
|
N_("Quit game"), |
|
|
|
N_("Closes the game."), |
|
|
|
N_("Closes the game."), |
|
|
|
DVL_VK_INVALID, |
|
|
|
SDLK_UNKNOWN, |
|
|
|
[] { gamemenu_quit_game(false); }); |
|
|
|
[] { gamemenu_quit_game(false); }); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
sgOptions.Keymapper.AddAction( |
|
|
|
sgOptions.Keymapper.AddAction( |
|
|
|
"StopHero", |
|
|
|
"StopHero", |
|
|
|
N_("Stop hero"), |
|
|
|
N_("Stop hero"), |
|
|
|
N_("Stops walking and cancel pending actions."), |
|
|
|
N_("Stops walking and cancel pending actions."), |
|
|
|
DVL_VK_INVALID, |
|
|
|
SDLK_UNKNOWN, |
|
|
|
[] { MyPlayer->Stop(); }, |
|
|
|
[] { MyPlayer->Stop(); }, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
CanPlayerTakeAction); |
|
|
|
CanPlayerTakeAction); |
|
|
|
@ -1538,21 +1539,21 @@ void InitKeymapActions() |
|
|
|
"Item Highlighting", |
|
|
|
"Item Highlighting", |
|
|
|
N_("Item highlighting"), |
|
|
|
N_("Item highlighting"), |
|
|
|
N_("Show/hide items on ground."), |
|
|
|
N_("Show/hide items on ground."), |
|
|
|
DVL_VK_LMENU, |
|
|
|
SDLK_LALT, |
|
|
|
[] { AltPressed(true); }, |
|
|
|
[] { AltPressed(true); }, |
|
|
|
[] { AltPressed(false); }); |
|
|
|
[] { AltPressed(false); }); |
|
|
|
sgOptions.Keymapper.AddAction( |
|
|
|
sgOptions.Keymapper.AddAction( |
|
|
|
"Toggle Item Highlighting", |
|
|
|
"Toggle Item Highlighting", |
|
|
|
N_("Toggle item highlighting"), |
|
|
|
N_("Toggle item highlighting"), |
|
|
|
N_("Permanent show/hide items on ground."), |
|
|
|
N_("Permanent show/hide items on ground."), |
|
|
|
DVL_VK_RCONTROL, |
|
|
|
SDLK_RCTRL, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
[] { ToggleItemLabelHighlight(); }); |
|
|
|
[] { ToggleItemLabelHighlight(); }); |
|
|
|
sgOptions.Keymapper.AddAction( |
|
|
|
sgOptions.Keymapper.AddAction( |
|
|
|
"Toggle Automap", |
|
|
|
"Toggle Automap", |
|
|
|
N_("Toggle automap"), |
|
|
|
N_("Toggle automap"), |
|
|
|
N_("Toggles if automap is displayed."), |
|
|
|
N_("Toggles if automap is displayed."), |
|
|
|
DVL_VK_TAB, |
|
|
|
SDLK_TAB, |
|
|
|
DoAutoMap, |
|
|
|
DoAutoMap, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
IsGameRunning); |
|
|
|
IsGameRunning); |
|
|
|
@ -1594,7 +1595,7 @@ void InitKeymapActions() |
|
|
|
"QuickMessage{}", |
|
|
|
"QuickMessage{}", |
|
|
|
N_("Quick Message {}"), |
|
|
|
N_("Quick Message {}"), |
|
|
|
N_("Use Quick Message in chat."), |
|
|
|
N_("Use Quick Message in chat."), |
|
|
|
DVL_VK_F9 + i, |
|
|
|
SDLK_F9 + i, |
|
|
|
[i]() { DiabloHotkeyMsg(i); }, |
|
|
|
[i]() { DiabloHotkeyMsg(i); }, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
@ -1604,7 +1605,7 @@ void InitKeymapActions() |
|
|
|
"Hide Info Screens", |
|
|
|
"Hide Info Screens", |
|
|
|
N_("Hide Info Screens"), |
|
|
|
N_("Hide Info Screens"), |
|
|
|
N_("Hide all info screens."), |
|
|
|
N_("Hide all info screens."), |
|
|
|
DVL_VK_SPACE, |
|
|
|
SDLK_SPACE, |
|
|
|
[] { |
|
|
|
[] { |
|
|
|
ClosePanels(); |
|
|
|
ClosePanels(); |
|
|
|
HelpFlag = false; |
|
|
|
HelpFlag = false; |
|
|
|
@ -1658,7 +1659,7 @@ void InitKeymapActions() |
|
|
|
"Help", |
|
|
|
"Help", |
|
|
|
N_("Help"), |
|
|
|
N_("Help"), |
|
|
|
N_("Open Help Screen."), |
|
|
|
N_("Open Help Screen."), |
|
|
|
DVL_VK_F1, |
|
|
|
SDLK_F1, |
|
|
|
HelpKeyPressed, |
|
|
|
HelpKeyPressed, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
CanPlayerTakeAction); |
|
|
|
CanPlayerTakeAction); |
|
|
|
@ -1666,7 +1667,7 @@ void InitKeymapActions() |
|
|
|
"Screenshot", |
|
|
|
"Screenshot", |
|
|
|
N_("Screenshot"), |
|
|
|
N_("Screenshot"), |
|
|
|
N_("Takes a screenshot."), |
|
|
|
N_("Takes a screenshot."), |
|
|
|
DVL_VK_SNAPSHOT, |
|
|
|
SDLK_PRINTSCREEN, |
|
|
|
nullptr, |
|
|
|
nullptr, |
|
|
|
CaptureScreen); |
|
|
|
CaptureScreen); |
|
|
|
sgOptions.Keymapper.AddAction( |
|
|
|
sgOptions.Keymapper.AddAction( |
|
|
|
@ -2013,12 +2014,12 @@ bool PressEscKey() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (dropGoldFlag) { |
|
|
|
if (dropGoldFlag) { |
|
|
|
control_drop_gold(DVL_VK_ESCAPE); |
|
|
|
control_drop_gold(SDLK_ESCAPE); |
|
|
|
rv = true; |
|
|
|
rv = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (IsWithdrawGoldOpen) { |
|
|
|
if (IsWithdrawGoldOpen) { |
|
|
|
WithdrawGoldKeyPress(DVL_VK_ESCAPE); |
|
|
|
WithdrawGoldKeyPress(SDLK_ESCAPE); |
|
|
|
rv = true; |
|
|
|
rv = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -2035,7 +2036,7 @@ bool PressEscKey() |
|
|
|
return rv; |
|
|
|
return rv; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void DisableInputEventHandler(uint32_t uMsg, int32_t /*wParam*/, int32_t lParam) |
|
|
|
void DisableInputEventHandler(uint32_t uMsg, uint32_t /*wParam*/, uint32_t lParam) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (uMsg) { |
|
|
|
switch (uMsg) { |
|
|
|
case DVL_WM_KEYDOWN: |
|
|
|
case DVL_WM_KEYDOWN: |
|
|
|
|