annotate IO/Keyboard.cpp @ 2575:a76d408c5132 tip

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