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