Mercurial > mm7
annotate Keyboard.cpp @ 2453:2a8010d99cf8
_4BF5B2() renamed to BackToHouseMenu()
author | Ritor1 |
---|---|
date | Fri, 25 Jul 2014 15:06:52 +0600 |
parents | 1e1b2728b3d3 |
children | 17ac6a47f8fb |
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 | |
10 #include "mm7_data.h" | |
1297 | 11 #include "Vis.h" |
12 #include "MM7.h" | |
13 #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
|
14 #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
|
15 #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
|
16 #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
|
17 #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
|
18 #include "CastSpellInfo.h" |
1297 | 19 #include "DecorationList.h" |
20 #include "Indoor.h" | |
21 #include "viewport.h" | |
22 #include "AudioPlayer.h" | |
2341 | 23 #include "Registry.h" |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1459
diff
changeset
|
24 #include "Level/Decoration.h" |
0 | 25 |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
26 #include <tuple> |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
27 #include <vector> |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
28 #include <string> |
0 | 29 |
30 struct KeyboardActionMapping *pKeyActionMap; | |
31 | |
32 | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
33 class CKeyListElement{ |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
34 public: |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
35 std::string m_keyName; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
36 unsigned char m_keyDefaultCode; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
37 unsigned short m_cmdId; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
38 KeyToggleType m_toggType; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
39 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
|
40 m_keyName(keyName), |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
41 m_keyDefaultCode(keyDefaultCode), |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
42 m_cmdId(cmdId), |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
43 m_toggType(toggType) |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
44 { |
0 | 45 |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
46 } |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
47 }; |
0 | 48 |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
49 std::array<CKeyListElement, 30>keyMappingParams = { |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
50 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
|
51 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
|
52 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
|
53 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
|
54 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
|
55 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
|
56 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
|
57 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
|
58 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
|
59 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
|
60 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
|
61 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
|
62 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
|
63 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
|
64 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
|
65 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
|
66 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
|
67 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
|
68 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
|
69 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
|
70 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
|
71 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
|
72 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
|
73 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
|
74 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
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 }; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
81 |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
82 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
|
83 { |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
84 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
|
85 std::tuple<const char*, const unsigned __int8>("DOWN", VK_DOWN), |
2201 | 86 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
|
87 std::tuple<const char*, const unsigned __int8>("бкебн", VK_LEFT), |
2201 | 88 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
|
89 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
|
90 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
|
91 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
|
92 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
|
93 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
|
94 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
|
95 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
|
96 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
|
97 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
|
98 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
|
99 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
|
100 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
|
101 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
|
102 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
|
103 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
|
104 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
|
105 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
|
106 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
|
107 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
|
108 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
|
109 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
|
110 }; |
0 | 111 |
112 //----- (00459C68) -------------------------------------------------------- | |
113 void KeyboardActionMapping::SetKeyMapping(int uAction, int vKey, KeyToggleType type) | |
114 { | |
115 pVirtualKeyCodesMapping[uAction] = vKey; | |
116 pToggleTypes[uAction] = type; | |
117 } | |
118 | |
119 //----- (00459C82) -------------------------------------------------------- | |
120 unsigned int KeyboardActionMapping::GetActionVKey(enum InputAction eAction) | |
121 { | |
122 return this->pVirtualKeyCodesMapping[eAction]; | |
123 } | |
124 | |
125 //----- (00459C8D) -------------------------------------------------------- | |
126 KeyboardActionMapping::KeyboardActionMapping() | |
127 { | |
128 uLastKeyPressed = 0; | |
271 | 129 field_204 = 0; |
323 | 130 pWindow = nullptr; |
0 | 131 |
132 SetDefaultMapping(); | |
133 ReadMappings(); | |
134 | |
135 ResetKeys(); | |
136 | |
2443 | 137 uNumKeysPressed = 0; |
138 | |
1031 | 139 uGameMenuUI_CurentlySelectedKeyIdx = -1; |
0 | 140 } |
1031 | 141 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx; |
0 | 142 |
143 //----- (00459CC4) -------------------------------------------------------- | |
144 void KeyboardActionMapping::SetDefaultMapping() | |
145 { | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
146 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
|
147 { |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
148 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
|
149 } |
0 | 150 } |
151 | |
152 //----- (00459E3F) -------------------------------------------------------- | |
153 void KeyboardActionMapping::ResetKeys() | |
154 { | |
2425 | 155 //тСМЙЖХЪ GetAsyncKeyState НОПЕДЕКЪЕР, ЪБКЪЕРЯЪ КХ ЙКЮБХЬЮ НРОСЫЕММНИ ХКХ МЮФЮРНИ БН БПЕЛЪ БШГНБЮ ТСМЙЖХХ |
156 //Х АШКЮ КХ ЙКЮБХЬЮ МЮФЮРЮ ОНЯКЕ ОПЕДШДСЫЕЦН БШГНБЮ GetAsyncKeyState. | |
0 | 157 for (uint i = 0; i < 30; ++i) |
2425 | 158 pToggleTypes[i] = (KeyToggleType)GetAsyncKeyState(pVirtualKeyCodesMapping[i]); |
0 | 159 } |
160 | |
161 //----- (00459E5A) -------------------------------------------------------- | |
1038 | 162 void KeyboardActionMapping::EnterText(int a2, int max_string_len, GUIWindow *pWindow) |
0 | 163 { |
164 KeyboardActionMapping *v4; // esi@1 | |
165 | |
166 v4 = this; | |
167 memset(this->pPressedKeysBuffer, 0, 0x101u); | |
168 v4->uNumKeysPressed = 0; | |
169 if ( a2 ) | |
170 v4->field_204 = 2; | |
171 else | |
172 v4->field_204 = 1; | |
1038 | 173 v4->max_input_string_len = max_string_len; |
0 | 174 v4->pWindow = pWindow; |
1038 | 175 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_IN_PROGRESS; |
0 | 176 } |
177 | |
178 //----- (00459ED1) -------------------------------------------------------- | |
1038 | 179 void KeyboardActionMapping::SetWindowInputStatus(int a2) |
0 | 180 { |
1038 | 181 field_204 = 0; |
182 if ( pWindow ) | |
183 pWindow->receives_keyboard_input_2 = a2; | |
0 | 184 } |
185 | |
186 //----- (00459F10) -------------------------------------------------------- | |
2201 | 187 bool KeyboardActionMapping::ProcessTextInput(unsigned int a2) |
0 | 188 { |
189 pKeyActionMap->uLastKeyPressed = a2; | |
1031 | 190 if ( uGameMenuUI_CurentlySelectedKeyIdx == -1 ) |
0 | 191 { |
2201 | 192 if ( pKeyActionMap->field_204 != 1 && pKeyActionMap->field_204 != 2 ) |
193 return 0; | |
194 if ( a2 == VK_BACK) | |
0 | 195 { |
2201 | 196 if (pKeyActionMap->uNumKeysPressed > 0) |
0 | 197 { |
2201 | 198 --pKeyActionMap->uNumKeysPressed; |
0 | 199 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0; |
200 } | |
201 } | |
2201 | 202 else if ( a2 == VK_RETURN ) |
203 { | |
204 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED); | |
205 } | |
206 else if ( a2 == VK_ESCAPE ) | |
0 | 207 { |
2201 | 208 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); |
209 } | |
210 else if (this->uNumKeysPressed < this->max_input_string_len) | |
211 { | |
212 if ( pKeyActionMap->field_204 == 1 ) | |
0 | 213 { |
2201 | 214 if ( a2 != VK_TAB ) |
0 | 215 { |
2201 | 216 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2; |
217 ++pKeyActionMap->uNumKeysPressed; | |
218 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0; | |
0 | 219 } |
2201 | 220 } |
221 else if (pKeyActionMap->field_204 == 2) | |
222 { | |
223 if ( isdigit(a2)) | |
224 { | |
225 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2; | |
226 ++pKeyActionMap->uNumKeysPressed; | |
227 } | |
0 | 228 } |
229 } | |
230 } | |
2201 | 231 else |
232 { | |
233 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = a2; | |
234 ++pKeyActionMap->uNumKeysPressed; | |
235 pKeyActionMap->pPressedKeysBuffer[pKeyActionMap->uNumKeysPressed] = 0; | |
236 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CONFIRMED); | |
237 } | |
0 | 238 return 1; |
239 } | |
1031 | 240 // 506E68: using guessed type int uGameMenuUI_CurentlySelectedKeyIdx; |
0 | 241 |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
242 |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
243 |
0 | 244 //----- (00459FFC) -------------------------------------------------------- |
245 void KeyboardActionMapping::ReadMappings() | |
246 { | |
247 char str[32]; | |
248 | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
249 for (size_t i = 0; i < keyMappingParams.size(); i++) |
0 | 250 { |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
251 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
|
252 short commandDefaultKeyCode = keyMappingParams[i].m_keyDefaultCode; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
253 short commandId = keyMappingParams[i].m_cmdId; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
254 KeyToggleType toggType = keyMappingParams[i].m_toggType; |
0 | 255 |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
256 ReadWindowsRegistryString(keyName, str, 32, "DEFAULT"); |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
257 if ( strcmp(str, "DEFAULT") && ( TranslateKeyNameToKeyCode(str) != -1) ) |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
258 { |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
259 pVirtualKeyCodesMapping[commandId] = TranslateKeyNameToKeyCode(str); |
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 else |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
262 { |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
263 pVirtualKeyCodesMapping[commandId] = commandDefaultKeyCode; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
264 } |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
265 pToggleTypes[commandId] = toggType; |
0 | 266 } |
267 | |
268 bAlwaysRun = ReadWindowsRegistryInt("valAlwaysRun", 0) != 0; | |
269 bFlipOnExit = ReadWindowsRegistryInt("FlipOnExit", 0) != 0; | |
270 } | |
271 | |
272 //----- (0045A960) -------------------------------------------------------- | |
273 void KeyboardActionMapping::StoreMappings() | |
274 { | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
275 |
0 | 276 const char *v2; // eax@1 |
277 | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
278 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
|
279 { |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
280 v2 = GetVKeyDisplayName(pVirtualKeyCodesMapping[keyMappingParams[i].m_cmdId]); |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
281 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
|
282 } |
0 | 283 } |
284 | |
285 //----- (0045ABCA) -------------------------------------------------------- | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
286 const unsigned __int8 KeyboardActionMapping::TranslateKeyNameToKeyCode(const char *Str) |
0 | 287 { |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
288 if (strlen(Str) == 1) |
0 | 289 { |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
290 if( Str[0] >= 65 && Str[0] <= 90 ) |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
291 return *Str; |
0 | 292 else |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
293 return 0xFF; |
0 | 294 } |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
295 |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
296 for ( size_t i = 0; i < keyNameToCodeTranslationMap.size(); i++) |
0 | 297 { |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
298 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
|
299 return std::get<1>(keyNameToCodeTranslationMap[i]); |
0 | 300 } |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
301 return 0xFF; |
0 | 302 } |
303 | |
304 //----- (0045AE2C) -------------------------------------------------------- | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
305 const char * KeyboardActionMapping::GetVKeyDisplayName(unsigned char a1) |
0 | 306 { |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
307 static char static_sub_45AE2C_string_69ADE0_keyName[32]; |
0 | 308 |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
309 if ( a1 >= 65 && a1 <= 90 ) |
0 | 310 { |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
311 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
|
312 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
|
313 return static_sub_45AE2C_string_69ADE0_keyName; |
0 | 314 } |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
315 |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
316 for ( size_t i = 0; i < keyNameToCodeTranslationMap.size(); i++) |
0 | 317 { |
2201 | 318 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
|
319 { |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
320 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
|
321 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
|
322 return static_sub_45AE2C_string_69ADE0_keyName; |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
323 } |
0 | 324 } |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
325 |
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
326 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
|
327 return static_sub_45AE2C_string_69ADE0_keyName; |
0 | 328 } |
329 | |
330 | |
331 //----- (0045B019) -------------------------------------------------------- | |
332 void Keyboard::EnterCriticalSection() | |
333 { | |
334 } | |
335 | |
336 //----- (0045B06E) -------------------------------------------------------- | |
337 bool Keyboard::IsShiftHeld() | |
338 { | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
339 return (GetAsyncKeyState(VK_SHIFT) & 0x8001) != 0; |
0 | 340 } |
341 | |
342 //----- (0045B0A9) -------------------------------------------------------- | |
343 bool Keyboard::IsKeyBeingHeld(int vKey) | |
344 { | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
345 return (GetAsyncKeyState(vKey) & 0x8001) != 0; |
0 | 346 } |
347 | |
348 //----- (0045B0CE) -------------------------------------------------------- | |
349 bool Keyboard::WasKeyPressed(int vKey) | |
350 { | |
2200
f0477fe92362
Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents:
2154
diff
changeset
|
351 return (GetAsyncKeyState(vKey) & 1) != 0; |
0 | 352 } |
1297 | 353 //----- (0046A14B) -------------------------------------------------------- |
354 void OnPressSpace() | |
355 { | |
356 //SHORT v0; // ax@2 | |
2201 | 357 /*int *v1; // eax@2 |
1297 | 358 char *v2; // ebx@5 |
359 unsigned int v3; // esi@5 | |
360 signed int v4; // edi@7 | |
361 unsigned int v5; // edx@7 | |
362 int v6; // ecx@8 | |
363 int v7; // eax@8 | |
364 int v8; // ecx@17 | |
365 int *v9; // esi@22 | |
366 signed int v10; // ebx@22 | |
367 int i; // edi@23 | |
368 int v12; // edx@24 | |
369 int v13; // ecx@24 | |
370 int j; // esi@28 | |
371 int v16; // [sp+4h] [bp-1Ch]@0 | |
372 char *v17; // [sp+8h] [bp-18h]@5 | |
373 unsigned int v18; // [sp+Ch] [bp-14h]@5 | |
374 int v19; // [sp+10h] [bp-10h]@8 | |
375 int *v20; // [sp+14h] [bp-Ch]@5 | |
376 int *v21; // [sp+18h] [bp-8h]@7 | |
2201 | 377 int v22; // [sp+1Ch] [bp-4h]@4*/ |
1297 | 378 |
2154 | 379 //if ( pRenderer->pRenderD3D ) |
1297 | 380 { |
2201 | 381 pGame->PickKeyboard(Keyboard::IsKeyBeingHeld(VK_CONTROL), &vis_sprite_filter_3, &vis_door_filter); |
1980 | 382 int pid = pGame->pVisInstance->get_picked_object_zbuf_val(); |
1297 | 383 if ( pid != -1 ) |
384 DoInteractionWithTopmostZObject(pid & 0xFFFF, PID_ID(pid)); | |
385 return; | |
386 } | |
387 | |
388 | |
389 // software render stuff following | |
2154 | 390 /* |
1297 | 391 static int dword_720660[100]; // 720660 |
392 static int dword_7207F0[100]; // 7207F0 | |
393 | |
394 v22 = 0; | |
395 v1 = (int *)((signed int)(viewparams->uScreen_BttmR_X + viewparams->uScreen_topL_X) >> 1);//wrong pointer | |
396 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y ) | |
397 { | |
398 v2 = (char *)v1 - 50; | |
399 v1 = (int *)((char *)v1 + 50); | |
400 v3 = 640 * viewparams->uScreen_topL_Y; | |
401 v17 = v2; | |
402 v20 = v1; | |
403 v18 = ((viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y - 1) >> 1) + 1; | |
404 do | |
405 { | |
406 if ( (signed int)v2 < (signed int)v20 ) | |
407 { | |
408 v1 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; | |
409 v21 = &pRenderer->pActiveZBuffer[(int)&v2[v3]]; | |
410 v4 = v22; | |
411 v5 = (((char *)v20 - v2 - 1) >> 1) + 1; | |
412 do | |
413 { | |
414 v6 = 0; | |
415 v7 = *v1 & 0xFFFF; | |
416 v19 = 0; | |
417 if ( v4 > 0 ) | |
418 { | |
419 do | |
420 { | |
421 if ( dword_7207F0[v6] == v7 ) | |
422 break; | |
423 ++v6; | |
424 v19 = v6; | |
425 } | |
426 while ( v6 < v22 ); | |
427 } | |
428 if ( PID_TYPE(v7) == OBJECT_Decoration) | |
429 { | |
430 v16 = (unsigned int)PID_ID(v7); | |
431 if ( (signed int)(((unsigned int)*v21 >> 16) | |
432 - pDecorationList->pDecorations[pLevelDecorations[(unsigned int)PID_ID(v7)].uDecorationDescID].uRadius) <= 512 ) | |
433 if ( v19 == v22 && v4 < 100 ) | |
434 { | |
435 ++v22; | |
436 ++v4; | |
437 v8 = *v21; | |
438 dword_7207F0[v4 - 1] = v7; | |
439 dword_720660[v4 - 1] = v8; | |
440 } | |
441 } | |
442 else if ( (unsigned int)*v21 <= 0x2000000 ) | |
443 { | |
444 if ( v19 == v22 && v4 < 100 ) | |
445 { | |
446 ++v22; | |
447 ++v4; | |
448 v8 = *v21; | |
449 dword_7207F0[v4 - 1] = v7; | |
450 dword_720660[v4 - 1] = v8; | |
451 } | |
452 } | |
453 v1 = v21 + 2; | |
454 --v5; | |
455 v21 += 2; | |
456 } | |
457 while ( v5 ); | |
458 v2 = v17; | |
459 } | |
460 v3 += 1280; | |
461 --v18; | |
462 } | |
463 while ( v18 ); | |
464 } | |
465 if ( v22 > 0 ) | |
466 { | |
467 v9 = dword_720660; | |
468 v10 = 1; | |
469 do | |
470 { | |
471 for ( i = v10; i < v22; ++i ) | |
472 { | |
473 v12 = *v9; | |
474 v13 = dword_720660[i]; | |
475 if ( v13 < *v9 ) | |
476 { | |
477 *v9 = v13; | |
478 dword_720660[i] = v12; | |
479 } | |
480 } | |
481 ++v10; | |
482 ++v9; | |
483 LOBYTE(v1) = v10 - 1; | |
484 } | |
485 while ( v10 - 1 < v22 ); | |
486 } | |
487 for ( j = 0; j < v22; ++j ) | |
488 { | |
489 LOBYTE(v1) = DoInteractionWithTopmostZObject(dword_720660[j] & 0xFFFF, v16); | |
490 if ( !(char)v1 ) | |
491 break; | |
2154 | 492 }*/ |
1297 | 493 } |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
494 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
495 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
496 //----- (0042FC4E) -------------------------------------------------------- |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
497 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
|
498 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
499 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
|
500 //char v8; // bl@100 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
501 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
|
502 int spell_price; // eax@103 |
2334 | 503 // char v14; // al@159 |
504 // unsigned int v15; // eax@168 | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
505 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
|
506 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
|
507 //int v24; // [sp+4h] [bp-4h]@87 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
508 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
509 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
|
510 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
|
511 if (!bAlwaysRun) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
512 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
513 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
|
514 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
|
515 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
516 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
|
517 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
518 else |
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 (pKeyboard->IsShiftHeld()) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
521 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
|
522 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
523 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
|
524 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
525 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
526 //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
|
527 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
528 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
529 // 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
|
530 /*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
|
531 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
532 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
|
533 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
|
534 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
535 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
|
536 if ( v14 ) |
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 (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
|
539 { |
2402 | 540 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
|
541 continue; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
542 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
543 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
|
544 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
545 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
|
546 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
|
547 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
548 v15 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
549 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
|
550 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
551 v15 = 1; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
552 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
|
553 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
|
554 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
|
555 *(&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
|
556 ++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
|
557 continue; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
558 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
559 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
|
560 } |
2402 | 561 //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
|
562 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
563 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
564 }*/ |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
565 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
|
566 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
567 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
|
568 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
569 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
|
570 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
|
571 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
|
572 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
573 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
|
574 if ( v4 ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
575 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
576 switch ( inputAction ) |
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 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
|
579 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
|
580 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
581 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
|
582 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
583 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
|
584 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
|
585 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
586 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
|
587 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
|
588 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
589 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
590 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
|
591 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
592 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
|
593 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
|
594 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
|
595 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
596 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
|
597 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
|
598 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
599 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
600 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
601 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
|
602 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
|
603 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
604 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
|
605 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
606 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
|
607 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
|
608 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
609 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
|
610 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
|
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 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
613 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
|
614 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
615 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
|
616 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
|
617 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
|
618 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
619 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
|
620 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
|
621 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
622 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
623 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
624 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
|
625 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
|
626 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
627 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
|
628 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
629 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
|
630 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
|
631 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
632 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
633 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
|
634 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
635 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
|
636 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
|
637 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
|
638 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
639 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
|
640 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
|
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 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
|
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 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
|
646 break; |
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 ( 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
|
649 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
650 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
|
651 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
|
652 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
|
653 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
654 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
|
655 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
|
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 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
|
658 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
659 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
|
660 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
661 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
|
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 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
|
664 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
665 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
|
666 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
667 else |
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 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
|
670 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
|
671 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
672 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
|
673 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
674 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
|
675 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
|
676 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
|
677 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
678 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
|
679 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
|
680 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
681 if ( GetAsyncKeyState(17) ) // strafing |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
682 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
683 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
|
684 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
685 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
|
686 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
687 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
|
688 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
689 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
|
690 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
691 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
692 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
693 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
|
694 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
|
695 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
696 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
|
697 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
698 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
|
699 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
|
700 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
|
701 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
702 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
|
703 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
|
704 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
705 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
|
706 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
|
707 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
708 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
|
709 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
|
710 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
711 pParty->Yell(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
712 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
|
713 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
714 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
715 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
|
716 if ( pCurrentScreen ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
717 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
718 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
|
719 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
720 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
|
721 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
722 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
723 if ( uActiveCharacter ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
724 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
725 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
|
726 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
727 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
|
728 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
|
729 CastSpellInfoHelpers::_427D48(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
730 pTurnEngine->ApplyPlayerAction(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
731 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
732 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
733 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
734 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
|
735 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
|
736 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
737 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
|
738 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
739 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
|
740 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
741 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
|
742 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
|
743 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
744 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
745 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
746 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
747 pTurnEngine->Start(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
748 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
|
749 } |
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 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
752 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
|
753 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
|
754 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
755 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
|
756 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
757 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
|
758 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
759 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
760 if ( !uActiveCharacter ) |
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 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
|
763 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
|
764 || (( !(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
|
765 ((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
|
766 ((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
|
767 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
|
768 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
|
769 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
|
770 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
771 pPartyActionQueue = pPartyActionQueue; |
2402 | 772 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
|
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 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
775 else |
2402 | 776 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
|
777 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
778 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
|
779 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
|
780 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
781 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
|
782 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
783 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
|
784 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
785 } |
2402 | 786 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
|
787 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
788 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
|
789 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
|
790 { |
2402 | 791 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
|
792 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
793 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
794 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
|
795 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
796 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
|
797 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
798 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
|
799 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
|
800 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
801 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
|
802 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
|
803 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
|
804 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
|
805 ++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
|
806 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
807 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
808 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
809 } |
2402 | 810 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
|
811 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
812 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
813 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
|
814 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
|
815 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
816 |
2402 | 817 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
|
818 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
819 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
|
820 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
|
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 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
|
823 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
|
824 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
825 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
|
826 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
|
827 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
828 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
|
829 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
|
830 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
831 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
|
832 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
|
833 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
834 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
|
835 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
|
836 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
837 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
|
838 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
|
839 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
840 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
|
841 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
|
842 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
843 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
|
844 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
|
845 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
846 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
|
847 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
|
848 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
849 case INPUT_FlyDown: |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
850 if ( !pCurrentScreen |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
851 && !pEventTimer->bPaused ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
852 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
853 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
|
854 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
|
855 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
856 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
857 case INPUT_ZoomIn: |
2402 | 858 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
|
859 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
860 case INPUT_ZoomOut: |
2402 | 861 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
|
862 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
863 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
|
864 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
|
865 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
866 default: |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
867 break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
868 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
869 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
870 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
871 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
872 } |