World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Keyboard.cpp
См. документацию.
1 #ifdef _WINDOWS
2 #include <windows.h>
3 #else
4 #include "SDL.h"
5 #include "IO/Mouse.h"
6 
7 // remove this after enabling SDLK_* keys
8 inline int GetAsyncKeyState(int vKey) { return (int)SDL_GetKeyboardState(&vKey); }
9 #endif
10 #undef PlaySound // conflicts with Player method
11 
12 #include <string>
13 #include <tuple>
14 #include <vector>
15 
16 #include "Engine/Engine.h"
17 #include "Engine/Objects/Actor.h"
18 #include "Engine/Party.h"
19 #include "Engine/Time.h"
20 
22 
23 #include "Engine/Graphics/Indoor.h"
24 #include "Engine/Graphics/Vis.h"
26 
28 
29 #include "IO/Keyboard.h"
30 
31 #include "GUI/GUIWindow.h"
32 
33 #include "Platform/Api.h"
34 
36 
37 //----- (0044F07B) --------------------------------------------------------
39  if (!keyboard->IsKeyBeingHeld(VK_SHIFT) &&
40  !keyboard->IsKeyBeingHeld(VK_LSHIFT) &&
41  !keyboard->IsKeyBeingHeld(VK_LSHIFT) ||
42  (keyboard->WasKeyPressed(VK_F11) == 0 &&
43  keyboard->WasKeyPressed(VK_F11)))
44  return true;
45  return false;
46 }
47 
49  public:
51  unsigned char m_keyDefaultCode;
52  unsigned short m_cmdId;
54  CKeyListElement(std::string keyName, unsigned char keyDefaultCode,
55  unsigned short cmdId, KeyToggleType toggType)
56  : m_keyName(keyName),
57  m_keyDefaultCode(keyDefaultCode),
58  m_cmdId(cmdId),
59  m_toggType(toggType) {}
60 };
61 
62 std::array<CKeyListElement, 30> keyMappingParams = {
63  CKeyListElement("KEY_FORWARD", VK_UP, INPUT_MoveForward,
65  CKeyListElement("KEY_BACKWARD", VK_DOWN, INPUT_MoveBackwards,
68  CKeyListElement("KEY_RIGHT", VK_RIGHT, INPUT_TurnRight,
75  CKeyListElement("KEY_EVENTTRIGGER", VK_SPACE, INPUT_EventTrigger,
79  CKeyListElement("KEY_CHARCYCLE", VK_TAB, INPUT_CharCycle,
88  CKeyListElement("KEY_LOOKDOWN", VK_DELETE, INPUT_LookDown,
90  CKeyListElement("KEY_CENTERVIEWPT", VK_END, INPUT_CenterView,
93  CKeyListElement("KEY_ZOOMOUT", VK_SUBTRACT, INPUT_ZoomOut,
96  CKeyListElement("KEY_FLYDOWN", VK_INSERT, INPUT_FlyDown,
100  CKeyListElement("KEY_STEPLEFT", VK_OEM_4, INPUT_StrafeLeft,
102  CKeyListElement("KEY_STEPRIGHT", VK_OEM_6, INPUT_StrafeRight,
104 
105 std::array<std::tuple<const char *, const unsigned __int8>, 26>
107  std::tuple<const char *, const unsigned __int8>("UP", VK_UP),
108  std::tuple<const char *, const unsigned __int8>("DOWN", VK_DOWN),
109  std::tuple<const char *, const unsigned __int8>("LEFT", VK_LEFT),
110  std::tuple<const char *, const unsigned __int8>("ВЛЕВО", VK_LEFT),
111  std::tuple<const char *, const unsigned __int8>("RIGHT", VK_RIGHT),
112  std::tuple<const char *, const unsigned __int8>("ВПРАВО", VK_RIGHT),
113  std::tuple<const char *, const unsigned __int8>("RETURN", VK_RETURN),
114  std::tuple<const char *, const unsigned __int8>("SPACE", VK_SPACE),
115  std::tuple<const char *, const unsigned __int8>("PAGE_DOWN", VK_NEXT),
116  std::tuple<const char *, const unsigned __int8>("PAGE_UP", VK_PRIOR),
117  std::tuple<const char *, const unsigned __int8>("TAB", VK_TAB),
118  std::tuple<const char *, const unsigned __int8>("SUBTRACT",
119  VK_SUBTRACT),
120  std::tuple<const char *, const unsigned __int8>("ADD", VK_ADD),
121  std::tuple<const char *, const unsigned __int8>("END", VK_END),
122  std::tuple<const char *, const unsigned __int8>("DELETE", VK_DELETE),
123  std::tuple<const char *, const unsigned __int8>("HOME", VK_HOME),
124  std::tuple<const char *, const unsigned __int8>("INSERT", VK_INSERT),
125  std::tuple<const char *, const unsigned __int8>("COMMA", VK_OEM_COMMA),
126  std::tuple<const char *, const unsigned __int8>("DECIMAL", VK_DECIMAL),
127  std::tuple<const char *, const unsigned __int8>("SEMICOLON", VK_OEM_1),
128  std::tuple<const char *, const unsigned __int8>("PERIOD",
129  VK_OEM_PERIOD),
130  std::tuple<const char *, const unsigned __int8>("SLASH", VK_OEM_2),
131  std::tuple<const char *, const unsigned __int8>("SQUOTE", VK_OEM_7),
132  std::tuple<const char *, const unsigned __int8>("BACKSLASH", VK_OEM_5),
133  std::tuple<const char *, const unsigned __int8>("BACKSPACE", VK_BACK),
134  std::tuple<const char *, const unsigned __int8>("CONTROL", VK_CONTROL),
135 };
136 
137 //----- (00459C68) --------------------------------------------------------
138 void KeyboardActionMapping::SetKeyMapping(int uAction, int vKey,
140  pVirtualKeyCodesMapping[uAction] = vKey;
141  pToggleTypes[uAction] = type;
142 }
143 
144 //----- (00459C82) --------------------------------------------------------
146  return this->pVirtualKeyCodesMapping[eAction];
147 }
148 
149 //----- (00459C8D) --------------------------------------------------------
151  uLastKeyPressed = 0;
152  field_204 = 0;
153  pWindow = nullptr;
154 
156  ReadMappings();
157 
158  ResetKeys();
159 
160  uNumKeysPressed = 0;
161 
163 }
164 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
165 
166 //----- (00459CC4) --------------------------------------------------------
168  for (size_t i = 0; i < keyMappingParams.size(); i++) {
169  SetKeyMapping(keyMappingParams[i].m_cmdId,
170  keyMappingParams[i].m_keyDefaultCode,
171  keyMappingParams[i].m_toggType);
172  }
173 }
174 
175 //----- (00459E3F) --------------------------------------------------------
177  for (uint i = 0; i < 30; ++i) GetAsyncKeyState(pVirtualKeyCodesMapping[i]);
178 }
179 
180 //----- (00459E5A) --------------------------------------------------------
181 void KeyboardActionMapping::EnterText(int a2, int max_string_len,
182  GUIWindow *pWindow) {
183  memset(this->pPressedKeysBuffer, 0, 0x101u);
184  this->uNumKeysPressed = 0;
185  if (a2)
186  this->field_204 = 2;
187  else
188  this->field_204 = 1;
189  this->max_input_string_len = max_string_len;
190  this->pWindow = pWindow;
191  pWindow->receives_keyboard_input_2 = WINDOW_INPUT_IN_PROGRESS;
192 }
193 
194 //----- (00459ED1) --------------------------------------------------------
196  field_204 = 0;
198 }
199 
200 //----- (00459F10) --------------------------------------------------------
204  if (pKeyActionMap->field_204 != 1 && pKeyActionMap->field_204 != 2)
205  return 0;
206  if (a2 == VK_BACK) {
207  if (pKeyActionMap->uNumKeysPressed > 0) {
211  }
212  } else if (a2 == VK_RETURN) {
213  pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED);
214  } else if (a2 == VK_ESCAPE) {
215  pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
216  } else if (this->uNumKeysPressed < this->max_input_string_len) {
217  if (pKeyActionMap->field_204 == 1) {
218  if (a2 != VK_TAB) {
221  a2;
225  0;
226  }
227  } else if (pKeyActionMap->field_204 == 2) {
228  if (isdigit(a2)) {
231  a2;
233  }
234  }
235  }
236  } else {
240  pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED);
241  }
242  return 1;
243 }
244 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
245 
246 //----- (00459FFC) --------------------------------------------------------
248  char str[32];
249 
250  for (size_t i = 0; i < keyMappingParams.size(); i++) {
251  const char *keyName = keyMappingParams[i].m_keyName.c_str();
252  short commandDefaultKeyCode = keyMappingParams[i].m_keyDefaultCode;
253  short commandId = keyMappingParams[i].m_cmdId;
254  KeyToggleType toggType = keyMappingParams[i].m_toggType;
255 
256  OS_GetAppString(keyName, str, 32, "DEFAULT");
257  if (strcmp(str, "DEFAULT") && (TranslateKeyNameToKeyCode(str) !=
258  0xff)) // returns 0xff on error not -1
260  else
261  pVirtualKeyCodesMapping[commandId] = commandDefaultKeyCode;
262  pToggleTypes[commandId] = toggType;
263  }
264 }
265 
266 //----- (0045A960) --------------------------------------------------------
268  const char *v2; // eax@1
269 
270  for (size_t i = 0; i < keyMappingParams.size(); i++) {
273  OS_SetAppString(keyMappingParams[i].m_keyName.c_str(), v2);
274  }
275 }
276 
277 //----- (0045ABCA) --------------------------------------------------------
279  const char *Str) {
280  if (strlen(Str) == 1) {
281  if (Str[0] >= 65 && Str[0] <= 90)
282  return *Str;
283  else
284  return 0xFF;
285  }
286 
287  for (size_t i = 0; i < keyNameToCodeTranslationMap.size(); i++) {
288  if (!strcmp(Str, std::get<0>(keyNameToCodeTranslationMap[i])))
289  return std::get<1>(keyNameToCodeTranslationMap[i]);
290  }
291  return 0xFF;
292 }
293 
294 //----- (0045AE2C) --------------------------------------------------------
295 const char *KeyboardActionMapping::GetVKeyDisplayName(unsigned char a1) {
296  static char static_sub_45AE2C_string_69ADE0_keyName[32];
297 
298  if (a1 >= 65 && a1 <= 90) {
299  static_sub_45AE2C_string_69ADE0_keyName[0] = a1;
300  static_sub_45AE2C_string_69ADE0_keyName[1] = '\0';
301  return static_sub_45AE2C_string_69ADE0_keyName;
302  }
303 
304  for (size_t i = 0; i < keyNameToCodeTranslationMap.size(); i++) {
305  if (a1 == std::get<1>(keyNameToCodeTranslationMap[i])) {
306  const char *keyName = std::get<0>(keyNameToCodeTranslationMap[i]);
307  strcpy(static_sub_45AE2C_string_69ADE0_keyName, keyName);
308  return static_sub_45AE2C_string_69ADE0_keyName;
309  }
310  }
311 
312  strcpy(static_sub_45AE2C_string_69ADE0_keyName, "-BAD KEY-");
313  return static_sub_45AE2C_string_69ADE0_keyName;
314 }
315 
316 //----- (0045B06E) --------------------------------------------------------
318  return (GetAsyncKeyState(VK_SHIFT) & 0x8001) != 0;
319 }
320 
321 //----- (0045B0A9) --------------------------------------------------------
322 bool Keyboard::IsKeyBeingHeld(int vKey) {
323  return (GetAsyncKeyState(vKey) & 0x8001) != 0;
324 }
325 
326 //----- (0045B0CE) --------------------------------------------------------
327 bool Keyboard::WasKeyPressed(int vKey) {
328  return (GetAsyncKeyState(vKey) & 1) != 0;
329 }
330 
331 //----- (0042FC4E) --------------------------------------------------------
333  char v4; // al@9
334  // unsigned __int16 v9; // ax@102
335  // int spell_price; // eax@103
336  PartyAction partyAction; // [sp-14h] [bp-1Ch]@20
337  InputAction inputAction; // [sp+0h] [bp-8h]@7
338 
339  if (!engine->config->always_run) {
340  if (this->IsShiftHeld())
342  else
344  } else {
345  if (this->IsShiftHeld())
347  else
349  }
350 
351  // pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
352 
353  if (pEventTimer->bPaused) { // game paused
354  for (uint i = 0; i < 30; ++i) {
355  inputAction = (InputAction)i;
357  v4 = WasKeyPressed(
358  pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
359  else
360  v4 = IsKeyBeingHeld(
361  pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
362 
363  if (v4) {
364  if (inputAction == INPUT_EventTrigger) {
366  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Game_Action, 0, 0);
367  continue;
368  }
370  /*v15 = pMessageQueue_50CBD0->uNumMessages;
371  if (pMessageQueue_50CBD0->uNumMessages) {
372  v15 = 0;
373  if (pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8) {
374  v15 = 1;
375  pMessageQueue_50CBD0->uNumMessages = 0;
376  pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
377  pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
378  *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
379  ++pMessageQueue_50CBD0->uNumMessages;
380  continue;
381  }
382  pMessageQueue_50CBD0->uNumMessages = 0;
383 
384  }*/
385  // pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
386  }
387  }
388  }
389  }
390  }
391  if (!pEventTimer->bPaused) { // game running
392  for (uint i = 0; i < 30; ++i) {
393  inputAction = (InputAction)i;
395  v4 = this->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
396  else
397  v4 = this->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
398  if (v4) {
399  switch (inputAction) {
400  case INPUT_MoveForward:
402  if (!pParty->bTurnBasedModeOn) {
404  partyAction = PARTY_RunForward;
405  else
406  partyAction = PARTY_WalkForward;
407  pPartyActionQueue->Add(partyAction);
408  break;
409  }
410  if (pTurnEngine->turn_stage != TE_WAIT &&
415  partyAction = PARTY_RunForward;
416  else
417  partyAction = PARTY_WalkForward;
418  pPartyActionQueue->Add(partyAction);
419  break;
420  }
421  break;
422  case INPUT_MoveBackwards:
424  if (!pParty->bTurnBasedModeOn) {
425  if (pParty->uFlags2 & 2)
426  partyAction = PARTY_RunBackward;
427  else
428  partyAction = PARTY_WalkBackward;
429  pPartyActionQueue->Add(partyAction);
430  break;
431  }
432  if (pTurnEngine->turn_stage != TE_WAIT &&
436  if (pParty->uFlags2 & 2)
437  partyAction = PARTY_RunBackward;
438  else
439  partyAction = PARTY_WalkBackward;
440  pPartyActionQueue->Add(partyAction);
441  break;
442  }
443  break;
444  case INPUT_StrafeLeft:
446  if (!pParty->bTurnBasedModeOn) {
447  partyAction = PARTY_StrafeLeft;
448  pPartyActionQueue->Add(partyAction);
449  break;
450  }
451  if (pTurnEngine->turn_stage == TE_WAIT ||
454  break;
456  partyAction = PARTY_StrafeLeft;
457  pPartyActionQueue->Add(partyAction);
458  break;
459  case INPUT_StrafeRight:
461  if (!pParty->bTurnBasedModeOn) {
462  partyAction = PARTY_StrafeRight;
463  pPartyActionQueue->Add(partyAction);
464  break;
465  }
466  if (pTurnEngine->turn_stage == TE_WAIT ||
469  break;
471  partyAction = PARTY_StrafeRight;
472  pPartyActionQueue->Add(partyAction);
473  break;
474  case INPUT_TurnLeft:
476  if (GetAsyncKeyState(VK_CONTROL)) { // strafing
477  if (pParty->bTurnBasedModeOn) {
478  if (pTurnEngine->turn_stage == TE_WAIT ||
481  break;
483  }
484  partyAction = PARTY_StrafeLeft;
485  } else {
486  if (pParty->uFlags2 & 2)
487  partyAction = PARTY_FastTurnLeft;
488  else
489  partyAction = PARTY_TurnLeft;
490  }
491  pPartyActionQueue->Add(partyAction);
494  pWeather->OnPlayerTurn(10);
495  break;
496  case INPUT_TurnRight:
498  if (GetAsyncKeyState(VK_CONTROL)) { // strafing
499  if (pParty->bTurnBasedModeOn) {
500  if (pTurnEngine->turn_stage == TE_WAIT ||
503  break;
505  }
506  partyAction = PARTY_StrafeRight;
507  } else {
508  if (pParty->uFlags2 & 2)
509  partyAction = PARTY_FastTurnRight;
510  else
511  partyAction = PARTY_TurnRight;
512  }
513  pPartyActionQueue->Add(partyAction);
516  pWeather->OnPlayerTurn(-10);
517  break;
518  case INPUT_Jump:
521  break;
522  partyAction = (PartyAction)12;
523  pPartyActionQueue->Add(partyAction);
524  break;
525  case INPUT_Yell:
527  pParty->Yell();
529  0);
530  }
531  break;
532  case INPUT_Pass:
534  if (pParty->bTurnBasedModeOn &&
537  break;
538  }
539  if (uActiveCharacter) {
540  if (!pPlayers[uActiveCharacter]->uTimeToRecovery) {
541  if (!pParty->bTurnBasedModeOn)
542  pPlayers[uActiveCharacter]->SetRecoveryTime(
543  (signed __int64)(flt_6BE3A4_debug_recmod1 *
544  (double)pPlayers[uActiveCharacter]->GetAttackRecoveryTime(false) *
545  2.133333333333333));
548  }
549  }
550  break;
551  case INPUT_Combat: // if press ENTER
553  if (pParty->bTurnBasedModeOn) {
555  PID_TYPE(
557  OBJECT_Player) {
558  pParty->bTurnBasedModeOn = false;
559  pTurnEngine->End(true);
560  }
561  } else {
562  pTurnEngine->Start();
563  pParty->bTurnBasedModeOn = true;
564  }
565  }
566  break;
567  case INPUT_CastReady: {
571  break;
572  }
573  if (!uActiveCharacter) break;
574 
575  uchar quickSpellNumber = pPlayers[uActiveCharacter]->uQuickSpell;
576  int skill_level = pPlayers[uActiveCharacter]->GetActualSkillMastery(PLAYER_SKILL_TYPE(quickSpellNumber / 11 + 12));
577 
578  int uRequiredMana = 0;
579  if (!engine->config->debug_all_magic)
580  uRequiredMana = pSpellDatas[quickSpellNumber].mana_per_skill[skill_level - 1];
581 
582  bool enoughMana = (pPlayers[uActiveCharacter]->sMana >= uRequiredMana);
583 
584  if (!pPlayers[uActiveCharacter]->uQuickSpell ||
585  engine->IsUnderwater() || !enoughMana) {
587  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Attack, 0, 0);
588  break;
589  } else {
590  pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CastQuickSpell, 0, 0);
591  }
592  } break;
593  case INPUT_Attack:
597  break;
598  }
599  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Attack, 0, 0);
600  break;
601  case INPUT_EventTrigger:
603  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Game_Action, 0, 0);
604  break;
605  }
608  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
609  }
610  break;
611  case INPUT_CharCycle:
613 
614  pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CycleCharacters, 0, 0);
615  break;
616  case INPUT_LookUp:
617  if (pEventTimer->bPaused) break;
618  partyAction = (PartyAction)7;
619  pPartyActionQueue->Add(partyAction);
620  break;
621  case INPUT_CenterView:
622  if (pEventTimer->bPaused) break;
623  partyAction = (PartyAction)9;
624  pPartyActionQueue->Add(partyAction);
625  break;
626  case INPUT_LookDown:
627  if (pEventTimer->bPaused) break;
628  partyAction = (PartyAction)8;
629  pPartyActionQueue->Add(partyAction);
630  break;
631  case INPUT_FlyUp:
633  partyAction = (PartyAction)13;
634  pPartyActionQueue->Add(partyAction);
635  break;
636  case INPUT_Land:
638  partyAction = (PartyAction)15;
639  pPartyActionQueue->Add(partyAction);
640  break;
641  case INPUT_FlyDown:
643  partyAction = (PartyAction)14;
644  pPartyActionQueue->Add(partyAction);
645  }
646  break;
647  case INPUT_ZoomIn:
648  pMessageQueue_50C9E8->AddGUIMessage(UIMSG_ClickZoomOutBtn, 0, 0);
649  break;
650  case INPUT_ZoomOut:
651  pMessageQueue_50C9E8->AddGUIMessage(UIMSG_ClickZoomInBtn, 0, 0);
652  break;
653  case INPUT_AlwaysRun:
654  engine->ToggleAlwaysRun();
655  break;
656  default:
657  break;
658  }
659  }
660  }
661  }
662 }
KeyboardActionMapping::TranslateKeyNameToKeyCode
const uint8_t TranslateKeyNameToKeyCode(const char *Str)
Definition: Keyboard.cpp:278
SDL.h
TE_MOVEMENT
@ TE_MOVEMENT
Definition: TurnEngine.h:22
TE_ATTACK
@ TE_ATTACK
Definition: TurnEngine.h:21
KeyboardActionMapping::EnterText
void EnterText(int a2, int max_string_len, GUIWindow *pWindow)
Definition: Keyboard.cpp:181
INPUT_StrafeLeft
@ INPUT_StrafeLeft
Definition: Keyboard.h:33
INPUT_CharCycle
@ INPUT_CharCycle
Definition: Keyboard.h:17
UIMSG_Escape
@ UIMSG_Escape
Definition: GUIWindow.h:96
keyMappingParams
std::array< CKeyListElement, 30 > keyMappingParams
Definition: Keyboard.cpp:62
UIMSG_CycleCharacters
@ UIMSG_CycleCharacters
Definition: GUIWindow.h:143
PARTY_StrafeLeft
@ PARTY_StrafeLeft
Definition: Party.h:98
GUIWindow
Definition: GUIWindow.h:433
INPUT_Autonotes
@ INPUT_Autonotes
Definition: Keyboard.h:22
INPUT_LookDown
@ INPUT_LookDown
Definition: Keyboard.h:26
CKeyListElement::m_cmdId
unsigned short m_cmdId
Definition: Keyboard.cpp:52
Engine::keyboard
Keyboard * keyboard
Definition: Engine.h:470
Weather::bRenderSnow
bool bRenderSnow
Definition: Weather.h:18
INPUT_CenterView
@ INPUT_CenterView
Definition: Keyboard.h:27
CKeyListElement::CKeyListElement
CKeyListElement(std::string keyName, unsigned char keyDefaultCode, unsigned short cmdId, KeyToggleType toggType)
Definition: Keyboard.cpp:54
CURRENT_SCREEN::SCREEN_CHEST
@ SCREEN_CHEST
INPUT_ZoomOut
@ INPUT_ZoomOut
Definition: Keyboard.h:29
INPUT_QuickRef
@ INPUT_QuickRef
Definition: Keyboard.h:19
CURRENT_SCREEN::SCREEN_SPELL_BOOK
@ SCREEN_SPELL_BOOK
UIMSG_ClickZoomInBtn
@ UIMSG_ClickZoomInBtn
Definition: GUIWindow.h:191
engine
std::shared_ptr< Engine > engine
Definition: Engine.cpp:130
KeyToggleType::TOGGLE_Continuously
@ TOGGLE_Continuously
stru262_TurnBased::ApplyPlayerAction
void ApplyPlayerAction()
Definition: TurnEngine.cpp:101
INPUT_Cast
@ INPUT_Cast
Definition: Keyboard.h:15
INPUT_MoveBackwards
@ INPUT_MoveBackwards
Definition: Keyboard.h:6
Timer::bPaused
unsigned int bPaused
Definition: Time.h:127
INPUT_TurnLeft
@ INPUT_TurnLeft
Definition: Keyboard.h:7
PARTY_WalkForward
@ PARTY_WalkForward
Definition: Party.h:100
INPUT_MoveForward
@ INPUT_MoveForward
Definition: Keyboard.h:5
pPlayers
NZIArray< struct Player *, 5 > pPlayers
Definition: Player.cpp:46
TurnEngine.h
GUIWindow::receives_keyboard_input_2
int receives_keyboard_input_2
Definition: GUIWindow.h:486
Engine.h
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
pTurnEngine
struct stru262_TurnBased * pTurnEngine
Definition: TurnEngine.cpp:21
Keyboard::IsShiftHeld
bool IsShiftHeld()
Definition: Keyboard.cpp:317
GetAsyncKeyState
int GetAsyncKeyState(int vKey)
Definition: Keyboard.cpp:8
INPUT_Combat
@ INPUT_Combat
Definition: Keyboard.h:11
INPUT_ZoomIn
@ INPUT_ZoomIn
Definition: Keyboard.h:28
INPUT_FlyUp
@ INPUT_FlyUp
Definition: Keyboard.h:30
Actor.h
Party::Yell
void Yell()
Definition: Party.cpp:598
TE_FLAG_8
@ TE_FLAG_8
Definition: TurnEngine.h:7
UIMSG_CastQuickSpell
@ UIMSG_CastQuickSpell
Definition: GUIWindow.h:29
pWeather
Weather * pWeather
Definition: Weather.cpp:8
INPUT_Quest
@ INPUT_Quest
Definition: Keyboard.h:18
TurnBased_QueueElem::uPackedID
int uPackedID
Definition: TurnEngine.h:34
CURRENT_SCREEN::SCREEN_BRANCHLESS_NPC_DIALOG
@ SCREEN_BRANCHLESS_NPC_DIALOG
INPUT_Rest
@ INPUT_Rest
Definition: Keyboard.h:20
Keyboard::ProcessInputActions
void ProcessInputActions()
Definition: Keyboard.cpp:332
pParty
Party * pParty
Definition: Party.cpp:30
pMessageQueue_50C9E8
struct GUIMessageQueue * pMessageQueue_50C9E8
Definition: GUIWindow.cpp:87
SPEECH_Yell
@ SPEECH_Yell
Definition: Player.h:111
keyNameToCodeTranslationMap
std::array< std::tuple< const char *, const unsigned __int8 >, 26 > keyNameToCodeTranslationMap
Definition: Keyboard.cpp:106
KeyToggleType::TOGGLE_OneTimePress
@ TOGGLE_OneTimePress
Engine::_44F07B
bool _44F07B()
Definition: Keyboard.cpp:38
Keyboard::WasKeyPressed
bool WasKeyPressed(int vKey)
Definition: Keyboard.cpp:327
KeyboardActionMapping::SetKeyMapping
void SetKeyMapping(int uAction, int vKey, KeyToggleType type)
Definition: Keyboard.cpp:138
KeyboardActionMapping::KeyboardActionMapping
KeyboardActionMapping()
Definition: Keyboard.cpp:150
CKeyListElement::m_keyName
std::string m_keyName
Definition: Keyboard.cpp:50
INPUT_AlwaysRun
@ INPUT_AlwaysRun
Definition: Keyboard.h:24
INPUT_Jump
@ INPUT_Jump
Definition: Keyboard.h:10
PLAYER_SKILL_TYPE
PLAYER_SKILL_TYPE
Definition: Player.h:170
PARTY_FastTurnRight
@ PARTY_FastTurnRight
Definition: Party.h:114
uchar
unsigned char uchar
Definition: MM7.h:44
INPUT_TurnRight
@ INPUT_TurnRight
Definition: Keyboard.h:8
INPUT_TimeCal
@ INPUT_TimeCal
Definition: Keyboard.h:21
PARTY_TurnRight
@ PARTY_TurnRight
Definition: Party.h:97
Indoor.h
PARTY_RunBackward
@ PARTY_RunBackward
Definition: Party.h:112
pSpellDatas
std::array< SpellData, 100 > pSpellDatas
Definition: Spells.cpp:170
KeyboardActionMapping::pPressedKeysBuffer
char pPressedKeysBuffer[257]
Definition: Keyboard.h:66
stru262_TurnBased::pQueue
TurnBased_QueueElem pQueue[530]
Definition: TurnEngine.h:82
stru262_TurnBased::Start
void Start()
Definition: TurnEngine.cpp:108
INPUT_Yell
@ INPUT_Yell
Definition: Keyboard.h:9
Party.h
KeyboardActionMapping::ReadMappings
void ReadMappings()
Definition: Keyboard.cpp:247
stru262_TurnBased::End
void End(bool bPlaySound)
Definition: TurnEngine.cpp:220
type
EGLenum type
Definition: SDL_egl.h:850
Weather.h
KeyToggleType
KeyToggleType
Definition: Keyboard.h:37
INPUT_StrafeRight
@ INPUT_StrafeRight
Definition: Keyboard.h:34
LEVEL_Outdoor
@ LEVEL_Outdoor
Definition: Indoor.h:287
KeyboardActionMapping
Definition: Keyboard.h:45
KeyboardActionMapping::ResetKeys
void ResetKeys()
Definition: Keyboard.cpp:176
pPartyActionQueue
struct ActionQueue * pPartyActionQueue
Definition: Party.cpp:32
KeyboardActionMapping::pVirtualKeyCodesMapping
unsigned int pVirtualKeyCodesMapping[30]
Definition: Keyboard.h:63
PartyAction
PartyAction
Definition: Party.h:94
TE_WAIT
@ TE_WAIT
Definition: TurnEngine.h:20
KeyboardActionMapping::GetActionVKey
unsigned int GetActionVKey(enum InputAction eAction)
Definition: Keyboard.cpp:145
KeyboardActionMapping::SetWindowInputStatus
void SetWindowInputStatus(int a2)
Definition: Keyboard.cpp:195
KeyboardActionMapping::field_204
int field_204
Definition: Keyboard.h:70
KeyboardActionMapping::StoreMappings
void StoreMappings()
Definition: Keyboard.cpp:267
INPUT_FlyDown
@ INPUT_FlyDown
Definition: Keyboard.h:31
ActionQueue::Add
void Add(PartyAction action)
Definition: Party.cpp:125
INPUT_CastReady
@ INPUT_CastReady
Definition: Keyboard.h:12
PARTY_FLAGS_2_RUNNING
@ PARTY_FLAGS_2_RUNNING
Definition: Party.h:66
INPUT_Pass
@ INPUT_Pass
Definition: Keyboard.h:16
PARTY_TurnLeft
@ PARTY_TurnLeft
Definition: Party.h:96
INPUT_Land
@ INPUT_Land
Definition: Keyboard.h:32
OBJECT_Player
@ OBJECT_Player
Definition: Actor.h:68
Party::bTurnBasedModeOn
bool bTurnBasedModeOn
Definition: Party.h:305
INPUT_Mapbook
@ INPUT_Mapbook
Definition: Keyboard.h:23
CURRENT_SCREEN::SCREEN_GAME
@ SCREEN_GAME
CKeyListElement
Definition: Keyboard.cpp:48
Weather::OnPlayerTurn
bool OnPlayerTurn(int dangle)
Definition: Weather.cpp:56
CKeyListElement::m_keyDefaultCode
unsigned char m_keyDefaultCode
Definition: Keyboard.cpp:51
CURRENT_SCREEN::SCREEN_NPC_DIALOGUE
@ SCREEN_NPC_DIALOGUE
KeyboardActionMapping::GetVKeyDisplayName
const char * GetVKeyDisplayName(unsigned char a1)
Definition: Keyboard.cpp:295
KeyboardActionMapping::uLastKeyPressed
unsigned int uLastKeyPressed
Definition: Keyboard.h:60
CKeyListElement::m_toggType
KeyToggleType m_toggType
Definition: Keyboard.cpp:53
uRequiredMana
unsigned int uRequiredMana
Definition: mm7_data.cpp:516
KeyboardActionMapping::SetDefaultMapping
void SetDefaultMapping()
Definition: Keyboard.cpp:167
pKeyActionMap
struct KeyboardActionMapping * pKeyActionMap
Definition: Keyboard.cpp:35
v2
GLfloat GLfloat GLfloat v2
Definition: SDL_opengl_glext.h:695
flt_6BE3A4_debug_recmod1
float flt_6BE3A4_debug_recmod1
Definition: mm7_data.cpp:716
uint
unsigned int uint
Definition: MM7.h:4
uActiveCharacter
unsigned int uActiveCharacter
Definition: mm7_data.cpp:555
KeyboardActionMapping::pWindow
GUIWindow * pWindow
Definition: Keyboard.h:71
SDL_GetKeyboardState
const DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys)
Get a snapshot of the current state of the keyboard.
UIMSG_Attack
@ UIMSG_Attack
Definition: GUIWindow.h:27
UIMSG_Game_Action
@ UIMSG_Game_Action
Definition: GUIWindow.h:193
uCurrentlyLoadedLevelType
LEVEL_TYPE uCurrentlyLoadedLevelType
Definition: Indoor.cpp:52
InputAction
InputAction
Definition: Keyboard.h:4
OS_SetAppString
void OS_SetAppString(const char *pKey, const char *pString)
Definition: Lin.cpp:93
INPUT_EventTrigger
@ INPUT_EventTrigger
Definition: Keyboard.h:14
INPUT_LookUp
@ INPUT_LookUp
Definition: Keyboard.h:25
Keyboard::IsKeyBeingHeld
static bool IsKeyBeingHeld(int vKey)
Definition: Keyboard.cpp:322
KeyboardActionMapping::uNumKeysPressed
uint8_t uNumKeysPressed
Definition: Keyboard.h:67
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:691
KeyboardActionMapping::max_input_string_len
int max_input_string_len
Definition: Keyboard.h:65
INPUT_Attack
@ INPUT_Attack
Definition: Keyboard.h:13
GUIMessageQueue::Clear
void Clear()
Definition: GUIWindow.cpp:169
GUIWindow.h
KeyboardActionMapping::pToggleTypes
KeyToggleType pToggleTypes[30]
Definition: Keyboard.h:64
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
CastSpellInfoHelpers::Cancel_Spell_Cast_In_Progress
void Cancel_Spell_Cast_In_Progress()
Definition: CastSpellInfo.cpp:4350
Party::uFlags2
int uFlags2
Definition: Party.h:307
PARTY_WalkBackward
@ PARTY_WalkBackward
Definition: Party.h:101
OS_GetAppString
bool OS_GetAppString(const char *path, char *out_string, int out_string_size)
Definition: Launcher.cpp:62
PARTY_FastTurnLeft
@ PARTY_FastTurnLeft
Definition: Party.h:113
stru262_TurnBased::field_18
int field_18
Definition: TurnEngine.h:80
stru262_TurnBased::turn_stage
int turn_stage
Definition: TurnEngine.h:75
KeyboardActionMapping::ProcessTextInput
bool ProcessTextInput(unsigned int a2)
Definition: Keyboard.cpp:201
Keyboard.h
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
PARTY_RunForward
@ PARTY_RunForward
Definition: Party.h:111
UIMSG_ClickZoomOutBtn
@ UIMSG_ClickZoomOutBtn
Definition: GUIWindow.h:190
Mouse.h
PARTY_StrafeRight
@ PARTY_StrafeRight
Definition: Party.h:99
CastSpellInfo.h
Api.h
uGameMenuUI_CurentlySelectedKeyIdx
int uGameMenuUI_CurentlySelectedKeyIdx
Definition: mm7_data.cpp:540
stru262_TurnBased::uActionPointsLeft
int uActionPointsLeft
Definition: TurnEngine.h:79
Vis.h
Time.h