annotate IO/Keyboard.cpp @ 2544:c674d547cc7c

GUIWindow switch logic refactored into behaviour classes
author a.parshin
date Mon, 11 May 2015 09:51:04 +0200
parents a902abdfc7f2
children 87e5590d034b
rev   line source
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
4
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
6
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
7 #include "Engine/Engine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
8
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
9 #include "Keyboard.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
10 #include "GUI/GUIWindow.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
11
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
12 #include "Engine/Graphics/Vis.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
13 #include "Engine/Objects/Actor.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
14 #include "Engine/Party.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
15 #include "Engine/Timer.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
16 #include "Engine/TurnEngine/TurnEngine.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
17 #include "Engine/Graphics/Weather.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
18 #include "Engine/Spells/CastSpellInfo.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
19 #include "Engine/Graphics/Indoor.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
20 #include "Engine/Registry.h"
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
21
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
22 #include <tuple>
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
23 #include <vector>
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
24 #include <string>
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
25
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
26 struct KeyboardActionMapping *pKeyActionMap;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
27
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
28
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
29 class CKeyListElement
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
30 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
31 public:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
32 std::string m_keyName;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
33 unsigned char m_keyDefaultCode;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
34 unsigned short m_cmdId;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
35 KeyToggleType m_toggType;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
36 CKeyListElement(std::string keyName, unsigned char keyDefaultCode, unsigned short cmdId, KeyToggleType toggType):
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
37 m_keyName(keyName),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
38 m_keyDefaultCode(keyDefaultCode),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
39 m_cmdId(cmdId),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
40 m_toggType(toggType)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
41 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
42
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
43 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
44 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
45
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
46 std::array<CKeyListElement, 30>keyMappingParams = {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
47 CKeyListElement("KEY_FORWARD", VK_UP, INPUT_MoveForward, TOGGLE_Continuously),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
48 CKeyListElement("KEY_BACKWARD", VK_DOWN, INPUT_MoveBackwards, TOGGLE_Continuously),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
49 CKeyListElement("KEY_LEFT", VK_LEFT, INPUT_TurnLeft, TOGGLE_Continuously),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
50 CKeyListElement("KEY_RIGHT", VK_RIGHT, INPUT_TurnRight, TOGGLE_Continuously),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
51 CKeyListElement("KEY_ATTACK", 'A', INPUT_Attack, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
52 CKeyListElement("KEY_CASTREADY", 'S', INPUT_CastReady, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
53 CKeyListElement("KEY_YELL", 'Y', INPUT_Yell, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
54 CKeyListElement("KEY_JUMP", 'X', INPUT_Jump, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
55 CKeyListElement("KEY_COMBAT", VK_RETURN, INPUT_Combat, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
56 CKeyListElement("KEY_EVENTTRIGGER", VK_SPACE, INPUT_EventTrigger, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
57 CKeyListElement("KEY_CAST", 'C', INPUT_Cast, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
58 CKeyListElement("KEY_PASS", 'B', INPUT_Pass, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
59 CKeyListElement("KEY_CHARCYCLE", VK_TAB, INPUT_CharCycle, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
60 CKeyListElement("KEY_QUEST", 'Q', INPUT_Quest, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
61 CKeyListElement("KEY_QUICKREF", 'Z', INPUT_QuickRef, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
62 CKeyListElement("KEY_REST", 'R', INPUT_Rest, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
63 CKeyListElement("KEY_TIMECAL", 'T', INPUT_TimeCal, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
64 CKeyListElement("KEY_AUTONOTES", 'N', INPUT_Autonotes, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
65 CKeyListElement("KEY_MAPBOOK", 'M', INPUT_Mapbook, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
66 CKeyListElement("KEY_LOOKUP", VK_NEXT, INPUT_LookUp, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
67 CKeyListElement("KEY_LOOKDOWN", VK_DELETE, INPUT_LookDown, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
68 CKeyListElement("KEY_CENTERVIEWPT", VK_END, INPUT_CenterView, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
69 CKeyListElement("KEY_ZOOMIN", VK_ADD, INPUT_ZoomIn, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
70 CKeyListElement("KEY_ZOOMOUT", VK_SUBTRACT, INPUT_ZoomOut, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
71 CKeyListElement("KEY_FLYUP", VK_PRIOR, INPUT_FlyUp, TOGGLE_Continuously),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
72 CKeyListElement("KEY_FLYDOWN", VK_INSERT, INPUT_FlyDown, TOGGLE_Continuously),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
73 CKeyListElement("KEY_LAND", VK_HOME, INPUT_Land, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
74 CKeyListElement("KEY_ALWAYSRUN", 'U', INPUT_AlwaysRun, TOGGLE_OneTimePress),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
75 CKeyListElement("KEY_STEPLEFT", VK_OEM_4, INPUT_StrafeLeft, TOGGLE_Continuously),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
76 CKeyListElement("KEY_STEPRIGHT", VK_OEM_6, INPUT_StrafeRight, TOGGLE_Continuously)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
77 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
78
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
79 std::array<std::tuple<const char*, const unsigned __int8>, 26> keyNameToCodeTranslationMap =
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
80 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
81 std::tuple<const char*, const unsigned __int8>("UP", VK_UP),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
82 std::tuple<const char*, const unsigned __int8>("DOWN", VK_DOWN),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
83 std::tuple<const char*, const unsigned __int8>("LEFT", VK_LEFT),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
84 std::tuple<const char*, const unsigned __int8>("бкебн", VK_LEFT),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
85 std::tuple<const char*, const unsigned __int8>("RIGHT", VK_RIGHT),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
86 std::tuple<const char*, const unsigned __int8>("бопюбн", VK_RIGHT),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
87 std::tuple<const char*, const unsigned __int8>("RETURN", VK_RETURN),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
88 std::tuple<const char*, const unsigned __int8>("SPACE", VK_SPACE),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
89 std::tuple<const char*, const unsigned __int8>("PAGE_DOWN", VK_NEXT),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
90 std::tuple<const char*, const unsigned __int8>("PAGE_UP", VK_PRIOR),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
91 std::tuple<const char*, const unsigned __int8>("TAB", VK_TAB),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
92 std::tuple<const char*, const unsigned __int8>("SUBTRACT", VK_SUBTRACT),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
93 std::tuple<const char*, const unsigned __int8>("ADD", VK_ADD),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
94 std::tuple<const char*, const unsigned __int8>("END", VK_END),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
95 std::tuple<const char*, const unsigned __int8>("DELETE", VK_DELETE),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
96 std::tuple<const char*, const unsigned __int8>("HOME", VK_HOME),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
97 std::tuple<const char*, const unsigned __int8>("INSERT", VK_INSERT),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
98 std::tuple<const char*, const unsigned __int8>("COMMA", VK_OEM_COMMA),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
99 std::tuple<const char*, const unsigned __int8>("DECIMAL", VK_DECIMAL),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
100 std::tuple<const char*, const unsigned __int8>("SEMICOLON", VK_OEM_1),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
101 std::tuple<const char*, const unsigned __int8>("PERIOD", VK_OEM_PERIOD),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
102 std::tuple<const char*, const unsigned __int8>("SLASH", VK_OEM_2),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
103 std::tuple<const char*, const unsigned __int8>("SQUOTE", VK_OEM_7),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
104 std::tuple<const char*, const unsigned __int8>("BACKSLASH", VK_OEM_5),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
105 std::tuple<const char*, const unsigned __int8>("BACKSPACE", VK_BACK),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
106 std::tuple<const char*, const unsigned __int8>("CONTROL", VK_CONTROL),
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
107 };
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
108
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
109 //----- (00459C68) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
110 void KeyboardActionMapping::SetKeyMapping(int uAction, int vKey, KeyToggleType type)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
111 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
112 pVirtualKeyCodesMapping[uAction] = vKey;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
113 pToggleTypes[uAction] = type;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
114 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
115
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
116 //----- (00459C82) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
117 unsigned int KeyboardActionMapping::GetActionVKey(enum InputAction eAction)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
118 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
119 return this->pVirtualKeyCodesMapping[eAction];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
120 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
121
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
122 //----- (00459C8D) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
123 KeyboardActionMapping::KeyboardActionMapping()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
124 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
125 uLastKeyPressed = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
126 field_204 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
127 pWindow = nullptr;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
128
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
129 SetDefaultMapping();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
130 ReadMappings();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
131
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
132 ResetKeys();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
133
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
134 uNumKeysPressed = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
135
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
136 uGameMenuUI_CurentlySelectedKeyIdx = -1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
137 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
138 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
139
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
140 //----- (00459CC4) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
141 void KeyboardActionMapping::SetDefaultMapping()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
142 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
143 for ( size_t i = 0; i < keyMappingParams.size(); i++)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
144 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
145 SetKeyMapping(keyMappingParams[i].m_cmdId, keyMappingParams[i].m_keyDefaultCode, keyMappingParams[i].m_toggType);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
146 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
147 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
148
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
149 //----- (00459E3F) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
150 void KeyboardActionMapping::ResetKeys()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
151 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
152 for (uint i = 0; i < 30; ++i)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
153 GetAsyncKeyState(pVirtualKeyCodesMapping[i]);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
154 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
155
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
156 //----- (00459E5A) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
157 void KeyboardActionMapping::EnterText(int a2, int max_string_len, GUIWindow *pWindow)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
158 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
159 memset(this->pPressedKeysBuffer, 0, 0x101u);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
160 this->uNumKeysPressed = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
161 if ( a2 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
162 this->field_204 = 2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
163 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
164 this->field_204 = 1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
165 this->max_input_string_len = max_string_len;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
166 this->pWindow = pWindow;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
167 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_IN_PROGRESS;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
168 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
169
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
170 //----- (00459ED1) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
171 void KeyboardActionMapping::SetWindowInputStatus(int a2)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
172 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
173 field_204 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
174 if ( pWindow )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
175 pWindow->receives_keyboard_input_2 = a2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
176 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
177
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
178 //----- (00459F10) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
179 bool KeyboardActionMapping::ProcessTextInput(unsigned int a2)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
180 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
181 pKeyActionMap->uLastKeyPressed = a2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
182 if ( uGameMenuUI_CurentlySelectedKeyIdx == -1 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
183 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
184 if ( pKeyActionMap->field_204 != 1 && pKeyActionMap->field_204 != 2 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
185 return 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
186 if ( a2 == VK_BACK)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
187 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
188 if (pKeyActionMap->uNumKeysPressed > 0)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
189 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
190 --pKeyActionMap->uNumKeysPressed;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
191 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
192 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
193 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
194 else if ( a2 == VK_RETURN )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
195 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
196 else if ( a2 == VK_ESCAPE )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
197 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
198 else if (this->uNumKeysPressed < this->max_input_string_len)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
199 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
200 if ( pKeyActionMap->field_204 == 1 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
201 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
202 if ( a2 != VK_TAB )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
203 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
204 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
205 ++pKeyActionMap->uNumKeysPressed;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
206 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
207 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
208 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
209 else if (pKeyActionMap->field_204 == 2)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
210 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
211 if ( isdigit(a2))
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
212 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
213 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
214 ++pKeyActionMap->uNumKeysPressed;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
215 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
216 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
217 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
218 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
219 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
220 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
221 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
222 ++pKeyActionMap->uNumKeysPressed;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
223 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
224 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
225 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
226 return 1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
227 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
228 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
229
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
230 //----- (00459FFC) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
231 void KeyboardActionMapping::ReadMappings()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
232 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
233 char str[32];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
234
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
235 for (size_t i = 0; i < keyMappingParams.size(); i++)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
236 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
237 const char* keyName = keyMappingParams[i].m_keyName.c_str();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
238 short commandDefaultKeyCode = keyMappingParams[i].m_keyDefaultCode;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
239 short commandId = keyMappingParams[i].m_cmdId;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
240 KeyToggleType toggType = keyMappingParams[i].m_toggType;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
241
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
242 ReadWindowsRegistryString(keyName, str, 32, "DEFAULT");
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
243 if ( strcmp(str, "DEFAULT") && ( TranslateKeyNameToKeyCode(str) != -1) )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
244 pVirtualKeyCodesMapping[commandId] = TranslateKeyNameToKeyCode(str);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
245 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
246 pVirtualKeyCodesMapping[commandId] = commandDefaultKeyCode;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
247 pToggleTypes[commandId] = toggType;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
248 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
249
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
250 bAlwaysRun = ReadWindowsRegistryInt("valAlwaysRun", 0) != 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
251 bFlipOnExit = ReadWindowsRegistryInt("FlipOnExit", 0) != 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
252 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
253
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
254 //----- (0045A960) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
255 void KeyboardActionMapping::StoreMappings()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
256 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
257
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
258 const char *v2; // eax@1
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
259
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
260 for ( size_t i = 0; i < keyMappingParams.size(); i++)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
261 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
262 v2 = GetVKeyDisplayName(pVirtualKeyCodesMapping[keyMappingParams[i].m_cmdId]);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
263 WriteWindowsRegistryString(keyMappingParams[i].m_keyName.c_str(), v2);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
264 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
265 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
266
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
267 //----- (0045ABCA) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
268 const unsigned __int8 KeyboardActionMapping::TranslateKeyNameToKeyCode(const char *Str)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
269 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
270 if (strlen(Str) == 1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
271 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
272 if( Str[0] >= 65 && Str[0] <= 90 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
273 return *Str;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
274 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
275 return 0xFF;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
276 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
277
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
278 for ( size_t i = 0; i < keyNameToCodeTranslationMap.size(); i++)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
279 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
280 if (!strcmp(Str, std::get<0>(keyNameToCodeTranslationMap[i])))
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
281 return std::get<1>(keyNameToCodeTranslationMap[i]);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
282 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
283 return 0xFF;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
284 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
285
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
286 //----- (0045AE2C) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
287 const char * KeyboardActionMapping::GetVKeyDisplayName(unsigned char a1)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
288 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
289 static char static_sub_45AE2C_string_69ADE0_keyName[32];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
290
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
291 if ( a1 >= 65 && a1 <= 90 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
292 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
293 static_sub_45AE2C_string_69ADE0_keyName[0] = a1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
294 static_sub_45AE2C_string_69ADE0_keyName[1] = '\0';
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
295 return static_sub_45AE2C_string_69ADE0_keyName;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
296 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
297
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
298 for ( size_t i = 0; i < keyNameToCodeTranslationMap.size(); i++)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
299 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
300 if ( a1 == std::get<1>(keyNameToCodeTranslationMap[i]))
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
301 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
302 const char* keyName = std::get<0>(keyNameToCodeTranslationMap[i]);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
303 strcpy_s(static_sub_45AE2C_string_69ADE0_keyName, keyName);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
304 return static_sub_45AE2C_string_69ADE0_keyName;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
305 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
306 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
307
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
308 strcpy_s(static_sub_45AE2C_string_69ADE0_keyName, "-мер -");
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
309 return static_sub_45AE2C_string_69ADE0_keyName;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
310 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
311
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
312
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
313 //----- (0045B019) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
314 void Keyboard::EnterCriticalSection()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
315 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
316 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
317
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
318 //----- (0045B06E) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
319 bool Keyboard::IsShiftHeld()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
320 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
321 return (GetAsyncKeyState(VK_SHIFT) & 0x8001) != 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
322 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
323
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
324 //----- (0045B0A9) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
325 bool Keyboard::IsKeyBeingHeld(int vKey)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
326 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
327 return (GetAsyncKeyState(vKey) & 0x8001) != 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
328 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
329
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
330 //----- (0045B0CE) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
331 bool Keyboard::WasKeyPressed(int vKey)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
332 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
333 return (GetAsyncKeyState(vKey) & 1) != 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
334 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
335 //----- (0046A14B) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
336 void OnPressSpace()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
337 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
338
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
339 //if ( pRenderer->pRenderD3D )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
340 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
341 pEngine->PickKeyboard(Keyboard::IsKeyBeingHeld(VK_CONTROL), &vis_sprite_filter_3, &vis_door_filter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
342 int pid = pEngine->pVisInstance->get_picked_object_zbuf_val();
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
343 if ( pid != -1 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
344 DoInteractionWithTopmostZObject(pid & 0xFFFF, PID_ID(pid));
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
345 return;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
346 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
347
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
348
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
349 // software render stuff following
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
350 /*
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
351 static int dword_720660[100]; // 720660
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
352 static int dword_7207F0[100]; // 7207F0
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
353
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
354 v22 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
355 v1 = (int *)((signed int)(viewparams->uScreen_BttmR_X + viewparams->uScreen_topL_X) >> 1);//wrong pointer
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
356 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
357 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
358 v2 = (char *)v1 - 50;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
359 v1 = (int *)((char *)v1 + 50);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
360 v3 = 640 * viewparams->uScreen_topL_Y;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
361 v17 = v2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
362 v20 = v1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
363 v18 = ((viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y - 1) >> 1) + 1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
364 do
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
365 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
366 if ( (signed int)v2 < (signed int)v20 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
367 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
368 v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
369 v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
370 v4 = v22;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
371 v5 = (((char *)v20 - v2 - 1) >> 1) + 1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
372 do
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
373 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
374 v6 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
375 v7 = *v1 & 0xFFFF;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
376 v19 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
377 if ( v4 > 0 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
378 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
379 do
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
380 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
381 if ( dword_7207F0[v6] == v7 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
382 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
383 ++v6;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
384 v19 = v6;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
385 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
386 while ( v6 < v22 );
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
387 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
388 if ( PID_TYPE(v7) == OBJECT_Decoration)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
389 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
390 v16 = (unsigned int)PID_ID(v7);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
391 if ( (signed int)(((unsigned int)*v21 >> 16)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
392 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)PID_ID(v7)].uDecorationDescID].uRadius) <= 512 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
393 if ( v19 == v22 && v4 < 100 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
394 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
395 ++v22;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
396 ++v4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
397 v8 = *v21;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
398 dword_7207F0[v4 - 1] = v7;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
399 dword_720660[v4 - 1] = v8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
400 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
401 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
402 else if ( (unsigned int)*v21 <= 0x2000000 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
403 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
404 if ( v19 == v22 && v4 < 100 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
405 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
406 ++v22;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
407 ++v4;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
408 v8 = *v21;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
409 dword_7207F0[v4 - 1] = v7;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
410 dword_720660[v4 - 1] = v8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
411 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
412 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
413 v1 = v21 + 2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
414 --v5;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
415 v21 += 2;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
416 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
417 while ( v5 );
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
418 v2 = v17;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
419 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
420 v3 += 1280;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
421 --v18;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
422 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
423 while ( v18 );
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
424 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
425 if ( v22 > 0 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
426 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
427 v9 = dword_720660;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
428 v10 = 1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
429 do
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
430 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
431 for ( i = v10; i < v22; ++i )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
432 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
433 v12 = *v9;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
434 v13 = dword_720660[i];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
435 if ( v13 < *v9 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
436 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
437 *v9 = v13;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
438 dword_720660[i] = v12;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
439 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
440 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
441 ++v10;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
442 ++v9;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
443 LOBYTE(v1) = v10 - 1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
444 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
445 while ( v10 - 1 < v22 );
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
446 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
447 for ( j = 0; j < v22; ++j )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
448 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
449 LOBYTE(v1) = DoInteractionWithTopmostZObject(dword_720660[j] & 0xFFFF, v16);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
450 if ( !(char)v1 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
451 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
452 }*/
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
453 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
454
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
455
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
456 //----- (0042FC4E) --------------------------------------------------------
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
457 void Keyboard::ProcessInputActions()
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
458 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
459 char v4; // al@9
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
460 unsigned __int16 v9; // ax@102
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
461 int spell_price; // eax@103
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
462 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
463 InputAction inputAction; // [sp+0h] [bp-8h]@7
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
464
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
465 pEngine->pKeyboardInstance->EnterCriticalSection();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
466 Keyboard* pKeyboard = pEngine->pKeyboardInstance;
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
467 if (!bAlwaysRun)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
468 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
469 if (pKeyboard->IsShiftHeld())
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
470 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
471 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
472 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
473 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
474 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
475 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
476 if (pKeyboard->IsShiftHeld())
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
477 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
478 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
479 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
480 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
481
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
482 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
483
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
484
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
485 // WUT? double event trigger
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
486 /*for ( uint i = 0; i < 30; ++i )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
487 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
488 if ( pKeyActionMap->pToggleTypes[i] )
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
489 v14 = pEngine->pKeyboardInstance->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[i]);
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
490 else
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
491 v14 = pEngine->pKeyboardInstance->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[i]);
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
492 if ( v14 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
493 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
494 if (current_screen_type == SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
495 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
496 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Game_Action, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
497 continue;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
498 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
499 if ( current_screen_type == SCREEN_NPC_DIALOGUE || current_screen_type == SCREEN_BRANCHLESS_NPC_DIALOG )
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
500 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
501 v15 = pMessageQueue_50CBD0->uNumMessages;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
502 if ( pMessageQueue_50CBD0->uNumMessages )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
503 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
504 v15 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
505 if ( pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
506 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
507 v15 = 1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
508 pMessageQueue_50CBD0->uNumMessages = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
509 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
510 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
511 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
512 ++pMessageQueue_50CBD0->uNumMessages;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
513 continue;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
514 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
515 pMessageQueue_50CBD0->uNumMessages = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
516 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
517 //pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
518 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
519 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
520 }*/
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
521 if ( !pEventTimer->bPaused )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
522 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
523 for ( uint i = 0; i < 30; ++i )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
524 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
525 inputAction = (InputAction)i;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
526 if ( pKeyActionMap->pToggleTypes[inputAction] )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
527 v4 = pKeyboard->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
528 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
529 v4 = pKeyboard->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
530 if ( v4 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
531 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
532 switch ( inputAction )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
533 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
534 case INPUT_MoveForward:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
535 if (current_screen_type != SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
536 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
537 if (!pParty->bTurnBasedModeOn)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
538 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
539 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
540 partyAction = PARTY_RunForward;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
541 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
542 partyAction = PARTY_WalkForward;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
543 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
544 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
545 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
546 if (pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
547 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
548 pTurnEngine->uActionPointsLeft -= 26;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
549 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
550 partyAction = PARTY_RunForward;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
551 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
552 partyAction = PARTY_WalkForward;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
553 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
554 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
555 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
556 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
557 case INPUT_MoveBackwards:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
558 if (current_screen_type != SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
559 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
560 if (!pParty->bTurnBasedModeOn)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
561 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
562 if ( pParty->uFlags2 & 2 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
563 partyAction = PARTY_RunBackward;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
564 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
565 partyAction = PARTY_WalkBackward;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
566 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
567 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
568 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
569 if ( pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
570 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
571 pTurnEngine->uActionPointsLeft -= 26;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
572 if ( pParty->uFlags2 & 2 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
573 partyAction = PARTY_RunBackward;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
574 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
575 partyAction = PARTY_WalkBackward;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
576 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
577 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
578 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
579 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
580 case INPUT_StrafeLeft:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
581 if (current_screen_type != SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
582 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
583 if (!pParty->bTurnBasedModeOn)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
584 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
585 partyAction = PARTY_StrafeLeft;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
586 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
587 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
588 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
589 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
590 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
591 pTurnEngine->uActionPointsLeft -= 26;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
592 partyAction = PARTY_StrafeLeft;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
593 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
594 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
595 case INPUT_StrafeRight:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
596 if (current_screen_type != SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
597 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
598 if (!pParty->bTurnBasedModeOn)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
599 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
600 partyAction = PARTY_StrafeRight;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
601 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
602 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
603 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
604 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
605 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
606 pTurnEngine->uActionPointsLeft -= 26;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
607 partyAction = PARTY_StrafeRight;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
608 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
609 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
610 case INPUT_TurnLeft:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
611 if (current_screen_type != SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
612 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
613 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
614 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
615 if (pParty->bTurnBasedModeOn)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
616 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
617 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
618 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
619 pTurnEngine->uActionPointsLeft -= 26;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
620 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
621 partyAction = PARTY_StrafeLeft;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
622 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
623 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
624 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
625 if ( pParty->uFlags2 & 2 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
626 partyAction = PARTY_FastTurnLeft;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
627 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
628 partyAction = PARTY_TurnLeft;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
629 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
630 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
631 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
632 pWeather->OnPlayerTurn(10);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
633 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
634 case INPUT_TurnRight:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
635 if (current_screen_type != SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
636 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
637 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
638 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
639 if (pParty->bTurnBasedModeOn)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
640 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
641 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
642 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
643 pTurnEngine->uActionPointsLeft -= 26;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
644 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
645 partyAction = PARTY_StrafeRight;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
646 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
647 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
648 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
649 if ( pParty->uFlags2 & 2 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
650 partyAction = PARTY_FastTurnRight;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
651 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
652 partyAction = PARTY_TurnRight;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
653 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
654 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
655 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
656 pWeather->OnPlayerTurn(-10);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
657 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
658 case INPUT_Jump:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
659 if (current_screen_type != SCREEN_GAME || pParty->bTurnBasedModeOn)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
660 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
661 partyAction = (PartyAction)12;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
662 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
663 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
664 case INPUT_Yell:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
665 if (!current_screen_type && uActiveCharacter)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
666 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
667 pParty->Yell();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
668 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
669 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
670 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
671 case INPUT_Pass:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
672 if ( current_screen_type )
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
673 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
674 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
675 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
676 pTurnEngine->field_18 |= TE_FLAG_8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
677 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
678 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
679 if ( uActiveCharacter )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
680 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
681 if ( !pPlayers[uActiveCharacter]->uTimeToRecovery )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
682 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
683 if ( !pParty->bTurnBasedModeOn )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
684 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)pPlayers[uActiveCharacter]->GetAttackRecoveryTime(false) * 2.133333333333333));
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
685 CastSpellInfoHelpers::_427D48();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
686 pTurnEngine->ApplyPlayerAction();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
687 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
688 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
689 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
690 case INPUT_Combat://if press ENTER
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
691 if (current_screen_type == SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
692 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
693 if (pParty->bTurnBasedModeOn)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
694 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
695 if (pTurnEngine->turn_stage == TE_MOVEMENT || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
696 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
697 pParty->bTurnBasedModeOn = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
698 pTurnEngine->End(true);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
699 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
700 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
701 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
702 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
703 pTurnEngine->Start();
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
704 pParty->bTurnBasedModeOn = true;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
705 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
706 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
707 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
708 case INPUT_CastReady:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
709 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
710 if (current_screen_type != SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
711 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
712 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
713 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
714 pTurnEngine->field_18 |= TE_FLAG_8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
715 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
716 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
717 if ( !uActiveCharacter )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
718 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
719 uchar quickSpellNumber = pPlayers[uActiveCharacter]->uQuickSpell;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
720 v9 = pPlayers[uActiveCharacter]->pActiveSkills[quickSpellNumber / 11 + 12];
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
721 bool enoughMana = false;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
722 if ((v9 & 0x100) != 0)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
723 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
724 enoughMana = pSpellDatas[quickSpellNumber].uMagisterLevelMana < pPlayers[uActiveCharacter]->sMana;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
725 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
726 else if ((v9 & 0x80) != 0)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
727 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
728 enoughMana = pSpellDatas[quickSpellNumber].uMasterLevelMana < pPlayers[uActiveCharacter]->sMana;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
729 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
730 else if ((v9 & 0x40) != 0)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
731 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
732 enoughMana = pSpellDatas[quickSpellNumber].uExpertLevelMana < pPlayers[uActiveCharacter]->sMana;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
733 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
734 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
735 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
736 enoughMana = pSpellDatas[quickSpellNumber].uNormalLevelMana < pPlayers[uActiveCharacter]->sMana;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
737 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
738 if ( !pPlayers[uActiveCharacter]->uQuickSpell || bUnderwater || !enoughMana)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
739 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
740 pPartyActionQueue = pPartyActionQueue;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
741 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Attack, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
742 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
743 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
744 else
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
745 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CastQuickSpell, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
746 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
747 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
748 case INPUT_Attack:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
749 if (current_screen_type != SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
750 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
751 if (pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT)
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
752 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
753 pTurnEngine->field_18 |= TE_FLAG_8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
754 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
755 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
756 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Attack, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
757 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
758 case INPUT_EventTrigger:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
759 if (current_screen_type == SCREEN_GAME)
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
760 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
761 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Game_Action, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
762 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
763 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
764 if ( current_screen_type == SCREEN_NPC_DIALOGUE )
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
765 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
766 if ( pMessageQueue_50CBD0->uNumMessages )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
767 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
768 pMessageQueue_50CBD0->uNumMessages = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
769 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
770 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
771 pMessageQueue_50CBD0->uNumMessages = 1;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
772 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
773 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
774 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 = 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
775 ++pMessageQueue_50CBD0->uNumMessages;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
776 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
777 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
778 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
779 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
780 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
781 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
782 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
783 case INPUT_CharCycle:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
784 if ( current_screen_type == SCREEN_SPELL_BOOK )
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
785 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
786
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
787 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CycleCharacters, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
788 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
789 case INPUT_LookUp:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
790 if ( pEventTimer->bPaused )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
791 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
792 partyAction = (PartyAction)7;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
793 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
794 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
795 case INPUT_CenterView:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
796 if ( pEventTimer->bPaused )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
797 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
798 partyAction = (PartyAction)9;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
799 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
800 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
801 case INPUT_LookDown:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
802 if ( pEventTimer->bPaused )
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
803 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
804 partyAction = (PartyAction)8;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
805 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
806 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
807 case INPUT_FlyUp:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
808 if ( current_screen_type || pEventTimer->bPaused )
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
809 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
810 partyAction = (PartyAction)13;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
811 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
812 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
813 case INPUT_Land:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
814 if ( current_screen_type || pEventTimer->bPaused )
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
815 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
816 partyAction = (PartyAction)15;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
817 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
818 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
819 case INPUT_FlyDown:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
820 if ( !current_screen_type && !pEventTimer->bPaused )
2502
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
821 {
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
822 partyAction = (PartyAction)14;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
823 pPartyActionQueue->Add(partyAction);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
824 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
825 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
826 case INPUT_ZoomIn:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
827 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_ClickZoomOutBtn, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
828 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
829 case INPUT_ZoomOut:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
830 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_ClickZoomInBtn, 0, 0);
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
831 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
832 case INPUT_AlwaysRun:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
833 bAlwaysRun = bAlwaysRun == 0;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
834 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
835 default:
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
836 break;
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
837 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
838 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
839 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
840 }
a77c34acdbc9 Media folder
Ritor1
parents:
diff changeset
841 }