Mercurial > mm7
annotate GUIWindow.cpp @ 1926:3eb0c4f3d899
Woops, debug stuff.
author | Nomad |
---|---|
date | Wed, 23 Oct 2013 15:46:05 +0200 |
parents | 918a8cebd7a4 |
children | e8d329651a2a |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1160
diff
changeset
|
4 |
0 | 5 #include "GUIWindow.h" |
6 #include "GUIFont.h" | |
7 #include "Party.h" | |
8 #include "LOD.h" | |
9 #include "Keyboard.h" | |
10 #include "Math.h" | |
11 #include "VideoPlayer.h" | |
12 #include "MapInfo.h" | |
13 #include "Time.h" | |
14 #include "AudioPlayer.h" | |
15 #include "Mouse.h" | |
16 #include "Viewport.h" | |
17 #include "Render.h" | |
18 #include "PlayerFrameTable.h" | |
19 #include "SaveLoad.h" | |
20 #include "StorylineTextTable.h" | |
21 #include "Events2D.h" | |
1299 | 22 #include "UI\UIHouses.h" |
1310 | 23 #include "UI\UIBooks.h" |
189 | 24 #include "texts.h" |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
74
diff
changeset
|
25 #include "Autonotes.h" |
949 | 26 #include "Awards.h" |
1297 | 27 #include "Chest.h" |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1591
diff
changeset
|
28 #include "Outdoor.h" |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1639
diff
changeset
|
29 #include "Game.h" |
1913 | 30 #include "IconFrameTable.h" |
0 | 31 |
32 | |
33 #include "mm7_data.h" | |
34 | |
1268 | 35 typedef struct _RGBColor |
36 { | |
37 unsigned char R; | |
38 unsigned char B; | |
39 unsigned char G; | |
40 }RGBColor; | |
0 | 41 |
42 | |
1268 | 43 std::array<RGBColor, 20> spell_tooltip_colors={{ |
44 {0x96, 0xD4, 0xFF}, | |
45 {0xFF, 0x80, 0x00}, | |
46 {0xFF, 0xFF, 0x9B}, | |
47 {0xE1, 0xE1, 0xE1}, | |
48 {0x80, 0x80, 0x80}, | |
49 {0x96, 0xD4, 0xFF}, | |
50 {0xFF, 0x55, 0x00}, | |
51 {0x96, 0xD4, 0xFF}, | |
52 {0xFF, 0x55, 0x00}, | |
53 {0xE1, 0xE1, 0xE1}, | |
54 {0xFF, 0x55, 0x00}, | |
55 {0x96, 0xD4, 0xFF}, | |
56 {0xEB, 0x0F, 0xFF}, | |
57 {0xFF, 0x80, 0x00}, | |
58 {0x96, 0xD4, 0xFF}, | |
59 {0x80, 0x80, 0x80}, | |
60 {0xFF, 0x55, 0x00}, | |
61 {0x00, 0x80, 0xFF}, | |
62 {0x00, 0x80, 0xFF}, | |
63 {0x96, 0xD4, 0xFF}}}; | |
64 | |
0 | 65 |
66 int pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[1]; // idb | |
67 struct GUIWindow *pWindow_MainMenu; | |
1202 | 68 std::array<struct GUIWindow, 20> pWindowList; |
0 | 69 |
70 struct GUIMessageQueue *pMessageQueue_50CBD0 = new GUIMessageQueue; | |
1012 | 71 struct GUIMessageQueue *pMessageQueue_50C9E8 = new GUIMessageQueue; |
0 | 72 |
1038 | 73 |
74 | |
75 | |
76 | |
77 | |
783 | 78 // inlined |
79 //----- (mm6c::00420520) -------------------------------------------------- | |
80 void GUIMessageQueue::Flush() | |
81 { | |
82 if (uNumMessages) | |
83 uNumMessages = pMessages[0].field_8 != 0; | |
84 } | |
85 | |
86 | |
0 | 87 //----- (004356B9) -------------------------------------------------------- |
88 void GUIMessageQueue::PopMessage(enum UIMessageType *pType, int *pParam, int *a4) | |
89 { | |
90 signed int v4; // edx@1 | |
91 GUIMessage *v5; // eax@2 | |
92 | |
93 v4 = 0; | |
94 if ( this->uNumMessages ) | |
95 { | |
96 v5 = this->pMessages; | |
97 *pType = this->pMessages[0].eType; | |
98 *pParam = this->pMessages[0].param; | |
99 *a4 = this->pMessages[0].field_8; | |
100 if ( (signed int)(this->uNumMessages - 1) > 0 ) | |
101 { | |
102 do | |
103 { | |
104 v5->eType = v5[1].eType; | |
105 v5->param = v5[1].param; | |
106 v5->field_8 = v5[1].field_8; | |
107 ++v4; | |
108 ++v5; | |
109 } | |
110 while ( v4 < (signed int)(this->uNumMessages - 1) ); | |
111 } | |
112 --this->uNumMessages; | |
113 } | |
114 } | |
115 | |
116 | |
117 | |
994 | 118 |
119 | |
120 | |
121 //----- (0041B4E1) -------------------------------------------------------- | |
122 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) | |
123 { | |
124 unsigned __int8 v3; // bl@1 | |
125 int result; // eax@1 | |
126 int i; // edx@2 | |
127 GUIButton *j; // ecx@3 | |
128 int k; // edx@7 | |
129 GUIButton *l; // ecx@8 | |
130 unsigned __int8 v9; // [sp+4h] [bp-8h]@1 | |
131 char v10; // [sp+8h] [bp-4h]@1 | |
132 | |
133 v3 = uNewHotkey; | |
134 v10 = toupper(uOldHotkey); | |
135 result = toupper(v3); | |
136 v9 = result; | |
137 if ( bFirstCall ) | |
138 { | |
139 for ( i = uNumVisibleWindows; i >= 0; --i ) | |
140 { | |
141 result = 84 * pVisibleWindowsIdxs[i]; | |
142 for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) | |
143 j->field_28 = 0; | |
144 } | |
145 } | |
146 for ( k = uNumVisibleWindows; k >= 0; --k ) | |
147 { | |
148 result = 84 * pVisibleWindowsIdxs[k]; | |
149 for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) | |
150 { | |
151 LOBYTE(result) = v10; | |
152 if ( l->uHotkey == v10 ) | |
153 { | |
154 if ( !l->field_28 ) | |
155 { | |
156 LOBYTE(result) = v9; | |
157 l->field_28 = 1; | |
158 l->uHotkey = v9; | |
159 } | |
160 } | |
161 } | |
162 } | |
163 return result; | |
164 } | |
165 | |
166 | |
167 | |
168 | |
169 //----- (0041B438) -------------------------------------------------------- | |
170 GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) | |
171 { | |
172 char v1; // al@1 | |
173 int v2; // esi@1 | |
174 char v3; // dl@1 | |
175 GUIWindow *v4; // ecx@2 | |
176 GUIButton *result; // eax@2 | |
177 //int v6; // edx@12 | |
178 | |
179 v1 = toupper(uHotkey); | |
180 v2 = uNumVisibleWindows; | |
181 v3 = v1; | |
1210 | 182 for( v2 = uNumVisibleWindows; v2 >= 0 && pVisibleWindowsIdxs[v2] > 0; v2-- ) |
994 | 183 { |
1210 | 184 v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; |
185 for ( result = v4->pControlsHead; result; result = result->pNext ) | |
186 { | |
187 if ( result->uHotkey == v3 ) | |
188 { | |
189 pMessageQueue_50CBD0->AddMessage(result->msg, result->msg_param, 0); | |
190 return result; | |
191 } | |
192 } | |
193 if ( !v4->uFrameX && !v4->uFrameY && (v4->uFrameWidth == 640 && v4->uFrameHeight == 480) ) | |
194 break; | |
994 | 195 } |
196 return 0; | |
197 } | |
198 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
199 | |
0 | 200 //----- (0041D73D) -------------------------------------------------------- |
1006 | 201 void GUIWindow::_41D73D_draw_buff_tooltip() |
202 { | |
1268 | 203 |
204 __int64 remaing_time; // ST28_8@11 | |
205 unsigned short text_color; | |
206 int Y_pos; // esi@11 | |
207 int string_count; // [sp+20h] [bp-4h]@7 | |
208 | |
209 | |
210 string_count = 0; | |
211 for (int i=0; i<20; ++i) | |
212 if ( pParty->pPartyBuffs[i].uExpireTime > 0i64 ) | |
213 ++string_count; | |
0 | 214 |
1268 | 215 uFrameHeight = pFontArrus->uFontHeight + 72; |
216 uFrameHeight += (string_count - 1) * pFontArrus->uFontHeight; | |
217 uFrameZ = uFrameWidth + uFrameX - 1; | |
218 uFrameW = uFrameY + uFrameHeight - 1; | |
219 DrawMessageBox(0); | |
220 DrawTitleText(pFontArrus, 0, 12, 0, pGlobalTXT_LocalizationStrings[451], 3u); | |
221 if ( !string_count ) | |
222 DrawTitleText(pFontComic, 0, 40, 0, pGlobalTXT_LocalizationStrings[153], 3u); | |
223 | |
224 GetTickCount(); | |
225 string_count = 0; | |
226 for (int i=0; i<20; ++i) | |
0 | 227 { |
1268 | 228 if ( pParty->pPartyBuffs[i].uExpireTime>0i64 )//!!! |
229 { | |
230 remaing_time = pParty->pPartyBuffs[i].uExpireTime- pParty->uTimePlayed;//!!! | |
231 Y_pos = string_count * pFontComic->uFontHeight + 40; | |
232 text_color = TargetColor(spell_tooltip_colors[i].R, spell_tooltip_colors[i].G, spell_tooltip_colors[i].B); | |
233 DrawText(pFontComic, 52, Y_pos, text_color, aSpellNames[i], 0, 0, 0); | |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
234 DrawBuff_remaining_time_string(Y_pos, this, remaing_time, pFontComic); |
1268 | 235 ++string_count; |
236 } | |
0 | 237 } |
238 } | |
239 | |
240 | |
241 //----- (0041D08F) -------------------------------------------------------- | |
1411 | 242 void GUIWindow::_41D08F_set_keyboard_control_group(int num_buttons, int a3, int a4, int a5) |
0 | 243 { |
1411 | 244 if (num_buttons) |
0 | 245 { |
1411 | 246 this->pNumPresenceButton = num_buttons; |
0 | 247 this->field_30 = a3; |
248 this->field_34 = a4; | |
249 this->pCurrentPosActiveItem = a5; | |
250 this->pStartingPosActiveItem = a5; | |
972 | 251 this->receives_keyboard_input = true; |
0 | 252 } |
253 else | |
254 { | |
255 this->pNumPresenceButton = 0; | |
256 this->field_30 = a3; | |
257 this->field_34 = a4; | |
258 this->pCurrentPosActiveItem = 0; | |
259 this->pStartingPosActiveItem = 0; | |
972 | 260 this->receives_keyboard_input = false; |
0 | 261 } |
262 } | |
263 | |
264 | |
265 //----- (0041C26A) -------------------------------------------------------- | |
266 void GUIWindow::Release() | |
267 { | |
961 | 268 //GUIWindow *v1; // esi@1 |
0 | 269 int i; // edi@20 |
961 | 270 //GUIButton *v8; // eax@26 |
271 GUIButton *pNextBtn; // edi@27 | |
272 //int v10; // esi@28 | |
273 //int v11; // ecx@28 | |
0 | 274 int v12; // edx@29 |
275 | |
961 | 276 //v1 = this; |
0 | 277 if ( !this ) |
278 return; | |
696 | 279 |
280 switch( this->eWindowType ) | |
0 | 281 { |
696 | 282 case WINDOW_GreetingNPC: |
283 { | |
1006 | 284 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 285 pCurrentScreen = pMainScreenNum; |
1459 | 286 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); |
696 | 287 break; |
288 } | |
289 case WINDOW_HouseInterior: | |
290 { | |
291 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) | |
292 pDialogueNPCPortraits[i]->Release(); | |
293 uNumDialogueNPCPortraits = 0; | |
294 pTexture_Dialogue_Background->Release(); | |
0 | 295 |
1006 | 296 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
297 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
696 | 298 dword_5C35D4 = 0; |
299 if ( bFlipOnExit ) | |
300 { | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1591
diff
changeset
|
301 pParty->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (stru_5C6E00->uIntegerPi + pParty->sRotationY); |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1639
diff
changeset
|
302 pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY; |
696 | 303 } |
304 pParty->uFlags |= 2u; | |
305 break; | |
306 } | |
307 case WINDOW_Transition: | |
308 { | |
309 pVideoPlayer->Unload(); | |
310 pTexture_outside->Release(); | |
311 pTexture_Dialogue_Background->Release(); | |
1006 | 312 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 313 pCurrentScreen = pMainScreenNum; |
314 break; | |
315 } | |
316 case WINDOW_SpellBook: | |
317 { | |
1402 | 318 OnCloseSpellBookPage(); |
319 OnCloseSpellBook(); | |
696 | 320 break; |
321 } | |
322 case WINDOW_Book: | |
323 { | |
1402 | 324 OnCloseBook(); |
696 | 325 break; |
326 } | |
1402 | 327 case WINDOW_ChangeLocation: |
328 { | |
0 | 329 pTexture_outside->Release(); |
330 pTexture_Dialogue_Background->Release(); | |
1006 | 331 pIcons_LOD->SyncLoadedFilesCount(); |
11 | 332 pCurrentScreen = pMainScreenNum; |
696 | 333 break; |
334 } | |
335 case WINDOW_Dialogue: | |
336 { | |
337 if ( !dword_591084 ) | |
338 pDialogueNPCPortraits[0]->Release(); | |
339 uNumDialogueNPCPortraits = 0; | |
340 pTexture_Dialogue_Background->Release(); | |
341 | |
1006 | 342 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 343 pCurrentScreen = pMainScreenNum; |
344 } | |
345 default: | |
346 { | |
347 break; | |
348 } | |
0 | 349 } |
961 | 350 //v8 = this->pControlsHead; |
351 if ( this->pControlsHead ) | |
0 | 352 { |
353 do | |
354 { | |
961 | 355 pNextBtn = this->pControlsHead->pNext; |
1583 | 356 free(this->pControlsHead); |
961 | 357 this->pControlsHead = pNextBtn; |
0 | 358 } |
961 | 359 while ( pNextBtn ); |
0 | 360 } |
961 | 361 this->pControlsHead = 0; |
362 this->pControlsTail = 0; | |
363 this->uNumControls = 0; | |
364 this->eWindowType = WINDOW_null; | |
365 while ( this->numVisibleWindows < uNumVisibleWindows ) | |
0 | 366 { |
961 | 367 v12 = pVisibleWindowsIdxs[this->numVisibleWindows + 1]; |
368 pVisibleWindowsIdxs[this->numVisibleWindows] = v12; | |
962 | 369 --pWindowList[v12 - 1].numVisibleWindows; |
961 | 370 ++this->numVisibleWindows; |
0 | 371 } |
961 | 372 pVisibleWindowsIdxs[uNumVisibleWindows] = 0; |
373 uNumVisibleWindows = uNumVisibleWindows - 1; | |
0 | 374 } |
375 | |
376 | |
377 | |
378 | |
379 | |
380 | |
381 //----- (0041CD3B) -------------------------------------------------------- | |
382 GUIButton *GUIWindow::GetControl(unsigned int uID) | |
383 { | |
384 GUIButton *result; // eax@1 | |
385 | |
386 result = this->pControlsHead; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
387 for ( uID; uID; --uID ) |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
388 result = result->pNext; |
0 | 389 return result; |
390 } | |
391 | |
392 //----- (00411BFC) -------------------------------------------------------- | |
393 void GUIWindow::InitializeBookView() | |
394 { | |
1453 | 395 char *pString; // eax@12 |
396 int pTextHeight; // eax@12 | |
397 //__int64 page_count; // qax@12 | |
398 unsigned int page_count; // esi@12 | |
0 | 399 unsigned __int16 v18; // ax@38 |
1310 | 400 signed int max_beacons; // [sp+10h] [bp-5Ch]@38 |
1453 | 401 GUIWindow journal_window; // [sp+18h] [bp-54h]@8 |
0 | 402 |
403 pAudioPlayer->StopChannels(-1, -1); | |
404 InitializeBookFonts(); | |
1453 | 405 this->CreateButton(475, 445, 158, 34, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); // Close |
151 | 406 pCurrentScreen = SCREEN_BOOKS; |
1446 | 407 full_num_items_in_book = 0; |
408 books_primary_item_per_page = 0; | |
409 books_page_number = 0; | |
949 | 410 num_achieved_awards = 0; |
1453 | 411 switch (this->par1C) |
412 { | |
413 case WINDOW_LloydsBeacon: | |
414 { | |
688 | 415 byte_506360 = 0; |
948 | 416 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("lb_bordr", TEXTURE_16BIT_PALETTE); |
417 pTexture_LloydBeacons[0] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); | |
1310 | 418 pTexture_LloydBeacons[1] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); |
1453 | 419 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
420 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
948 | 421 |
1453 | 422 pBtn_Book_1 = this->CreateButton(415, 13, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 0, 0, pGlobalTXT_LocalizationStrings[375], 0); // Set Beacon |
423 pBtn_Book_2 = this->CreateButton(415, 48, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 1, 0, pGlobalTXT_LocalizationStrings[523], 0); // Recall Beacon | |
1310 | 424 |
425 max_beacons = 1; | |
1453 | 426 v18 = pParty->pPlayers[_506348_current_lloyd_playerid].pActiveSkills[PLAYER_SKILL_WATER]; |
1310 | 427 if ( v18 & 0x100 || (v18 & 0x80) ) |
428 max_beacons = 5; | |
429 else if ( v18 & 0x40 ) | |
430 max_beacons = 3; | |
431 | |
1453 | 432 for ( int i = 0; i < max_beacons; ++i ) |
1430 | 433 CreateButton(pLloydsBeaconsPreviewXs[i], pLloydsBeaconsPreviewYs[i], |
1310 | 434 92, 68, 1, 180, UIMSG_InstallBeacon, i, 0, "", 0); |
435 | |
1453 | 436 for ( int i = 0; i < 5; ++i ) |
437 { | |
438 if (pParty->pPlayers[_506348_current_lloyd_playerid].pInstalledBeacons[i].uBeaconTime >= (signed __int64)pParty->uTimePlayed) | |
439 LoadThumbnailLloydTexture(i, _506348_current_lloyd_playerid + 1); | |
440 else | |
441 memset(&pParty->pPlayers[_506348_current_lloyd_playerid].pInstalledBeacons[i], 0, sizeof(LloydBeacon)); | |
442 } | |
443 } | |
444 break; | |
710 | 445 |
446 case WINDOW_TownPortal: | |
447 { | |
948 | 448 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("townport", TEXTURE_16BIT_PALETTE); |
710 | 449 pTexture_TownPortalIcons[0] = pIcons_LOD->LoadTexturePtr("tpharmndy", TEXTURE_16BIT_PALETTE); |
450 pTexture_TownPortalIcons[1] = pIcons_LOD->LoadTexturePtr("tpelf", TEXTURE_16BIT_PALETTE); | |
451 pTexture_TownPortalIcons[2] = pIcons_LOD->LoadTexturePtr("tpwarlock", TEXTURE_16BIT_PALETTE); | |
452 pTexture_TownPortalIcons[3] = pIcons_LOD->LoadTexturePtr("tpisland", TEXTURE_16BIT_PALETTE); | |
453 pTexture_TownPortalIcons[4] = pIcons_LOD->LoadTexturePtr("tpheaven", TEXTURE_16BIT_PALETTE); | |
730 | 454 pTexture_TownPortalIcons[5] = pIcons_LOD->LoadTexturePtr("tphell", TEXTURE_16BIT_PALETTE); |
1393 | 455 |
456 static int pTownPortalBook_ws[6] = { 80, 66, 68, 72, 67, 74}; | |
457 static int pTownPortalBook_hs[6] = { 55, 56, 65, 67, 67, 59}; | |
1453 | 458 for ( uint i = 0; i < 6; ++i ) |
459 this->CreateButton(pTownPortalBook_xs[i], pTownPortalBook_ys[i], pTownPortalBook_ws[i], pTownPortalBook_hs[i], 1, 182, UIMSG_ClickTownInTP, i, 0, "", nullptr); | |
1310 | 460 |
710 | 461 } |
462 break; | |
463 | |
464 case WINDOW_QuestBook: | |
948 | 465 { |
466 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("sbquiknot", TEXTURE_16BIT_PALETTE); | |
467 pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr( "divbar", TEXTURE_16BIT_PALETTE); | |
1453 | 468 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
469 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
470 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
471 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
472 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, | |
473 pTex_book_button1_on->uTextureWidth, pTex_book_button1_on->uTextureHeight, | |
996 | 474 1, 0, UIMSG_ClickBooksBtn, 0xBu, 0, pGlobalTXT_LocalizationStrings[192],// "Scroll Up" |
1453 | 475 pTex_book_button1_on, 0); |
476 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, | |
477 pTex_book_button2_on->uTextureHeight, pTex_book_button2_on->uTextureHeight, | |
996 | 478 1, 0, UIMSG_ClickBooksBtn, 0xAu, 0, pGlobalTXT_LocalizationStrings[193],// "Scroll Down" |
1453 | 479 pTex_book_button2_on, 0); |
949 | 480 num_achieved_awards = 0; |
1202 | 481 memset(achieved_awards.data(), 0, 4000); |
1453 | 482 for ( uint i = books_primary_item_per_page; i < 512; ++i ) |
483 { | |
484 if ( _449B57_test_bit(pParty->_quest_bits, i) && pQuestTable[i] ) | |
485 { | |
486 achieved_awards[num_achieved_awards] = (AwardType)i; | |
487 ++num_achieved_awards; | |
488 } | |
489 } | |
490 full_num_items_in_book = num_achieved_awards; | |
949 | 491 num_achieved_awards = 0; |
1453 | 492 } |
493 break; | |
981 | 494 |
1453 | 495 case WINDOW_AutonotesBook: |
496 { | |
948 | 497 pTexture_AutonotesBook = pIcons_LOD->LoadTexturePtr("sbautnot", TEXTURE_16BIT_PALETTE); |
498 pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr("divbar", TEXTURE_16BIT_PALETTE); | |
1453 | 499 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
500 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
501 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
502 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
503 pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tab-an-1b", TEXTURE_16BIT_PALETTE); | |
504 pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tab-an-1a", TEXTURE_16BIT_PALETTE); | |
505 pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tab-an-2b", TEXTURE_16BIT_PALETTE); | |
506 pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tab-an-2a", TEXTURE_16BIT_PALETTE); | |
507 pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tab-an-3b", TEXTURE_16BIT_PALETTE); | |
508 pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tab-an-3a", TEXTURE_16BIT_PALETTE); | |
509 pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tab-an-5b", TEXTURE_16BIT_PALETTE); | |
510 pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tab-an-5a", TEXTURE_16BIT_PALETTE); | |
511 pTex_book_button7_on = pIcons_LOD->LoadTexturePtr("tab-an-4b", TEXTURE_16BIT_PALETTE); | |
512 pTex_book_button7_off = pIcons_LOD->LoadTexturePtr("tab-an-4a", TEXTURE_16BIT_PALETTE); | |
513 pTex_book_button8_on = pIcons_LOD->LoadTexturePtr("tab-an-8b", TEXTURE_16BIT_PALETTE); | |
514 pTex_book_button8_off = pIcons_LOD->LoadTexturePtr("tab-an-8a", TEXTURE_16BIT_PALETTE); | |
948 | 515 |
1453 | 516 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, |
517 UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[193], pTex_book_button1_on, 0); | |
518 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, | |
519 UIMSG_ClickBooksBtn, 10, 0, pGlobalTXT_LocalizationStrings[192], pTex_book_button2_on, 0); | |
520 pBtn_Book_3 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, | |
521 UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[85], pTex_book_button3_on, 0); // "Potion Notes" | |
522 pBtn_Book_4 = this->CreateButton(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, | |
523 UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[137], pTex_book_button4_on, 0); // "Fountain Notes" | |
524 pBtn_Book_5 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, | |
525 UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[8], pTex_book_button5_on, 0); // "Obelisk Notes" | |
526 pBtn_Book_6 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, | |
527 UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[141], pTex_book_button6_on, 0); // "Seer Notes" | |
528 pBtn_Autonotes_Misc = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, 50, 34, 1, 0, | |
529 UIMSG_ClickBooksBtn, 6, 0, pGlobalTXT_LocalizationStrings[123], pTex_book_button7_on, 0); // "Miscellaneous Notes" | |
530 pBtn_Autonotes_Instructors = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, 50, 34, 1, 0, | |
531 UIMSG_ClickBooksBtn, 7, 0, pGlobalTXT_LocalizationStrings[662], pTex_book_button8_on, 0); // "Instructors" | |
948 | 532 |
949 | 533 num_achieved_awards = 0; |
1453 | 534 for ( uint i = books_primary_item_per_page; i < 196; ++i ) |
535 { | |
536 if ( _506568_autonote_type == pAutonoteTxt[i].eType)//dword_72371C[2 * v10] ) | |
537 { | |
538 if ( i ) | |
539 { | |
540 if ( _449B57_test_bit(pParty->_autonote_bits, i) && pAutonoteTxt[i].pText ) | |
541 { | |
542 achieved_awards[num_achieved_awards] = (AwardType)i; | |
543 ++num_achieved_awards; | |
544 } | |
545 } | |
546 } | |
547 } | |
548 full_num_items_in_book = num_achieved_awards; | |
549 num_achieved_awards = 0; | |
550 } | |
551 break; | |
1310 | 552 |
1453 | 553 case WINDOW_MapsBook: |
554 { | |
688 | 555 dword_506364 = 1; |
948 | 556 pSpellBookPagesTextr_12 = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); |
1453 | 557 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("zoom-on", TEXTURE_16BIT_PALETTE); |
558 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("zoot-on", TEXTURE_16BIT_PALETTE); | |
559 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("zoom-off", TEXTURE_16BIT_PALETTE); | |
560 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("zoot-off", TEXTURE_16BIT_PALETTE); | |
561 pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tabNon", TEXTURE_16BIT_PALETTE); | |
562 pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tabNoff", TEXTURE_16BIT_PALETTE); | |
563 pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tabSon", TEXTURE_16BIT_PALETTE); | |
564 pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tabSoff", TEXTURE_16BIT_PALETTE); | |
565 pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tabEon", TEXTURE_16BIT_PALETTE); | |
566 pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tabEoff", TEXTURE_16BIT_PALETTE); | |
567 pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tabWon", TEXTURE_16BIT_PALETTE); | |
568 pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tabWoff", TEXTURE_16BIT_PALETTE); | |
948 | 569 |
1453 | 570 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, |
571 UIMSG_ClickBooksBtn, 0, 0, pGlobalTXT_LocalizationStrings[251], pTex_book_button1_on, 0);// "Zoom In" | |
572 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, | |
573 UIMSG_ClickBooksBtn, 1, 0, pGlobalTXT_LocalizationStrings[252], pTex_book_button2_on, 0);// "Zoom Out" | |
574 pBtn_Book_3 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, | |
1310 | 575 UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[192], (Texture *)"", 0);// Scroll Up |
1453 | 576 pBtn_Book_4 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, |
1310 | 577 UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[193], (Texture *)"", 0);// Scroll Down |
1453 | 578 pBtn_Book_5 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, |
1310 | 579 UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[573], (Texture *)"", 0);// "Scroll Right" |
1453 | 580 pBtn_Book_6 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, |
1310 | 581 UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[572], (Texture *)"", 0);// "Scroll Left" |
1453 | 582 } |
583 break; | |
948 | 584 |
1453 | 585 case WINDOW_CalendarBook: |
586 { | |
948 | 587 pSpellBookPagesTextr_13 = pIcons_LOD->LoadTexturePtr("sbdate-time", TEXTURE_16BIT_PALETTE); |
588 pTex_moon_new = pIcons_LOD->LoadTexturePtr("moon_new", TEXTURE_16BIT_PALETTE); | |
589 pTex_moon_4 = pIcons_LOD->LoadTexturePtr("moon_4", TEXTURE_16BIT_PALETTE); | |
590 pTex_moon_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); | |
591 pTex_moon_2_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); | |
592 pTex_moon_ful = pIcons_LOD->LoadTexturePtr("moon_ful", TEXTURE_16BIT_PALETTE); | |
1453 | 593 } |
594 break; | |
948 | 595 |
1453 | 596 case WINDOW_JournalBook: |
597 { | |
948 | 598 pSpellBookPagesTextr_11 = pIcons_LOD->LoadTexturePtr("sbplayrnot", TEXTURE_16BIT_PALETTE); |
1453 | 599 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
600 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
601 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
602 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
948 | 603 |
1453 | 604 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, |
605 pTex_book_button1_on->uTextureWidth, pTex_book_button1_on->uTextureHeight, 1, 0, | |
606 UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[192], pTex_book_button1_on, 0); | |
607 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on->uTextureHeight, | |
608 pTex_book_button2_on->uTextureHeight, 1, 0, UIMSG_ClickBooksBtn, 10, 0, | |
609 pGlobalTXT_LocalizationStrings[193], pTex_book_button2_on, 0); | |
948 | 610 |
949 | 611 num_achieved_awards = 0; |
1453 | 612 journal_window.uFrameX = 48; |
613 journal_window.uFrameY = 70; | |
614 journal_window.uFrameWidth = 360; | |
615 journal_window.uFrameHeight = 264; | |
616 journal_window.uFrameZ = 407; | |
617 journal_window.uFrameHeight = (LOBYTE(pAutonoteFont->uFontHeight) - 3) * 264 / LOBYTE(pAutonoteFont->uFontHeight) - 3; | |
618 journal_window.uFrameW = journal_window.uFrameHeight + 69; | |
949 | 619 memset(&achieved_awards, 0, 4000); |
1453 | 620 memset(Journal_limitation_factor.data(), 0, 100); |
1446 | 621 if ( books_primary_item_per_page < 29 ) |
1453 | 622 { |
623 for ( int i = books_primary_item_per_page; i < books_primary_item_per_page + 31; i++ ) | |
624 { | |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1709
diff
changeset
|
625 if ( pParty->PartyTimes.HistoryEventTimes[i] > 0 ) |
688 | 626 { |
1453 | 627 if ( pStorylineText->StoreLine[i + 1].pText ) |
628 { | |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1709
diff
changeset
|
629 pString = BuildDialogueString(pStorylineText->StoreLine[i + 1].pText, uActiveCharacter - 1, 0, 0, 0, &pParty->PartyTimes.HistoryEventTimes[i]); |
1453 | 630 pTextHeight = pAutonoteFont->CalcTextHeight(pString, &journal_window, 1, 0); |
631 page_count = ((pTextHeight - (pAutonoteFont->uFontHeight - 3)) / (signed int)journal_window.uFrameHeight) + 1; | |
632 memset32((char *)&achieved_awards[num_achieved_awards] , i + 1, page_count); | |
633 for ( uint j = 0; j <= page_count - 1; ++j ) | |
634 Journal_limitation_factor[num_achieved_awards++] = j; | |
635 } | |
688 | 636 } |
1453 | 637 } |
688 | 638 } |
1453 | 639 full_num_items_in_book = num_achieved_awards; |
640 num_achieved_awards = 0; | |
641 } | |
642 break; | |
643 } | |
0 | 644 } |
645 | |
646 //----- (00415551) -------------------------------------------------------- | |
647 void GUIWindow::DrawMessageBox(int arg0) | |
648 { | |
649 unsigned int v2; // edi@1 | |
650 GUIWindow *v3; // ebx@1 | |
651 signed int v4; // esi@2 | |
652 unsigned int v5; // eax@2 | |
653 unsigned int v6; // edx@4 | |
654 unsigned int v7; // ecx@6 | |
655 unsigned int v8; // eax@9 | |
656 __int32 v9; // eax@10 | |
657 unsigned int v10; // eax@18 | |
658 LONG v11; // ecx@18 | |
659 unsigned int v12; // edx@18 | |
660 unsigned int v13; // eax@18 | |
661 const char *v14; // ecx@18 | |
662 int v15; // eax@19 | |
663 unsigned int v16; // esi@19 | |
664 const char *v17; // ebx@25 | |
665 int v18; // eax@26 | |
666 GUIWindow v19; // [sp+Ch] [bp-60h]@18 | |
667 POINT a2; // [sp+60h] [bp-Ch]@8 | |
668 unsigned int v21; // [sp+68h] [bp-4h]@18 | |
669 unsigned int v22; // [sp+74h] [bp+8h]@2 | |
670 unsigned int v23; // [sp+74h] [bp+8h]@18 | |
671 | |
672 v2 = 0; | |
673 v3 = this; | |
674 if ( arg0 ) | |
675 { | |
693 | 676 v4 = pViewport->uViewportTL_X; |
677 v5 = pViewport->uViewportBR_X; | |
678 v2 = pViewport->uViewportTL_Y; | |
679 v22 = pViewport->uViewportBR_Y; | |
0 | 680 } |
681 else | |
682 { | |
683 v4 = 0; | |
684 v5 = 640; | |
685 v22 = 480; | |
686 } | |
687 v6 = this->uFrameX; | |
688 if ( (signed int)this->uFrameX >= v4 ) | |
689 { | |
690 v7 = this->uFrameWidth; | |
691 if ( (signed int)(v7 + v6) <= (signed int)v5 ) | |
692 goto LABEL_9; | |
693 v3->uFrameX = v5 - v7; | |
694 } | |
695 else | |
696 { | |
697 this->uFrameX = v4; | |
698 } | |
699 v3->uFrameY = pMouse->GetCursorPos(&a2)->y + 30; | |
700 LABEL_9: | |
701 v8 = v3->uFrameY; | |
702 if ( (signed int)v8 >= (signed int)v2 ) | |
703 { | |
704 if ( (signed int)(v8 + v3->uFrameHeight) <= (signed int)v22 ) | |
705 goto LABEL_14; | |
706 v9 = pMouse->GetCursorPos(&a2)->y - v3->uFrameHeight - 30; | |
707 } | |
708 else | |
709 { | |
710 v9 = pMouse->GetCursorPos(&a2)->y + 30; | |
711 } | |
712 v3->uFrameY = v9; | |
713 LABEL_14: | |
714 if ( (signed int)v3->uFrameY < (signed int)v2 ) | |
715 v3->uFrameY = v2; | |
716 if ( (signed int)v3->uFrameX < v4 ) | |
717 v3->uFrameX = v4; | |
718 v10 = v3->uFrameWidth; | |
719 v11 = v3->uFrameX; | |
720 v12 = v3->uFrameY; | |
721 v21 = v10; | |
722 a2.y = v11; | |
723 v3->uFrameZ = v10 + v11 - 1; | |
724 v13 = v3->uFrameHeight; | |
725 v3->uFrameW = v13 + v12 - 1; | |
726 memcpy(&v19, v3, sizeof(v19)); | |
727 v19.uFrameX += 12; | |
728 v19.uFrameWidth -= 24; | |
729 v19.uFrameY += 12; | |
730 v19.uFrameHeight -= 12; | |
731 v19.uFrameZ = v19.uFrameWidth + v19.uFrameX - 1; | |
732 v23 = v12; | |
733 v19.uFrameW = v19.uFrameHeight + v19.uFrameY - 1; | |
734 v14 = v3->Hint; | |
735 if ( v14 ) | |
736 { | |
737 v15 = pFontLucida->CalcTextHeight(v14, &v19, 0, 0); | |
738 v12 = v23; | |
739 v16 = v15 + 24; | |
740 } | |
741 else | |
742 { | |
743 v16 = v13; | |
744 } | |
745 if ( (signed int)v16 < 64 ) | |
746 v16 = 64; | |
747 if ( (signed int)(v16 + v12) > 479 ) | |
748 v16 = 479 - v12; | |
749 DrawPopupWindow(a2.y, v12, v21, v16); | |
750 v17 = v3->Hint; | |
751 if ( v17 ) | |
752 { | |
753 v18 = pFontLucida->CalcTextHeight(v17, &v19, 0, 0); | |
1004 | 754 v19.DrawTitleText(pFontLucida, 0, (signed int)(v16 - v18) / 2 - 14, 0, v17, 3); |
0 | 755 } |
756 } | |
757 | |
758 | |
759 | |
760 | |
761 //----- (00411B59) -------------------------------------------------------- | |
762 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer) | |
763 { | |
764 unsigned int v2; // esi@1 | |
765 unsigned int v3; // edi@1 | |
766 FILE *v4; // ebx@1 | |
767 FILE *v5; // eax@2 | |
768 char pContainerName[64]; // [sp+Ch] [bp-44h]@1 | |
769 unsigned int v7; // [sp+4Ch] [bp-4h]@1 | |
770 | |
771 v2 = uSlot; | |
772 v7 = uPlayer; | |
773 v3 = uSlot + 1; | |
774 sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); | |
775 v4 = fopen(pContainerName, "rb"); | |
776 if ( v4 ) | |
777 { | |
778 pSavegameThumbnails[v2].LoadFromFILE(v4, 0, 1u); | |
779 fclose(v4); | |
780 } | |
781 else | |
782 { | |
783 sprintf(pContainerName, "lloyd%d%d.pcx", v7, v3); | |
784 v5 = pNew_LOD->FindContainer(pContainerName, 1); | |
785 if ( v5 ) | |
786 pSavegameThumbnails[v2].LoadFromFILE(v5, 0, 0); | |
787 else | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
788 *((int *)&pSavegameThumbnails.data()->pPixels + 10 * v2) = 0; |
0 | 789 } |
790 } | |
791 | |
792 | |
793 //----- (00411621) -------------------------------------------------------- | |
198 | 794 void GUIWindow::OpenSpellBook() |
0 | 795 { |
11 | 796 Player *pPlayer; // edi@1 |
198 | 797 //GUIWindow *pWindow; // esi@1 |
798 //unsigned int v3; // ebp@1 | |
0 | 799 int v4; // eax@3 |
198 | 800 ///GUIButton *result; // eax@25 |
0 | 801 int a2; // [sp+10h] [bp-8h]@1 |
198 | 802 //int v7; // [sp+14h] [bp-4h]@1 |
0 | 803 |
11 | 804 pPlayer = pPlayers[uActiveCharacter]; |
198 | 805 //pWindow = this; |
806 LoadSpellbook(pPlayer->lastOpenedSpellbookPage); | |
807 //v3 = 0; | |
0 | 808 a2 = 0; |
198 | 809 |
810 auto chapter = &pPlayer->spellbook.pChapters[pPlayer->lastOpenedSpellbookPage]; | |
811 for (uint i = 0; i < 11; ++i) | |
0 | 812 { |
198 | 813 if (!chapter->bIsSpellAvailable[i]) |
814 continue; | |
363 | 815 v4= pPlayer->lastOpenedSpellbookPage; |
816 //v4 = (12 * pPlayer->lastOpenedSpellbookPage + pSpellbookSpellIndices[pPlayer->lastOpenedSpellbookPage][i + 1]); | |
693 | 817 CreateButton(pViewport->uViewportTL_X + pIconPos[v4][pSpellbookSpellIndices[v4][i+1]].Xpos, |
818 pViewport->uViewportTL_Y + pIconPos[v4][pSpellbookSpellIndices[v4][i+1]].Ypos, //dword_4E20D0 | |
1402 | 819 SBPageSSpellsTextureList[i + 1]->uTextureWidth, |
820 SBPageSSpellsTextureList[i + 1]->uTextureHeight, | |
832 | 821 1, 79, UIMSG_SelectSpell, i, 0, "", 0); |
0 | 822 ++a2; |
198 | 823 //++v3; |
0 | 824 } |
198 | 825 //while ( (signed int)v3 < 11 ); |
826 | |
1118 | 827 CreateButton(0, 0, 0, 0, 1, 0, UIMSG_SpellBook_PressTab, 0, '\t', "", 0); |
0 | 828 if ( a2 ) |
972 | 829 _41D08F_set_keyboard_control_group(a2, 0, 0, 0); |
948 | 830 |
831 if (pPlayer->pActiveSkills[PLAYER_SKILL_FIRE]) CreateButton(399, 10, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 0, 0, aSpellSchoolNames[0], 0); | |
832 if (pPlayer->pActiveSkills[PLAYER_SKILL_AIR]) CreateButton(399, 46, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 1, 0, aSpellSchoolNames[1], 0); | |
833 if (pPlayer->pActiveSkills[PLAYER_SKILL_WATER]) CreateButton(399, 83, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 2, 0, aSpellSchoolNames[2], 0); | |
834 if (pPlayer->pActiveSkills[PLAYER_SKILL_EARTH]) CreateButton(399, 121, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 3, 0, aSpellSchoolNames[3], 0); | |
835 if (pPlayer->pActiveSkills[PLAYER_SKILL_SPIRIT]) CreateButton(399, 158, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 4, 0, aSpellSchoolNames[4], 0); | |
836 if (pPlayer->pActiveSkills[PLAYER_SKILL_MIND]) CreateButton(400, 196, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 5, 0, aSpellSchoolNames[5], 0); | |
837 if (pPlayer->pActiveSkills[PLAYER_SKILL_BODY]) CreateButton(400, 234, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 6, 0, aSpellSchoolNames[6], 0); | |
838 if (pPlayer->pActiveSkills[PLAYER_SKILL_LIGHT]) CreateButton(400, 271, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 7, 0, aSpellSchoolNames[7], 0); | |
839 if (pPlayer->pActiveSkills[PLAYER_SKILL_DARK]) CreateButton(400, 307, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 8, 0, aSpellSchoolNames[8], 0); | |
840 | |
1402 | 841 CreateButton(476, 450, pSBClickQuickSpellBtnTextr->uTextureWidth, pSBClickQuickSpellBtnTextr->uTextureHeight, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", 0); |
842 pBtn_InstallRemoveSpell = CreateButton(476, 450, 48, 32, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", pSBClickQuickSpellBtnTextr, 0); | |
843 CreateButton(561, 450, pSpellBookClickCloseBtnTextr->uTextureWidth, pSpellBookClickCloseBtnTextr->uTextureHeight, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); | |
844 pBtn_CloseBook = CreateButton(561, 450, 48, 32, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], pSpellBookClickCloseBtnTextr, 0); | |
0 | 845 } |
846 // 50640C: using guessed type int dword_50640C[]; | |
847 | |
848 //----- (004B3157) -------------------------------------------------------- | |
405 | 849 void GUIWindow::HouseDialogManager() |
0 | 850 { |
854 | 851 unsigned __int16 pWhiteColor; // di@2 |
852 const char *pHouseName; // edx@4 | |
0 | 853 signed int v3; // edx@5 |
854 char *v4; // edi@9 | |
854 | 855 int pTextHeight; // eax@45 |
0 | 856 int v6; // edi@45 |
857 char *v7; // eax@45 | |
858 int v8; // edi@46 | |
859 int v9; // eax@50 | |
860 unsigned int v10; // [sp-10h] [bp-C8h]@53 | |
873 | 861 char *pTitleText; // [sp-8h] [bp-C0h]@50 |
854 | 862 GUIWindow pDialogWindow; // [sp+Ch] [bp-ACh]@4 |
863 GUIWindow pWindow; // [sp+60h] [bp-58h]@2 | |
864 int pColor2; // [sp+B4h] [bp-4h]@2 | |
0 | 865 |
336 | 866 if ( !window_SpeakInHouse ) |
0 | 867 return; |
854 | 868 memcpy(&pWindow, this, sizeof(pWindow)); |
869 pWindow.uFrameWidth -= 18; | |
870 pWindow.uFrameZ -= 18; | |
949 | 871 pWhiteColor = TargetColor(0xFFu, 0xFFu, 0xFFu); |
872 pColor2 = TargetColor(0x15u, 0x99u, 0xE9u); | |
0 | 873 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); |
910 | 874 pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]); |
457 | 875 if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic ) |
0 | 876 { |
854 | 877 pDialogWindow.uFrameWidth = 130; |
878 pDialogWindow.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight); | |
879 pHouseName = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName; | |
880 if ( pHouseName ) | |
0 | 881 { |
854 | 882 v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(pHouseName, &pDialogWindow, 0, 0); |
0 | 883 if ( v3 < 0 ) |
884 v3 = 0; | |
854 | 885 pWindow.DrawTitleText(pFontCreate, 0x1EAu, v3 / 2 + 4, pWhiteColor, |
0 | 886 //(const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C], |
336 | 887 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName, 3); |
0 | 888 } |
889 } | |
854 | 890 pWindow.uFrameWidth += 8; |
891 pWindow.uFrameZ += 8; | |
457 | 892 if ( !pDialogueNPCCount ) |
0 | 893 { |
1411 | 894 if ( in_current_building_type == BuildingType_Jail ) |
0 | 895 { |
480 | 896 JailDialog(); |
854 | 897 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
898 { | |
899 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
900 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
901 } | |
902 else | |
903 { | |
904 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
905 } | |
906 return; | |
0 | 907 } |
827 | 908 if ( current_npc_text ) |
0 | 909 { |
854 | 910 pDialogWindow.uFrameWidth = 458; |
911 pDialogWindow.uFrameZ = 457; | |
912 pTextHeight = pFontArrus->CalcTextHeight(current_npc_text, &pDialogWindow, 13, 0); | |
913 v6 = pTextHeight + 7; | |
1496 | 914 pRenderer->GetLeather(8, 352 - (pTextHeight + 7), &pIcons_LOD->pTextures[uTextureID_Leather], |
854 | 915 pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - (pTextHeight + 7)); |
916 pRenderer->DrawTextureIndexed(8, 347 - v6, pTexture_591428); | |
917 v7 = FitTextInAWindow(current_npc_text, pFontArrus, &pDialogWindow, 0xDu, 0); | |
336 | 918 window_SpeakInHouse->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0); |
0 | 919 } |
920 if ( uNumDialogueNPCPortraits <= 0 ) | |
854 | 921 { |
922 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
923 { | |
924 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
925 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
926 } | |
927 else | |
928 { | |
929 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
930 } | |
931 return; | |
932 } | |
873 | 933 for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 ) |
0 | 934 { |
419 | 935 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4, |
874 | 936 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
419 | 937 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8], |
938 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]); | |
0 | 939 if ( uNumDialogueNPCPortraits < 4 ) |
854 | 940 { |
873 | 941 if ( v8 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
854 | 942 { |
873 | 943 pTitleText = pMapStats->pInfos[uHouse_ExitPic].pName; |
944 v9 = 94 * v8 + 113; | |
854 | 945 } |
946 else | |
947 { | |
873 | 948 if ( !v8 && dword_591080 ) |
949 { | |
950 pTitleText = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle; | |
951 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3); | |
952 continue; | |
953 } | |
1211 | 954 pTitleText = HouseNPCData[v8 +1 - (dword_591080 != 0)]->pName; |
955 v9 = pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; | |
854 | 956 } |
873 | 957 v10 = v9; |
1211 | 958 pWindow.DrawTitleText(pFontCreate, 483, v10, pColor2, pTitleText, 3); |
854 | 959 } |
874 | 960 } |
873 | 961 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
0 | 962 { |
873 | 963 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
964 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
0 | 965 } |
873 | 966 else |
967 { | |
968 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
969 } | |
970 return; | |
0 | 971 } |
457 | 972 v4 = (char *)pDialogueNPCCount - 1; |
419 | 973 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
974 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]); | |
151 | 975 if ( pCurrentScreen == SCREEN_E ) |
0 | 976 { |
984 | 977 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
854 | 978 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
979 { | |
980 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
981 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
982 } | |
983 else | |
984 { | |
985 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
986 } | |
987 return; | |
0 | 988 } |
1634 | 989 if ( v4 || !dword_591080 )//íà èçóìðóäíîì îñòðîâå çàõîäèò íà êîðàáëå ïîêà íå âûïîëíåíû êâåñòû |
0 | 990 { |
1634 | 991 SimpleHouseDialog(); |
0 | 992 } |
993 else | |
994 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
995 sprintfex( pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], |
336 | 996 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName, |
997 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
998 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, pColor2, pTmpBuf.data(), 3); |
484 | 999 switch ( in_current_building_type ) |
0 | 1000 { |
1411 | 1001 case BuildingType_WeaponShop: |
405 | 1002 WeaponShopDialog(); |
0 | 1003 break; |
1411 | 1004 case BuildingType_ArmorShop: |
405 | 1005 ArmorShopDialog(); |
0 | 1006 break; |
1411 | 1007 case BuildingType_MagicShop: |
405 | 1008 MagicShopDialog(); |
0 | 1009 break; |
1411 | 1010 case BuildingType_AlchemistShop: |
405 | 1011 AlchemistDialog(); |
0 | 1012 break; |
1411 | 1013 case BuildingType_FireGuild: |
1014 case BuildingType_AirGuild: | |
1015 case BuildingType_WaterGuild: | |
1016 case BuildingType_EarthGuild: | |
1017 case BuildingType_SpiritGuild: | |
1018 case BuildingType_MindGuild: | |
1019 case BuildingType_BodyGuild: | |
1020 case BuildingType_LightGuild: | |
1021 case BuildingType_DarkGuild: | |
480 | 1022 GuildDialog(); |
1023 break; | |
1411 | 1024 case BuildingType_18: |
987 | 1025 __debugbreak(); //What over the dialog? |
480 | 1026 sub_4B6478(); |
1027 break; | |
1411 | 1028 case BuildingType_TownHall: |
480 | 1029 TownHallDialog(); |
1030 break; | |
1411 | 1031 case BuildingType_Tavern: |
480 | 1032 TavernDialog(); |
1033 break; | |
1411 | 1034 case BuildingType_Bank: |
480 | 1035 BankDialog(); |
1036 break; | |
1411 | 1037 case BuildingType_Temple: |
495 | 1038 TempleDialog(); |
480 | 1039 break; |
1411 | 1040 case BuildingType_Stables: |
1591 | 1041 case BuildingType_Boats: |
480 | 1042 TravelByTransport(); |
1043 break; | |
1411 | 1044 case BuildingType_Training: |
480 | 1045 TrainingDialog(); |
1046 break; | |
1411 | 1047 case BuildingType_Jail: |
480 | 1048 JailDialog(); |
1049 break; | |
0 | 1050 default: |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
1051 //__debugbreak();//New BuildingType (if enter Boat) |
0 | 1052 break; |
1053 } | |
1054 } | |
457 | 1055 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
0 | 1056 { |
370 | 1057 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
1058 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
0 | 1059 } |
1060 else | |
1061 { | |
526 | 1062 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); |
0 | 1063 } |
1064 } | |
1065 | |
1066 //----- (004B1854) -------------------------------------------------------- | |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1067 void GUIWindow::DrawShops_next_generation_time_string( __int64 next_generation_time ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1068 { |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1069 unsigned int full_time; // esi@1 |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1070 signed __int64 hours; // kr00_8@1 |
1838 | 1071 const char *text; // eax@2 |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1072 signed __int64 minutes; // [sp+Ch] [bp-10h]@1 |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1073 signed __int64 seconds; // [sp+14h] [bp-8h]@1 |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1074 unsigned int days; // [sp+20h] [bp+4h]@1 |
0 | 1075 |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1076 full_time = (signed __int64)((double)next_generation_time * 0.234375); |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1077 seconds = (signed __int64)full_time % 60; |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1078 minutes = (signed __int64)(full_time / 60) % 60; |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1079 hours = ((full_time / 60) / 60) % 24; |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1080 days = (unsigned int)((full_time / 60) / 60) / 24; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1081 strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[532]); |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1082 if ( days ) |
0 | 1083 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1084 text = pGlobalTXT_LocalizationStrings[57];//Days |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1085 if ( days <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1086 text = pGlobalTXT_LocalizationStrings[56];//Day |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1087 sprintfex(pTmpBuf2.data(), "%d %s ", days, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1088 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1089 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1090 if ( hours ) |
0 | 1091 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1092 if ( hours <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1093 text = pGlobalTXT_LocalizationStrings[109];//Hour |
0 | 1094 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1095 text = pGlobalTXT_LocalizationStrings[110];//Hours |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1096 sprintfex(pTmpBuf2.data(), "%d %s ", (int)hours, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1097 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1098 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1099 if ( minutes && !days ) |
0 | 1100 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1101 if ( minutes <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1102 text = pGlobalTXT_LocalizationStrings[437];//"Minute" |
0 | 1103 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1104 text = pGlobalTXT_LocalizationStrings[436]; //"Minutes" |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1105 sprintfex(pTmpBuf2.data(), "%d %s ", (int)minutes, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1106 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1107 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1108 if ( seconds && !hours ) |
0 | 1109 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1110 if ( seconds <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1111 text = pGlobalTXT_LocalizationStrings[439]; //"Second" |
0 | 1112 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1113 text = pGlobalTXT_LocalizationStrings[438]; //"Seconds" |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1114 sprintfex(pTmpBuf2.data(), "%d %s ", (int)seconds, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1115 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1116 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1117 this->DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), this, 0, 0)) / 2 + 101, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
0 | 1118 } |
1119 | |
1120 | |
1121 | |
1122 //----- (0044D406) -------------------------------------------------------- | |
1268 | 1123 void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, |
1124 const char *pInString, unsigned int uLineSpacing ) | |
762 | 1125 { |
0 | 1126 GUIWindow *pWindow; // esi@1 |
1127 unsigned int v8; // ebx@1 | |
1128 char *v9; // eax@1 | |
1129 unsigned int v11; // edi@1 | |
1130 signed int v12; // esi@1 | |
1131 int v13; // eax@2 | |
1132 GUIFont *pFont; // [sp+Ch] [bp-4h]@1 | |
1133 const char *Stra; // [sp+24h] [bp+14h]@5 | |
1134 | |
1135 pWindow = this; | |
1136 pFont = a2; | |
1137 v8 = this->uFrameWidth - uHorizontalMargin; | |
1138 ui_current_text_color = uDefaultColor; | |
1139 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0); | |
762 | 1140 Stra = strtok(v9, "\n"); |
0 | 1141 v11 = uHorizontalMargin + pWindow->uFrameX; |
1142 v12 = uVerticalMargin + pWindow->uFrameY; | |
1143 while ( 1 ) | |
1144 { | |
762 | 1145 if ( !Stra ) |
0 | 1146 break; |
762 | 1147 v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1; |
0 | 1148 if ( v13 < 0 ) |
1149 v13 = 0; | |
1150 pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, 640); | |
49 | 1151 v12 += pFont->uFontHeight - uLineSpacing; |
762 | 1152 Stra = strtok(0, "\n"); |
0 | 1153 } |
1154 } | |
1155 // 5C6DB4: using guessed type int ui_current_text_color; | |
1156 | |
1157 | |
1158 | |
1159 //----- (0044CE08) -------------------------------------------------------- | |
1006 | 1160 void GUIWindow::DrawText( GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor ) |
1161 { | |
0 | 1162 GUIWindow *v9; // edi@1 |
1163 GUIFont *v10; // ebx@1 | |
1164 int v11; // eax@2 | |
1165 signed int v12; // esi@9 | |
1166 signed int v13; // edi@9 | |
1167 int v14; // edx@9 | |
1168 int v15; // eax@25 | |
1169 unsigned int v16; // ecx@25 | |
1170 int v17; // eax@27 | |
1171 int v18; // edi@32 | |
1172 int v19; // esi@38 | |
1173 std::string v21; // [sp-18h] [bp-50h]@2 | |
1174 const char *v22; // [sp-8h] [bp-40h]@2 | |
1175 int v23; // [sp-4h] [bp-3Ch]@2 | |
1176 char Dest[6]; // [sp+Ch] [bp-2Ch]@32 | |
1177 //char v25; // [sp+Fh] [bp-29h]@32 | |
1178 //char v26; // [sp+11h] [bp-27h]@34 | |
1179 const char *v27; // [sp+20h] [bp-18h]@25 | |
1180 int v28; // [sp+24h] [bp-14h]@25 | |
1181 int v29; // [sp+28h] [bp-10h]@1 | |
1182 size_t v30; // [sp+2Ch] [bp-Ch]@4 | |
1183 GUIWindow *v31; // [sp+30h] [bp-8h]@1 | |
1184 const char *v32; // [sp+34h] [bp-4h]@7 | |
1185 size_t pInString; // [sp+4Ch] [bp+14h]@11 | |
1186 | |
1187 auto a1 = this; | |
1188 v29 = 0; | |
1189 v9 = a1; | |
1190 v10 = a2; | |
1191 v31 = a1; | |
1192 if ( !Str ) | |
1193 { | |
1194 MessageBoxW(nullptr, L"Invalid string passed!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:859", 0); | |
1006 | 1195 return; |
0 | 1196 } |
1197 v11 = strcmp(Str, "null"); | |
1198 if ( v11 ) | |
1199 { | |
1200 v30 = strlen(Str); | |
1201 LOBYTE(v11) = 0; | |
1202 if ( !uX ) | |
1203 uX = 12; | |
1204 if ( a8 ) | |
1205 { | |
1206 v32 = Str; | |
1207 } | |
1208 else | |
1209 { | |
1210 v11 = (int)FitTextInAWindow(Str, v10, v9, uX, 0); | |
1211 v32 = (const char *)v11; | |
1212 } | |
1213 v12 = uX + v9->uFrameX; | |
1214 v13 = uY + v9->uFrameY; | |
1215 v14 = 0; | |
1216 if ( !a8 || (v11 = v13 + LOBYTE(v10->uFontHeight), v11 <= a8) ) | |
1217 { | |
1218 pInString = 0; | |
1219 if ( (signed int)v30 > 0 ) | |
1220 { | |
1221 do | |
1222 { | |
1223 LOBYTE(v11) = v32[v14]; | |
1224 if ( (unsigned __int8)v11 >= v10->cFirstChar && (unsigned __int8)v11 <= v10->cLastChar | |
1225 || (char)v11 == 12 | |
1226 || (char)v11 == 13 | |
1227 || (char)v11 == 9 | |
1228 || (char)v11 == 10 ) | |
1229 { | |
1230 switch ( (unsigned __int8)v11 ) | |
1231 { | |
1232 case 9u: | |
1233 strncpy(Dest, &v32[v14 + 1], 3u); | |
1234 Dest[3] = 0; | |
1235 pInString += 3; | |
1236 v29 = atoi(Dest); | |
1237 v19 = atoi(Dest); | |
1238 LOBYTE(v11) = (char)v31; | |
1239 v12 = uX + v31->uFrameX + v19; | |
1240 break; | |
1241 case 0xAu: | |
1242 v11 = LOBYTE(v10->uFontHeight); | |
1243 uY = uY + v11 - 3; | |
1244 v13 = uY + v31->uFrameY; | |
1245 v12 = uX + v29 + v31->uFrameX; | |
1246 if ( a8 ) | |
1247 goto LABEL_36; | |
1248 break; | |
1249 case 0xCu: | |
1250 strncpy(Dest, &v32[v14 + 1], 5u); | |
1251 Dest[5] = 0; | |
1252 v11 = atoi(Dest); | |
1253 pInString += 5; | |
1254 uFontColor = v11; | |
1255 break; | |
1256 case 0xDu: | |
1257 strncpy(Dest, &v32[v14 + 1], 3u); | |
1258 Dest[3] = 0; | |
1259 pInString += 3; | |
1260 v18 = atoi(Dest); | |
1261 v11 = v10->GetLineWidth(&v32[pInString]); | |
1262 v12 = v31->uFrameZ - v11 - v18; | |
1263 v13 = uY + v31->uFrameY; | |
1264 if ( a8 ) | |
1265 { | |
1266 v11 = LOBYTE(v10->uFontHeight); | |
1267 LABEL_36: | |
1268 v11 = v11 + v13 - 3; | |
1269 if ( v11 > a8 ) | |
1006 | 1270 return; |
0 | 1271 break; |
1272 } | |
1273 break; | |
1274 default: | |
1275 if ( (char)v11 == 34 && v32[v14 + 1] == 34 ) | |
1276 { | |
1277 ++v14; | |
1278 pInString = v14; | |
1279 } | |
1280 v27 = &v32[v14]; | |
1281 v15 = (unsigned __int8)v32[v14]; | |
1282 v16 = *((int *)&v10->cFirstChar + 3 * v15 + 9); | |
1283 v28 = *((int *)&v10->cFirstChar + 3 * v15 + 9); | |
1284 if ( v14 > 0 ) | |
1285 v12 += v10->pMetrics[v15].uLeftSpacing; | |
1160 | 1286 v17 = (int)((char *)&v10[1] + v10->font_pixels_offset[v15]); |
0 | 1287 if ( (short)uFontColor ) |
1288 pRenderer->DrawText( | |
1289 v12, | |
1290 v13, | |
1291 (unsigned __int8 *)v17, | |
1292 v16, | |
1293 LOBYTE(v10->uFontHeight), | |
1294 v10->pFontPalettes[0], | |
1295 uFontColor, | |
1296 uFontShadowColor); | |
1297 else | |
1298 pRenderer->DrawTextPalette( | |
1299 v12, | |
1300 v13, | |
1268 | 1301 (unsigned char*)v17, |
0 | 1302 v16, |
1303 LOBYTE(v10->uFontHeight), | |
1304 v10->pFontPalettes[0], | |
1305 a7); | |
1306 LOBYTE(v11) = v30; | |
1307 v12 += v28; | |
1308 if ( (signed int)pInString < (signed int)v30 ) | |
1309 { | |
1310 LOBYTE(v11) = 3 * *v27; | |
1311 v12 += v10->pMetrics[(unsigned __int8)*v27].uRightSpacing; | |
1312 } | |
1313 break; | |
1314 } | |
1315 } | |
1316 v14 = pInString++ + 1; | |
1317 } | |
1318 while ( (signed int)pInString < (signed int)v30 ); | |
1319 } | |
1320 } | |
1321 } | |
1006 | 1322 return; |
0 | 1323 } |
1324 | |
1325 | |
1326 //----- (0044CB4F) -------------------------------------------------------- | |
1268 | 1327 int GUIWindow::DrawTextInRect( GUIFont *pFont, unsigned int uX, unsigned int uY, unsigned int uColor, const char *text, int rect_width, int reverse_text ) |
1328 { | |
1329 | |
24 | 1330 int pLineWidth; // ebx@1 |
1268 | 1331 int text_width; // esi@3 |
0 | 1332 unsigned __int8 v12; // cl@7 |
1333 signed int v13; // esi@19 | |
1334 signed int v14; // ebx@19 | |
1335 unsigned __int8 v15; // cl@21 | |
1336 int v16; // eax@22 | |
1337 int v17; // ecx@22 | |
1338 int v18; // ecx@23 | |
1339 int v19; // ecx@24 | |
1340 unsigned int v20; // ecx@26 | |
1268 | 1341 unsigned char* v21; // eax@28 |
0 | 1342 int v22; // ebx@34 |
1343 int v23; // eax@34 | |
1344 int v24; // ebx@36 | |
1268 | 1345 char Str[6]; // [sp+Ch] [bp-20h]@34 |
0 | 1346 char v26; // [sp+Fh] [bp-1Dh]@34 |
1347 char v27; // [sp+11h] [bp-1Bh]@35 | |
1348 int v28; // [sp+20h] [bp-Ch]@17 | |
1349 GUIWindow *pWindow; // [sp+24h] [bp-8h]@1 | |
24 | 1350 size_t pNumLen; // [sp+28h] [bp-4h]@1 |
0 | 1351 size_t Str1a; // [sp+40h] [bp+14h]@5 |
1352 size_t Str1b; // [sp+40h] [bp+14h]@19 | |
1353 const char *Sourcea; // [sp+44h] [bp+18h]@20 | |
1354 int v34; // [sp+48h] [bp+1Ch]@26 | |
1268 | 1355 int i; |
0 | 1356 |
1268 | 1357 |
0 | 1358 pWindow = this; |
1268 | 1359 pNumLen = strlen(text); |
1360 pLineWidth = pFont->GetLineWidth(text); | |
1361 if ( pLineWidth < rect_width ) | |
0 | 1362 { |
1268 | 1363 pWindow->DrawText(pFont, uX, uY, uColor, text, 0, 0, 0); |
24 | 1364 return pLineWidth; |
0 | 1365 } |
1268 | 1366 strcpy(pTmpBuf2.data(), text); |
1367 text_width = 0; | |
1368 if ( reverse_text ) | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1369 _strrev(pTmpBuf2.data()); |
0 | 1370 Str1a = 0; |
1268 | 1371 for (i=0; i<pNumLen; ++i) |
0 | 1372 { |
1268 | 1373 if ( text_width >= rect_width ) |
0 | 1374 break; |
1268 | 1375 v12 = pTmpBuf2[i]; |
1376 if ( pFont->IsCharValid(v12) ) | |
0 | 1377 { |
1268 | 1378 switch (v12) |
0 | 1379 { |
1268 | 1380 case '\t':// Horizontal tab 09 |
1381 case '\n': //Line Feed 0A 10 | |
1382 case '\r': //Form Feed, page eject 0C 12 | |
1383 break; | |
1384 case '\f': //Carriage Return 0D 13 | |
1385 i += 5; | |
1386 break; | |
1387 default: | |
1388 if ( i > 0 ) | |
1389 text_width += pFont->pMetrics[v12].uLeftSpacing; | |
1390 text_width += pFont->pMetrics[v12].uWidth; | |
1391 if ( i < pNumLen ) | |
1392 text_width += pFont->pMetrics[v12].uRightSpacing; | |
1393 } | |
0 | 1394 } |
1395 } | |
1268 | 1396 pTmpBuf2[i - 1] = 0; |
1397 | |
1398 | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1399 pNumLen = strlen(pTmpBuf2.data()); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1400 v28 = pFont->GetLineWidth(pTmpBuf2.data()); |
1268 | 1401 if ( reverse_text ) |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1402 _strrev(pTmpBuf2.data()); |
1268 | 1403 |
0 | 1404 v13 = uX + pWindow->uFrameX; |
1405 v14 = uY + pWindow->uFrameY; | |
1268 | 1406 for (i=0; i<pNumLen; ++i) |
0 | 1407 { |
1268 | 1408 v15 = pTmpBuf2[i]; |
1409 if ( pFont->IsCharValid(v15) ) | |
0 | 1410 { |
1268 | 1411 switch (v12) |
1412 { | |
1413 case '\t':// Horizontal tab 09 | |
1414 { | |
1415 strncpy(Str, &pTmpBuf2[i+1], 3); | |
1416 Str[3] = 0; | |
1417 // atoi(Str); | |
1418 i += 3; | |
1419 break; | |
1420 } | |
1421 case '\n': //Line Feed 0A 10 | |
1422 { | |
1423 v24 = pFont->uFontHeight; | |
1424 v13 = uX; | |
1425 uY = uY + pFont->uFontHeight - 3; | |
1426 v14 = uY+pFont->uFontHeight - 3; | |
1427 break; | |
1428 } | |
1429 case '\r': //Form Feed, page eject 0C 12 | |
0 | 1430 { |
1268 | 1431 strncpy(Str, &pTmpBuf2[i+1], 5); |
1432 Str[5] = 0; | |
1433 i += 5; | |
1434 uColor = atoi(Str); | |
1435 break; | |
1436 } | |
1437 case '\f': //Carriage Return 0D 13 | |
1438 { | |
1439 strncpy(Str, &pTmpBuf2[i+1], 3); | |
1440 Str[3] = 0; | |
1441 i += 3; | |
1442 v23 = pFont->GetLineWidth(&pTmpBuf2[i]); | |
1443 v13 = pWindow->uFrameZ - v23 - atoi(Str); | |
1444 v14 = uY; | |
1445 break; | |
0 | 1446 } |
1268 | 1447 default: |
1448 v20 = pFont->pMetrics[v15].uWidth; | |
1449 if ( i > 0 ) | |
1450 v13 += pFont->pMetrics[v15].uLeftSpacing; | |
1451 v21 = &pFont->pFontData[pFont->font_pixels_offset[v15]]; | |
1452 if ( uColor ) | |
1453 pRenderer->DrawText(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], uColor, 0); | |
1454 else | |
1455 pRenderer->DrawTextPalette(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], 0); | |
1456 v13 += v20; | |
1457 if ( i < (signed int)pNumLen ) | |
1458 v13 += pFont->pMetrics[v15].uRightSpacing; | |
1459 } | |
0 | 1460 } |
1268 | 1461 |
1462 | |
0 | 1463 } |
1464 return v28; | |
1465 } | |
1466 | |
1467 //----- (0041D12F) -------------------------------------------------------- | |
189 | 1468 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, |
832 | 1469 int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...) |
0 | 1470 { |
17 | 1471 GUIButton *pButton; // esi@1 |
0 | 1472 unsigned int v13; // eax@1 |
1473 unsigned int v14; // ebx@4 | |
1474 unsigned int v15; // eax@4 | |
189 | 1475 unsigned int TextureNum=0; // ebx@4 |
0 | 1476 unsigned int v17; // eax@4 |
1477 Texture *v18; // eax@4 | |
1478 Texture **v19; // ecx@5 | |
1479 Texture **v20; // edx@5 | |
1480 GUIButton *v21; // eax@7 | |
189 | 1481 va_list texturs_ptr; |
0 | 1482 |
1583 | 1483 pButton = (GUIButton *)malloc(0xBC); |
17 | 1484 pButton->pParent = this; |
1268 | 1485 pButton->uWidth = uWidth; |
17 | 1486 pButton->uHeight = uHeight; |
1268 | 1487 |
0 | 1488 if ( a6 == 2 && !uHeight ) |
17 | 1489 pButton->uHeight = uWidth; |
1268 | 1490 |
17 | 1491 pButton->uButtonType = a6; |
1268 | 1492 pButton->uX = uX + this->uFrameX; |
1493 pButton->uY = uY + this->uFrameY; | |
1494 pButton->uZ = pButton->uX + uWidth - 1; | |
1495 pButton->uW = pButton->uY + uHeight - 1; | |
271 | 1496 pButton->field_2C_is_pushed = 0; |
17 | 1497 pButton->field_1C = a7; |
832 | 1498 pButton->msg = msg; |
1499 pButton->msg_param = msg_param; | |
17 | 1500 pButton->uHotkey = uHotkey; |
1268 | 1501 //strlen(pName); |
17 | 1502 strcpy(pButton->pButtonName, pName); |
189 | 1503 va_start(texturs_ptr, pName); |
1504 while (NULL!=(pTextures=va_arg(texturs_ptr, Texture *))) | |
0 | 1505 { |
189 | 1506 pButton->pTextures[TextureNum]=pTextures; |
1507 ++TextureNum; | |
0 | 1508 } |
189 | 1509 va_end(texturs_ptr); |
1510 pButton->uNumTextures = TextureNum; | |
1511 if ( this->pControlsTail ) | |
1512 this->pControlsTail->pNext = pButton; | |
0 | 1513 else |
17 | 1514 this->pControlsHead = pButton; |
1515 pButton->pPrev = this->pControlsTail; | |
1516 this->pControlsTail = pButton; | |
1517 pButton->pNext = 0; | |
0 | 1518 ++this->uNumControls; |
17 | 1519 return pButton; |
0 | 1520 } |
1521 | |
1522 //----- (00459C2B) -------------------------------------------------------- | |
1268 | 1523 void GUIWindow::DrawFlashingInputCursor( signed int uX, int uY, struct GUIFont *a2 ) |
1524 { | |
0 | 1525 if ( GetTickCount() % 1000 > 500 ) |
1268 | 1526 DrawText(a2, uX, uY, 0, "_", 0, 0, 0); |
0 | 1527 } |
1528 | |
1529 //----- (0041C432) -------------------------------------------------------- | |
1268 | 1530 GUIWindow * GUIWindow::Create( unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, enum WindowType eWindowType, int pButton, const char* hint ) |
1531 { | |
0 | 1532 unsigned int uNextFreeWindowID; // ebp@1 |
1533 //int *v8; // eax@1 | |
1534 //GUIWindow *pWindow; // esi@4 | |
962 | 1535 //int v10; // eax@4 |
0 | 1536 unsigned int v11; // ebx@15 |
423 | 1537 NPCData *speakingNPC; // ebp@15 |
1538 int v14; // eax@20 | |
1539 int v16; // eax@25 | |
1540 int v18; // eax@30 | |
1541 int v20; // eax@35 | |
1542 int v22; // eax@40 | |
1543 int v24; // eax@45 | |
0 | 1544 int v25; // eax@65 |
1545 unsigned int v26; // ebx@65 | |
1546 char *v27; // eax@71 | |
1547 const char *v29; // [sp-8h] [bp-18h]@68 | |
1548 char *v30; // [sp-4h] [bp-14h]@68 | |
1549 int uWidtha; // [sp+14h] [bp+4h]@66 | |
423 | 1550 int num_menu_buttons; // [sp+20h] [bp+10h]@15 |
0 | 1551 |
1552 for (uNextFreeWindowID = 0; uNextFreeWindowID < 20; ++uNextFreeWindowID) | |
1553 { | |
1554 if (pWindowList[uNextFreeWindowID].eWindowType == WINDOW_null) | |
1555 break; | |
1556 } | |
1557 | |
1558 auto pWindow = &pWindowList[uNextFreeWindowID]; | |
1559 pWindow->uFrameWidth = uWidth; | |
1268 | 1560 pWindow->uFrameHeight = uHeight; |
1561 | |
1562 pWindow->uFrameX = uX; | |
1563 pWindow->uFrameY = uY; | |
0 | 1564 pWindow->uFrameZ = uX + uWidth - 1; |
1565 pWindow->uFrameW = uY + uHeight - 1; | |
1268 | 1566 |
11 | 1567 pWindow->ptr_1C = (void *)pButton; |
1268 | 1568 pWindow->Hint = hint; |
1569 | |
0 | 1570 pWindow->eWindowType = eWindowType; |
972 | 1571 pWindow->receives_keyboard_input = false; |
496 | 1572 ++uNumVisibleWindows; |
1573 pWindow->numVisibleWindows = uNumVisibleWindows; | |
1574 pVisibleWindowsIdxs[uNumVisibleWindows] = uNextFreeWindowID + 1; | |
0 | 1575 if ( (signed int)eWindowType <= 20 ) |
1576 { | |
1577 if (eWindowType != WINDOW_Chest) | |
1578 { | |
1579 switch (eWindowType) | |
1580 { | |
1268 | 1581 case WINDOW_Book: { |
0 | 1582 pWindow->InitializeBookView(); |
1583 break; | |
1268 | 1584 } |
1585 case WINDOW_Dialogue: { | |
11 | 1586 pMainScreenNum = pCurrentScreen; |
151 | 1587 pCurrentScreen = SCREEN_NPC_DIALOGUE; |
832 | 1588 pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" |
735 | 1589 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
496 | 1590 if ( pWindow->par1C != 1 ) |
0 | 1591 { |
423 | 1592 num_menu_buttons = 0; |
0 | 1593 v11 = LOBYTE(pFontArrus->uFontHeight) - 3; |
602 | 1594 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
827 | 1595 if ( GetGreetType(sDialogue_SpeakingActorNPC_ID) == 1 )//QuestsNPC_greet |
0 | 1596 { |
423 | 1597 if ( speakingNPC->joins ) |
0 | 1598 { |
832 | 1599 pWindow->CreateButton(480, 130, 140, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0xDu, 0, "", 0); |
423 | 1600 num_menu_buttons = 1; |
0 | 1601 } |
423 | 1602 if ( speakingNPC->evt_A ) |
0 | 1603 { |
423 | 1604 if ( num_menu_buttons < 4 ) |
0 | 1605 { |
423 | 1606 v14 = NPC_EventProcessor(speakingNPC->evt_A); |
0 | 1607 if ( v14 == 1 || v14 == 2 ) |
832 | 1608 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x13u, 0, "", 0); |
0 | 1609 } |
1610 } | |
423 | 1611 if ( speakingNPC->evt_B ) |
0 | 1612 { |
423 | 1613 if ( num_menu_buttons < 4 ) |
0 | 1614 { |
423 | 1615 v16 = NPC_EventProcessor(speakingNPC->evt_B); |
0 | 1616 if ( v16 == 1 || v16 == 2 ) |
832 | 1617 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x14u, 0, "", 0); |
0 | 1618 } |
1619 } | |
423 | 1620 if ( speakingNPC->evt_C ) |
0 | 1621 { |
423 | 1622 if ( num_menu_buttons < 4 ) |
0 | 1623 { |
423 | 1624 v18 = NPC_EventProcessor(speakingNPC->evt_C); |
0 | 1625 if ( v18 == 1 || v18 == 2 ) |
832 | 1626 pWindow->CreateButton( 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x15u, 0, "", 0); |
0 | 1627 } |
1628 } | |
423 | 1629 if ( speakingNPC->evt_D ) |
0 | 1630 { |
423 | 1631 if ( num_menu_buttons < 4 ) |
0 | 1632 { |
423 | 1633 v20 = NPC_EventProcessor(speakingNPC->evt_D); |
0 | 1634 if ( v20 == 1 || v20 == 2 ) |
832 | 1635 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x16u, 0, "", 0); |
0 | 1636 } |
1637 } | |
423 | 1638 if ( speakingNPC->evt_E ) |
0 | 1639 { |
423 | 1640 if ( num_menu_buttons < 4 ) |
0 | 1641 { |
423 | 1642 v22 = NPC_EventProcessor(speakingNPC->evt_E); |
0 | 1643 if ( v22 == 1 || v22 == 2 ) |
832 | 1644 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x17u, 0, "", 0); |
0 | 1645 } |
1646 } | |
423 | 1647 if (speakingNPC->evt_F ) |
0 | 1648 { |
423 | 1649 if ( num_menu_buttons < 4 ) |
0 | 1650 { |
423 | 1651 v24 = NPC_EventProcessor(speakingNPC->evt_F); |
0 | 1652 if ( v24 == 1 || v24 == 2 ) |
832 | 1653 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x18u, 0, "", 0); |
0 | 1654 } |
1655 } | |
1656 } | |
1657 else | |
1658 { | |
423 | 1659 if ( speakingNPC->joins ) |
0 | 1660 { |
832 | 1661 pWindow->CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);//Ïîäðîáíåå |
423 | 1662 if (speakingNPC->Hired()) |
0 | 1663 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1664 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[408], speakingNPC->pName); //Îòïóñòèòü |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1665 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pTmpBuf.data(), 0); |
0 | 1666 } |
1667 else | |
1668 { | |
832 | 1669 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pGlobalTXT_LocalizationStrings[406], 0);//Íàíÿòü |
0 | 1670 } |
423 | 1671 num_menu_buttons = 2; |
0 | 1672 } |
1673 } | |
972 | 1674 pWindow->_41D08F_set_keyboard_control_group(num_menu_buttons, 1, 0, 1); |
0 | 1675 } |
1676 break; | |
1268 | 1677 } |
1678 case WINDOW_ChangeLocation: { | |
11 | 1679 pMainScreenNum = pCurrentScreen; |
151 | 1680 pCurrentScreen = SCREEN_CHANGE_LOCATION; |
987 | 1681 pBtn_ExitCancel = pWindow->CreateButton( 566, 445, 75, 33, 1, 0, UIMSG_CHANGE_LOCATION_ClickCencelBtn, 0, 'N', pGlobalTXT_LocalizationStrings[156], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);//Îñòàòüñÿ â ýòîé îáëàñòè |
948 | 1682 pBtn_YES = pWindow->CreateButton( 486, 445, 75, 33, 1, 0, UIMSG_OnTravelByFoot, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); |
1683 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63, 73, 1, 0, UIMSG_OnTravelByFoot, 1, ' ', pWindow->Hint, 0, 0, 0); | |
1684 pWindow->CreateButton( 8, 8, 460, 344, 1, 0, UIMSG_OnTravelByFoot, 1, 0, pWindow->Hint, 0); | |
0 | 1685 break; |
1268 | 1686 } |
1687 case WINDOW_SpellBook: {// îêíî êíèãè çàêëîâ | |
0 | 1688 InitializeBookTextures(); |
11 | 1689 pWindow->OpenSpellBook(); |
0 | 1690 break; |
1268 | 1691 } |
1692 case WINDOW_GreetingNPC: {// îêíî ïðèâåòñòâèÿ ÍÏÑ | |
11 | 1693 pMainScreenNum = pCurrentScreen; |
3 | 1694 pKeyActionMap->EnterText(0, 15, pWindow); |
151 | 1695 pCurrentScreen = SCREEN_BRANCHLESS_NPC_DIALOG; |
0 | 1696 break; |
1268 | 1697 } |
1698 | |
0 | 1699 } |
1700 return pWindow; | |
1701 } | |
11 | 1702 //LABEL_62: |
948 | 1703 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, '1', "", 0); |
1704 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, '2', "", 0); | |
1705 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3u, '3', "", 0); | |
1706 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 4u, '4', "", 0); | |
832 | 1707 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, 9u, "", 0); |
0 | 1708 return pWindow; |
1709 } | |
1710 if (eWindowType == WINDOW_HouseInterior) | |
1711 { | |
151 | 1712 pCurrentScreen = SCREEN_HOUSE; |
1589 | 1713 pBtn_ExitCancel = pWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Âûéòè èç çäàíèÿ |
735 | 1714 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
1589 | 1715 for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) |
1716 { | |
1717 if ( v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
0 | 1718 { |
1589 | 1719 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; |
1720 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; | |
1721 } | |
1722 else | |
1723 { | |
1724 if ( v26 || !dword_591080 ) | |
1725 v27 = HouseNPCData[v26 +1 - ((dword_591080 != 0)? 1:0)]->pName; | |
0 | 1726 else |
1589 | 1727 v27 = (char*)p2DEvents[pButton - 1].pProprieterName; |
1728 v30 = v27; | |
1729 v29 = (char*)pGlobalTXT_LocalizationStrings[435]; | |
0 | 1730 } |
1589 | 1731 sprintfex(byte_591180[v26].data(), v29, v30); |
1732 HouseNPCPortraitsButtonsList[v26] = pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], | |
1733 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], | |
1734 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0); | |
1735 } | |
1211 | 1736 if ( uNumDialogueNPCPortraits == 1 ) |
0 | 1737 { |
336 | 1738 window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; |
0 | 1739 _4B4224_UpdateNPCTopics(0); |
1740 } | |
1741 } | |
1742 else | |
1743 { | |
158 | 1744 if (eWindowType == WINDOW_Transition) |
0 | 1745 { |
11 | 1746 pMainScreenNum = pCurrentScreen; |
151 | 1747 pCurrentScreen = SCREEN_INPUT_BLV; |
960 | 1748 pBtn_ExitCancel = pWindow->CreateButton(0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionWindowCloseBtn, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);//Îòìåíà |
948 | 1749 pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); |
1750 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1, 0, UIMSG_TransitionUI_Confirm, 1, 0x20u, pWindow->Hint, 0); | |
1751 pWindow->CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0, pWindow->Hint, 0); | |
0 | 1752 return pWindow; |
1753 } | |
961 | 1754 if (eWindowType == WINDOW_CastSpell) |
0 | 1755 { |
1756 pEventTimer->Pause(); | |
1757 pAudioPlayer->StopChannels(-1, -1); | |
1758 pMouse->SetCursorBitmap("MICON2"); | |
11 | 1759 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);//Âûáåðèòå öåëü |
0 | 1760 return pWindow; |
1761 } | |
158 | 1762 if (eWindowType == WINDOW_Scroll) |
11 | 1763 { |
948 | 1764 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, '1', "", 0); |
1765 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, '2', "", 0); | |
1766 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 3u, '3', "", 0); | |
1767 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 4u, '4', "", 0); | |
1768 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0); | |
11 | 1769 return pWindow; |
1770 } | |
898 | 1771 if (eWindowType == WINDOW_CastSpell_InInventory) |
0 | 1772 { |
1773 pMouse->SetCursorBitmap("MICON2"); | |
832 | 1774 pBtn_ExitCancel = pWindow->CreateButton(0x188u, 0x13Eu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],//Îòìåíà |
945 | 1775 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); |
11 | 1776 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2);//Âûáðàòü öåëü |
0 | 1777 ++pIcons_LOD->uTexturePacksCount; |
1778 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 1779 pCurrentScreen = SCREEN_CASTING; |
0 | 1780 if ( !pIcons_LOD->uNumPrevLoadedFiles ) |
1781 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
1782 } | |
1783 } | |
1784 return pWindow; | |
1295 | 1785 } |
1786 //----- (004B3EF0) -------------------------------------------------------- | |
1787 void DrawJoinGuildWindow( int pEventCode ) | |
1788 { | |
1789 uDialogueType = 81;//enum JoinGuildDialog | |
1790 current_npc_text = (char *)pNPCTopics[pEventCode + 99].pText; | |
1791 ContractSelectText(pEventCode); | |
1792 pDialogueWindow->Release(); | |
1793 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventCode, 0); | |
1794 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); // Cancel | |
1795 pDialogueWindow->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); | |
1796 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); | |
1797 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); | |
1798 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | |
1799 } | |
1800 //----- (0044603D) -------------------------------------------------------- | |
1458 | 1801 void DialogueEnding() |
1295 | 1802 { |
1803 sDialogue_SpeakingActorNPC_ID = 0; | |
1804 pDialogueWindow->Release(); | |
1805 pDialogueWindow = 0; | |
1806 pMiscTimer->Resume(); | |
1807 pEventTimer->Resume(); | |
1297 | 1808 } |
1809 //----- (004156F0) -------------------------------------------------------- | |
1810 void GUI_UpdateWindows() | |
1811 { | |
1812 GUIWindow *pWindow; // esi@4 | |
1813 //unsigned int pWindowType; // eax@4 | |
1814 const char *pHint; // edx@66 | |
1815 GUIButton *pButtonPtr_1C; // ebp@79 | |
1816 char *pHint1; // edx@80 | |
1817 int v26; // eax@98 | |
1818 unsigned int v27; // ebp@106 | |
1819 GUIWindow *pGUIWindow2; // ecx@109 | |
1820 GUIFont *pGUIFont; // ST1C_4@115 | |
1821 int v31; // eax@115 | |
1822 GUIButton *pButton; // ebp@118 | |
1823 int v39; // eax@129 | |
1824 unsigned int pNumMessages; // eax@142 | |
1825 GUIButton *pGUIButton; // ebp@146 | |
1826 //unsigned int pX; // [sp-1Ch] [bp-124h]@17 | |
1827 //unsigned int pY; // [sp-18h] [bp-120h]@17 | |
1828 //Texture *pTexture; // [sp-14h] [bp-11Ch]@17 | |
1829 //Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 | |
1830 int i; // [sp+0h] [bp-108h]@3 | |
1831 ItemGen pItemGen; // [sp+4h] [bp-104h]@98 | |
1832 GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133 | |
1833 ItemGen ItemGen2; // [sp+E4h] [bp-24h]@129 | |
1834 | |
1835 if (GetCurrentMenuID() != MENU_CREATEPARTY) | |
1836 UI_OnKeyDown(VK_NEXT); | |
1837 | |
1838 for ( i = 1; i <= uNumVisibleWindows; ++i ) | |
1839 { | |
1840 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; | |
1841 switch (pWindow->eWindowType) | |
1842 { | |
1843 case WINDOW_OptionsButtons: | |
1844 { | |
1845 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_Y, | |
1846 pViewport->uViewportTL_X, pIcons_LOD->GetTexture(uTextureID_Options)); | |
1847 viewparams->bRedrawGameUI = 1; | |
1848 continue; | |
1849 } | |
1850 case WINDOW_CharacterRecord: | |
1851 { | |
1852 CharacterUI_CharacterScreen_Draw(pPlayers[uActiveCharacter]); | |
1853 continue; | |
1854 } | |
1855 case WINDOW_Options: | |
1856 { | |
1857 GameMenuUI_Options_Draw(); | |
1858 continue; | |
1859 } | |
1860 case WINDOW_Book: | |
1861 { | |
1862 BookUI_Draw((WindowType)(int)pWindow->ptr_1C); | |
1863 continue; | |
1864 } | |
1865 case WINDOW_Dialogue: | |
1866 { | |
1867 GameUI_DrawDialogue(); | |
1868 continue; | |
1869 } | |
1870 case WINDOW_QuickReference: | |
1871 { | |
1872 GameUI_QuickRef_Draw(); | |
1873 continue; | |
1874 } | |
1875 case WINDOW_Rest: | |
1876 { | |
1877 RestUI_Draw(); | |
1878 continue; | |
1879 } | |
1880 case WINDOW_ChangeLocation: | |
1881 { | |
1882 TravelUI_Draw(); | |
1883 continue; | |
1884 } | |
1885 case WINDOW_SpellBook: | |
1886 { | |
1887 DrawSpellBookContent(pPlayers[uActiveCharacter]); | |
1888 continue; | |
1889 } | |
1890 case WINDOW_GreetingNPC: | |
1891 { | |
1892 GameUI_DrawBranchlessDialogue(); | |
1893 continue; | |
1894 } | |
1895 case WINDOW_Chest: | |
1896 { | |
1897 if ( pCurrentScreen == SCREEN_CHEST ) | |
1898 { | |
1312 | 1899 Chest::DrawChestUI(pWindow->par1C); |
1297 | 1900 } |
1901 else if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | |
1902 { | |
1903 pRenderer->ClearZBuffer(0, 479); | |
1904 draw_leather(); | |
1905 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | |
1906 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); | |
1907 } | |
1908 continue; | |
1909 } | |
1910 case WINDOW_SaveLoadButtons: | |
1911 { | |
1912 SaveUI_Draw(); | |
1913 continue; | |
1914 } | |
1915 case WINDOW_MainMenu_Load: | |
1916 { | |
1917 LoadUI_Draw(); | |
1918 continue; | |
1919 } | |
1920 case WINDOW_HouseInterior: | |
1921 { | |
1922 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager(); | |
1923 if ( !window_SpeakInHouse ) | |
1924 continue; | |
1312 | 1925 if ( window_SpeakInHouse->par1C >= 53 ) |
1297 | 1926 continue; |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1709
diff
changeset
|
1927 if ( pParty->PartyTimes._shop_ban_times[window_SpeakInHouse->par1C] <=pParty->uTimePlayed ) |
1297 | 1928 { |
1312 | 1929 if ( window_SpeakInHouse->par1C < 53 ) |
1297 | 1930 { |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1709
diff
changeset
|
1931 pParty->PartyTimes._shop_ban_times[window_SpeakInHouse->par1C] = 0; |
1297 | 1932 } |
1933 continue; | |
1934 } | |
1935 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
1936 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1937 continue; | |
1938 } | |
1939 case WINDOW_Transition: | |
1940 { | |
1941 TransitionUI_Draw(); | |
1942 continue; | |
1943 } | |
1944 case WINDOW_Scroll: | |
1945 { | |
1946 CreateScrollWindow(); | |
1947 continue; | |
1948 } | |
1949 case WINDOW_CastSpell_InInventory: | |
1950 { | |
1951 pRenderer->ClearZBuffer(0, 479); | |
1952 draw_leather(); | |
1953 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | |
1954 CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); | |
1955 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); | |
1956 continue; | |
1957 } | |
1458 | 1958 case WINDOW_ModalWindow: |
1297 | 1959 { |
1458 | 1960 ModalWindow_ShowHint(); |
1297 | 1961 continue; |
1962 } | |
1963 case WINDOW_50: | |
1964 { | |
1965 v27 = TargetColor(255, 255, 255); | |
1966 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
1967 { | |
1968 ptr_507BD0->DrawMessageBox(0); | |
1969 ptr_507BD0->DrawText(pFontCreate, 30, 40, v27, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
1970 v31 = pFontCreate->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); | |
1971 ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pFontCreate); | |
1972 continue; | |
1973 } | |
1974 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
1975 { | |
1976 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1977 pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0); | |
1978 pEventTimer->Resume(); | |
1979 ptr_507BD0->Release(); | |
1980 pCurrentScreen = SCREEN_GAME; | |
1981 viewparams->bRedrawGameUI = true; | |
1982 continue; | |
1983 } | |
1984 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED) | |
1985 { | |
1986 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1987 pEventTimer->Resume(); | |
1988 ptr_507BD0->Release(); | |
1989 continue; | |
1990 } | |
1991 } | |
1992 case WINDOW_59: | |
1993 { | |
1994 pWindow->DrawMessageBox(0); | |
1995 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | |
1996 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
1997 if ( !pKeyActionMap->field_204 ) | |
1998 { | |
1999 ItemGen2.Reset(); | |
2000 pWindow->Release(); | |
2001 pEventTimer->Resume(); | |
2002 pCurrentScreen = 0; | |
2003 viewparams->bRedrawGameUI = true; | |
2004 v26 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | |
2005 if ( v26 > 0 ) | |
2006 { | |
2007 if ( v26 < 800 ) | |
2008 { | |
2009 ItemGen2.uAttributes |= 1u; | |
2010 ItemGen2.uItemID = v26; | |
2011 if ( pItemsTable->pItems[v26].uEquipType == 12 ) | |
2012 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1640
diff
changeset
|
2013 ItemGen2.uNumCharges = rand() % 6 + ItemGen2.GetDamageMod() + 1; |
1297 | 2014 ItemGen2.uMaxCharges = LOBYTE(ItemGen2.uNumCharges); |
2015 } | |
2016 else | |
2017 { | |
2018 if ( v26 >= 221 && v26 < 271 ) | |
2019 ItemGen2.uEnchantmentType = rand() % 10 + 1; | |
2020 } | |
2021 pItemsTable->SetSpecialBonus(&ItemGen2); | |
2022 pParty->SetHoldingItem(&ItemGen2); | |
2023 } | |
2024 } | |
2025 } | |
2026 continue; | |
2027 } | |
2028 case WINDOW_PressedButton2: | |
2029 { | |
2030 if ( pWindow->Hint != (char *)1 ) | |
2031 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2032 pButton = (GUIButton *)pWindow->ptr_1C; | |
2033 if ( pButton->uX >= 0 && pButton->uX <= 640 ) | |
2034 { | |
2035 if ( pButton->uY >= 0 && pButton->uY <= 480 ) | |
2036 { | |
2037 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2038 viewparams->bRedrawGameUI = 1; | |
2039 if ( pWindow->Hint ) | |
2040 { | |
2041 if ( pWindow->Hint != (char *)1 ) | |
2042 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2043 } | |
2044 pWindow->Release(); | |
2045 continue; | |
2046 } | |
2047 } | |
2048 viewparams->bRedrawGameUI = 1; | |
2049 if ( pWindow->Hint ) | |
2050 { | |
2051 if ( pWindow->Hint != (char *)1 ) | |
2052 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2053 } | |
2054 pWindow->Release(); | |
2055 continue; | |
2056 } | |
2057 case WINDOW_CharactersPressedButton: | |
2058 { | |
2059 if ( pWindow->Hint != (char *)1 ) | |
2060 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2061 pButton = (GUIButton *)pWindow->ptr_1C; | |
2062 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
2063 viewparams->bRedrawGameUI = 1; | |
2064 if ( pWindow->Hint ) | |
2065 { | |
2066 if ( pWindow->Hint != (char *)1 ) | |
2067 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2068 } | |
2069 pWindow->Release(); | |
2070 continue; | |
2071 } | |
2072 case WINDOW_PressedButton: | |
2073 { | |
2074 if ( pWindow->Hint != (char *)1 ) | |
2075 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2076 pButton = (GUIButton *)pWindow->ptr_1C; | |
2077 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2078 viewparams->bRedrawGameUI = 1; | |
2079 if ( pWindow->Hint ) | |
2080 { | |
2081 if ( pWindow->Hint != (char *)1 ) | |
2082 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2083 } | |
2084 pWindow->Release(); | |
2085 continue; | |
2086 } | |
2087 case WINDOW_5D: | |
2088 { | |
2089 if ( pWindow->Hint != (char *)1 ) | |
2090 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2091 pButton = (GUIButton *)pWindow->ptr_1C; | |
2092 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
2093 viewparams->bRedrawGameUI = 1; | |
2094 pWindow->Release(); | |
2095 continue; | |
2096 } | |
2097 case WINDOW_SaveLoadBtn: | |
2098 { | |
2099 if (pWindow->Hint != (char *)1) | |
2100 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2101 pButton = (GUIButton *)pWindow->ptr_1C; | |
2102 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2103 pHint = pWindow->Hint; | |
2104 viewparams->bRedrawGameUI = 1; | |
2105 if ( pHint && pHint != (char *)1 ) | |
2106 pButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2107 pWindow->Release(); | |
2108 if (pCurrentScreen == SCREEN_SAVEGAME) | |
2109 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); | |
2110 else | |
2111 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); | |
2112 continue; | |
2113 } | |
2114 case WINDOW_LoadGame_CancelBtn: | |
2115 { | |
2116 if ( pWindow->Hint != (char *)1 ) | |
2117 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2118 pButton = (GUIButton *)pWindow->ptr_1C; | |
2119 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2120 viewparams->bRedrawGameUI = 1; | |
2121 if ( pWindow->Hint && pWindow->Hint != (char *)1 ) | |
2122 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2123 pWindow->Release(); | |
2124 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
2125 continue; | |
2126 } | |
2127 case WINDOW_CloseRestWindowBtn: | |
2128 { | |
2129 if ( pWindow->Hint != (char *)1 ) | |
2130 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2131 pGUIButton = (GUIButton *)pWindow->ptr_1C; | |
2132 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); | |
2133 pHint = pWindow->Hint; | |
2134 viewparams->bRedrawGameUI = 1; | |
2135 if ( pHint && pHint != (char *)1 ) | |
2136 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2137 pWindow->Release(); | |
2138 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
2139 continue; | |
2140 } | |
2141 case WINDOW_ExitCharacterWindow: | |
2142 { | |
2143 if ( pWindow->Hint != (char *)1 ) | |
2144 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2145 pButton = (GUIButton *)pWindow->ptr_1C; | |
2146 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
2147 pHint = pWindow->Hint; | |
2148 viewparams->bRedrawGameUI = 1; | |
2149 if ( pHint && pHint != (char *)1 ) | |
2150 pButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2151 pWindow->Release(); | |
2152 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
2153 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
2154 continue; | |
2155 } | |
2156 case WINDOW_RestWindow: | |
2157 { | |
2158 memset(&GUIButton2, 0, 0xBCu); | |
2159 GUIButton2.uZ = 197; | |
2160 GUIButton2.uW = 197; | |
2161 GUIButton2.uX = 27; | |
2162 GUIButton2.uY = 161; | |
2163 GUIButton2.uWidth = 171; | |
2164 GUIButton2.uHeight = 37; | |
2165 GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
2166 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2167 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15)); | |
2168 viewparams->bRedrawGameUI = 1; | |
2169 GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Îòäûõ è ëå÷åíèå 8 ÷àñîâ | |
2170 GUIButton2.pParent = 0; | |
2171 pGUIWindow2 = pWindow; | |
2172 pGUIWindow2->Release(); | |
2173 continue; | |
2174 } | |
2175 case WINDOW_BooksWindow: | |
2176 { | |
2177 pButton = (GUIButton *)pWindow->ptr_1C; | |
2178 pRenderer->DrawTextureIndexed(pWindow->uFrameY, | |
2179 pWindow->uFrameX, pButton->pTextures[0]); | |
2180 viewparams->bRedrawGameUI = true; | |
2181 continue; | |
2182 } | |
2183 case WINDOW_CharacterWindow_Inventory: | |
2184 { | |
2185 pWindow->DrawMessageBox(0); | |
2186 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | |
2187 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
2188 if ( !pKeyActionMap->field_204 ) | |
2189 { | |
2190 ItemGen2.Reset(); | |
2191 pWindow->Release(); | |
2192 pEventTimer->Resume(); | |
2193 pCurrentScreen = SCREEN_GAME; | |
2194 viewparams->bRedrawGameUI = 1; | |
2195 v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); | |
2196 if ( v39 > 0 ) | |
2197 { | |
2198 if ( v39 < 800 ) | |
2199 SpawnActor(v39); | |
2200 } | |
2201 } | |
2202 continue; | |
2203 } | |
2204 case WINDOW_KeyMappingOptions: | |
2205 { | |
2206 GameMenuUI_DrawKeyBindings(); | |
2207 continue; | |
2208 } | |
2209 case WINDOW_VideoOptions: | |
2210 { | |
2211 GameMenuUI_DrawVideoOptions(); | |
2212 continue; | |
2213 } | |
2214 default: | |
2215 { | |
2216 continue; | |
2217 } | |
2218 } | |
2219 } | |
2220 if ( GetCurrentMenuID() == -1 ) | |
2221 GameUI_DrawFoodAndGold(); | |
2222 if ( sub_4637E0_is_there_popup_onscreen() ) | |
1802 | 2223 UI_OnMouseRightClick(0); |
1297 | 2224 } |
1916 | 2225 void LoadFonts_and_DrawCopyrightWindow() |
2226 { | |
2227 MainMenuUI_LoadFontsAndSomeStuff(); | |
2228 DrawCopyrightWindow(); | |
2229 } | |
1297 | 2230 //----- (00415485) -------------------------------------------------------- |
2231 void DrawCopyrightWindow() | |
2232 { | |
2233 GUIWindow Dst; // [sp+8h] [bp-54h]@1 | |
2234 | |
2235 memset(&Dst, 0, 0x54u); | |
2236 Dst.uFrameWidth = 624; | |
2237 Dst.uFrameHeight = 256; | |
2238 Dst.uFrameX = 8; | |
2239 Dst.uFrameY = 30; // c 1999 The 3DO Company. | |
2240 Dst.uFrameHeight = pFontSmallnum->CalcTextHeight(pGlobalTXT_LocalizationStrings[157], &Dst, 24, 0) | |
2241 + 2 * LOBYTE(pFontSmallnum->uFontHeight) | |
2242 + 24; | |
2243 Dst.uFrameY = 470 - Dst.uFrameHeight; | |
2244 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; | |
2245 Dst.uFrameW = 469; | |
2246 //Dst.Hint = "abcagfdsgsg ljsrengvlkjesnfkjwnef"; | |
2247 Dst.DrawMessageBox(0); | |
2248 | |
2249 Dst.uFrameWidth -= 24; | |
2250 Dst.uFrameX += 12; | |
2251 Dst.uFrameY += 12; | |
2252 Dst.uFrameHeight -= 12; | |
2253 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; | |
2254 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; | |
2255 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); | |
2256 } | |
1458 | 2257 |
2258 | |
2259 | |
2260 | |
2261 int modal_window_prev_screen; | |
2262 | |
2263 //----- (004141CA) -------------------------------------------------------- | |
2264 void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message) | |
2265 { | |
2266 pEventTimer->Pause(); | |
2267 modal_window_prev_screen = pCurrentScreen; | |
2268 pModalWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ModalWindow, OnRelease_message, pStrHint); | |
2269 pCurrentScreen = SCREEN_MODAL_WINDOW; | |
2270 } | |
2271 | |
1297 | 2272 //----- (0041420D) -------------------------------------------------------- |
1458 | 2273 void ModalWindow_ShowHint() |
1297 | 2274 { |
2275 GUIWindow pWindow; // [sp+4h] [bp-54h]@1 | |
2276 | |
1458 | 2277 sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape |
1297 | 2278 pWindow.Hint = pTmpBuf2.data(); |
2279 pWindow.uFrameWidth = 400; | |
2280 pWindow.uFrameHeight = 100; | |
2281 pWindow.uFrameX = 120; | |
2282 pWindow.uFrameY = 140; | |
2283 pWindow.uFrameZ = 519; | |
2284 pWindow.uFrameW = 239; | |
2285 pWindow.DrawMessageBox(0); | |
2286 } | |
2287 | |
2288 //----- (0041426F) -------------------------------------------------------- | |
1458 | 2289 void ModalWindow_Release() |
1297 | 2290 { |
1458 | 2291 pMessageQueue_50CBD0->AddMessage((UIMessageType)pModalWindow->par1C, 0, 0); |
1297 | 2292 |
1458 | 2293 pModalWindow->Release(); |
2294 pModalWindow = nullptr; | |
1297 | 2295 |
1458 | 2296 pCurrentScreen = modal_window_prev_screen; |
1297 | 2297 pEventTimer->Resume(); |
2298 } | |
2299 | |
2300 //----- (00467FB6) -------------------------------------------------------- | |
2301 void CreateScrollWindow() | |
2302 { | |
2303 unsigned int v0; // eax@1 | |
2304 char *v1; // ST18_4@3 | |
2305 unsigned int v2; // eax@3 | |
2306 GUIWindow a1; // [sp+Ch] [bp-54h]@1 | |
2307 | |
2308 memcpy(&a1, pGUIWindow_ScrollWindow, sizeof(a1)); | |
2309 a1.Hint = 0; | |
2310 a1.uFrameX = 1; | |
2311 a1.uFrameY = 1; | |
2312 a1.uFrameWidth = 468; | |
1312 | 2313 v0 = pFontSmallnum->CalcTextHeight(pScrolls[pGUIWindow_ScrollWindow->par1C], &a1, 0, 0) |
1297 | 2314 + 2 * LOBYTE(pFontCreate->uFontHeight) |
2315 + 24; | |
2316 a1.uFrameHeight = v0; | |
2317 if ( (signed int)(v0 + a1.uFrameY) > 479 ) | |
2318 { | |
2319 v0 = 479 - a1.uFrameY; | |
2320 a1.uFrameHeight = 479 - a1.uFrameY; | |
2321 } | |
2322 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | |
2323 a1.uFrameW = v0 + a1.uFrameY - 1; | |
2324 a1.DrawMessageBox(0); | |
2325 a1.uFrameX += 12; | |
2326 a1.uFrameWidth -= 24; | |
2327 a1.uFrameY += 12; | |
2328 a1.uFrameHeight -= 12; | |
2329 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | |
2330 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | |
2331 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; | |
2332 v2 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
2333 sprintf(pTmpBuf.data(), format_4E2D80, v2, v1); | |
2334 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u); | |
2335 a1.DrawText( | |
2336 pFontSmallnum, | |
2337 1, | |
2338 LOBYTE(pFontCreate->uFontHeight) - 3, | |
2339 0, | |
2340 pScrolls[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C], | |
2341 0, | |
2342 0, | |
2343 0); | |
2344 } | |
2345 //----- (00467F48) -------------------------------------------------------- | |
2346 void CreateMsgScrollWindow( signed int mscroll_id ) | |
2347 { | |
2348 signed int v1; // esi@1 | |
2349 | |
2350 v1 = mscroll_id; | |
2351 if ( !pGUIWindow_ScrollWindow && mscroll_id >= 700 ) | |
2352 { | |
2353 if ( mscroll_id <= 782 ) | |
2354 { | |
2355 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE); | |
2356 pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Scroll, v1 - 700, 0); | |
2357 } | |
2358 } | |
2359 } | |
2360 //----- (00467F9F) -------------------------------------------------------- | |
1458 | 2361 void free_book_subwindow() |
1297 | 2362 { |
2363 if ( pGUIWindow_ScrollWindow ) | |
2364 { | |
2365 pGUIWindow_ScrollWindow->Release(); | |
2366 pGUIWindow_ScrollWindow = 0; | |
2367 } | |
1913 | 2368 } |
2369 //----- (004226EF) -------------------------------------------------------- | |
2370 void SetUserInterface(PartyAlignment align, bool bReplace) | |
2371 { | |
2372 extern void set_default_ui_skin(); | |
2373 set_default_ui_skin(); | |
2374 | |
2375 if (align == PartyAlignment_Evil) | |
2376 { | |
2377 if ( bReplace ) | |
2378 { | |
2379 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
2380 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
2381 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
2382 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
2383 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
2384 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
2385 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-c", 2); | |
2386 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-C", 2); | |
2387 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); | |
2388 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
2389 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
2390 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); | |
2391 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
2392 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
2393 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
2394 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2); | |
2395 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); | |
2396 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
2397 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
2398 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
2399 | |
2400 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); | |
2401 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); | |
2402 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); | |
2403 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); | |
2404 | |
2405 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
2406 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); | |
2407 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
2408 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); | |
2409 | |
2410 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); | |
2411 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); | |
2412 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-c", 2); | |
2413 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
2414 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
2415 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
2416 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
2417 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
2418 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
2419 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
2420 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
2421 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
2422 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
2423 } | |
2424 else | |
2425 { | |
2426 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
2427 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
2428 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
2429 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
2430 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
2431 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
2432 uTextureID_Minimap_Loop = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); | |
2433 uTextureID_Compas = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
2434 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); | |
2435 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
2436 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
2437 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); | |
2438 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
2439 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); | |
2440 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); | |
2441 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); | |
2442 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); | |
2443 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
2444 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
2445 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
2446 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); | |
2447 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); | |
2448 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
2449 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
2450 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
2451 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); | |
2452 uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
2453 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
2454 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
2455 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
2456 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2457 } | |
2458 uGameUIFontMain = TargetColor(0xC8u, 0, 0); | |
2459 uGameUIFontShadow = TargetColor(10, 0, 0); | |
2460 } | |
2461 else if (align == PartyAlignment_Neutral) | |
2462 { | |
2463 if ( bReplace ) | |
2464 { | |
2465 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
2466 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
2467 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
2468 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
2469 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
2470 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
2471 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-a", 2); | |
2472 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-a", 2); | |
2473 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); | |
2474 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
2475 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
2476 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); | |
2477 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
2478 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
2479 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
2480 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2); | |
2481 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); | |
2482 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
2483 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
2484 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
2485 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); | |
2486 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); | |
2487 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); | |
2488 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); | |
2489 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
2490 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
2491 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
2492 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2493 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2); | |
2494 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); | |
2495 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven", 2); | |
2496 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
2497 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
2498 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
2499 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
2500 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
2501 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
2502 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
2503 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
2504 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
2505 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
2506 } | |
2507 else | |
2508 { | |
2509 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
2510 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
2511 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
2512 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
2513 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
2514 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
2515 uTextureID_Minimap_Loop = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); | |
2516 uTextureID_Compas = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
2517 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); | |
2518 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
2519 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
2520 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); | |
2521 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
2522 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); | |
2523 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); | |
2524 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
2525 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
2526 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
2527 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); | |
2528 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); | |
2529 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); | |
2530 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); | |
2531 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
2532 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
2533 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
2534 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); | |
2535 uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
2536 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
2537 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
2538 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
2539 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2540 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
2541 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
2542 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
2543 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
2544 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
2545 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
2546 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
2547 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
2548 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
2549 pTexture_591428 = pIcons_LOD->LoadTexturePtr("endcap", TEXTURE_16BIT_PALETTE); | |
2550 } | |
2551 uGameUIFontMain = TargetColor(0xAu, 0, 0); | |
2552 uGameUIFontShadow = TargetColor(230, 214, 193); | |
2553 } | |
2554 else if (align == PartyAlignment_Good) | |
2555 { | |
2556 if ( bReplace ) | |
2557 { | |
2558 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
2559 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
2560 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
2561 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
2562 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
2563 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
2564 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-b", 2); | |
2565 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-B", 2); | |
2566 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); | |
2567 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
2568 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
2569 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); | |
2570 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
2571 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
2572 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
2573 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2); | |
2574 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); | |
2575 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
2576 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
2577 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
2578 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); | |
2579 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); | |
2580 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); | |
2581 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); | |
2582 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); | |
2583 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
2584 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
2585 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2586 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2); | |
2587 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); | |
2588 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-b", 2); | |
2589 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
2590 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
2591 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
2592 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
2593 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
2594 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
2595 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
2596 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
2597 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
2598 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
2599 } | |
2600 uGameUIFontMain = TargetColor(0, 0, 0xC8u); | |
2601 uGameUIFontShadow = TargetColor(255, 255, 255); | |
2602 } | |
2603 else Error("Invalid alignment type: %u", align); | |
2604 } | |
2605 //----- (0041D20D) -------------------------------------------------------- | |
2606 void DrawBuff_remaining_time_string( int uY, struct GUIWindow *window, __int64 remaining_time, struct GUIFont *Font ) | |
2607 { | |
2608 unsigned int full_time; // esi@1 | |
2609 signed __int64 hours; // kr00_8@1 | |
2610 const char *text; // eax@2 | |
2611 signed __int64 minutes; // [sp+10h] [bp-10h]@1 | |
2612 signed __int64 seconds; // [sp+18h] [bp-8h]@1 | |
2613 unsigned int day; // [sp+24h] [bp+4h]@1 | |
2614 | |
2615 full_time = (signed __int64)((double)remaining_time * 0.234375); | |
2616 day = (unsigned int)((full_time / 60) / 60) / 24; | |
2617 hours = ((full_time / 60) / 60) % 24; | |
2618 minutes = (signed __int64)(full_time / 60) % 60; | |
2619 seconds = (signed __int64)full_time % 60; | |
2620 strcpy(pTmpBuf.data(), "\r020"); | |
2621 if ( day ) | |
2622 { | |
2623 text = pGlobalTXT_LocalizationStrings[57]; // Days | |
2624 if ( day <= 1 ) | |
2625 text = pGlobalTXT_LocalizationStrings[56]; // Day | |
2626 sprintfex(pTmpBuf2.data(), "%d %s ", (int)day, text); | |
2627 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2628 } | |
2629 if ( hours ) | |
2630 { | |
2631 if ( hours <= 1 ) | |
2632 text = pGlobalTXT_LocalizationStrings[109];// Hour | |
2633 else | |
2634 text = pGlobalTXT_LocalizationStrings[110];// Hours | |
2635 sprintfex(pTmpBuf2.data(), "%d %s ", (int)hours, text); | |
2636 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2637 } | |
2638 if ( minutes && !day ) | |
2639 { | |
2640 if ( minutes <= 1 ) | |
2641 text = pGlobalTXT_LocalizationStrings[437];// Minute | |
2642 else | |
2643 text = pGlobalTXT_LocalizationStrings[436];// Minutes | |
2644 sprintfex(pTmpBuf2.data(), "%d %s ", (int)minutes, text); | |
2645 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2646 } | |
2647 if ( seconds && !hours ) | |
2648 { | |
2649 if ( seconds <= 1 ) | |
2650 text = pGlobalTXT_LocalizationStrings[439];// Second | |
2651 else | |
2652 text = pGlobalTXT_LocalizationStrings[438];// Seconds | |
2653 sprintfex(pTmpBuf2.data(), "%d %s ", (int)seconds, text); | |
2654 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2655 } | |
2656 window->DrawText(Font, 32, uY, 0, pTmpBuf.data(), 0, 0, 0); | |
0 | 2657 } |