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