Mercurial > mm7
annotate GUI/UI/UiGame.cpp @ 2547:fed97f15d1e1
* SaveLoad
* QuickReference
* Modal
* Character
author | a.parshin |
---|---|
date | Tue, 12 May 2015 01:45:31 +0200 |
parents | 4087cbc62706 |
children | f2a8ed07e921 |
rev | line source |
---|---|
2501 | 1 #define _CRTDBG_MAP_ALLOC |
2546 | 2 #define _CRT_SECURE_NO_WARNINGS |
2501 | 3 #include <stdlib.h> |
4 #include <crtdbg.h> | |
5 | |
2541 | 6 #include "Engine/Engine.h" |
2546 | 7 #include "Engine/Events.h" |
8 #include "Engine/Graphics/Texture.h" | |
9 #include "Engine/Graphics/Vis.h" | |
10 #include "Engine/MapInfo.h" | |
11 #include "Engine/Party.h" | |
12 #include "Engine/Graphics/Outdoor.h" | |
13 #include "Engine/LOD.h" | |
14 #include "Engine/Objects/Actor.h" | |
15 #include "Engine/Graphics/Viewport.h" | |
16 #include "Engine/Objects/SpriteObject.h" | |
17 #include "Engine/Objects/ObjectList.h" | |
18 #include "Engine/Graphics/DecorationList.h" | |
19 #include "Engine/Tables/PlayerFrameTable.h" | |
20 #include "Engine/stru123.h" | |
21 #include "Engine/Timer.h" | |
22 #include "Engine/Tables/IconFrameTable.h" | |
23 #include "Engine/TurnEngine/TurnEngine.h" | |
24 #include "Engine/texts.h" | |
25 #include "Engine/Graphics/Sprites.h" | |
26 #include "Engine/Graphics/PaletteManager.h" | |
27 #include "Engine/Graphics/BSPModel.h" | |
28 #include "Engine/OurMath.h" | |
29 #include "Engine/Graphics/Level/Decoration.h" | |
30 #include "Engine/Objects/Chest.h" | |
31 #include "Engine/Graphics/Overlays.h" | |
2501 | 32 |
2546 | 33 #include "IO/Mouse.h" |
34 #include "IO/Keyboard.h" | |
2501 | 35 |
2546 | 36 #include "GUI/GUIWindow.h" |
37 #include "GUI/GUIFont.h" | |
38 #include "GUI/UI/UIHouses.h" | |
39 #include "GUI/UI/UIGame.h" | |
2547 | 40 #include "GUI/UI/UICharacter.h" |
2501 | 41 |
2546 | 42 #include "Media/Audio/AudioPlayer.h" |
2501 | 43 |
44 int uTextureID_GameUI_CharSelectionFrame; // 50C98C | |
45 | |
2546 | 46 |
47 | |
48 | |
49 GUIWindow_GameMenu::GUIWindow_GameMenu() : | |
50 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) | |
51 { | |
52 // ----------------------- | |
53 // GameMenuUI_Load -- part | |
54 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); | |
55 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); | |
56 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); | |
57 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); | |
58 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); | |
59 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
60 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); | |
61 | |
62 pBtn_NewGame = CreateButton( | |
63 0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, | |
64 pGlobalTXT_LocalizationStrings[614],// "New Game" | |
65 pIcons_LOD->GetTexture(uTextureID_New1), | |
66 0 | |
67 ); | |
68 pBtn_SaveGame = CreateButton( | |
69 0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, | |
70 pGlobalTXT_LocalizationStrings[615],// "Save Game" | |
71 pIcons_LOD->GetTexture(uTextureID_Save1), | |
72 0 | |
73 ); | |
74 pBtn_LoadGame = CreateButton( | |
75 19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, | |
76 pGlobalTXT_LocalizationStrings[616],// "Load Game" | |
77 pIcons_LOD->GetTexture(uTextureID_Load1), | |
78 0 | |
79 ); | |
80 pBtn_GameControls = CreateButton( | |
81 241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, | |
82 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" | |
83 pIcons_LOD->GetTexture(uTextureID_Controls1), | |
84 0 | |
85 ); | |
86 pBtn_QuitGame = CreateButton( | |
87 241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, | |
88 pGlobalTXT_LocalizationStrings[618],// "Quit" | |
89 pIcons_LOD->GetTexture(uTextureID_Quit1), | |
90 0 | |
91 ); | |
92 pBtn_Resume = CreateButton( | |
93 241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, | |
94 pGlobalTXT_LocalizationStrings[619],// "Return to Game" | |
95 pIcons_LOD->GetTexture(uTextureID_Resume1), | |
96 0 | |
97 ); | |
98 _41D08F_set_keyboard_control_group(6, 1, 0, 0); | |
99 } | |
100 | |
101 void GUIWindow_GameMenu::Update() | |
102 { | |
103 // ----------------------------------- | |
104 // 004156F0 GUI_UpdateWindows --- part | |
105 pRenderer->DrawTextureIndexed( | |
106 pViewport->uViewportTL_Y, | |
107 pViewport->uViewportTL_X, | |
108 pIcons_LOD->GetTexture(uTextureID_Options) | |
109 ); | |
110 viewparams->bRedrawGameUI = 1; | |
111 } | |
112 | |
113 | |
114 | |
115 | |
116 | |
117 | |
118 std::array<bool, 28> GameMenuUI_InvaligKeyBindingsFlags; // 506E6C | |
119 //----- (00414D24) -------------------------------------------------------- | |
120 static unsigned int GameMenuUI_GetKeyBindingColor(int key_index) | |
121 { | |
122 if (uGameMenuUI_CurentlySelectedKeyIdx == key_index) | |
123 { | |
124 if (GetTickCount() % 1000 < 500) | |
125 return ui_gamemenu_keys_key_selection_blink_color_1; | |
126 else | |
127 return ui_gamemenu_keys_key_selection_blink_color_2; | |
128 } | |
129 else if (GameMenuUI_InvaligKeyBindingsFlags[key_index]) | |
130 { | |
131 int intensity; | |
132 | |
133 int time = GetTickCount() % 800; | |
134 if (time < 400) | |
135 intensity = -70 + 70 * time / 400; | |
136 else | |
137 intensity = +70 - 70 * time / 800; | |
138 | |
139 return Color16(185 + intensity, 40 + intensity / 4, 40 + intensity / 4); | |
140 } | |
141 | |
142 return ui_gamemenu_keys_key_default_color; | |
143 } | |
144 | |
145 | |
146 | |
147 GUIWindow_GameKeyBindings::GUIWindow_GameKeyBindings(): | |
148 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) | |
149 { | |
150 // ------------------------------------------ | |
151 // GameMenuUI_OptionsKeymapping_Load --- part | |
152 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE); | |
153 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE); | |
154 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); | |
155 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE); | |
156 uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE); | |
157 | |
158 CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, "", 0); | |
159 | |
160 CreateButton(19, 302, 108, 20, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0); | |
161 CreateButton(127, 302, 108, 20, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0); | |
162 CreateButton(127, 324, 108, 20, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "", 0); | |
163 CreateButton(19, 324, 108, 20, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0, "", 0); | |
164 | |
165 CreateButton(129, 148, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "", 0); | |
166 CreateButton(129, 167, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 1, 0, "", 0); | |
167 CreateButton(129, 186, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 2, 0, "", 0); | |
168 CreateButton(129, 205, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 3, 0, "", 0); | |
169 CreateButton(129, 224, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 4, 0, "", 0); | |
170 CreateButton(129, 243, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 5, 0, "", 0); | |
171 CreateButton(129, 262, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 6, 0, "", 0); | |
172 | |
173 CreateButton(350, 148, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 7, 0, "", 0); | |
174 CreateButton(350, 167, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 8, 0, "", 0); | |
175 CreateButton(350, 186, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 9, 0, "", 0); | |
176 CreateButton(350, 205, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 10, 0, "", 0); | |
177 CreateButton(350, 224, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 11, 0, "", 0); | |
178 CreateButton(350, 243, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 12, 0, "", 0); | |
179 CreateButton(350, 262, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 13, 0, "", 0); | |
180 | |
181 uGameMenuUI_CurentlySelectedKeyIdx = -1; | |
182 KeyboardPageNum = 1; | |
183 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags)); | |
184 memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u); | |
185 } | |
186 | |
187 //----- (004142D3) -------------------------------------------------------- | |
188 void GUIWindow_GameKeyBindings::Update() | |
189 { | |
190 // ----------------------------------- | |
191 // 004156F0 GUI_UpdateWindows --- part | |
192 signed int v4; // ecx@7 | |
193 signed int v5; // eax@8 | |
194 | |
195 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
196 { | |
197 pPrevVirtualCidesMapping[uGameMenuUI_CurentlySelectedKeyIdx] = pKeyActionMap->pPressedKeysBuffer[0]; | |
198 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags)); | |
199 v4 = 0; | |
200 do | |
201 { | |
202 v5 = 0; | |
203 do | |
204 { | |
205 if (v4 != v5 && pPrevVirtualCidesMapping[v4] == pPrevVirtualCidesMapping[v5]) | |
206 { | |
207 GameMenuUI_InvaligKeyBindingsFlags[v4] = true; | |
208 GameMenuUI_InvaligKeyBindingsFlags[v5] = true; | |
209 } | |
210 ++v5; | |
211 } while (v5 < 28); | |
212 ++v4; | |
213 } while (v4 < 28); | |
214 uGameMenuUI_CurentlySelectedKeyIdx = -1; | |
215 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
216 } | |
217 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Optkb[0]));//draw base texture | |
218 if (KeyboardPageNum == 1) | |
219 { | |
220 pRenderer->DrawTextureIndexed(19, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[3])); | |
221 | |
222 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "ÂÏÅШÄ", 0, 0, 0); | |
223 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(0), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]), 0, 0, 0); | |
224 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, ui_gamemenu_keys_action_name_color, "ÍÀÇÀÄ", 0, 0, 0); | |
225 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, GameMenuUI_GetKeyBindingColor(1), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[1]), 0, 0, 0); | |
226 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, ui_gamemenu_keys_action_name_color, "ÂËÅÂÎ", 0, 0, 0); | |
227 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, GameMenuUI_GetKeyBindingColor(2), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[2]), 0, 0, 0); | |
228 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, ui_gamemenu_keys_action_name_color, "ÂÏÐÀÂÎ", 0, 0, 0); | |
229 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, GameMenuUI_GetKeyBindingColor(3), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[3]), 0, 0, 0); | |
230 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, ui_gamemenu_keys_action_name_color, "ÊÐÈÊ", 0, 0, 0); | |
231 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, GameMenuUI_GetKeyBindingColor(4), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[4]), 0, 0, 0); | |
232 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, ui_gamemenu_keys_action_name_color, "ÏÐÛÆÎÊ", 0, 0, 0); | |
233 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, GameMenuUI_GetKeyBindingColor(5), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[5]), 0, 0, 0); | |
234 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, ui_gamemenu_keys_action_name_color, "Ï.ÐÅÆÈÌ", 0, 0, 0); | |
235 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, GameMenuUI_GetKeyBindingColor(6), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[6]), 0, 0, 0); | |
236 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, ui_gamemenu_keys_action_name_color, "ÏÐÈÌ. ÇÀÊË.", 0, 0, 0); | |
237 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, GameMenuUI_GetKeyBindingColor(7), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[7]), 0, 0, 0); | |
238 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, ui_gamemenu_keys_action_name_color, "ÀÒÀÊÀ", 0, 0, 0); | |
239 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, GameMenuUI_GetKeyBindingColor(8), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[8]), 0, 0, 0); | |
240 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, ui_gamemenu_keys_action_name_color, "ÄÅÉÑÒÂ.", 0, 0, 0); | |
241 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, GameMenuUI_GetKeyBindingColor(9), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[9]), 0, 0, 0); | |
242 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, ui_gamemenu_keys_action_name_color, "ÇÀÊËÈÍ.", 0, 0, 0); | |
243 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, GameMenuUI_GetKeyBindingColor(10), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[10]), 0, 0, 0); | |
244 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, ui_gamemenu_keys_action_name_color, "ÈÃÐÎÊ", 0, 0, 0); | |
245 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, GameMenuUI_GetKeyBindingColor(11), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[11]), 0, 0, 0); | |
246 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, ui_gamemenu_keys_action_name_color, "ÑËÅÄ. ÈÃÐÎÊ", 0, 0, 0); | |
247 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, GameMenuUI_GetKeyBindingColor(12), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[12]), 0, 0, 0); | |
248 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, ui_gamemenu_keys_action_name_color, "ÇÀÄÀÍÈß", 0, 0, 0); | |
249 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 268, GameMenuUI_GetKeyBindingColor(13), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[13]), 0, 0, 0); | |
250 } | |
251 else | |
252 { | |
253 pRenderer->DrawTextureIndexed(127, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[4])); | |
254 | |
255 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "Á. ÑÏÐÀÂÊÀ", 0, 0, 0); | |
256 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(14), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]), 0, 0, 0); | |
257 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, ui_gamemenu_keys_action_name_color, "ÎÒÄÛÕ", 0, 0, 0); | |
258 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, GameMenuUI_GetKeyBindingColor(15), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[15]), 0, 0, 0); | |
259 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, ui_gamemenu_keys_action_name_color, "ÒÅÊ. ÂÐÅÌß", 0, 0, 0); | |
260 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, GameMenuUI_GetKeyBindingColor(16), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[16]), 0, 0, 0); | |
261 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, ui_gamemenu_keys_action_name_color, "ÀÂÒÎÇÀÌÅÒÊÈ", 0, 0, 0); | |
262 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, GameMenuUI_GetKeyBindingColor(17), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[17]), 0, 0, 0); | |
263 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, ui_gamemenu_keys_action_name_color, "ÊÀÐÒÀ", 0, 0, 0); | |
264 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, GameMenuUI_GetKeyBindingColor(18), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[18]), 0, 0, 0); | |
265 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, ui_gamemenu_keys_action_name_color, "ÁÅÆÀÒÜ", 0, 0, 0); | |
266 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, GameMenuUI_GetKeyBindingColor(19), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[19]), 0, 0, 0); | |
267 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, ui_gamemenu_keys_action_name_color, "ÑÌ. ÂÂÅÐÕ", 0, 0, 0); | |
268 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, GameMenuUI_GetKeyBindingColor(20), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[20]), 0, 0, 0); | |
269 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, ui_gamemenu_keys_action_name_color, "ÑÌ. ÂÍÈÇ", 0, 0, 0); | |
270 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, GameMenuUI_GetKeyBindingColor(21), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[21]), 0, 0, 0); | |
271 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, ui_gamemenu_keys_action_name_color, "ÑÌ. ÂÏÅШÄ", 0, 0, 0); | |
272 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, GameMenuUI_GetKeyBindingColor(22), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[22]), 0, 0, 0); | |
273 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, ui_gamemenu_keys_action_name_color, "ÏÐÈÁËÈÇ", 0, 0, 0); | |
274 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, GameMenuUI_GetKeyBindingColor(23), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[23]), 0, 0, 0); | |
275 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, ui_gamemenu_keys_action_name_color, "ÎÒÄÀËÈÒÜ", 0, 0, 0); | |
276 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, GameMenuUI_GetKeyBindingColor(24), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[24]), 0, 0, 0); | |
277 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, ui_gamemenu_keys_action_name_color, "Ï. ÂÂÅÐÕ", 0, 0, 0); | |
278 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, GameMenuUI_GetKeyBindingColor(25), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[25]), 0, 0, 0); | |
279 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, ui_gamemenu_keys_action_name_color, "Ï. ÂÍÈÇ", 0, 0, 0); | |
280 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, GameMenuUI_GetKeyBindingColor(26), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[26]), 0, 0, 0); | |
281 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, ui_gamemenu_keys_action_name_color, "ÏÐÈÇÅÌË", 0, 0, 0); | |
282 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 268, GameMenuUI_GetKeyBindingColor(27), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[27]), 0, 0, 0); | |
283 } | |
284 } | |
285 | |
286 | |
287 | |
288 GUIWindow_GameVideoOptions::GUIWindow_GameVideoOptions() : | |
289 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) | |
290 { | |
291 // ------------------------------------- | |
292 // GameMenuUI_OptionsVideo_Load --- part | |
293 optvid_base_texture_id = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE); | |
294 bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE); | |
295 us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE); | |
296 tinting_texture_id = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE); | |
297 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | |
298 uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | |
299 pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | |
300 pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | |
301 pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | |
302 pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | |
303 pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | |
304 pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | |
305 pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | |
306 pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | |
307 pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | |
308 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | |
309 not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); | |
310 not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); | |
311 not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE); | |
312 | |
313 CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); | |
314 //if ( pRenderer->pRenderD3D ) | |
315 { | |
316 CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0); | |
317 CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0); | |
318 CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0); | |
319 } | |
320 /*if ( !pRenderer->bWindowMode ) | |
321 { | |
322 //v0 = 1; | |
323 if ( pRenderer->IsGammaSupported() ) | |
324 { | |
325 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0); | |
326 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0); | |
327 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0); | |
328 } | |
329 }*/ | |
330 } | |
331 | |
332 | |
333 | |
334 //----- (00414D9A) -------------------------------------------------------- | |
335 void GUIWindow_GameVideoOptions::Update() | |
336 { | |
337 // ----------------------------------- | |
338 // 004156F0 GUI_UpdateWindows --- part | |
339 GUIWindow msg_window; // [sp+8h] [bp-54h]@3 | |
340 | |
341 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(optvid_base_texture_id));//draw base texture | |
342 //if ( !pRenderer->bWindowMode && pRenderer->IsGammaSupported() ) | |
343 { | |
344 pRenderer->DrawTextureIndexed(17 * uGammaPos + 42, 162, pIcons_LOD->GetTexture(pTextureIDs_GammaPositions[uGammaPos])); | |
345 pRenderer->DrawTextureRGB(274, 169, &stru_506E40);//review_window | |
346 msg_window.uFrameX = 22; | |
347 msg_window.uFrameY = 190; | |
348 msg_window.uFrameWidth = 211; | |
349 msg_window.uFrameHeight = 79; | |
350 msg_window.uFrameZ = 232; | |
351 msg_window.uFrameW = 268; | |
352 msg_window.DrawTitleText(pFontSmallnum, 0, 0, ui_gamemenu_video_gamma_title_color, pGlobalTXT_LocalizationStrings[226], 3); // "Gamma controls the relative ""brightness"" of the game. May vary depending on your monitor." | |
353 } | |
354 | |
355 /*if (!pRenderer->pRenderD3D) | |
356 { | |
357 pRenderer->DrawTextureIndexed(20, 281, pIcons_LOD->GetTexture(not_available_bloodsplats_texture_id)); | |
358 pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(not_available_us_colored_lights_texture_id)); | |
359 pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(not_available_tinting_texture_id)); | |
360 } | |
361 else*/ | |
362 { | |
363 if (pEngine->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS) | |
364 pRenderer->DrawTextureIndexed(20, 281, pIcons_LOD->GetTexture(bloodsplats_texture_id)); | |
365 if (pRenderer->bUseColoredLights) | |
366 pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(us_colored_lights_texture_id)); | |
367 if (pRenderer->bTinting) | |
368 pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(tinting_texture_id)); | |
369 } | |
370 } | |
371 | |
372 | |
373 | |
374 | |
375 | |
376 | |
377 | |
378 | |
379 | |
380 | |
381 | |
382 | |
383 | |
384 | |
385 OptionsMenuSkin options_menu_skin; // 507C60 | |
386 OptionsMenuSkin::OptionsMenuSkin() : | |
387 uTextureID_Background(0), | |
388 uTextureID_ArrowLeft(0), | |
389 uTextureID_ArrowRight(0), | |
390 uTextureID_unused_0(0), uTextureID_unused_1(0), uTextureID_unused_2(0), | |
391 uTextureID_FlipOnExit(0), | |
392 uTextureID_AlwaysRun(0), | |
393 uTextureID_WalkSound(0), | |
394 uTextureID_ShowDamage(0) | |
395 { | |
396 for (uint i = 0; i < 3; ++i) uTextureID_TurnSpeed[i] = 0; | |
397 for (uint i = 0; i < 10; ++i) uTextureID_SoundLevels[i] = 0; | |
398 } | |
399 | |
400 void OptionsMenuSkin::Relaease() | |
401 { | |
402 #define RELEASE(id) \ | |
403 {\ | |
404 if (id)\ | |
405 pIcons_LOD->GetTexture(id)->Release();\ | |
406 id = 0;\ | |
407 } | |
408 | |
409 RELEASE(uTextureID_Background); | |
410 for (uint i = 0; i < 3; ++i) | |
411 RELEASE(uTextureID_TurnSpeed[i]); | |
412 RELEASE(uTextureID_ArrowLeft); | |
413 RELEASE(uTextureID_ArrowRight); | |
414 RELEASE(uTextureID_FlipOnExit); | |
415 for (uint i = 0; i < 10; ++i) | |
416 RELEASE(uTextureID_SoundLevels[i]); | |
417 RELEASE(uTextureID_AlwaysRun); | |
418 RELEASE(uTextureID_WalkSound); | |
419 RELEASE(uTextureID_ShowDamage); | |
420 | |
421 #undef RELEASE | |
422 } | |
423 | |
424 | |
425 GUIWindow_GameOptions::GUIWindow_GameOptions() : | |
426 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) | |
427 { | |
428 // GameMenuUI_Options_Load -- part | |
429 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); | |
430 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); | |
431 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); | |
432 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); | |
433 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); | |
434 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); | |
435 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); | |
436 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); | |
437 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); | |
438 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); | |
439 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); | |
440 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); | |
441 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); | |
442 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); | |
443 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); | |
444 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); | |
445 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); | |
446 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); | |
447 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); | |
448 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); | |
449 | |
450 CreateButton(22, 270, | |
451 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth, | |
452 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight, | |
453 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0); | |
454 CreateButton(93, 270, | |
455 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth, | |
456 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight, | |
457 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0); | |
458 CreateButton(164, 270, | |
459 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth, | |
460 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight, | |
461 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0); | |
462 | |
463 CreateButton(20, 303, | |
464 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth, | |
465 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight, | |
466 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0); | |
467 CreateButton(128, 303, | |
468 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth, | |
469 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight, | |
470 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0); | |
471 CreateButton(20, 325, | |
472 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth, | |
473 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight, | |
474 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0); | |
475 CreateButton(128, 325, | |
476 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth, | |
477 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight, | |
478 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0); | |
479 | |
480 pBtn_SliderLeft = CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
481 pBtn_SliderRight = CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
482 CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0); | |
483 | |
484 pBtn_SliderLeft = CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
485 pBtn_SliderRight = CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
486 CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0); | |
487 | |
488 pBtn_SliderLeft = CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); | |
489 pBtn_SliderRight = CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); | |
490 CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0); | |
491 | |
492 CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game" | |
493 CreateButton(19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0); | |
494 CreateButton(19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0); | |
495 } | |
496 | |
497 | |
498 | |
499 | |
500 //----- (00414F82) -------------------------------------------------------- | |
501 void GUIWindow_GameOptions::Update() | |
502 { | |
503 // ----------------------------------- | |
504 // 004156F0 GUI_UpdateWindows --- part | |
505 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Options)); | |
506 pRenderer->DrawTextureIndexed(8, 132, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_Background)); | |
507 | |
508 switch (uTurnSpeed) | |
509 { | |
510 case 64: pRenderer->DrawTextureIndexed(BtnTurnCoord[1], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])); break; | |
511 case 128: pRenderer->DrawTextureIndexed(BtnTurnCoord[2], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])); break; | |
512 default: pRenderer->DrawTextureIndexed(BtnTurnCoord[0], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])); break; | |
513 } | |
514 | |
515 if (bWalkSound) pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)); | |
516 if (bShowDamage) pRenderer->DrawTextureIndexed(128, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)); | |
517 if (bFlipOnExit) pRenderer->DrawTextureIndexed(128, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)); | |
518 if (bAlwaysRun) pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)); | |
519 | |
520 pRenderer->DrawTextureIndexed(265 + 17 * uSoundVolumeMultiplier, 162, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier])); | |
521 pRenderer->DrawTextureIndexed(265 + 17 * uMusicVolimeMultiplier, 216, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier])); | |
522 pRenderer->DrawTextureIndexed(265 + 17 * uVoicesVolumeMultiplier, 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier])); | |
523 } | |
524 | |
525 | |
526 | |
527 | |
528 | |
529 | |
530 | |
531 | |
532 | |
533 | |
2501 | 534 //----- (00421D00) -------------------------------------------------------- |
535 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) | |
536 { | |
537 Player* player = &pParty->pPlayers[uPlayerID - 1]; | |
538 if (pParty->pPickedItem.uItemID) | |
539 { | |
540 if (int slot = player->AddItem(-1, pParty->pPickedItem.uItemID)) | |
541 { | |
542 memcpy(&player->pInventoryItemList[slot-1], &pParty->pPickedItem, 0x24u); | |
543 viewparams->bRedrawGameUI = true; | |
544 pMouse->RemoveHoldingItem(); | |
545 return; | |
546 } | |
547 | |
548 if (!player->CanAct()) | |
549 { | |
550 player = pPlayers[uActiveCharacter]; | |
551 } | |
552 if( player->CanAct() || !pPlayers[uActiveCharacter]->CanAct() ) | |
553 player->PlaySound(SPEECH_NoRoom, 0); | |
554 } | |
555 | |
2541 | 556 if (current_screen_type == SCREEN_GAME) |
2501 | 557 { |
558 viewparams->bRedrawGameUI = true; | |
559 if ( uActiveCharacter != uPlayerID ) | |
560 { | |
561 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
562 return; | |
563 | |
564 uActiveCharacter = uPlayerID; | |
565 return; | |
566 } | |
2547 | 567 pGUIWindow_CurrentMenu = new GUIWindow_CharacterRecord(uActiveCharacter, SCREEN_CHARACTERS);//CharacterUI_Initialize(SCREEN_CHARACTERS); |
2501 | 568 return; |
569 } | |
2541 | 570 if ( current_screen_type == SCREEN_SPELL_BOOK ) |
2501 | 571 return; |
2541 | 572 if ( current_screen_type == SCREEN_CHEST ) |
2501 | 573 { |
574 viewparams->bRedrawGameUI = true; | |
575 if ( uActiveCharacter == uPlayerID ) | |
576 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
577 current_character_screen_window = WINDOW_CharacterWindow_Inventory; |
2541 | 578 current_screen_type = SCREEN_CHEST_INVENTORY; |
2501 | 579 uActiveCharacter = uPlayerID; |
580 return; | |
581 } | |
582 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
583 return; | |
584 uActiveCharacter = uPlayerID; | |
585 return; | |
586 } | |
2541 | 587 if ( current_screen_type != SCREEN_HOUSE ) |
2501 | 588 { |
2541 | 589 if ( current_screen_type == SCREEN_E ) |
2501 | 590 { |
591 uActiveCharacter = uPlayerID; | |
592 return; | |
593 } | |
2541 | 594 if ( current_screen_type != SCREEN_CHEST_INVENTORY ) |
2501 | 595 { |
596 viewparams->bRedrawGameUI = true; | |
597 uActiveCharacter = uPlayerID; | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
598 if (current_character_screen_window == WINDOW_CharacterWindow_Awards) |
2501 | 599 FillAwardsData(); |
600 return; | |
601 } | |
602 viewparams->bRedrawGameUI = true; | |
603 if ( uActiveCharacter == uPlayerID ) | |
604 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
605 current_character_screen_window = WINDOW_CharacterWindow_Inventory; |
2541 | 606 current_screen_type = SCREEN_CHEST_INVENTORY; |
2501 | 607 uActiveCharacter = uPlayerID; |
608 return; | |
609 } | |
610 if ( pPlayers[uPlayerID]->uTimeToRecovery ) | |
611 return; | |
612 uActiveCharacter = uPlayerID; | |
613 return; | |
614 } | |
615 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
616 return; | |
617 viewparams->bRedrawGameUI = true; | |
618 if ( uActiveCharacter != uPlayerID ) | |
619 { | |
620 uActiveCharacter = uPlayerID; | |
621 return; | |
622 } | |
623 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6) | |
624 { | |
625 __debugbreak(); // fix indexing | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
626 current_character_screen_window = WINDOW_CharacterWindow_Inventory; |
2547 | 627 pGUIWindow_CurrentMenu = new GUIWindow_CharacterRecord(uActiveCharacter, SCREEN_E);//CharacterUI_Initialize(SCREEN_E); |
2501 | 628 return; |
629 } | |
630 } | |
631 | |
632 //----- (00416B01) -------------------------------------------------------- | |
633 void GameUI_DrawNPCPopup(void *_this)//PopupWindowForBenefitAndJoinText | |
634 { | |
635 int v1; // edi@2 | |
636 NPCData *pNPC; // eax@16 | |
637 const CHAR *pText; // eax@18 | |
638 char *v11; // esi@26 | |
639 GUIWindow popup_window; // [sp+Ch] [bp-60h]@23 | |
640 int a2; // [sp+60h] [bp-Ch]@16 | |
641 LPCSTR lpsz; // [sp+68h] [bp-4h]@6 | |
642 | |
643 if ( bNoNPCHiring != 1 ) | |
644 { | |
645 v1 = 0; | |
646 /*do | |
647 { | |
648 if ( v3->pName ) | |
649 pTmpBuf[v1++] = v2; | |
650 ++v3; | |
651 ++v2; | |
652 } | |
653 while ( (signed int)v3 < (signed int)&pParty->pPickedItem );*/ | |
654 for (int i = 0; i < 2; ++i) | |
655 { | |
656 if (pParty->pHirelings[i].pName) | |
657 pTmpBuf[v1++] = i; | |
658 } | |
659 lpsz = 0; | |
660 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
661 { | |
662 /*v4 = pNPCStats->pNewNPCData; | |
663 do | |
664 { | |
665 if ( v4->uFlags & 0x80 | |
666 && (!pParty->pHirelings[0].pName || strcmp(v4->pName, pParty->pHirelings[0].pName)) | |
667 && (!pParty->pHirelings[1].pName || strcmp(v4->pName, pParty->pHirelings[1].pName)) ) | |
668 pTmpBuf[v1++] = (char)lpsz + 2; | |
669 ++lpsz; | |
670 ++v4; | |
671 } | |
672 while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/ | |
673 for ( uint i = 0; i < pNPCStats->uNumNewNPCs; ++i ) | |
674 { | |
675 if (pNPCStats->pNewNPCData[i].Hired()) | |
676 { | |
677 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) | |
678 { | |
679 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName)) | |
680 pTmpBuf[v1++] = i + 2; | |
681 } | |
682 } | |
683 } | |
684 } | |
685 if ( (signed int)((char *)_this + pParty->hirelingScrollPosition) < v1 ) | |
686 { | |
687 sDialogue_SpeakingActorNPC_ID = -1 - pParty->hirelingScrollPosition - (int)_this; | |
688 pNPC = GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &a2); | |
689 if ( pNPC ) | |
690 { | |
691 if ( a2 == 57 ) | |
692 pText = pNPCTopics[512].pText; // Baby dragon | |
693 else | |
694 pText = (const CHAR *)pNPCStats->pProfessions[pNPC->uProfession].pBenefits; | |
695 lpsz = pText; | |
696 if ( !pText ) | |
697 { | |
698 lpsz = (LPCSTR)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; | |
699 if ( !lpsz ) | |
700 lpsz = ""; | |
701 } | |
702 popup_window.Hint = nullptr; | |
703 popup_window.uFrameX = 38; | |
704 popup_window.uFrameY = 60; | |
705 popup_window.uFrameWidth = 276; | |
706 popup_window.uFrameZ = 313; | |
707 popup_window.uFrameHeight = pFontArrus->CalcTextHeight(lpsz, &popup_window, 0, 0) + 2 * LOBYTE(pFontArrus->uFontHeight) + 24; | |
708 if ( (signed int)popup_window.uFrameHeight < 130 ) | |
709 popup_window.uFrameHeight = 130; | |
710 popup_window.uFrameWidth = 400; | |
711 popup_window.uFrameZ = popup_window.uFrameX + 399; | |
712 popup_window.DrawMessageBox(0); | |
713 sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID); | |
714 pRenderer->DrawTextureIndexed(popup_window.uFrameX + 22, popup_window.uFrameY + 36, | |
715 (Texture *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1 | |
716 ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0)); | |
717 if ( pNPC->uProfession ) | |
718 { | |
719 v11 = pTmpBuf.data(); | |
720 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]); | |
721 } | |
722 else | |
723 { | |
724 v11 = pTmpBuf.data(); | |
725 strcpy(pTmpBuf.data(), pNPC->pName); | |
726 } | |
727 popup_window.DrawTitleText(pFontArrus, 0, 12, Color16(0xFFu, 0xFFu, 0x9Bu), v11, 3); | |
728 popup_window.uFrameWidth -= 24; | |
729 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
730 popup_window.DrawText(pFontArrus, 100, 36, 0, BuildDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0), 0, 0, 0); | |
731 } | |
732 } | |
733 } | |
734 } | |
735 | |
736 //----- (00445D4A) -------------------------------------------------------- | |
737 void GameUI_InitializeDialogue(Actor *actor, int bPlayerSaysHello) | |
738 { | |
739 NPCData *pNPCInfo; // ebp@1 | |
740 int v9; // esi@8 | |
741 int pNumberContacts; // eax@11 | |
742 char pContainer[32]; // [sp+14h] [bp-28h]@3 | |
743 | |
744 dword_A74CDC = -1; | |
745 pNPCStats->dword_AE336C_LastMispronouncedNameFirstLetter = -1; | |
746 pEventTimer->Pause(); | |
747 pMiscTimer->Pause(); | |
748 pAudioPlayer->StopChannels(-1, -1); | |
749 uDialogueType = 0; | |
750 sDialogue_SpeakingActorNPC_ID = actor->sNPC_ID; | |
751 pDialogue_SpeakingActor = actor; | |
752 pNPCInfo = GetNPCData(actor->sNPC_ID); | |
753 if ( (pNPCInfo->uFlags & 3) != 2 ) | |
754 pNPCInfo->uFlags = pNPCInfo->uFlags + 1; | |
755 | |
756 switch (pParty->alignment) | |
757 { | |
758 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break; | |
759 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break; | |
760 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break; | |
761 } | |
762 | |
763 pDialogueNPCCount = 0; | |
764 uNumDialogueNPCPortraits = 1; | |
765 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | |
766 sprintfex(pContainer, "npc%03u", pNPCInfo->uPortraitID); | |
767 v9 = 0; | |
768 pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | |
769 dword_591084 = areWeLoadingTexture; | |
770 uTextureID_right_panel_loop = uTextureID_right_panel; | |
771 if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 ) | |
772 { | |
773 if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame | |
774 || (pNumberContacts = pNPCInfo->uFlags & 0xFFFFFF7F, (pNumberContacts & 0x80000000u) != 0) ) | |
775 { | |
776 v9 = 1; | |
777 } | |
778 else | |
779 { | |
780 if ( pNumberContacts > 1 ) | |
781 { | |
782 if ( pNumberContacts == 2 ) | |
783 { | |
784 v9 = 3; | |
785 } | |
786 else | |
787 { | |
788 if ( pNumberContacts != 3 ) | |
789 { | |
790 if ( pNumberContacts != 4 ) | |
791 v9 = 1; | |
792 } | |
793 else | |
794 { | |
795 v9 = 2; | |
796 } | |
797 } | |
798 } | |
799 else if ( pNPCInfo->rep ) | |
800 { | |
801 v9 = 2; | |
802 } | |
803 } | |
804 } | |
805 if (sDialogue_SpeakingActorNPC_ID < 0) | |
806 v9 = 4; | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
807 pDialogueWindow = new GUIWindow_Dialogue(0, 0, window->GetWidth(), window->GetHeight(), 3, 0);//pNumberContacts = 1, v9 = 0; pNumberContacts = 2, v9 = 3; |
2501 | 808 if (pNPCInfo->Hired() && !pNPCInfo->bHasUsedTheAbility) |
809 { | |
810 if (pNPCInfo->uProfession == 10 || //Healer | |
811 pNPCInfo->uProfession == 11 || //Expert Healer | |
812 pNPCInfo->uProfession == 12 || //Master Healer | |
813 pNPCInfo->uProfession == 33 || //Cook | |
814 pNPCInfo->uProfession == 34 || //Chef | |
815 pNPCInfo->uProfession == 39 || //Wind Master | |
816 pNPCInfo->uProfession == 40 || //Water Master | |
817 pNPCInfo->uProfession == 41 || //Gate Master | |
818 pNPCInfo->uProfession == 42 || //Chaplain | |
819 pNPCInfo->uProfession == 43 || //Piper | |
820 pNPCInfo->uProfession == 52 //Fallen Wizard | |
821 ) | |
822 { | |
823 pDialogueWindow->CreateButton(480, 250, 140, LOBYTE(pFontArrus->uFontHeight) - 3, 1, 0, UIMSG_SelectNPCDialogueOption, 9, 0, "", 0); | |
824 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1); | |
825 } | |
826 } | |
827 | |
828 pDialogueWindow->CreateButton( 61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | |
829 pDialogueWindow->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
830 pDialogueWindow->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
831 pDialogueWindow->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
832 | |
833 if (bPlayerSaysHello && uActiveCharacter && !pNPCInfo->Hired()) | |
834 { | |
835 if (pParty->uCurrentHour < 5 || pParty->uCurrentHour > 21) | |
836 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodEvening, 0); | |
837 else | |
838 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodDay, 0); | |
839 } | |
840 } | |
841 | |
842 //----- (00445350) -------------------------------------------------------- | |
843 void GameUI_DrawDialogue() | |
844 { | |
845 NPCData *pNPC; // ebx@2 | |
846 int pGreetType; // eax@2 | |
847 int pTextHeight; // esi@39 | |
848 GUIButton *pButton; // eax@43 | |
849 int all_text_height; // ebx@93 | |
850 signed int index; // esi@99 | |
851 int v42; // edi@102 | |
852 int v45; | |
853 unsigned __int16 pTextColor; // ax@104 | |
854 GUIWindow window; // [sp+ACh] [bp-68h]@42 | |
855 // GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39 | |
856 const char *pInString=nullptr; // [sp+110h] [bp-4h]@32 | |
857 | |
858 if ( !pDialogueWindow ) | |
859 return; | |
860 | |
861 // Window title(Çàãîëîâîê îêíà)---- | |
862 memcpy(&window, pDialogueWindow, sizeof(window)); | |
863 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
864 pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID); | |
865 window.uFrameWidth -= 10; | |
866 window.uFrameZ -= 10; | |
867 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); | |
2524 | 868 pRenderer->DrawTextureIndexedAlpha(468, 0, (Texture *)(uTextureID_right_panel_loop != -1 ? &pIcons_LOD->pTextures[uTextureID_right_panel_loop] : 0)); |
2501 | 869 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0)); |
870 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); | |
871 | |
872 if (pNPC->uProfession) | |
873 { | |
874 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames.data())); // sometimes buffer overflows; errors emerge both here and in dialogue text | |
875 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s | |
876 } | |
877 else if (pNPC->pName) | |
878 strcpy(pTmpBuf.data(), pNPC->pName); | |
879 | |
880 window.DrawTitleText(pFontArrus, 483, 112, ui_game_dialogue_npc_name_color, pTmpBuf.data(), 3); | |
881 pParty->GetPartyFame(); | |
882 | |
883 pInString = nullptr; | |
884 switch (uDialogueType) | |
885 { | |
886 case DIALOGUE_13: | |
887 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); | |
888 break; | |
889 | |
890 case DIALOGUE_PROFESSION_DETAILS: | |
891 { | |
892 //auto prof = pNPCStats->pProfessions[pNPC->uProfession]; | |
893 | |
894 if (dialogue_show_profession_details) | |
895 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pBenefits, uActiveCharacter - 1, 0, 0, 0, 0); | |
896 else if (pNPC->Hired()) | |
897 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); | |
898 else | |
899 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); | |
900 } | |
901 break; | |
902 | |
903 | |
904 case DIALOGUE_ARENA_WELCOME: | |
905 pInString = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:" | |
906 break; | |
907 | |
908 case DIALOGUE_ARENA_FIGHT_NOT_OVER_YET: | |
909 pInString = pGlobalTXT_LocalizationStrings[577]; //"Get back in there you wimps:" | |
910 break; | |
911 | |
912 case DIALOGUE_ARENA_REWARD: | |
913 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[576], gold_transaction_amount);// "Congratulations on your win: here's your stuff: %u gold." | |
914 pInString = pTmpBuf.data(); | |
915 break; | |
916 | |
917 case DIALOGUE_ARENA_ALREADY_WON: | |
918 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" | |
919 break; | |
920 | |
921 default: | |
922 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_EVT_E && !byte_5B0938[0]) | |
923 { | |
924 pInString = (char *)current_npc_text; | |
925 } | |
926 else if (pGreetType == 1)//QuestNPC_greet | |
927 { | |
928 if (pNPC->greet) | |
929 { | |
930 if ((pNPC->uFlags & 3) == 2) | |
931 pInString = pNPCStats->pNPCGreetings[pNPC->greet].pGreeting2; | |
932 else | |
933 pInString = pNPCStats->pNPCGreetings[pNPC->greet].pGreeting1; | |
934 } | |
935 } | |
936 else if (pGreetType == 2)//HiredNPC_greet | |
937 { | |
938 NPCProfession* prof = &pNPCStats->pProfessions[pNPC->uProfession]; | |
939 | |
940 if (pNPC->Hired()) | |
941 pInString = BuildDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); | |
942 else | |
943 pInString = BuildDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0); | |
944 } | |
945 break; | |
946 } | |
947 | |
948 // Message window(Îêíî ñîîáùåíèÿ)---- | |
949 if (pInString) | |
950 { | |
951 window.uFrameWidth = game_viewport_width; | |
952 window.uFrameZ = 452; | |
953 GUIFont* font = pFontArrus; | |
954 pTextHeight = pFontArrus->CalcTextHeight(pInString, &window, 13, 0) + 7; | |
955 if ( 352 - pTextHeight < 8 ) | |
956 { | |
957 font = pFontCreate; | |
958 pTextHeight = pFontCreate->CalcTextHeight(pInString, &window, 13, 0) + 7; | |
959 } | |
960 if (uTextureID_Leather != -1) | |
961 pRenderer->GetLeather(8, 352 - pTextHeight, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - pTextHeight); | |
962 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428); | |
963 pDialogueWindow->DrawText(font, 13, 354 - pTextHeight, 0, FitTextInAWindow(pInString, font, &window, 13, 0), 0, 0, 0); | |
964 } | |
965 // Right panel(Ïðàâàÿ ïàíåëü)------- | |
966 memcpy(&window, pDialogueWindow, sizeof(window)); | |
967 window.uFrameX = 483; | |
968 window.uFrameWidth = 148; | |
969 window.uFrameZ = 334; | |
970 for (int i = window.pStartingPosActiveItem; i < window.pStartingPosActiveItem + window.pNumPresenceButton; ++i) | |
971 { | |
972 pButton = window.GetControl(i); | |
973 if ( !pButton ) | |
974 break; | |
975 | |
976 if ( pButton->msg_param > 88 ) | |
977 pButton->pButtonName[0] = 0; | |
978 else if (pButton->msg_param == 88) | |
979 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord | |
980 else if (pButton->msg_param == 87) | |
981 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[580]); // Knight | |
982 else if (pButton->msg_param == 86) | |
983 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[579]); // Squire | |
984 else if (pButton->msg_param == 85) | |
985 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[578]); // Page | |
986 else if (pButton->msg_param == 77) | |
987 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[407]); // Details | |
988 else if (pButton->msg_param == 76) | |
989 { | |
990 if (pNPC->Hired()) | |
991 sprintf(pButton->pButtonName, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s | |
992 else | |
993 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire | |
994 } | |
995 else if (pButton->msg_param == 24) | |
996 { | |
997 __debugbreak(); // learn conditions of this event | |
998 if (!pNPC->evt_F) | |
999 { | |
1000 pButton->pButtonName[0] = 0; | |
1001 pButton->msg_param = 0; | |
1002 } | |
1003 else | |
1004 strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_F].pTopic); | |
1005 } | |
1006 else if (pButton->msg_param == 9) | |
1007 strcpy(pButton->pButtonName, GetProfessionActionText(pNPC->uProfession)); | |
1008 else if (pButton->msg_param == 19) // Scavenger Hunt | |
1009 { | |
1010 if (!pNPC->evt_A) | |
1011 { | |
1012 pButton->pButtonName[0] = 0; | |
1013 pButton->msg_param = 0; | |
1014 } | |
1015 else | |
1016 strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_A].pTopic); | |
1017 } | |
1018 else if (pButton->msg_param == 20) // Scavenger Hunt | |
1019 { | |
1020 if (!pNPC->evt_B) | |
1021 { | |
1022 pButton->pButtonName[0] = 0; | |
1023 pButton->msg_param = 0; | |
1024 } | |
1025 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_B].pTopic); | |
1026 } | |
1027 else if (pButton->msg_param == 21) | |
1028 { | |
1029 //__debugbreak(); // learn conditions of this event | |
1030 if (!pNPC->evt_C) | |
1031 { | |
1032 pButton->pButtonName[0] = 0; | |
1033 pButton->msg_param = 0; | |
1034 } | |
1035 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_C].pTopic); | |
1036 } | |
1037 else if (pButton->msg_param == 22) | |
1038 { | |
1039 //__debugbreak(); // learn conditions of this event | |
1040 if (!pNPC->evt_D) | |
1041 { | |
1042 pButton->pButtonName[0] = 0; | |
1043 pButton->msg_param = 0; | |
1044 } | |
1045 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_D].pTopic); | |
1046 } | |
1047 else if (pButton->msg_param == 23) | |
1048 { | |
1049 //__debugbreak(); // learn conditions of this event | |
1050 if (!pNPC->evt_E) | |
1051 { | |
1052 pButton->pButtonName[0] = 0; | |
1053 pButton->msg_param = 0; | |
1054 } | |
1055 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_E].pTopic); | |
1056 } | |
1057 else if (pButton->msg_param == 13) | |
1058 { | |
1059 if (pNPC->Hired()) | |
1060 sprintf(pButton->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s | |
1061 else | |
1062 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[122]); // Join | |
1063 } | |
1064 else | |
1065 pButton->pButtonName[0] = 0; | |
1066 | |
1067 if (pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1) | |
1068 { | |
1069 int num_dead_actors = 0; | |
1070 pInString = nullptr; | |
1071 for ( uint i = 0; i < uNumActors; ++i ) | |
1072 { | |
1073 if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || pActors[i].uAIState == Disabled) | |
1074 ++num_dead_actors; | |
1075 else | |
1076 { | |
1077 int sumonner_type = PID_TYPE(pActors[i].uSummonerID); | |
1078 if (sumonner_type == OBJECT_Player) | |
1079 ++num_dead_actors; | |
1080 } | |
1081 } | |
1082 if (num_dead_actors == uNumActors) | |
1083 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize | |
1084 } | |
1085 } | |
1086 | |
1087 // Install Buttons(Óñòàíîâêà êíîïîê)-------- | |
1088 index = 0; | |
1089 all_text_height = 0; | |
1090 for ( int i = pDialogueWindow->pStartingPosActiveItem; | |
1091 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i ) | |
1092 { | |
1093 pButton = pDialogueWindow->GetControl(i); | |
1094 if ( !pButton ) | |
1095 break; | |
1096 all_text_height += pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); | |
1097 index++; | |
1098 } | |
1099 if ( index ) | |
1100 { | |
1101 v45 = (174 - all_text_height) / index; | |
1102 if ( v45 > 32 ) | |
1103 v45 = 32; | |
1104 v42 = (174 - v45 * index - all_text_height)/ 2 - v45 / 2 + 138; | |
1105 for ( int i = pDialogueWindow->pStartingPosActiveItem; | |
1106 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i ) | |
1107 { | |
1108 pButton = pDialogueWindow->GetControl(i); | |
1109 if ( !pButton ) | |
1110 break; | |
1111 pButton->uY = (unsigned int)(v45 + v42); | |
1112 pTextHeight = pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0); | |
1113 pButton->uHeight = pTextHeight; | |
1114 v42 = pButton->uY + pTextHeight - 1; | |
1115 pButton->uW = v42; | |
1116 pTextColor = ui_game_dialogue_option_normal_color; | |
1117 if ( pDialogueWindow->pCurrentPosActiveItem == i ) | |
1118 pTextColor = ui_game_dialogue_option_highlight_color; | |
1119 window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pButton->pButtonName, 3); | |
1120 } | |
1121 } | |
1122 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId)); | |
1123 } | |
1124 | |
1125 //----- (00444FBE) -------------------------------------------------------- | |
1126 void GameUI_DrawBranchlessDialogue() | |
1127 { | |
1128 int pTextHeight; // esi@4 | |
1129 char Str[200]; // [sp+Ch] [bp-120h]@12 | |
1130 GUIWindow BranchlessDlg_window; // [sp+D4h] [bp-58h]@4 | |
1131 GUIFont *pFont; // [sp+128h] [bp-4h]@1 | |
1132 | |
1133 pFont = pFontArrus; | |
1134 if ( current_npc_text && !byte_5B0938[0] ) | |
1135 strcpy(byte_5B0938.data(), current_npc_text); | |
1136 BranchlessDlg_window.uFrameWidth = game_viewport_width; | |
1137 BranchlessDlg_window.uFrameZ = 452; | |
1138 pTextHeight = pFontArrus->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7; | |
1139 if ( 352 - pTextHeight < 8 ) | |
1140 { | |
1141 pFont = pFontCreate; | |
1142 pTextHeight = pFontCreate->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7; | |
1143 } | |
1144 pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight); | |
1145 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428); | |
1146 pGUIWindow2->DrawText(pFont, 12, 354 - pTextHeight, 0, FitTextInAWindow(byte_5B0938.data(), pFont, &BranchlessDlg_window, 12, 0), 0, 0, 0); | |
1147 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar); | |
1148 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS) | |
1149 { | |
1150 if ( pGUIWindow2->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
1151 { | |
1152 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1153 strcpy(GameUI_Footer_TimedString.data(), pKeyActionMap->pPressedKeysBuffer); | |
1154 sub_4452BB(); | |
1155 return; | |
1156 } | |
1157 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED) | |
1158 return; | |
1159 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1160 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); | |
1161 sub_4452BB(); | |
1162 return; | |
1163 } | |
1164 if ( pGUIWindow2->ptr_1C == (void *)26 ) | |
1165 { | |
1166 sprintf(Str, "%s %s", GameUI_Footer_TimedString, pKeyActionMap->pPressedKeysBuffer); | |
1167 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0); | |
1168 pGUIWindow2->DrawFlashingInputCursor(pFontLucida->GetLineWidth(Str) + 13, 357, pFontLucida); | |
1169 return; | |
1170 } | |
1171 if ( pKeyActionMap->pPressedKeysBuffer[0] ) | |
1172 { | |
1173 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE); | |
1174 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u); | |
1175 sub_4452BB(); | |
1176 return; | |
1177 } | |
1178 } | |
1179 | |
1180 //----- (004443D5) -------------------------------------------------------- | |
1181 const char *GameUI_GetMinimapHintText() | |
1182 { | |
1183 double v3; // st7@1 | |
1184 int v7; // eax@4 | |
1185 const char *v14; // eax@8 | |
1186 char *result; // eax@12 | |
1187 unsigned int pMapID; // eax@14 | |
1188 int global_coord_X; // [sp+10h] [bp-1Ch]@1 | |
1189 int global_coord_Y; // [sp+14h] [bp-18h]@1 | |
1190 unsigned int pY; // [sp+1Ch] [bp-10h]@1 | |
1191 unsigned int pX; // [sp+28h] [bp-4h]@1 | |
1192 | |
1193 result = 0; | |
1194 pMouse->GetClickPos(&pX, &pY); | |
1195 v3 = 1.0 / (float)((signed int)viewparams->uMinimapZoom * 0.000015258789); | |
1196 global_coord_X = (signed __int64)((double)(pX - 557) * v3 + (double)pParty->vPosition.x); | |
1197 global_coord_Y = (signed __int64)((double)pParty->vPosition.y - (double)(pY - 74) * v3); | |
1198 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || pOutdoor->uNumBModels <= 0 ) | |
1199 { | |
1200 pMapID = pMapStats->GetMapInfo(pCurrentMapName); | |
1201 if ( pMapID == 0 ) | |
1202 result = "No Maze Info for this maze on file!"; | |
1203 else | |
1204 result = pMapStats->pInfos[pMapID].pName; | |
1205 } | |
1206 else | |
1207 { | |
1208 for ( uint j = 0; j < (uint)pOutdoor->uNumBModels; ++j ) | |
1209 { | |
1210 v7 = int_get_vector_length(abs((signed)pOutdoor->pBModels[j].vBoundingCenter.x - global_coord_X), | |
1211 abs((signed)pOutdoor->pBModels[j].vBoundingCenter.y - global_coord_Y), 0); | |
1212 if ( v7 < 2 * pOutdoor->pBModels[j].sBoundingRadius ) | |
1213 { | |
1214 if ( pOutdoor->pBModels[j].uNumFaces ) | |
1215 { | |
1216 for ( uint i = 0; i < (uint)pOutdoor->pBModels[j].uNumFaces; ++i ) | |
1217 { | |
1218 if ( pOutdoor->pBModels[j].pFaces[i].sCogTriggeredID ) | |
1219 { | |
1220 if ( !(pOutdoor->pBModels[j].pFaces[i].uAttributes & FACE_HAS_EVENT) ) | |
1221 { | |
1222 v14 = GetEventHintString(pOutdoor->pBModels[j].pFaces[i].sCogTriggeredID); | |
1223 if ( v14 ) | |
1224 { | |
1225 if ( _stricmp(v14, "") ) | |
1226 result = (char *)v14; | |
1227 } | |
1228 } | |
1229 } | |
1230 } | |
1231 } | |
1232 if ( result ) | |
1233 return result; | |
1234 } | |
1235 } | |
1236 pMapID = pMapStats->GetMapInfo(pCurrentMapName); | |
1237 if ( pMapID == 0 ) | |
1238 result = "No Maze Info for this maze on file!"; | |
1239 else | |
1240 result = pMapStats->pInfos[pMapID].pName; | |
1241 return result; | |
1242 } | |
1243 return result; | |
1244 } | |
1245 | |
1246 //----- (0041D3B7) -------------------------------------------------------- | |
1247 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) | |
1248 { | |
1249 Texture *v13; // eax@6 | |
1250 PlayerFrame *v15; // eax@12 | |
1251 unsigned int pTextColor; // eax@15 | |
1252 const char *v29; // eax@16 | |
1253 int v36; // esi@22 | |
1254 const char *v39; // eax@24 | |
1255 signed int uFramesetID; // [sp+20h] [bp-8h]@9 | |
1256 int uFramesetIDa; // [sp+20h] [bp-8h]@18 | |
1257 | |
1258 uint numActivePlayerBuffs = 0; | |
1259 for (uint i = 0; i < 24; ++i) | |
1260 if (player->pPlayerBuffs[i].uExpireTime > 0) | |
1261 ++numActivePlayerBuffs; | |
1262 | |
1263 window->uFrameHeight = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)); | |
1264 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1; | |
1265 window->uFrameW = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)) + window->uFrameY - 1; | |
1266 window->DrawMessageBox(0); | |
1267 | |
1268 if (player->IsEradicated()) | |
1269 v13 = pTexture_PlayerFaceEradicated; | |
1270 else if (player->IsDead()) | |
1271 v13 = pTexture_PlayerFaceDead; | |
1272 else | |
1273 { | |
1274 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression); | |
1275 if ( !uFramesetID ) | |
1276 uFramesetID = 1; | |
1277 if ( player->expression == CHARACTER_EXPRESSION_21) | |
1278 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
1279 else | |
1280 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, pMiscTimer->Time()); | |
1281 player->field_1AA2 = v15->uTextureID - 1; | |
1282 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1]; | |
1283 } | |
1284 | |
2524 | 1285 pRenderer->DrawTextureIndexedAlpha(window->uFrameX + 24, window->uFrameY + 24, v13); |
2501 | 1286 |
1287 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); | |
1288 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" | |
1289 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1290 strcat(pTmpBuf.data(), "\f00000\n"); | |
1291 | |
1292 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth()); | |
1293 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108], // "Hit Points" | |
1294 pTextColor, player->sHealth, player->GetMaxHealth()); | |
1295 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1296 | |
1297 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana()); | |
1298 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212], // "Spell Points" | |
1299 pTextColor, player->sMana, player->GetMaxMana()); | |
1300 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1301 | |
1302 pTextColor = player->GetMajorConditionIdx(); | |
1303 sprintfex(pTmpBuf2.data(), "%s: \f%05d%s\f00000\n", pGlobalTXT_LocalizationStrings[47], // "Condition | |
1304 GetConditionDrawColor(pTextColor), aCharacterConditionNames[pTextColor]); | |
1305 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1306 | |
1307 if ( player->uQuickSpell ) | |
1308 v29 = pSpellStats->pInfos[player->uQuickSpell].pShortName; | |
1309 else | |
1310 v29 = pGlobalTXT_LocalizationStrings[153]; | |
1311 sprintfex(pTmpBuf2.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell" | |
1312 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1313 | |
1314 window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf.data(), 0, 0, 0); | |
1315 | |
1316 uFramesetIDa = 0; | |
1317 for (uint i = 0; i < 24; ++i) | |
1318 { | |
1319 SpellBuff* buff = &player->pPlayerBuffs[i]; | |
1320 if (buff->uExpireTime > 0) | |
1321 { | |
1322 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; | |
1323 window->DrawText(pFontComic, 52, v36, ui_game_character_record_playerbuff_colors[i], aSpellNames[20 + i], 0, 0, 0); | |
1324 DrawBuff_remaining_time_string(v36, window, buff->uExpireTime - pParty->uTimePlayed, pFontComic); | |
1325 } | |
1326 } | |
1327 | |
1328 v39 = ""; | |
1329 if ( uFramesetIDa == 0 ) | |
1330 v39 = pGlobalTXT_LocalizationStrings[153]; // "None" | |
1331 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s" | |
1332 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0); | |
1333 } | |
1334 | |
1335 //----- (0041AD6E) -------------------------------------------------------- | |
1336 void GameUI_DrawRightPanelItems() | |
1337 { | |
1338 if ( (unsigned long long)GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed ) | |
1339 GameUI_RightPanel_BookFlashTimer = 0; | |
1340 | |
1341 if ( pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128 ) | |
1342 { | |
1343 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; | |
1344 | |
1345 static bool byte_50697C = false; // 50697C | |
1346 byte_50697C = !byte_50697C; | |
2541 | 1347 if ( byte_50697C && current_screen_type != SCREEN_REST ) |
2501 | 1348 { |
2524 | 1349 if (bFlashQuestBook) pRenderer->DrawTextureIndexedAlpha(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); |
1350 if (bFlashAutonotesBook) pRenderer->DrawTextureIndexedAlpha(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); | |
1351 if (bFlashHistoryBook) pRenderer->DrawTextureIndexedAlpha(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); | |
2501 | 1352 } |
1353 else | |
1354 { | |
1355 pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); | |
1356 GameUI_DrawHiredNPCs(); | |
1357 } | |
1358 } | |
1359 } | |
1360 | |
1361 //----- (0041AEBB) -------------------------------------------------------- | |
1362 void GameUI_DrawFoodAndGold() | |
1363 { | |
1364 int text_y; // esi@2 | |
1365 | |
1366 if ( uGameState != GAME_STATE_FINAL_WINDOW ) | |
1367 { | |
1368 text_y = _44100D_should_alter_right_panel() != 0 ? 381 : 322; | |
1369 sprintf(pTmpBuf.data(), "\r087%lu", pParty->uNumFoodRations); | |
1370 pPrimaryWindow->DrawText(pFontSmallnum, 0, text_y, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow); | |
1371 sprintf(pTmpBuf.data(), "\r028%lu", pParty->uNumGold); | |
1372 pPrimaryWindow->DrawText(pFontSmallnum, 0, text_y, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow); | |
1373 } | |
1374 } | |
1375 | |
1376 //----- (0041B0C9) -------------------------------------------------------- | |
1377 void GameUI_DrawLifeManaBars() | |
1378 { | |
1379 double v3; // st7@3 | |
1380 double v7; // st7@25 | |
1381 Texture *pTextureHealth; // [sp-4h] [bp-30h]@10 | |
1382 Texture *pTextureMana; // [sp+Ch] [bp-20h]@1 | |
1383 | |
1384 pTextureMana = pIcons_LOD->GetTexture(uTextureID_BarBlue); | |
1385 for (uint i = 0; i < 4; ++i) | |
1386 { | |
1387 if (pParty->pPlayers[i].sHealth > 0) | |
1388 { | |
1389 int v17 = 0; | |
1390 if (i == 2 || i == 3) | |
1391 v17 = 2; | |
1392 v3 = (double)pParty->pPlayers[i].sHealth / (double)pParty->pPlayers[i].GetMaxHealth(); | |
1393 if( v3 > 0.5 ) | |
1394 { | |
1395 if ( v3 > 1.0 ) | |
1396 v3 = 1.0; | |
1397 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarGreen); | |
1398 } | |
1399 else if ( v3 > 0.25 ) | |
1400 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarYellow); | |
1401 else if ( v3 > 0.0 ) | |
1402 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarRed); | |
1403 if( v3 > 0.0 ) | |
1404 { | |
2524 | 1405 pRenderer->SetUIClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402, |
2501 | 1406 v17 + pHealthBarPos[i] + pTextureHealth->uTextureWidth, pTextureHealth->uTextureHeight + 402); |
1407 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, pTextureHealth); | |
2524 | 1408 pRenderer->ResetUIClipRect(); |
2501 | 1409 } |
1410 } | |
1411 if (pParty->pPlayers[i].sMana > 0) | |
1412 { | |
1413 v7 = pParty->pPlayers[i].sMana / (double)pParty->pPlayers[i].GetMaxMana(); | |
1414 if ( v7 > 1.0 ) | |
1415 v7 = 1.0; | |
1416 int v17 = 0; | |
1417 if (i == 2) | |
1418 v17 = 1; | |
2524 | 1419 pRenderer->SetUIClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402, |
2501 | 1420 v17 + pManaBarPos[i] + pTextureMana->uTextureWidth, pTextureMana->uTextureHeight + 402); |
1421 pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, pTextureMana); | |
2524 | 1422 pRenderer->ResetUIClipRect(); |
2501 | 1423 } |
1424 } | |
1425 } | |
1426 | |
1427 //----- (0041B3B6) -------------------------------------------------------- | |
1428 void GameUI_DrawRightPanel() | |
1429 { | |
2524 | 1430 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportBR_X, 0, pIcons_LOD->GetTexture(uTextureID_right_panel)); |
2501 | 1431 } |
1432 | |
1433 //----- (0041B3E2) -------------------------------------------------------- | |
1434 void GameUI_DrawRightPanelFrames() | |
1435 { | |
1436 pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); | |
1437 pRenderer->DrawTextureRGB(0, 8, pTexture_LeftFrame); | |
1438 pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); | |
1439 pRenderer->DrawTextureRGB(0, 352, pTexture_BottomFrame); | |
1440 GameUI_DrawFoodAndGold(); | |
1441 GameUI_DrawRightPanelItems(); | |
1442 } | |
1443 | |
1444 //----- (0041C047) -------------------------------------------------------- | |
1445 void GameUI_Footer_2() | |
1446 { | |
1447 char *v1; // edx@2 | |
1448 int v5; // eax@5 | |
1449 | |
1450 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); | |
1451 if (GameUI_Footer_TimeLeft) | |
1452 v1 = GameUI_Footer_TimedString.data(); | |
1453 else | |
1454 { | |
1455 if (!pFooterString[0]) | |
1456 return; | |
1457 v1 = pFooterString.data(); | |
1458 } | |
1459 | |
1460 v5 = pFontLucida->AlignText_Center(450, v1); | |
1461 pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); | |
1462 } | |
1463 | |
1464 //----- (0041C0B8) -------------------------------------------------------- | |
1465 void GameUI_SetFooterString(const char *pStr) | |
1466 { | |
1467 const char *v1; // esi@1 | |
1468 | |
1469 v1 = pStr; | |
1470 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(pStr, 1) && (*v1 || GameUI_Footer_TimeLeft) ) | |
1471 { | |
1472 if ( GameUI_Footer_TimeLeft ) | |
1473 { | |
1474 for ( int i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); i > 450; i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) ) | |
1475 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; | |
1476 } | |
1477 else | |
1478 { | |
1479 strcpy(pFooterString.data(), v1); | |
1480 for ( int j = pFontLucida->GetLineWidth(pFooterString.data()); j > 450; j = pFontLucida->GetLineWidth(pFooterString.data()) ) | |
1481 pFooterString[strlen(pFooterString.data()) - 1] = 0; | |
1482 } | |
1483 } | |
1484 } | |
1485 | |
1486 //----- (0041C179) -------------------------------------------------------- | |
1487 void GameUI_Footer() | |
1488 { | |
1489 char *v1; // edi@5 | |
1490 int v2; // eax@5 | |
1491 int v6; // eax@9 | |
1492 char v9; // zf@12 | |
1493 | |
1494 if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter ) | |
1495 { | |
1496 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); | |
1497 if ( GameUI_Footer_TimeLeft ) | |
1498 { | |
1499 v1 = GameUI_Footer_TimedString.data(); | |
1500 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | |
1501 while ( v2 > 450 ) | |
1502 { | |
1503 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; | |
1504 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); | |
1505 } | |
1506 } | |
1507 else | |
1508 { | |
1509 v1 = pFooterString.data(); | |
1510 v6 = pFontLucida->GetLineWidth(pFooterString.data()); | |
1511 while ( v6 > 450 ) | |
1512 { | |
1513 pFooterString[strlen(pFooterString.data()) - 1] = 0; | |
1514 v6 = pFontLucida->GetLineWidth(pFooterString.data()); | |
1515 } | |
1516 } | |
1517 v9 = *v1 == 0; | |
1518 bForceDrawFooter = 0; | |
1519 if ( !v9 ) | |
1520 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, v1) + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); | |
1521 } | |
1522 } | |
1523 // 5C35BC: using guessed type int bForceDrawFooter; | |
1524 //----- (00420EFF) -------------------------------------------------------- | |
1525 void GameUI_WritePointedObjectStatusString() | |
1526 { | |
1527 GUIWindow *pWindow; // edi@7 | |
1528 GUIButton *pButton; // ecx@11 | |
1529 int requiredSkillpoints; // ecx@19 | |
1530 enum UIMessageType pMessageType1; // esi@24 | |
1531 int v14; // eax@41 | |
1532 ItemGen *pItemGen; // ecx@44 | |
1533 int v16; // ecx@46 | |
1534 signed int pickedObjectPID; // eax@55 | |
1535 signed int v18b; | |
1536 signed int pickedObjectID; // ecx@63 | |
1537 BLVFace *pFace; // eax@69 | |
1538 const char *pText; // ecx@79 | |
1539 enum UIMessageType pMessageType2; // esi@110 | |
1540 enum UIMessageType pMessageType3; // edx@117 | |
1541 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | |
1542 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | |
1543 unsigned int pY; // [sp+D8h] [bp-8h]@1 | |
1544 | |
1545 pMouse->uPointingObjectID = 0; | |
1546 pMouse->GetClickPos(&pX, &pY); | |
1547 if ( pX < 0 || pX > window->GetWidth() - 1 || pY < 0 || pY > window->GetHeight() - 1 ) | |
1548 return; | |
2541 | 1549 if ( current_screen_type == SCREEN_GAME ) |
2501 | 1550 { |
1551 if ( pX <= (window->GetWidth() - 1) * 0.73125 && pY <= (window->GetHeight() - 1) * 0.73125 ) | |
1552 { | |
1553 //if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 | |
1554 { | |
2541 | 1555 pickedObjectPID = pEngine->pVisInstance->get_picked_object_zbuf_val(); |
2501 | 1556 if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X |
1557 || pY < (unsigned int)pViewport->uScreen_TL_Y || pY > (unsigned int)pViewport->uScreen_BR_Y ) | |
1558 pickedObjectPID = -1; | |
1559 if ( pickedObjectPID == -1 ) | |
1560 { | |
1561 if ( uLastPointedObjectID != 0 ) | |
1562 { | |
1563 pFooterString[0] = 0; | |
1564 bForceDrawFooter = 1; | |
1565 } | |
1566 uLastPointedObjectID = 0; | |
1567 return; | |
1568 } | |
1569 } | |
1570 /*else | |
1571 { | |
1572 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1573 }*/ | |
1574 pMouse->uPointingObjectID = (unsigned __int16)pickedObjectPID; | |
1575 pickedObjectID = (signed)PID_ID(pickedObjectPID); | |
1576 if ( PID_TYPE(pickedObjectPID) == OBJECT_Item ) | |
1577 { | |
1578 if ( pObjectList->pObjects[pSpriteObjects[pickedObjectID].uObjectDescID].uFlags & 0x10 ) | |
1579 { | |
1580 pMouse->uPointingObjectID = 0; | |
1581 pFooterString[0] = 0; | |
1582 bForceDrawFooter = 1; | |
1583 uLastPointedObjectID = 0; | |
1584 return; | |
1585 } | |
1586 if ( pickedObjectPID >= 0x2000000u || pParty->pPickedItem.uItemID ) | |
1587 { | |
1588 GameUI_SetFooterString(pSpriteObjects[pickedObjectID].stru_24.GetDisplayName()); | |
1589 } | |
1590 else | |
1591 { | |
1592 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], pSpriteObjects[pickedObjectID].stru_24.GetDisplayName());// "Get %s" | |
1593 GameUI_SetFooterString(pTmpBuf.data()); | |
1594 } //intentional fallthrough | |
1595 } | |
1596 else if ( PID_TYPE(pickedObjectPID) == OBJECT_Decoration ) | |
1597 { | |
1598 if ( !pLevelDecorations[pickedObjectID].uEventID ) | |
1599 { | |
1600 if ( pLevelDecorations[pickedObjectID].IsInteractive() ) | |
1601 pText = pNPCTopics[stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[pickedObjectID]._idx_in_stru123 - 75] + 380].pTopic;//íåâåðíî äëÿ êîñòðà | |
1602 else | |
1603 pText = pDecorationList->pDecorations[pLevelDecorations[pickedObjectID].uDecorationDescID].field_20; | |
1604 GameUI_SetFooterString(pText); | |
1605 } | |
1606 else | |
1607 { | |
1608 char* hintString = GetEventHintString(pLevelDecorations[pickedObjectID].uEventID); | |
1609 if ( hintString != '\0' ) | |
1610 { | |
1611 GameUI_SetFooterString(hintString); | |
1612 } | |
1613 } //intentional fallthrough | |
1614 } | |
1615 else if ( PID_TYPE(pickedObjectPID) == OBJECT_BModel ) | |
1616 { | |
1617 if ( pickedObjectPID < 0x2000000u ) | |
1618 { | |
1619 char* newString = nullptr; | |
1620 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor ) | |
1621 { | |
1622 v18b = (signed int)(unsigned __int16)pickedObjectPID >> 9; | |
1623 short triggeredId = pOutdoor->pBModels[v18b].pFaces[pickedObjectID & 0x3F].sCogTriggeredID; | |
1624 if (triggeredId != 0) | |
1625 { | |
1626 newString = GetEventHintString(pOutdoor->pBModels[v18b].pFaces[pickedObjectID & 0x3F].sCogTriggeredID); | |
1627 } | |
1628 } | |
1629 else | |
1630 { | |
1631 pFace = &pIndoor->pFaces[pickedObjectID]; | |
1632 if ( pFace->uAttributes & FACE_INDICATE ) | |
1633 { | |
1634 unsigned short eventId = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
1635 if (eventId != 0) | |
1636 { | |
1637 newString = GetEventHintString(pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID); | |
1638 } | |
1639 } | |
1640 } | |
1641 if (newString) | |
1642 { | |
1643 GameUI_SetFooterString(newString); | |
1644 if ( pMouse->uPointingObjectID == 0 && uLastPointedObjectID != 0) | |
1645 { | |
1646 pFooterString[0] = 0; | |
1647 bForceDrawFooter = 1; | |
1648 } | |
1649 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1650 return; | |
1651 } | |
1652 } | |
1653 pMouse->uPointingObjectID = 0; | |
1654 pFooterString[0] = 0; | |
1655 bForceDrawFooter = 1; | |
1656 uLastPointedObjectID = 0; | |
1657 return; | |
1658 } | |
1659 else if ( PID_TYPE(pickedObjectPID) == OBJECT_Actor ) | |
1660 { | |
1661 if ( pickedObjectPID >= 0x2000000 ) | |
1662 { | |
1663 pMouse->uPointingObjectID = 0; | |
1664 if ( uLastPointedObjectID != 0 ) | |
1665 { | |
1666 pFooterString[0] = 0; | |
1667 bForceDrawFooter = 1; | |
1668 } | |
1669 uLastPointedObjectID = 0; | |
1670 return; | |
1671 } | |
1672 if ( pActors[pickedObjectID].dword_000334_unique_name ) | |
1673 pText = pMonsterStats->pPlaceStrings[pActors[pickedObjectID].dword_000334_unique_name]; | |
1674 else | |
1675 pText = pMonsterStats->pInfos[pActors[pickedObjectID].pMonsterInfo.uID].pName; | |
1676 GameUI_SetFooterString(pText); //intentional fallthrough | |
1677 } | |
1678 if ( pMouse->uPointingObjectID == 0 && uLastPointedObjectID != 0) | |
1679 { | |
1680 pFooterString[0] = 0; | |
1681 bForceDrawFooter = 1; | |
1682 } | |
1683 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1684 return; | |
1685 } | |
1686 } | |
1687 else | |
1688 { | |
1689 for (int i = uNumVisibleWindows; i > 0; --i) | |
1690 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
1691 pWindow = pWindowList[pVisibleWindowsIdxs[i] - 1]; |
2501 | 1692 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ |
1693 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
1694 { | |
1695 for ( pButton = pWindow->pControlsHead; pButton != nullptr; pButton = pButton->pNext ) | |
1696 { | |
1697 switch ( pButton->uButtonType ) | |
1698 { | |
1699 case 1://for dialogue window | |
1700 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ | |
1701 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) | |
1702 { | |
1703 pMessageType1 = (UIMessageType)pButton->field_1C; | |
1704 if ( pMessageType1 ) | |
1705 pMessageQueue_50CBD0->AddGUIMessage(pMessageType1, pButton->msg_param, 0); | |
1706 GameUI_SetFooterString(pButton->pButtonName); | |
1707 uLastPointedObjectID = 1; | |
1708 return; | |
1709 } | |
1710 break; | |
1711 case 2://hovering over portraits | |
1712 if (pButton->uWidth != 0 && pButton->uHeight != 0) | |
1713 { | |
1714 uint distW = pX - pButton->uX; | |
1715 uint distY = pY - pButton->uY; | |
1716 | |
1717 double ratioX = 1.0 * (distW*distW) / (pButton->uWidth*pButton->uWidth); | |
1718 double ratioY = 1.0 * (distY*distY) / (pButton->uHeight*pButton->uHeight); | |
1719 | |
1720 if (ratioX + ratioY < 1.0) | |
1721 { | |
1722 pMessageType2 = (UIMessageType)pButton->field_1C; | |
1723 if ( pMessageType2 != 0 ) | |
1724 pMessageQueue_50CBD0->AddGUIMessage(pMessageType2, pButton->msg_param, 0); | |
1725 GameUI_SetFooterString(pButton->pButtonName); // for character name | |
1726 uLastPointedObjectID = 1; | |
1727 return; | |
1728 } | |
1729 } | |
1730 break; | |
1731 case 3:// click on skill | |
1732 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1733 && pY >= pButton->uY && pY <= pButton->uW ) | |
1734 { | |
1735 requiredSkillpoints = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1736 if ( pPlayers[uActiveCharacter]->uSkillPoints < requiredSkillpoints ) | |
1737 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], requiredSkillpoints - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1738 else | |
1739 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], requiredSkillpoints);// "Clicking here will spend %d Skill Points" | |
1740 GameUI_SetFooterString(Str1); | |
1741 uLastPointedObjectID = 1; | |
1742 return; | |
1743 } | |
1744 break; | |
1745 } | |
1746 } | |
1747 } | |
1748 if ( pWindow->uFrameHeight == 480 ) | |
1749 { | |
1750 //DebugBreak(); //Why is this condition here (in the original too)? Might check fullscreen windows. Let Silvo know if you find out | |
1751 return; | |
1752 } | |
1753 } | |
1754 //The game never gets to this point even in the original. It's also bugged(neither branch displays anything). | |
1755 //TODO fix these and move them up before the window check loop. | |
2541 | 1756 if ( current_screen_type == SCREEN_CHEST ) |
2501 | 1757 { |
1758 Chest::ChestUI_WritePointedObjectStatusString(); | |
1759 if ( uLastPointedObjectID != 0 ) | |
1760 { | |
1761 pFooterString[0] = 0; | |
1762 bForceDrawFooter = 1; | |
1763 } | |
1764 uLastPointedObjectID = 0; | |
1765 return; | |
1766 } | |
2541 | 1767 else if ( current_screen_type == SCREEN_HOUSE ) |
2501 | 1768 { |
1769 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD | |
1770 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) | |
1771 || v16 == -65536 ) | |
1772 { | |
1773 if ( uLastPointedObjectID != 0 ) | |
1774 { | |
1775 pFooterString[0] = 0; | |
1776 bForceDrawFooter = 1; | |
1777 } | |
1778 uLastPointedObjectID = 0; | |
1779 return; | |
1780 } | |
1781 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); | |
1782 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1783 pFooterString[0] = 0; | |
1784 bForceDrawFooter = 1; | |
1785 uLastPointedObjectID = 0; | |
1786 return; | |
1787 } | |
1788 if ( pY < 350 ) | |
1789 { | |
1790 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1791 if ( v14 == 0 || v14 == -65536 || v14 >= 5000 ) | |
1792 { | |
1793 if ( pMouse->uPointingObjectID == 0 ) | |
1794 { | |
1795 if ( uLastPointedObjectID != 0 ) | |
1796 { | |
1797 pFooterString[0] = 0; | |
1798 bForceDrawFooter = 1; | |
1799 } | |
1800 } | |
1801 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1802 return; | |
1803 } | |
1804 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v14-1]; | |
1805 GameUI_SetFooterString(pItemGen->GetDisplayName()); | |
1806 pFooterString[0] = 0; | |
1807 bForceDrawFooter = 1; | |
1808 uLastPointedObjectID = 0; | |
1809 return; | |
1810 } | |
1811 } | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
1812 if ( (signed int)pX >= (signed int)pWindowList[0]->uFrameX && (signed int)pX <= (signed int)pWindowList[0]->uFrameZ |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
1813 && (signed int)pY >= (signed int)pWindowList[0]->uFrameY && (signed int)pY <= (signed int)pWindowList[0]->uFrameW ) |
2501 | 1814 { |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2541
diff
changeset
|
1815 for ( pButton = pWindowList[0]->pControlsHead; pButton != nullptr; pButton = pButton->pNext ) |
2501 | 1816 { |
1817 switch (pButton->uButtonType) | |
1818 { | |
1819 case 1: | |
1820 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ | |
1821 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) | |
1822 { | |
1823 pMessageType3 = (UIMessageType)pButton->field_1C; | |
1824 if ( pMessageType3 == 0 ) // For books | |
1825 { | |
1826 GameUI_SetFooterString(pButton->pButtonName); | |
1827 } | |
1828 else | |
1829 { | |
1830 pMessageQueue_50CBD0->AddGUIMessage(pMessageType3, pButton->msg_param, 0); | |
1831 } | |
1832 uLastPointedObjectID = 1; | |
1833 return; | |
1834 } | |
1835 break; | |
1836 case 2://hovering over portraits | |
1837 if (pButton->uWidth != 0 && pButton->uHeight != 0) | |
1838 { | |
1839 uint distW = pX - pButton->uX; | |
1840 uint distY = pY - pButton->uY; | |
1841 | |
1842 double ratioX = 1.0 * (distW*distW) / (pButton->uWidth*pButton->uWidth); | |
1843 double ratioY = 1.0 * (distY*distY) / (pButton->uHeight*pButton->uHeight); | |
1844 | |
1845 if (ratioX + ratioY < 1.0) | |
1846 { | |
1847 pMessageType2 = (UIMessageType)pButton->field_1C; | |
1848 if ( pMessageType2 != 0 ) | |
1849 pMessageQueue_50CBD0->AddGUIMessage(pMessageType2, pButton->msg_param, 0); | |
1850 GameUI_SetFooterString(pButton->pButtonName); // for character name | |
1851 uLastPointedObjectID = 1; | |
1852 return; | |
1853 } | |
1854 } | |
1855 break; | |
1856 case 3: | |
1857 if ( pX >= pButton->uX && pX <= pButton->uZ | |
1858 && pY >= pButton->uY && pY <= pButton->uW ) | |
1859 { | |
1860 requiredSkillpoints = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; | |
1861 if ( pPlayers[uActiveCharacter]->uSkillPoints < requiredSkillpoints ) | |
1862 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], requiredSkillpoints - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" | |
1863 else | |
1864 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], requiredSkillpoints);// "Clicking here will spend %d Skill Points" | |
1865 GameUI_SetFooterString(Str1); | |
1866 uLastPointedObjectID = 1; | |
1867 return; | |
1868 } | |
1869 break; | |
1870 } | |
1871 } | |
1872 } | |
1873 //pMouse->uPointingObjectID = sub_46A99B(); //for software | |
1874 if ( uLastPointedObjectID != 0 ) | |
1875 { | |
1876 pFooterString[0] = 0; | |
1877 bForceDrawFooter = 1; | |
1878 } | |
1879 uLastPointedObjectID = 0; | |
1880 return; | |
1881 } | |
1882 | |
1883 //----- (0044158F) -------------------------------------------------------- | |
1884 void GameUI_DrawCharacterSelectionFrame() | |
1885 { | |
1886 if ( uActiveCharacter ) | |
2524 | 1887 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380, |
2501 | 1888 pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame)); |
1889 } | |
1890 | |
1891 //----- (0044162D) -------------------------------------------------------- | |
1892 void GameUI_DrawPartySpells() | |
1893 { | |
1894 unsigned int v0; // ebp@1 | |
1895 Texture *spell_texture; // [sp-4h] [bp-1Ch]@12 | |
1896 //Texture *v9; // [sp-4h] [bp-1Ch]@21 | |
1897 | |
1898 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); | |
1899 //v1 = 0; | |
1900 for (uint i = 0; i < 14; ++i) | |
1901 { | |
1902 //v2 = byte_4E5DD8[v1]; | |
1903 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) | |
1904 { | |
1905 Texture* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); | |
1906 //v3 = pTextureIDs_PartyBuffIcons[i]; | |
1907 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], | |
1908 pPartySpellbuffsUI_XYs[i][1], tex, tex, | |
1909 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); | |
1910 } | |
1911 //++v1; | |
1912 } | |
1913 //while ( v1 < 14 ); | |
2541 | 1914 if (current_screen_type == SCREEN_GAME || current_screen_type == SCREEN_NPC_DIALOGUE) |
2501 | 1915 { |
1916 if (pParty->FlyActive()) | |
1917 { | |
1918 if ( pParty->bFlying ) | |
1919 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); | |
1920 else | |
1921 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); | |
1922 //if ( pRenderer->pRenderD3D ) | |
1923 pRenderer->DrawTextureIndexed(8, 8, spell_texture); | |
1924 /*else | |
2524 | 1925 pRenderer->DrawTextureIndexedAlpha(8, 8, v7);*/ |
2501 | 1926 } |
1927 if ( pParty->WaterWalkActive() ) | |
1928 { | |
1929 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) | |
1930 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); | |
1931 else | |
1932 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); | |
1933 //if ( pRenderer->pRenderD3D ) | |
1934 pRenderer->DrawTextureIndexed(396, 8, spell_texture); | |
1935 /*else | |
2524 | 1936 pRenderer->DrawTextureIndexedAlpha(396, 8, v9);*/ |
2501 | 1937 } |
1938 } | |
1939 for (uint i = 0; i < 4; ++i) | |
1940 { | |
1941 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime ) | |
1942 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); | |
1943 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime ) | |
1944 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); | |
1945 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime ) | |
1946 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); | |
1947 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime ) | |
1948 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); | |
1949 } | |
1950 } | |
1951 | |
1952 //----- (004921C1) -------------------------------------------------------- | |
1953 void GameUI_DrawPortraits(unsigned int _this) | |
1954 { | |
1955 unsigned int face_expression_ID; // eax@17 | |
1956 PlayerFrame *pFrame; // eax@21 | |
1957 int pTextureID; // eax@57 | |
1958 Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 | |
1959 | |
1960 if ( _A750D8_player_speech_timer ) | |
1961 { | |
1962 _A750D8_player_speech_timer -= (signed int)pMiscTimer->uTimeElapsed; | |
1963 if ( _A750D8_player_speech_timer <= 0 ) | |
1964 { | |
1965 if ( pPlayers[uSpeakingCharacter]->CanAct() ) | |
1966 pPlayers[uSpeakingCharacter]->PlaySound(PlayerSpeechID, 0); | |
1967 _A750D8_player_speech_timer = 0i64; | |
1968 } | |
1969 } | |
1970 | |
1971 for (uint i = 0; i < 4; ++i) | |
1972 { | |
1973 Player* pPlayer = &pParty->pPlayers[i]; | |
1974 if ( pPlayer->IsEradicated() ) | |
1975 { | |
1976 pPortrait = pTexture_PlayerFaceEradicated; | |
1977 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | |
1978 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | |
1979 else | |
2524 | 1980 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
2501 | 1981 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
1982 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | |
1983 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | |
1984 sub_441A4E(i); | |
1985 continue; | |
1986 } | |
1987 if (pPlayer->IsDead()) | |
1988 { | |
1989 pPortrait = pTexture_PlayerFaceDead; | |
1990 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | |
1991 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | |
1992 else | |
2524 | 1993 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
2501 | 1994 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
1995 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | |
1996 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | |
1997 sub_441A4E(i); | |
1998 continue; | |
1999 } | |
2000 face_expression_ID = 0; | |
2001 for ( uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j ) | |
2002 if ( pPlayerFrameTable->pFrames[j].expression == pPlayer->expression ) | |
2003 { | |
2004 face_expression_ID = j; | |
2005 break; | |
2006 } | |
2007 if ( face_expression_ID == 0 ) | |
2008 face_expression_ID = 1; | |
2009 if (pPlayer->expression == CHARACTER_EXPRESSION_21) | |
2010 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
2011 else | |
2012 pFrame = pPlayerFrameTable->GetFrameBy_x(face_expression_ID, pPlayer->uExpressionTimePassed); | |
2013 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) | |
2014 { | |
2015 pPlayer->field_1AA2 = pFrame->uTextureID - 1; | |
2016 pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; | |
2017 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | |
2018 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | |
2019 else | |
2524 | 2020 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); |
2501 | 2021 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
2022 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | |
2023 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | |
2024 sub_441A4E(i); | |
2025 continue; | |
2026 } | |
2027 } | |
2028 if ( pParty->bTurnBasedModeOn == 1 ) | |
2029 { | |
2030 if ( pTurnEngine->turn_stage != TE_WAIT ) | |
2031 { | |
2032 if (PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) | |
2033 { | |
2034 if ( pTurnEngine->uActorQueueSize > 0 ) | |
2035 { | |
2036 for (uint i = 0; i < (uint)pTurnEngine->uActorQueueSize; ++i) | |
2037 { | |
2038 if (PID_TYPE(pTurnEngine->pQueue[i].uPackedID) != OBJECT_Player) | |
2039 break; | |
2040 pTextureID = dword_5079D0; | |
2041 if ( pParty->uFlags & 0x10 ) | |
2042 pTextureID = dword_5079CC; | |
2043 else | |
2044 { | |
2045 if ( pParty->uFlags & 0x20 ) | |
2046 pTextureID = dword_5079C8; | |
2047 } | |
2524 | 2048 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4, 385, pIcons_LOD->GetTexture(pTextureID)); |
2501 | 2049 } |
2050 } | |
2051 } | |
2052 } | |
2053 } | |
2054 else | |
2055 { | |
2056 for (uint i = 0; i < 4; ++i) | |
2057 { | |
2058 if (pParty->pPlayers[i].CanAct() && !pParty->pPlayers[i].uTimeToRecovery) | |
2059 { | |
2060 pTextureID = dword_5079D0; | |
2061 if ( pParty->uFlags & 0x10 ) | |
2062 pTextureID = dword_5079CC; | |
2063 else | |
2064 { | |
2065 if ( pParty->uFlags & 0x20 ) | |
2066 pTextureID = dword_5079C8; | |
2067 } | |
2524 | 2068 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 385, pIcons_LOD->GetTexture(pTextureID)); |
2501 | 2069 } |
2070 } | |
2071 } | |
2072 } | |
2073 | |
2074 //----- (00441D38) -------------------------------------------------------- | |
2075 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) | |
2076 { | |
2077 int uHeight; // ebx@6 | |
2078 signed int pW; // ebx@23 | |
2079 int v15; // eax@23 | |
2080 double v20; // st7@30 | |
2081 signed int v27; // eax@37 | |
2082 //unsigned __int16 *v28; // ecx@37 | |
2083 signed int v29; // edi@40 | |
2084 int pPoint_X; // edi@72 | |
2085 int pPoint_Y; // ebx@72 | |
2086 unsigned int lPitch; // [sp+20h] [bp-34h]@1 | |
2087 signed int pY; // [sp+20h] [bp-34h]@23 | |
2088 signed int pX; // [sp+24h] [bp-30h]@23 | |
2089 signed int v70; // [sp+24h] [bp-30h]@37 | |
2090 signed int uBluea; // [sp+28h] [bp-2Ch]@37 | |
2091 int v73; // [sp+2Ch] [bp-28h]@30 | |
2092 signed int uCenterY; // [sp+48h] [bp-Ch]@1 | |
2093 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 | |
2094 signed int uWidth; // [sp+5Ch] [bp+8h]@30 | |
2095 signed int pZ; // [sp+60h] [bp+Ch]@23 | |
2096 float uWb; // [sp+60h] [bp+Ch]@30 | |
2097 unsigned int pColor; | |
2098 | |
2099 uCenterX = (uX + uZ) / 2; | |
2100 uCenterY = (uY + uW) / 2; | |
2101 lPitch = pRenderer->uTargetSurfacePitch; | |
2102 bool bWizardEyeActive = pParty->WizardEyeActive(); | |
2103 int uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); | |
2104 if ( CheckHiredNPCSpeciality(Cartographer) ) | |
2105 { | |
2106 bWizardEyeActive = true; | |
2107 uWizardEyeSkillLevel = 2; | |
2108 } | |
2109 | |
2110 if ( wizard_eye ) | |
2111 { | |
2112 bWizardEyeActive = true; | |
2113 uWizardEyeSkillLevel = 3; | |
2114 } | |
2115 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1); | |
2116 uHeight = uW - uY; | |
2117 uWidth = uZ - uX; | |
2118 | |
2119 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
2120 { | |
2121 uchar* pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; | |
2122 ushort* pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; | |
2123 v73 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / (signed int)uZoom; | |
2124 v20 = (double)(pParty->vPosition.x + 32768) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); | |
2125 uWb = (double)(32768 - pParty->vPosition.y) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); | |
2126 switch (uZoom) | |
2127 { | |
2128 case 512: | |
2129 { | |
2130 v20 = v20 - (double)(uWidth / 2); | |
2131 uWb = uWb - (double)(uHeight / 2); | |
2132 } | |
2133 break; | |
2134 case 1024: | |
2135 { | |
2136 v20 = v20 - (double)(uWidth / 4); | |
2137 uWb = uWb - (double)(uHeight / 4); | |
2138 } | |
2139 break; | |
2140 case 2048: | |
2141 { | |
2142 v20 = v20 - (double)(uWidth / 8); | |
2143 uWb = uWb - (double)(uHeight / 8); | |
2144 } | |
2145 break; | |
2146 default: assert(false); | |
2147 } | |
2148 | |
2149 static unsigned __int16 pOdmMinimap[117][137]; | |
2150 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); | |
2151 | |
2152 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); | |
2153 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); | |
2154 v27 = uBluea >> 16; | |
2155 //v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; | |
2156 | |
2157 if (pMapLod0 && bRedrawOdmMinimap) | |
2158 { | |
2159 assert(uWidth == 137 && uHeight == 117); | |
2160 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; | |
2161 | |
2162 ushort mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; | |
2163 | |
2164 v29 = v70 >> 16; | |
2165 for (int y = 0; y < uHeight; ++y) | |
2166 { | |
2167 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth]; | |
2168 for (int x = 0; x < uWidth; ++x) | |
2169 { | |
2170 //*pMinimap++ = pPal[pMapLod0Line[v29]]; | |
2171 pRenderer->WritePixel16(uX + x, uY + y, pPal[pMapLod0Line[v29]]); | |
2172 v29 = (v70 + x * v73) >> 16; | |
2173 } | |
2174 uBluea += v73; | |
2175 v27 = uBluea >> 16; | |
2176 } | |
2177 | |
2178 /*v29 = v70 >> 16; | |
2179 for (int y = 0; y < uHeight; ++y) | |
2180 { | |
2181 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth]; | |
2182 for (int x = 0; x < uWidth; ++x) | |
2183 { | |
2184 //*pMinimap++ = pPal[pMapLod0Line[v29]]; | |
2185 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; | |
2186 v29 = (v70 + x * v73) >> 16; | |
2187 } | |
2188 v29 = v70 >> 16; | |
2189 v28 += 137 - uWidth; | |
2190 uBluea += v73; | |
2191 v27 = uBluea >> 16; | |
2192 }*/ | |
2193 } | |
2194 | |
2195 /*for (int y = 0; y < 117; ++y) | |
2196 { | |
2197 for (int x = 0; x < 137; ++x) | |
2198 { | |
2199 *v28++ = pOdmMinimap[y][x]; | |
2200 } | |
2201 v28 += lPitch - 137; | |
2202 }*/ | |
2203 uNumBlueFacesInBLVMinimap = 0; | |
2204 } | |
2205 else// uCurrentlyLoadedLevelType == LEVEL_Indoor | |
2206 { | |
2207 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); | |
2208 uNumBlueFacesInBLVMinimap = 0; | |
2209 | |
2210 for (uint i = 0; i < (uint)pIndoor->pMapOutlines->uNumOutlines; ++i) | |
2211 { | |
2212 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[i]; | |
2213 //BLVFace* pFace1 = &pIndoor->pFaces[pOutline->uFace1ID]; | |
2214 //BLVFace* pFace2 = &pIndoor->pFaces[pOutline->uFace2ID]; | |
2215 if (pIndoor->pFaces[pOutline->uFace1ID].Visible() && pIndoor->pFaces[pOutline->uFace2ID].Visible()) | |
2216 { | |
2217 if ( pOutline->uFlags & 1 ) | |
2218 { | |
2219 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | |
2220 (pIndoor->pFaces[pOutline->uFace1ID].Clickable() || pIndoor->pFaces[pOutline->uFace2ID].Clickable()) && | |
2508 | 2221 (pIndoor->pFaceExtras[pIndoor->pFaces[pOutline->uFace1ID].uFaceExtraID].uEventID |
2222 || pIndoor->pFaceExtras[pIndoor->pFaces[pOutline->uFace2ID].uFaceExtraID].uEventID)) | |
2501 | 2223 { |
2224 if (uNumBlueFacesInBLVMinimap < 49) | |
2225 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | |
2226 } | |
2227 else | |
2228 { | |
2229 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2230 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2231 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2232 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2233 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
2234 if ( v15 > 100 ) | |
2235 v15 = 100; | |
2236 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); | |
2237 } | |
2238 continue; | |
2239 } | |
2508 | 2240 if (pIndoor->pFaces[pOutline->uFace1ID].uAttributes & FACE_UNKNOW7 |
2241 || pIndoor->pFaces[pOutline->uFace2ID].uAttributes & FACE_UNKNOW7) | |
2501 | 2242 { |
2243 pOutline->uFlags = pOutline->uFlags | 1; | |
2244 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); | |
2245 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | |
2246 (pIndoor->pFaces[pOutline->uFace1ID].Clickable() || pIndoor->pFaces[pOutline->uFace2ID].Clickable()) && | |
2247 (pIndoor->pFaceExtras[pIndoor->pFaces[pOutline->uFace1ID].uFaceExtraID].uEventID || pIndoor->pFaceExtras[pIndoor->pFaces[pOutline->uFace2ID].uFaceExtraID].uEventID)) | |
2248 { | |
2249 if (uNumBlueFacesInBLVMinimap < 49) | |
2250 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | |
2251 } | |
2252 else | |
2253 { | |
2254 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2255 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2256 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2257 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2258 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
2259 if ( v15 > 100 ) | |
2260 v15 = 100; | |
2261 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); | |
2262 } | |
2263 continue; | |
2264 } | |
2265 } | |
2266 } | |
2267 | |
2268 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) | |
2269 { | |
2270 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; | |
2271 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2272 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2273 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
2274 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2275 pRenderer->RasterLine2D(pX, pY, pZ, pW, ui_game_minimap_outline_color); | |
2276 } | |
2277 } | |
2278 | |
2279 //draw arrow on the minimap(include. Ritor1) | |
2280 uint arrow_idx; | |
2281 unsigned int rotate = pParty->sRotationY & stru_5C6E00->uDoublePiMask; | |
2282 if ( (signed int)rotate <= 1920 ) | |
2283 arrow_idx = 6; | |
2516 | 2284 if ( (signed int)rotate < 1664 ) |
2501 | 2285 arrow_idx = 5; |
2516 | 2286 if ( (signed int)rotate <= 1408 ) |
2501 | 2287 arrow_idx = 4; |
2516 | 2288 if ( (signed int)rotate < 1152 ) |
2501 | 2289 arrow_idx = 3; |
2516 | 2290 if ( (signed int)rotate <= 896 ) |
2501 | 2291 arrow_idx = 2; |
2516 | 2292 if ( (signed int)rotate < 640 ) |
2501 | 2293 arrow_idx = 1; |
2516 | 2294 if ( (signed int)rotate <= 384 ) |
2501 | 2295 arrow_idx = 0; |
2516 | 2296 if ( (signed int)rotate < 128 || (signed int)rotate > 1920 ) |
2501 | 2297 arrow_idx = 7; |
2524 | 2298 pRenderer->DrawTextureIndexedAlpha(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));//ñòðåëêà |
2501 | 2299 |
2300 //draw objects on the minimap | |
2301 if ( bWizardEyeActive ) | |
2302 { | |
2303 if ( uWizardEyeSkillLevel >= 2 ) | |
2304 { | |
2305 for ( uint i = 0; i < uNumSpriteObjects; ++i ) | |
2306 { | |
2307 if ( !pSpriteObjects[i].uType || !pSpriteObjects[i].uObjectDescID ) | |
2308 continue; | |
2309 //if (uWizardEyeSkillLevel == 1 | |
2310 pPoint_X = uCenterX + fixpoint_mul((pSpriteObjects[i].vPosition.x - pParty->vPosition.x), uZoom); | |
2311 pPoint_Y = uCenterY - fixpoint_mul((pSpriteObjects[i].vPosition.y - pParty->vPosition.y), uZoom); | |
2312 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z && | |
2313 // pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w) | |
2314 { | |
2315 if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) | |
2316 { | |
2317 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_projectile_color); | |
2318 } | |
2319 else if ( uZoom > 512 ) | |
2320 { | |
2321 pRenderer->RasterLine2D(pPoint_X - 2, pPoint_Y, pPoint_X - 2, pPoint_Y + 1, ui_game_minimap_treasure_color); | |
2322 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_treasure_color); | |
2323 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 2, pPoint_X, pPoint_Y + 1, ui_game_minimap_treasure_color); | |
2324 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 1, pPoint_X + 1, pPoint_Y + 1, ui_game_minimap_treasure_color); | |
2325 pRenderer->RasterLine2D(pPoint_X + 2, pPoint_Y, pPoint_X + 2, pPoint_Y + 1, ui_game_minimap_treasure_color); | |
2326 } | |
2327 else | |
2328 { | |
2329 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y, ui_game_minimap_treasure_color); | |
2330 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y, ui_game_minimap_treasure_color); | |
2331 } | |
2332 } | |
2333 } | |
2334 } | |
2335 for ( uint i = 0; i < uNumActors; ++i )//draw actors(îòðèñîâêà ìîíñòðîâ è íïñ) | |
2336 { | |
2337 if ( pActors[i].uAIState != Removed && pActors[i].uAIState != Disabled | |
2338 && (pActors[i].uAIState == Dead || pActors[i].ActorNearby()) ) | |
2339 { | |
2340 pPoint_X = uCenterX + (fixpoint_mul((pActors[i].vPosition.x - pParty->vPosition.x), uZoom)); | |
2341 pPoint_Y = uCenterY - (fixpoint_mul((pActors[i].vPosition.y - pParty->vPosition.y), uZoom)); | |
2342 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z | |
2343 // && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) | |
2344 { | |
2345 pColor = ui_game_minimap_actor_friendly_color; | |
2346 if ( pActors[i].uAttributes & ACTOR_HOSTILE ) | |
2347 pColor = ui_game_minimap_actor_hostile_color; | |
2348 if ( pActors[i].uAIState == Dead) | |
2349 pColor = ui_game_minimap_actor_corpse_color; | |
2350 if ( uZoom > 1024 ) | |
2351 { | |
2352 pRenderer->RasterLine2D(pPoint_X - 2, pPoint_Y - 1, pPoint_X - 2, pPoint_Y + 1, pColor); | |
2353 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 2, pPoint_X - 1, pPoint_Y + 2, pColor); | |
2354 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 2, pPoint_X, pPoint_Y + 2, pColor); | |
2355 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 2, pPoint_X + 1, pPoint_Y + 2, pColor); | |
2356 pRenderer->RasterLine2D(pPoint_X + 2, pPoint_Y - 1, pPoint_X + 2, pPoint_Y + 1, pColor); | |
2357 } | |
2358 else | |
2359 { | |
2360 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y, pColor); | |
2361 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y, pColor); | |
2362 } | |
2363 } | |
2364 } | |
2365 } | |
2366 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i )//draw items(îòðèñîâêà ïðåäìåòîâ) | |
2367 { | |
2368 if ( pLevelDecorations[i].uFlags & 8 ) | |
2369 { | |
2370 pPoint_X = uCenterX + (fixpoint_mul((pLevelDecorations[i].vPosition.x - pParty->vPosition.x), uZoom)); | |
2371 pPoint_Y = uCenterY - (fixpoint_mul((pLevelDecorations[i].vPosition.y - pParty->vPosition.y), uZoom)); | |
2372 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z | |
2373 // && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) | |
2374 { | |
2375 if ( (signed int)uZoom > 512 ) | |
2376 { | |
2377 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1); | |
2378 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y + 1, ui_game_minimap_decoration_color_1); | |
2379 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 1, pPoint_X + 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1); | |
2380 } | |
2381 else | |
2382 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_decoration_color_1); | |
2383 } | |
2384 } | |
2385 } | |
2386 } | |
2524 | 2387 pRenderer->DrawTextureIndexedAlpha(468, 0, pIcons_LOD->GetTexture(uTextureID_Minimap_Loop));//draw minimap_loop |
2388 pRenderer->SetUIClipRect(541, 0, 567, 480); | |
2501 | 2389 pRenderer->DrawTextureIndexed(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, pIcons_LOD->GetTexture(uTextureID_Compas));//draw compas |
2524 | 2390 pRenderer->ResetUIClipRect(); |
2501 | 2391 } |
2392 | |
2393 //----- (00441498) -------------------------------------------------------- | |
2394 void GameUI_DrawTorchlightAndWizardEye() | |
2395 { | |
2541 | 2396 if (current_screen_type == SCREEN_GAME |
2397 || current_screen_type == SCREEN_MENU | |
2398 || current_screen_type == SCREEN_OPTIONS | |
2399 || current_screen_type == SCREEN_REST | |
2400 || current_screen_type == SCREEN_SPELL_BOOK | |
2401 || current_screen_type == SCREEN_CHEST | |
2402 || current_screen_type == SCREEN_SAVEGAME | |
2403 || current_screen_type == SCREEN_LOADGAME | |
2404 || current_screen_type == SCREEN_CHEST_INVENTORY | |
2405 || current_screen_type == SCREEN_BOOKS | |
2406 || current_screen_type == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
2501 | 2407 { |
2408 if (pParty->TorchlightActive()) | |
2409 { | |
2410 IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); | |
2524 | 2411 pRenderer->DrawTextureIndexedAlpha(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); |
2501 | 2412 } |
2413 if (pParty->WizardEyeActive()) | |
2414 { | |
2415 IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); | |
2524 | 2416 pRenderer->DrawTextureIndexedAlpha(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); |
2501 | 2417 } |
2418 } | |
2419 } | |
2541 | 2420 // 4E28F8: using guessed type int current_screen_type; |
2501 | 2421 |
2422 | |
2423 //----- (00491F87) -------------------------------------------------------- | |
2424 void GameUI_DrawHiredNPCs() | |
2425 { | |
2426 unsigned int v13; // eax@23 | |
2427 char pContainer[20]; // [sp+Ch] [bp-30h]@18 | |
2428 signed int uFrameID; // [sp+24h] [bp-18h]@19 | |
2429 int v22; // [sp+34h] [bp-8h]@2 | |
2430 unsigned __int8 pNPC_limit_ID; // [sp+3Bh] [bp-1h]@2 | |
2431 | |
2432 if ( bNoNPCHiring != 1 ) | |
2433 { | |
2434 pNPC_limit_ID = 0; | |
2435 v22 = 0; | |
2436 if (pParty->pHirelings[0].pName) | |
2437 pTmpBuf[v22++] = 0; | |
2438 if (pParty->pHirelings[1].pName) | |
2439 pTmpBuf[v22++] = 1; | |
2440 | |
2441 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
2442 { | |
2443 if (pNPCStats->pNewNPCData[i].uFlags & 128) | |
2444 { | |
2445 if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName)) | |
2446 { | |
2447 if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName)) | |
2448 pTmpBuf[v22++] = i + 2; | |
2449 } | |
2450 } | |
2451 } | |
2452 | |
2453 for ( int i = pParty->hirelingScrollPosition; i < v22 && pNPC_limit_ID < 2; i++ ) | |
2454 { | |
2455 if ( (unsigned __int8)pTmpBuf[i] >= 2 ) | |
2456 { | |
2457 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID); | |
2458 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], | |
2459 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE))); | |
2460 } | |
2461 else | |
2462 { | |
2463 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID); | |
2464 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], | |
2465 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE))); | |
2466 if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 ) | |
2467 { | |
2468 uFrameID = pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_B; | |
2469 v13 = 0; | |
2470 if (pIconsFrameTable->uNumIcons) | |
2471 { | |
2472 for ( v13 = 0; v13 < pIconsFrameTable->uNumIcons; ++v13 ) | |
2473 { | |
2474 if ( !_stricmp("spell96", pIconsFrameTable->pIcons[v13].pAnimationName) ) | |
2475 break; | |
2476 } | |
2477 } | |
2524 | 2478 pRenderer->DrawTextureIndexedAlpha(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], |
2501 | 2479 &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(v13, uFrameID)->uTextureID]); |
2480 } | |
2481 } | |
2482 ++pNPC_limit_ID; | |
2483 } | |
2484 } | |
2485 } | |
2486 | |
2487 //----- (004178FE) -------------------------------------------------------- | |
2488 unsigned int UI_GetHealthManaAndOtherQualitiesStringColor(signed int current_pos, signed int base_pos) | |
2489 { | |
2490 unsigned __int16 R, G, B; | |
2491 | |
2492 if ( current_pos <= base_pos ) | |
2493 { | |
2494 if ( current_pos == base_pos )//White | |
2495 return 0; | |
2496 if ( 100 * current_pos / base_pos >= 25 )//Yellow( current_pos > 1/4 ) | |
2497 R = 255, G = 255, B = 100; | |
2498 else//Red( current_pos < 1/4 ) | |
2499 R = 255, G = 0, B = 0; | |
2500 } | |
2501 else//Green | |
2502 R = 0, G = 255, B = 0; | |
2503 return Color16(R, G, B); | |
2504 } | |
2505 | |
2506 //----- (00417939) -------------------------------------------------------- | |
2507 int GetConditionDrawColor(unsigned int uConditionIdx) | |
2508 { | |
2509 switch (uConditionIdx) | |
2510 { | |
2511 case Condition_Zombie: | |
2512 case Condition_Good: | |
2513 return ui_character_condition_normal_color; | |
2514 | |
2515 case Condition_Cursed: | |
2516 case Condition_Weak: | |
2517 case Condition_Fear: | |
2518 case Condition_Drunk: | |
2519 case Condition_Insane: | |
2520 case Condition_Poison_Weak: | |
2521 case Condition_Disease_Weak: | |
2522 return ui_character_condition_light_color; | |
2523 | |
2524 case Condition_Sleep: | |
2525 case Condition_Poison_Medium: | |
2526 case Condition_Disease_Medium: | |
2527 case Condition_Paralyzed: | |
2528 case Condition_Unconcious: | |
2529 return ui_character_condition_moderate_color; | |
2530 | |
2531 case Condition_Poison_Severe: | |
2532 case Condition_Disease_Severe: | |
2533 case Condition_Dead: | |
2534 case Condition_Pertified: | |
2535 case Condition_Eradicated: | |
2536 return ui_character_condition_severe_color; | |
2537 } | |
2538 Error("Invalid condition (%u)", uConditionIdx); | |
2539 } | |
2540 | |
2541 //----- (00495430) -------------------------------------------------------- | |
2542 const char * GetReputationString(signed int a1) | |
2543 { | |
2544 if (a1 >= 25) | |
2545 return pGlobalTXT_LocalizationStrings[379]; // Hated | |
2546 else if (a1 >= 6) | |
2547 return pGlobalTXT_LocalizationStrings[392]; // Unfriendly | |
2548 else if (a1 >= -5) | |
2549 return pGlobalTXT_LocalizationStrings[399]; // Neutral; | |
2550 else if (a1 >= -24) | |
2551 return pGlobalTXT_LocalizationStrings[402]; // Friendly | |
2552 else | |
2553 return pGlobalTXT_LocalizationStrings[434]; // Respected; | |
2554 } | |
2555 | |
2556 //----- (00441A4E) -------------------------------------------------------- | |
2557 __int16 __fastcall sub_441A4E(int a1)//for blessing | |
2558 { | |
2559 __int16 result; // ax@1 | |
2560 int v2; // ebx@1 | |
2561 // char *v3; // esi@1 | |
2562 // int v4; // edi@4 | |
2563 bool v5; // ecx@4 | |
2564 SpriteFrame *pFrame; // eax@6 | |
2565 //SpriteFrame *v7; // edi@6 | |
2566 int v8; // eax@6 | |
2567 // unsigned __int16 v9; // ax@6 | |
2568 RenderBillboardTransform_local0 v10; // [sp+Ch] [bp-5Ch]@1 | |
2569 int v11; // [sp+5Ch] [bp-Ch]@6 | |
2570 int v12; // [sp+60h] [bp-8h]@1 | |
2571 //int v13; // [sp+64h] [bp-4h]@6 | |
2572 | |
2573 v10.sParentBillboardID = -1; | |
2574 v10.pTarget = pRenderer->pTargetSurface; | |
2575 v10.pTargetZ = pRenderer->pActiveZBuffer; | |
2576 v10.uTargetPitch = pRenderer->GetRenderWidth(); | |
2577 result = 0; | |
2578 v2 = a1; | |
2579 v10.uViewportX = 0; | |
2580 v10.uViewportY = 0; | |
2581 v10.uViewportZ = window->GetWidth() - 1; | |
2582 v10.uViewportW = window->GetHeight() - 1; | |
2583 v12 = 0; | |
2584 //v3 = (char *)&pOtherOverlayList->pOverlays[0].field_C; | |
2585 //do | |
2586 for (uint i = 0; i < 50; ++i) | |
2587 { | |
2588 if (pOtherOverlayList->pOverlays[i].field_6 > 0) | |
2589 { | |
2590 result = pOtherOverlayList->pOverlays[i].field_0; | |
2591 if (pOtherOverlayList->pOverlays[i].field_0 >= 300) | |
2592 { | |
2593 //v4 = result; | |
2594 v5 = pOtherOverlayList->pOverlays[i].field_0 == v2 + 320 | |
2595 || pOtherOverlayList->pOverlays[i].field_0 == v2 + 330 | |
2596 || pOtherOverlayList->pOverlays[i].field_0 == v2 + 340 | |
2597 || pOtherOverlayList->pOverlays[i].field_0 == v2 + 350; | |
2598 pOtherOverlayList->pOverlays[i].field_0 = v2 + 310; | |
2599 if (pOtherOverlayList->pOverlays[i].field_0 == v2 + 310 || v5) | |
2600 { | |
2601 if (!pOtherOverlayList->pOverlays[i].field_0) | |
2602 { | |
2603 pFrame = pSpriteFrameTable->GetFrame(pOverlayList->pOverlays[pOtherOverlayList->pOverlays[i].field_2].uSpriteFramesetID, | |
2604 pOtherOverlayList->pOverlays[i].field_4); | |
2605 //v7 = v6; | |
2606 v11 = pOtherOverlayList->pOverlays[i].field_E; | |
2607 //v13 = pFrame->scale; | |
2608 //v13 = fixpoint_mul(v11, pFrame->scale); | |
2609 v10.uScreenSpaceX = pOtherOverlayList->pOverlays[i].field_8; | |
2610 v10.uScreenSpaceY = pOtherOverlayList->pOverlays[i].field_A; | |
2611 v10._screenspace_x_scaler_packedfloat = fixpoint_mul(v11, pFrame->scale); | |
2612 v10._screenspace_y_scaler_packedfloat = fixpoint_mul(v11, pFrame->scale); | |
2613 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(pFrame->uPaletteIndex, 0, 1); | |
2614 v8 = pOtherOverlayList->pOverlays[i].field_2; | |
2615 v10.sZValue = 0; | |
2616 v10.uFlags = 0; | |
2617 //v9 = pOverlayList->pOverlays[v8].uOverlayType; | |
2618 if (!pOverlayList->pOverlays[v8].uOverlayType || pOverlayList->pOverlays[v8].uOverlayType == 2) | |
2619 v10.uScreenSpaceY += pSprites_LOD->pSpriteHeaders[pFrame->pHwSpriteIDs[0]].uHeight / 2; | |
2620 result = pSprites_LOD->pSpriteHeaders[pFrame->pHwSpriteIDs[0]]._4AD2D1(&v10, 0); | |
2621 ++v12; | |
2622 if (v12 == 5) | |
2623 break; | |
2624 } | |
2625 } | |
2626 } | |
2627 } | |
2628 //v3 += 20; | |
2629 } | |
2630 //while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays ); | |
2631 return result; | |
2632 } |