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