annotate IO/Keyboard.cpp @ 2515:b96f6cb1855d

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