Mercurial > mm7
annotate GUIWindow.cpp @ 2471:b61ebbb46ace
VS 2010 filters
author | Ritor1 |
---|---|
date | Mon, 18 Aug 2014 22:24:00 +0600 |
parents | 8516bb27d7f0 |
children | e42e01ff1526 |
rev | line source |
---|---|
2415 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2216
diff
changeset
|
5 #define _CRT_SECURE_NO_WARNINGS |
2336 | 6 #include "ErrorHandling.h" |
2464 | 7 |
0 | 8 #include "GUIWindow.h" |
9 #include "GUIFont.h" | |
10 #include "Party.h" | |
11 #include "LOD.h" | |
12 #include "Keyboard.h" | |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2026
diff
changeset
|
13 #include "OurMath.h" |
2044 | 14 #include "Timer.h" |
0 | 15 #include "AudioPlayer.h" |
16 #include "Mouse.h" | |
17 #include "Viewport.h" | |
18 #include "StorylineTextTable.h" | |
1299 | 19 #include "UI\UIHouses.h" |
1310 | 20 #include "UI\UIBooks.h" |
189 | 21 #include "texts.h" |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
74
diff
changeset
|
22 #include "Autonotes.h" |
949 | 23 #include "Awards.h" |
1297 | 24 #include "Chest.h" |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1591
diff
changeset
|
25 #include "Outdoor.h" |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1639
diff
changeset
|
26 #include "Game.h" |
1913 | 27 #include "IconFrameTable.h" |
2362 | 28 #include "Actor.h" |
0 | 29 |
2463 | 30 #include "UI\UIArena.h" |
31 #include "Events.h" | |
32 #include "Level\Decoration.h" | |
33 | |
1268 | 34 typedef struct _RGBColor |
35 { | |
36 unsigned char R; | |
37 unsigned char B; | |
38 unsigned char G; | |
39 }RGBColor; | |
0 | 40 |
41 | |
1268 | 42 std::array<RGBColor, 20> spell_tooltip_colors={{ |
43 {0x96, 0xD4, 0xFF}, | |
44 {0xFF, 0x80, 0x00}, | |
45 {0xFF, 0xFF, 0x9B}, | |
46 {0xE1, 0xE1, 0xE1}, | |
47 {0x80, 0x80, 0x80}, | |
48 {0x96, 0xD4, 0xFF}, | |
49 {0xFF, 0x55, 0x00}, | |
50 {0x96, 0xD4, 0xFF}, | |
51 {0xFF, 0x55, 0x00}, | |
52 {0xE1, 0xE1, 0xE1}, | |
53 {0xFF, 0x55, 0x00}, | |
54 {0x96, 0xD4, 0xFF}, | |
55 {0xEB, 0x0F, 0xFF}, | |
56 {0xFF, 0x80, 0x00}, | |
57 {0x96, 0xD4, 0xFF}, | |
58 {0x80, 0x80, 0x80}, | |
59 {0xFF, 0x55, 0x00}, | |
60 {0x00, 0x80, 0xFF}, | |
61 {0x00, 0x80, 0xFF}, | |
62 {0x96, 0xD4, 0xFF}}}; | |
63 | |
0 | 64 |
65 int pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[1]; // idb | |
2278 | 66 struct GUIWindow *pWindow_MMT_MainMenu; |
0 | 67 struct GUIWindow *pWindow_MainMenu; |
1202 | 68 std::array<struct GUIWindow, 20> pWindowList; |
0 | 69 |
70 struct GUIMessageQueue *pMessageQueue_50CBD0 = new GUIMessageQueue; | |
1012 | 71 struct GUIMessageQueue *pMessageQueue_50C9E8 = new GUIMessageQueue; |
0 | 72 |
1038 | 73 |
74 | |
75 | |
76 | |
77 | |
783 | 78 // inlined |
79 //----- (mm6c::00420520) -------------------------------------------------- | |
80 void GUIMessageQueue::Flush() | |
81 { | |
82 if (uNumMessages) | |
83 uNumMessages = pMessages[0].field_8 != 0; | |
84 } | |
85 | |
0 | 86 //----- (004356B9) -------------------------------------------------------- |
87 void GUIMessageQueue::PopMessage(enum UIMessageType *pType, int *pParam, int *a4) | |
88 { | |
89 if ( this->uNumMessages ) | |
90 { | |
91 *pType = this->pMessages[0].eType; | |
92 *pParam = this->pMessages[0].param; | |
93 *a4 = this->pMessages[0].field_8; | |
94 if ( (signed int)(this->uNumMessages - 1) > 0 ) | |
95 { | |
2271 | 96 for ( uint i = 0; i < (signed int)(this->uNumMessages - 1); ++i ) |
0 | 97 { |
2271 | 98 this->pMessages[i].eType = this->pMessages[i + 1].eType; |
99 this->pMessages[i].param = this->pMessages[i + 1].param; | |
100 this->pMessages[i].field_8 = this->pMessages[i + 1].field_8; | |
0 | 101 } |
102 } | |
103 --this->uNumMessages; | |
104 } | |
105 } | |
106 | |
994 | 107 //----- (0041B4E1) -------------------------------------------------------- |
108 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) | |
109 { | |
110 int result; // eax@1 | |
111 int i; // edx@2 | |
112 GUIButton *j; // ecx@3 | |
113 int k; // edx@7 | |
114 GUIButton *l; // ecx@8 | |
115 unsigned __int8 v9; // [sp+4h] [bp-8h]@1 | |
2445 | 116 char old_hot_key; // [sp+8h] [bp-4h]@1 |
994 | 117 |
2445 | 118 //v3 = uNewHotkey; |
119 old_hot_key = toupper(uOldHotkey); | |
120 result = toupper(uNewHotkey); | |
994 | 121 v9 = result; |
122 if ( bFirstCall ) | |
123 { | |
124 for ( i = uNumVisibleWindows; i >= 0; --i ) | |
125 { | |
126 result = 84 * pVisibleWindowsIdxs[i]; | |
127 for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) | |
128 j->field_28 = 0; | |
129 } | |
130 } | |
131 for ( k = uNumVisibleWindows; k >= 0; --k ) | |
132 { | |
133 result = 84 * pVisibleWindowsIdxs[k]; | |
134 for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) | |
135 { | |
2445 | 136 LOBYTE(result) = old_hot_key; |
137 if ( l->uHotkey == old_hot_key ) | |
994 | 138 { |
139 if ( !l->field_28 ) | |
140 { | |
141 LOBYTE(result) = v9; | |
142 l->field_28 = 1; | |
143 l->uHotkey = v9; | |
144 } | |
145 } | |
146 } | |
147 } | |
148 return result; | |
149 } | |
150 | |
151 //----- (0041B438) -------------------------------------------------------- | |
152 GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) | |
153 { | |
2445 | 154 char Hot_key_num; // al@1 |
155 GUIWindow *current_window; // ecx@2 | |
994 | 156 GUIButton *result; // eax@2 |
157 | |
2445 | 158 Hot_key_num = toupper(uHotkey); |
159 for( int i = uNumVisibleWindows; i >= 0 && pVisibleWindowsIdxs[i] > 0; i-- ) | |
994 | 160 { |
2445 | 161 current_window = &pWindowList[pVisibleWindowsIdxs[i] - 1]; |
162 for ( result = current_window->pControlsHead; result; result = result->pNext ) | |
1210 | 163 { |
2445 | 164 if ( result->uHotkey == Hot_key_num ) |
1210 | 165 { |
2402 | 166 pMessageQueue_50CBD0->AddGUIMessage(result->msg, result->msg_param, 0); |
1210 | 167 return result; |
168 } | |
169 } | |
2445 | 170 if ( !current_window->uFrameX && !current_window->uFrameY |
171 && (current_window->uFrameWidth == window->GetWidth() && current_window->uFrameHeight == window->GetWidth()) ) | |
1210 | 172 break; |
994 | 173 } |
174 return 0; | |
175 } | |
176 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
177 | |
0 | 178 //----- (0041D73D) -------------------------------------------------------- |
1006 | 179 void GUIWindow::_41D73D_draw_buff_tooltip() |
2461 | 180 { |
1268 | 181 __int64 remaing_time; // ST28_8@11 |
182 unsigned short text_color; | |
183 int Y_pos; // esi@11 | |
184 int string_count; // [sp+20h] [bp-4h]@7 | |
185 | |
186 string_count = 0; | |
187 for (int i=0; i<20; ++i) | |
188 if ( pParty->pPartyBuffs[i].uExpireTime > 0i64 ) | |
189 ++string_count; | |
0 | 190 |
1268 | 191 uFrameHeight = pFontArrus->uFontHeight + 72; |
192 uFrameHeight += (string_count - 1) * pFontArrus->uFontHeight; | |
193 uFrameZ = uFrameWidth + uFrameX - 1; | |
194 uFrameW = uFrameY + uFrameHeight - 1; | |
195 DrawMessageBox(0); | |
2461 | 196 DrawTitleText(pFontArrus, 0, 12, 0, pGlobalTXT_LocalizationStrings[451], 3); |
1268 | 197 if ( !string_count ) |
2461 | 198 DrawTitleText(pFontComic, 0, 40, 0, pGlobalTXT_LocalizationStrings[153], 3); |
1268 | 199 |
200 GetTickCount(); | |
201 string_count = 0; | |
202 for (int i=0; i<20; ++i) | |
0 | 203 { |
1268 | 204 if ( pParty->pPartyBuffs[i].uExpireTime>0i64 )//!!! |
205 { | |
206 remaing_time = pParty->pPartyBuffs[i].uExpireTime- pParty->uTimePlayed;//!!! | |
207 Y_pos = string_count * pFontComic->uFontHeight + 40; | |
2069 | 208 text_color = Color16(spell_tooltip_colors[i].R, spell_tooltip_colors[i].G, spell_tooltip_colors[i].B); |
1268 | 209 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
|
210 DrawBuff_remaining_time_string(Y_pos, this, remaing_time, pFontComic); |
1268 | 211 ++string_count; |
2461 | 212 } |
0 | 213 } |
214 } | |
215 | |
216 | |
217 //----- (0041D08F) -------------------------------------------------------- | |
1411 | 218 void GUIWindow::_41D08F_set_keyboard_control_group(int num_buttons, int a3, int a4, int a5) |
0 | 219 { |
1411 | 220 if (num_buttons) |
0 | 221 { |
1411 | 222 this->pNumPresenceButton = num_buttons; |
0 | 223 this->field_30 = a3; |
224 this->field_34 = a4; | |
225 this->pCurrentPosActiveItem = a5; | |
226 this->pStartingPosActiveItem = a5; | |
972 | 227 this->receives_keyboard_input = true; |
0 | 228 } |
229 else | |
230 { | |
231 this->pNumPresenceButton = 0; | |
232 this->field_30 = a3; | |
233 this->field_34 = a4; | |
234 this->pCurrentPosActiveItem = 0; | |
235 this->pStartingPosActiveItem = 0; | |
972 | 236 this->receives_keyboard_input = false; |
0 | 237 } |
238 } | |
239 | |
240 | |
241 //----- (0041C26A) -------------------------------------------------------- | |
242 void GUIWindow::Release() | |
243 { | |
961 | 244 //GUIWindow *v1; // esi@1 |
0 | 245 int i; // edi@20 |
961 | 246 //GUIButton *v8; // eax@26 |
247 GUIButton *pNextBtn; // edi@27 | |
248 //int v10; // esi@28 | |
249 //int v11; // ecx@28 | |
0 | 250 int v12; // edx@29 |
251 | |
961 | 252 //v1 = this; |
0 | 253 if ( !this ) |
254 return; | |
696 | 255 |
256 switch( this->eWindowType ) | |
0 | 257 { |
696 | 258 case WINDOW_GreetingNPC: |
259 { | |
1006 | 260 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 261 pCurrentScreen = pMainScreenNum; |
1459 | 262 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); |
696 | 263 break; |
264 } | |
265 case WINDOW_HouseInterior: | |
266 { | |
267 for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) | |
268 pDialogueNPCPortraits[i]->Release(); | |
269 uNumDialogueNPCPortraits = 0; | |
270 pTexture_Dialogue_Background->Release(); | |
0 | 271 |
1006 | 272 pIcons_LOD->SyncLoadedFilesCount(); |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
273 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
696 | 274 dword_5C35D4 = 0; |
275 if ( bFlipOnExit ) | |
276 { | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1591
diff
changeset
|
277 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
|
278 pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY; |
696 | 279 } |
280 pParty->uFlags |= 2u; | |
281 break; | |
282 } | |
283 case WINDOW_Transition: | |
284 { | |
2434
1eb352f7319a
* Fixed double release of movie in transition screens
a.parshin
parents:
2415
diff
changeset
|
285 //pVideoPlayer->Unload(); |
696 | 286 pTexture_outside->Release(); |
287 pTexture_Dialogue_Background->Release(); | |
1006 | 288 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 289 pCurrentScreen = pMainScreenNum; |
290 break; | |
291 } | |
292 case WINDOW_SpellBook: | |
293 { | |
1402 | 294 OnCloseSpellBookPage(); |
295 OnCloseSpellBook(); | |
696 | 296 break; |
297 } | |
298 case WINDOW_Book: | |
299 { | |
1402 | 300 OnCloseBook(); |
696 | 301 break; |
302 } | |
1402 | 303 case WINDOW_ChangeLocation: |
304 { | |
0 | 305 pTexture_outside->Release(); |
306 pTexture_Dialogue_Background->Release(); | |
1006 | 307 pIcons_LOD->SyncLoadedFilesCount(); |
11 | 308 pCurrentScreen = pMainScreenNum; |
696 | 309 break; |
310 } | |
311 case WINDOW_Dialogue: | |
312 { | |
313 if ( !dword_591084 ) | |
314 pDialogueNPCPortraits[0]->Release(); | |
315 uNumDialogueNPCPortraits = 0; | |
316 pTexture_Dialogue_Background->Release(); | |
317 | |
1006 | 318 pIcons_LOD->SyncLoadedFilesCount(); |
696 | 319 pCurrentScreen = pMainScreenNum; |
2004
2bcb4ec491cb
fixing game window not reacting after closing npc dialog
Grumpy7
parents:
1980
diff
changeset
|
320 break; |
696 | 321 } |
1942 | 322 case WINDOW_null: |
323 return; | |
696 | 324 default: |
325 break; | |
0 | 326 } |
961 | 327 //v8 = this->pControlsHead; |
328 if ( this->pControlsHead ) | |
0 | 329 { |
330 do | |
331 { | |
961 | 332 pNextBtn = this->pControlsHead->pNext; |
1583 | 333 free(this->pControlsHead); |
961 | 334 this->pControlsHead = pNextBtn; |
0 | 335 } |
961 | 336 while ( pNextBtn ); |
0 | 337 } |
961 | 338 this->pControlsHead = 0; |
339 this->pControlsTail = 0; | |
340 this->uNumControls = 0; | |
341 this->eWindowType = WINDOW_null; | |
342 while ( this->numVisibleWindows < uNumVisibleWindows ) | |
0 | 343 { |
961 | 344 v12 = pVisibleWindowsIdxs[this->numVisibleWindows + 1]; |
345 pVisibleWindowsIdxs[this->numVisibleWindows] = v12; | |
962 | 346 --pWindowList[v12 - 1].numVisibleWindows; |
961 | 347 ++this->numVisibleWindows; |
0 | 348 } |
961 | 349 pVisibleWindowsIdxs[uNumVisibleWindows] = 0; |
350 uNumVisibleWindows = uNumVisibleWindows - 1; | |
0 | 351 } |
352 | |
353 //----- (0041CD3B) -------------------------------------------------------- | |
354 GUIButton *GUIWindow::GetControl(unsigned int uID) | |
355 { | |
356 GUIButton *result; // eax@1 | |
357 | |
358 result = this->pControlsHead; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
359 for ( uID; uID; --uID ) |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
360 result = result->pNext; |
0 | 361 return result; |
362 } | |
363 | |
364 //----- (00411BFC) -------------------------------------------------------- | |
365 void GUIWindow::InitializeBookView() | |
366 { | |
1453 | 367 char *pString; // eax@12 |
368 int pTextHeight; // eax@12 | |
369 //__int64 page_count; // qax@12 | |
370 unsigned int page_count; // esi@12 | |
0 | 371 unsigned __int16 v18; // ax@38 |
1310 | 372 signed int max_beacons; // [sp+10h] [bp-5Ch]@38 |
1453 | 373 GUIWindow journal_window; // [sp+18h] [bp-54h]@8 |
0 | 374 |
375 pAudioPlayer->StopChannels(-1, -1); | |
376 InitializeBookFonts(); | |
1453 | 377 this->CreateButton(475, 445, 158, 34, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); // Close |
151 | 378 pCurrentScreen = SCREEN_BOOKS; |
1446 | 379 full_num_items_in_book = 0; |
380 books_primary_item_per_page = 0; | |
381 books_page_number = 0; | |
949 | 382 num_achieved_awards = 0; |
1453 | 383 switch (this->par1C) |
384 { | |
385 case WINDOW_LloydsBeacon: | |
386 { | |
688 | 387 byte_506360 = 0; |
948 | 388 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("lb_bordr", TEXTURE_16BIT_PALETTE); |
389 pTexture_LloydBeacons[0] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); | |
1310 | 390 pTexture_LloydBeacons[1] = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); |
1453 | 391 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
392 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
948 | 393 |
1453 | 394 pBtn_Book_1 = this->CreateButton(415, 13, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 0, 0, pGlobalTXT_LocalizationStrings[375], 0); // Set Beacon |
395 pBtn_Book_2 = this->CreateButton(415, 48, 39, 36, 1, 0, UIMSG_LloydsBeacon_FlippingBtn, 1, 0, pGlobalTXT_LocalizationStrings[523], 0); // Recall Beacon | |
1310 | 396 |
397 max_beacons = 1; | |
1453 | 398 v18 = pParty->pPlayers[_506348_current_lloyd_playerid].pActiveSkills[PLAYER_SKILL_WATER]; |
1310 | 399 if ( v18 & 0x100 || (v18 & 0x80) ) |
400 max_beacons = 5; | |
401 else if ( v18 & 0x40 ) | |
402 max_beacons = 3; | |
403 | |
1453 | 404 for ( int i = 0; i < max_beacons; ++i ) |
1430 | 405 CreateButton(pLloydsBeaconsPreviewXs[i], pLloydsBeaconsPreviewYs[i], |
1310 | 406 92, 68, 1, 180, UIMSG_InstallBeacon, i, 0, "", 0); |
407 | |
1453 | 408 for ( int i = 0; i < 5; ++i ) |
409 { | |
410 if (pParty->pPlayers[_506348_current_lloyd_playerid].pInstalledBeacons[i].uBeaconTime >= (signed __int64)pParty->uTimePlayed) | |
411 LoadThumbnailLloydTexture(i, _506348_current_lloyd_playerid + 1); | |
412 else | |
413 memset(&pParty->pPlayers[_506348_current_lloyd_playerid].pInstalledBeacons[i], 0, sizeof(LloydBeacon)); | |
414 } | |
415 } | |
416 break; | |
710 | 417 |
418 case WINDOW_TownPortal: | |
419 { | |
948 | 420 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("townport", TEXTURE_16BIT_PALETTE); |
710 | 421 pTexture_TownPortalIcons[0] = pIcons_LOD->LoadTexturePtr("tpharmndy", TEXTURE_16BIT_PALETTE); |
422 pTexture_TownPortalIcons[1] = pIcons_LOD->LoadTexturePtr("tpelf", TEXTURE_16BIT_PALETTE); | |
423 pTexture_TownPortalIcons[2] = pIcons_LOD->LoadTexturePtr("tpwarlock", TEXTURE_16BIT_PALETTE); | |
424 pTexture_TownPortalIcons[3] = pIcons_LOD->LoadTexturePtr("tpisland", TEXTURE_16BIT_PALETTE); | |
425 pTexture_TownPortalIcons[4] = pIcons_LOD->LoadTexturePtr("tpheaven", TEXTURE_16BIT_PALETTE); | |
730 | 426 pTexture_TownPortalIcons[5] = pIcons_LOD->LoadTexturePtr("tphell", TEXTURE_16BIT_PALETTE); |
1393 | 427 |
428 static int pTownPortalBook_ws[6] = { 80, 66, 68, 72, 67, 74}; | |
429 static int pTownPortalBook_hs[6] = { 55, 56, 65, 67, 67, 59}; | |
1453 | 430 for ( uint i = 0; i < 6; ++i ) |
431 this->CreateButton(pTownPortalBook_xs[i], pTownPortalBook_ys[i], pTownPortalBook_ws[i], pTownPortalBook_hs[i], 1, 182, UIMSG_ClickTownInTP, i, 0, "", nullptr); | |
1310 | 432 |
710 | 433 } |
434 break; | |
435 | |
436 case WINDOW_QuestBook: | |
948 | 437 { |
438 pTexture_CurrentBook = pIcons_LOD->LoadTexturePtr("sbquiknot", TEXTURE_16BIT_PALETTE); | |
439 pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr( "divbar", TEXTURE_16BIT_PALETTE); | |
1453 | 440 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
441 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
442 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
443 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
444 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, | |
445 pTex_book_button1_on->uTextureWidth, pTex_book_button1_on->uTextureHeight, | |
996 | 446 1, 0, UIMSG_ClickBooksBtn, 0xBu, 0, pGlobalTXT_LocalizationStrings[192],// "Scroll Up" |
1453 | 447 pTex_book_button1_on, 0); |
448 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, | |
449 pTex_book_button2_on->uTextureHeight, pTex_book_button2_on->uTextureHeight, | |
996 | 450 1, 0, UIMSG_ClickBooksBtn, 0xAu, 0, pGlobalTXT_LocalizationStrings[193],// "Scroll Down" |
1453 | 451 pTex_book_button2_on, 0); |
949 | 452 num_achieved_awards = 0; |
1202 | 453 memset(achieved_awards.data(), 0, 4000); |
1453 | 454 for ( uint i = books_primary_item_per_page; i < 512; ++i ) |
455 { | |
456 if ( _449B57_test_bit(pParty->_quest_bits, i) && pQuestTable[i] ) | |
457 { | |
458 achieved_awards[num_achieved_awards] = (AwardType)i; | |
459 ++num_achieved_awards; | |
460 } | |
461 } | |
462 full_num_items_in_book = num_achieved_awards; | |
949 | 463 num_achieved_awards = 0; |
1453 | 464 } |
465 break; | |
981 | 466 |
1453 | 467 case WINDOW_AutonotesBook: |
468 { | |
948 | 469 pTexture_AutonotesBook = pIcons_LOD->LoadTexturePtr("sbautnot", TEXTURE_16BIT_PALETTE); |
470 pSpellBookPagesTextr_10 = pIcons_LOD->LoadTexturePtr("divbar", TEXTURE_16BIT_PALETTE); | |
1453 | 471 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
472 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
473 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
474 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
475 pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tab-an-1b", TEXTURE_16BIT_PALETTE); | |
476 pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tab-an-1a", TEXTURE_16BIT_PALETTE); | |
477 pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tab-an-2b", TEXTURE_16BIT_PALETTE); | |
478 pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tab-an-2a", TEXTURE_16BIT_PALETTE); | |
479 pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tab-an-3b", TEXTURE_16BIT_PALETTE); | |
480 pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tab-an-3a", TEXTURE_16BIT_PALETTE); | |
481 pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tab-an-5b", TEXTURE_16BIT_PALETTE); | |
482 pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tab-an-5a", TEXTURE_16BIT_PALETTE); | |
483 pTex_book_button7_on = pIcons_LOD->LoadTexturePtr("tab-an-4b", TEXTURE_16BIT_PALETTE); | |
484 pTex_book_button7_off = pIcons_LOD->LoadTexturePtr("tab-an-4a", TEXTURE_16BIT_PALETTE); | |
485 pTex_book_button8_on = pIcons_LOD->LoadTexturePtr("tab-an-8b", TEXTURE_16BIT_PALETTE); | |
486 pTex_book_button8_off = pIcons_LOD->LoadTexturePtr("tab-an-8a", TEXTURE_16BIT_PALETTE); | |
948 | 487 |
1453 | 488 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, |
489 UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[193], pTex_book_button1_on, 0); | |
490 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, | |
491 UIMSG_ClickBooksBtn, 10, 0, pGlobalTXT_LocalizationStrings[192], pTex_book_button2_on, 0); | |
492 pBtn_Book_3 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, | |
493 UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[85], pTex_book_button3_on, 0); // "Potion Notes" | |
494 pBtn_Book_4 = this->CreateButton(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, | |
495 UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[137], pTex_book_button4_on, 0); // "Fountain Notes" | |
496 pBtn_Book_5 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, | |
497 UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[8], pTex_book_button5_on, 0); // "Obelisk Notes" | |
498 pBtn_Book_6 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, | |
499 UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[141], pTex_book_button6_on, 0); // "Seer Notes" | |
500 pBtn_Autonotes_Misc = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, 50, 34, 1, 0, | |
501 UIMSG_ClickBooksBtn, 6, 0, pGlobalTXT_LocalizationStrings[123], pTex_book_button7_on, 0); // "Miscellaneous Notes" | |
502 pBtn_Autonotes_Instructors = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, 50, 34, 1, 0, | |
503 UIMSG_ClickBooksBtn, 7, 0, pGlobalTXT_LocalizationStrings[662], pTex_book_button8_on, 0); // "Instructors" | |
948 | 504 |
949 | 505 num_achieved_awards = 0; |
1453 | 506 for ( uint i = books_primary_item_per_page; i < 196; ++i ) |
507 { | |
508 if ( _506568_autonote_type == pAutonoteTxt[i].eType)//dword_72371C[2 * v10] ) | |
509 { | |
510 if ( i ) | |
511 { | |
512 if ( _449B57_test_bit(pParty->_autonote_bits, i) && pAutonoteTxt[i].pText ) | |
513 { | |
514 achieved_awards[num_achieved_awards] = (AwardType)i; | |
515 ++num_achieved_awards; | |
516 } | |
517 } | |
518 } | |
519 } | |
520 full_num_items_in_book = num_achieved_awards; | |
521 num_achieved_awards = 0; | |
522 } | |
523 break; | |
1310 | 524 |
1453 | 525 case WINDOW_MapsBook: |
526 { | |
688 | 527 dword_506364 = 1; |
948 | 528 pSpellBookPagesTextr_12 = pIcons_LOD->LoadTexturePtr("sbmap", TEXTURE_16BIT_PALETTE); |
1453 | 529 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("zoom-on", TEXTURE_16BIT_PALETTE); |
530 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("zoot-on", TEXTURE_16BIT_PALETTE); | |
531 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("zoom-off", TEXTURE_16BIT_PALETTE); | |
532 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("zoot-off", TEXTURE_16BIT_PALETTE); | |
533 pTex_book_button3_on = pIcons_LOD->LoadTexturePtr("tabNon", TEXTURE_16BIT_PALETTE); | |
534 pTex_book_button3_off = pIcons_LOD->LoadTexturePtr("tabNoff", TEXTURE_16BIT_PALETTE); | |
535 pTex_book_button4_on = pIcons_LOD->LoadTexturePtr("tabSon", TEXTURE_16BIT_PALETTE); | |
536 pTex_book_button4_off = pIcons_LOD->LoadTexturePtr("tabSoff", TEXTURE_16BIT_PALETTE); | |
537 pTex_book_button5_on = pIcons_LOD->LoadTexturePtr("tabEon", TEXTURE_16BIT_PALETTE); | |
538 pTex_book_button5_off = pIcons_LOD->LoadTexturePtr("tabEoff", TEXTURE_16BIT_PALETTE); | |
539 pTex_book_button6_on = pIcons_LOD->LoadTexturePtr("tabWon", TEXTURE_16BIT_PALETTE); | |
540 pTex_book_button6_off = pIcons_LOD->LoadTexturePtr("tabWoff", TEXTURE_16BIT_PALETTE); | |
948 | 541 |
1453 | 542 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, 50, 34, 1, 0, |
543 UIMSG_ClickBooksBtn, 0, 0, pGlobalTXT_LocalizationStrings[251], pTex_book_button1_on, 0);// "Zoom In" | |
544 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, 50, 34, 1, 0, | |
545 UIMSG_ClickBooksBtn, 1, 0, pGlobalTXT_LocalizationStrings[252], pTex_book_button2_on, 0);// "Zoom Out" | |
546 pBtn_Book_3 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 113, 50, 34, 1, 0, | |
1310 | 547 UIMSG_ClickBooksBtn, 2, 0, pGlobalTXT_LocalizationStrings[192], (Texture *)"", 0);// Scroll Up |
1453 | 548 pBtn_Book_4 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 150, 50, 34, 1, 0, |
1310 | 549 UIMSG_ClickBooksBtn, 3, 0, pGlobalTXT_LocalizationStrings[193], (Texture *)"", 0);// Scroll Down |
1453 | 550 pBtn_Book_5 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, 50, 34, 1, 0, |
1310 | 551 UIMSG_ClickBooksBtn, 4, 0, pGlobalTXT_LocalizationStrings[573], (Texture *)"", 0);// "Scroll Right" |
1453 | 552 pBtn_Book_6 = this->CreateButton(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, 50, 34, 1, 0, |
1310 | 553 UIMSG_ClickBooksBtn, 5, 0, pGlobalTXT_LocalizationStrings[572], (Texture *)"", 0);// "Scroll Left" |
1453 | 554 } |
555 break; | |
948 | 556 |
1453 | 557 case WINDOW_CalendarBook: |
558 { | |
948 | 559 pSpellBookPagesTextr_13 = pIcons_LOD->LoadTexturePtr("sbdate-time", TEXTURE_16BIT_PALETTE); |
560 pTex_moon_new = pIcons_LOD->LoadTexturePtr("moon_new", TEXTURE_16BIT_PALETTE); | |
561 pTex_moon_4 = pIcons_LOD->LoadTexturePtr("moon_4", TEXTURE_16BIT_PALETTE); | |
562 pTex_moon_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); | |
563 pTex_moon_2_2 = pIcons_LOD->LoadTexturePtr("moon_2", TEXTURE_16BIT_PALETTE); | |
564 pTex_moon_ful = pIcons_LOD->LoadTexturePtr("moon_ful", TEXTURE_16BIT_PALETTE); | |
1453 | 565 } |
566 break; | |
948 | 567 |
1453 | 568 case WINDOW_JournalBook: |
569 { | |
948 | 570 pSpellBookPagesTextr_11 = pIcons_LOD->LoadTexturePtr("sbplayrnot", TEXTURE_16BIT_PALETTE); |
1453 | 571 pTex_book_button1_on = pIcons_LOD->LoadTexturePtr("tab-an-6b", TEXTURE_16BIT_PALETTE); |
572 pTex_book_button2_on = pIcons_LOD->LoadTexturePtr("tab-an-7b", TEXTURE_16BIT_PALETTE); | |
573 pTex_book_button1_off = pIcons_LOD->LoadTexturePtr("tab-an-6a", TEXTURE_16BIT_PALETTE); | |
574 pTex_book_button2_off = pIcons_LOD->LoadTexturePtr("tab-an-7a", TEXTURE_16BIT_PALETTE); | |
948 | 575 |
1453 | 576 pBtn_Book_1 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 1, |
577 pTex_book_button1_on->uTextureWidth, pTex_book_button1_on->uTextureHeight, 1, 0, | |
578 UIMSG_ClickBooksBtn, 11, 0, pGlobalTXT_LocalizationStrings[192], pTex_book_button1_on, 0); | |
579 pBtn_Book_2 = this->CreateButton(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 38, pTex_book_button2_on->uTextureHeight, | |
580 pTex_book_button2_on->uTextureHeight, 1, 0, UIMSG_ClickBooksBtn, 10, 0, | |
581 pGlobalTXT_LocalizationStrings[193], pTex_book_button2_on, 0); | |
948 | 582 |
949 | 583 num_achieved_awards = 0; |
1453 | 584 journal_window.uFrameX = 48; |
585 journal_window.uFrameY = 70; | |
586 journal_window.uFrameWidth = 360; | |
587 journal_window.uFrameHeight = 264; | |
588 journal_window.uFrameZ = 407; | |
589 journal_window.uFrameHeight = (LOBYTE(pAutonoteFont->uFontHeight) - 3) * 264 / LOBYTE(pAutonoteFont->uFontHeight) - 3; | |
590 journal_window.uFrameW = journal_window.uFrameHeight + 69; | |
949 | 591 memset(&achieved_awards, 0, 4000); |
1453 | 592 memset(Journal_limitation_factor.data(), 0, 100); |
1446 | 593 if ( books_primary_item_per_page < 29 ) |
1453 | 594 { |
2026 | 595 for ( int i = books_primary_item_per_page; i < books_primary_item_per_page + 29; i++ ) |
1453 | 596 { |
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
|
597 if ( pParty->PartyTimes.HistoryEventTimes[i] > 0 ) |
688 | 598 { |
1453 | 599 if ( pStorylineText->StoreLine[i + 1].pText ) |
600 { | |
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
|
601 pString = BuildDialogueString(pStorylineText->StoreLine[i + 1].pText, uActiveCharacter - 1, 0, 0, 0, &pParty->PartyTimes.HistoryEventTimes[i]); |
1453 | 602 pTextHeight = pAutonoteFont->CalcTextHeight(pString, &journal_window, 1, 0); |
603 page_count = ((pTextHeight - (pAutonoteFont->uFontHeight - 3)) / (signed int)journal_window.uFrameHeight) + 1; | |
604 memset32((char *)&achieved_awards[num_achieved_awards] , i + 1, page_count); | |
605 for ( uint j = 0; j <= page_count - 1; ++j ) | |
606 Journal_limitation_factor[num_achieved_awards++] = j; | |
607 } | |
688 | 608 } |
1453 | 609 } |
688 | 610 } |
1453 | 611 full_num_items_in_book = num_achieved_awards; |
612 num_achieved_awards = 0; | |
613 } | |
614 break; | |
615 } | |
0 | 616 } |
617 | |
618 //----- (00415551) -------------------------------------------------------- | |
619 void GUIWindow::DrawMessageBox(int arg0) | |
620 { | |
621 unsigned int v2; // edi@1 | |
622 signed int v4; // esi@2 | |
623 unsigned int v5; // eax@2 | |
624 unsigned int v16; // esi@19 | |
2271 | 625 GUIWindow current_window; // [sp+Ch] [bp-60h]@18 |
626 POINT cursor; // [sp+60h] [bp-Ch]@8 | |
0 | 627 unsigned int v22; // [sp+74h] [bp+8h]@2 |
628 | |
629 v2 = 0; | |
630 if ( arg0 ) | |
631 { | |
693 | 632 v4 = pViewport->uViewportTL_X; |
633 v5 = pViewport->uViewportBR_X; | |
634 v2 = pViewport->uViewportTL_Y; | |
635 v22 = pViewport->uViewportBR_Y; | |
0 | 636 } |
637 else | |
638 { | |
639 v4 = 0; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2153
diff
changeset
|
640 v5 = window->GetWidth(); |
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2153
diff
changeset
|
641 v22 = window->GetHeight(); |
0 | 642 } |
2271 | 643 pMouse->GetCursorPos(&cursor); |
0 | 644 if ( (signed int)this->uFrameX >= v4 ) |
645 { | |
2271 | 646 if ( (signed int)(this->uFrameWidth + this->uFrameX) > (signed int)v5 ) |
647 { | |
648 this->uFrameX = v5 - this->uFrameWidth; | |
649 this->uFrameY = cursor.y + 30; | |
650 } | |
0 | 651 } |
652 else | |
653 { | |
654 this->uFrameX = v4; | |
2271 | 655 this->uFrameY = cursor.y + 30; |
0 | 656 } |
2271 | 657 |
658 if ( (signed int)this->uFrameY >= (signed int)v2 ) | |
0 | 659 { |
2271 | 660 if ( (signed int)(this->uFrameY + this->uFrameHeight) > (signed int)v22 ) |
661 this->uFrameY = cursor.y - this->uFrameHeight - 30; | |
0 | 662 } |
663 else | |
2271 | 664 this->uFrameY = cursor.y + 30; |
665 if ( (signed int)this->uFrameY < (signed int)v2 ) | |
666 this->uFrameY = v2; | |
667 if ( (signed int)this->uFrameX < v4 ) | |
668 this->uFrameX = v4; | |
669 this->uFrameZ = this->uFrameWidth + this->uFrameX - 1; | |
670 this->uFrameW = this->uFrameHeight + this->uFrameY - 1; | |
671 memcpy(¤t_window, this, sizeof(current_window)); | |
672 current_window.uFrameX += 12; | |
673 current_window.uFrameWidth -= 24; | |
674 current_window.uFrameY += 12; | |
675 current_window.uFrameHeight -= 12; | |
676 current_window.uFrameZ = current_window.uFrameWidth + current_window.uFrameX - 1; | |
677 current_window.uFrameW = current_window.uFrameHeight + current_window.uFrameY - 1; | |
678 if ( this->Hint ) | |
679 v16 = pFontLucida->CalcTextHeight(this->Hint, ¤t_window, 0, 0) + 24; | |
0 | 680 else |
2271 | 681 v16 = this->uFrameHeight; |
0 | 682 if ( (signed int)v16 < 64 ) |
683 v16 = 64; | |
2271 | 684 if ( (signed int)(v16 + this->uFrameY) > 479 ) |
685 v16 = 479 - this->uFrameY; | |
686 DrawPopupWindow(this->uFrameX, this->uFrameY, this->uFrameWidth, v16); | |
687 if ( this->Hint ) | |
688 current_window.DrawTitleText(pFontLucida, 0, (signed int)(v16 - pFontLucida->CalcTextHeight(this->Hint, ¤t_window, 0, 0)) / 2 - 14, 0, this->Hint, 3); | |
0 | 689 } |
690 | |
691 //----- (00411B59) -------------------------------------------------------- | |
692 void __fastcall LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer) | |
693 { | |
2271 | 694 //unsigned int v2; // esi@1 |
695 //unsigned int v3; // edi@1 | |
0 | 696 FILE *v4; // ebx@1 |
697 FILE *v5; // eax@2 | |
698 char pContainerName[64]; // [sp+Ch] [bp-44h]@1 | |
2271 | 699 //unsigned int v7; // [sp+4Ch] [bp-4h]@1 |
0 | 700 |
2271 | 701 //v2 = uSlot; |
702 //v7 = uPlayer; | |
703 //v3 = uSlot + 1; | |
0 | 704 sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); |
705 v4 = fopen(pContainerName, "rb"); | |
706 if ( v4 ) | |
707 { | |
2271 | 708 pSavegameThumbnails[uSlot].LoadFromFILE(v4, 0, 1); |
0 | 709 fclose(v4); |
710 } | |
711 else | |
712 { | |
2271 | 713 sprintf(pContainerName, "lloyd%d%d.pcx", uPlayer, uSlot + 1); |
0 | 714 v5 = pNew_LOD->FindContainer(pContainerName, 1); |
715 if ( v5 ) | |
2271 | 716 pSavegameThumbnails[uSlot].LoadFromFILE(v5, 0, 0); |
0 | 717 else |
2271 | 718 *((int *)&pSavegameThumbnails.data()->pPixels + 10 * uSlot) = 0; |
0 | 719 } |
720 } | |
721 | |
722 | |
723 //----- (00411621) -------------------------------------------------------- | |
198 | 724 void GUIWindow::OpenSpellBook() |
0 | 725 { |
11 | 726 Player *pPlayer; // edi@1 |
198 | 727 //GUIWindow *pWindow; // esi@1 |
728 //unsigned int v3; // ebp@1 | |
0 | 729 int v4; // eax@3 |
198 | 730 ///GUIButton *result; // eax@25 |
0 | 731 int a2; // [sp+10h] [bp-8h]@1 |
198 | 732 //int v7; // [sp+14h] [bp-4h]@1 |
0 | 733 |
11 | 734 pPlayer = pPlayers[uActiveCharacter]; |
198 | 735 //pWindow = this; |
736 LoadSpellbook(pPlayer->lastOpenedSpellbookPage); | |
737 //v3 = 0; | |
0 | 738 a2 = 0; |
198 | 739 |
1980 | 740 PlayerSpellbookChapter* chapter = &pPlayer->spellbook.pChapters[pPlayer->lastOpenedSpellbookPage]; |
198 | 741 for (uint i = 0; i < 11; ++i) |
0 | 742 { |
198 | 743 if (!chapter->bIsSpellAvailable[i]) |
744 continue; | |
363 | 745 v4= pPlayer->lastOpenedSpellbookPage; |
746 //v4 = (12 * pPlayer->lastOpenedSpellbookPage + pSpellbookSpellIndices[pPlayer->lastOpenedSpellbookPage][i + 1]); | |
693 | 747 CreateButton(pViewport->uViewportTL_X + pIconPos[v4][pSpellbookSpellIndices[v4][i+1]].Xpos, |
748 pViewport->uViewportTL_Y + pIconPos[v4][pSpellbookSpellIndices[v4][i+1]].Ypos, //dword_4E20D0 | |
1402 | 749 SBPageSSpellsTextureList[i + 1]->uTextureWidth, |
750 SBPageSSpellsTextureList[i + 1]->uTextureHeight, | |
832 | 751 1, 79, UIMSG_SelectSpell, i, 0, "", 0); |
0 | 752 ++a2; |
198 | 753 //++v3; |
0 | 754 } |
198 | 755 //while ( (signed int)v3 < 11 ); |
756 | |
1118 | 757 CreateButton(0, 0, 0, 0, 1, 0, UIMSG_SpellBook_PressTab, 0, '\t', "", 0); |
0 | 758 if ( a2 ) |
972 | 759 _41D08F_set_keyboard_control_group(a2, 0, 0, 0); |
948 | 760 |
761 if (pPlayer->pActiveSkills[PLAYER_SKILL_FIRE]) CreateButton(399, 10, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 0, 0, aSpellSchoolNames[0], 0); | |
762 if (pPlayer->pActiveSkills[PLAYER_SKILL_AIR]) CreateButton(399, 46, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 1, 0, aSpellSchoolNames[1], 0); | |
763 if (pPlayer->pActiveSkills[PLAYER_SKILL_WATER]) CreateButton(399, 83, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 2, 0, aSpellSchoolNames[2], 0); | |
764 if (pPlayer->pActiveSkills[PLAYER_SKILL_EARTH]) CreateButton(399, 121, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 3, 0, aSpellSchoolNames[3], 0); | |
765 if (pPlayer->pActiveSkills[PLAYER_SKILL_SPIRIT]) CreateButton(399, 158, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 4, 0, aSpellSchoolNames[4], 0); | |
766 if (pPlayer->pActiveSkills[PLAYER_SKILL_MIND]) CreateButton(400, 196, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 5, 0, aSpellSchoolNames[5], 0); | |
767 if (pPlayer->pActiveSkills[PLAYER_SKILL_BODY]) CreateButton(400, 234, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 6, 0, aSpellSchoolNames[6], 0); | |
768 if (pPlayer->pActiveSkills[PLAYER_SKILL_LIGHT]) CreateButton(400, 271, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 7, 0, aSpellSchoolNames[7], 0); | |
769 if (pPlayer->pActiveSkills[PLAYER_SKILL_DARK]) CreateButton(400, 307, 50, 36, 1, 0, UIMSG_OpenSpellbookPage, 8, 0, aSpellSchoolNames[8], 0); | |
770 | |
1402 | 771 CreateButton(476, 450, pSBClickQuickSpellBtnTextr->uTextureWidth, pSBClickQuickSpellBtnTextr->uTextureHeight, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", 0); |
772 pBtn_InstallRemoveSpell = CreateButton(476, 450, 48, 32, 1, 78, UIMSG_ClickInstallRemoveQuickSpellBtn, 0, 0, "", pSBClickQuickSpellBtnTextr, 0); | |
773 CreateButton(561, 450, pSpellBookClickCloseBtnTextr->uTextureWidth, pSpellBookClickCloseBtnTextr->uTextureHeight, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], 0); | |
774 pBtn_CloseBook = CreateButton(561, 450, 48, 32, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], pSpellBookClickCloseBtnTextr, 0); | |
0 | 775 } |
776 // 50640C: using guessed type int dword_50640C[]; | |
777 | |
778 //----- (004B3157) -------------------------------------------------------- | |
405 | 779 void GUIWindow::HouseDialogManager() |
0 | 780 { |
854 | 781 unsigned __int16 pWhiteColor; // di@2 |
782 const char *pHouseName; // edx@4 | |
0 | 783 signed int v3; // edx@5 |
784 char *v4; // edi@9 | |
854 | 785 int pTextHeight; // eax@45 |
0 | 786 int v6; // edi@45 |
787 char *v7; // eax@45 | |
788 int v8; // edi@46 | |
789 int v9; // eax@50 | |
790 unsigned int v10; // [sp-10h] [bp-C8h]@53 | |
873 | 791 char *pTitleText; // [sp-8h] [bp-C0h]@50 |
854 | 792 GUIWindow pDialogWindow; // [sp+Ch] [bp-ACh]@4 |
793 GUIWindow pWindow; // [sp+60h] [bp-58h]@2 | |
794 int pColor2; // [sp+B4h] [bp-4h]@2 | |
0 | 795 |
336 | 796 if ( !window_SpeakInHouse ) |
0 | 797 return; |
854 | 798 memcpy(&pWindow, this, sizeof(pWindow)); |
799 pWindow.uFrameWidth -= 18; | |
800 pWindow.uFrameZ -= 18; | |
2069 | 801 pWhiteColor = Color16(0xFFu, 0xFFu, 0xFFu); |
802 pColor2 = Color16(0x15u, 0x99u, 0xE9u); | |
0 | 803 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background); |
910 | 804 pRenderer->DrawTextureTransparent(0x1D4u, 0, &pIcons_LOD->pTextures[uTextureID_right_panel_loop]); |
457 | 805 if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic ) |
0 | 806 { |
854 | 807 pDialogWindow.uFrameWidth = 130; |
808 pDialogWindow.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight); | |
809 pHouseName = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName; | |
810 if ( pHouseName ) | |
0 | 811 { |
854 | 812 v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(pHouseName, &pDialogWindow, 0, 0); |
0 | 813 if ( v3 < 0 ) |
814 v3 = 0; | |
854 | 815 pWindow.DrawTitleText(pFontCreate, 0x1EAu, v3 / 2 + 4, pWhiteColor, |
0 | 816 //(const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C], |
336 | 817 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName, 3); |
0 | 818 } |
819 } | |
854 | 820 pWindow.uFrameWidth += 8; |
821 pWindow.uFrameZ += 8; | |
457 | 822 if ( !pDialogueNPCCount ) |
0 | 823 { |
1411 | 824 if ( in_current_building_type == BuildingType_Jail ) |
0 | 825 { |
480 | 826 JailDialog(); |
854 | 827 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
828 { | |
829 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
830 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
831 } | |
832 else | |
833 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
834 return; | |
0 | 835 } |
827 | 836 if ( current_npc_text ) |
0 | 837 { |
854 | 838 pDialogWindow.uFrameWidth = 458; |
839 pDialogWindow.uFrameZ = 457; | |
840 pTextHeight = pFontArrus->CalcTextHeight(current_npc_text, &pDialogWindow, 13, 0); | |
841 v6 = pTextHeight + 7; | |
1496 | 842 pRenderer->GetLeather(8, 352 - (pTextHeight + 7), &pIcons_LOD->pTextures[uTextureID_Leather], |
854 | 843 pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - (pTextHeight + 7)); |
844 pRenderer->DrawTextureIndexed(8, 347 - v6, pTexture_591428); | |
845 v7 = FitTextInAWindow(current_npc_text, pFontArrus, &pDialogWindow, 0xDu, 0); | |
336 | 846 window_SpeakInHouse->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0); |
0 | 847 } |
848 if ( uNumDialogueNPCPortraits <= 0 ) | |
854 | 849 { |
850 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
851 { | |
852 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
853 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
854 } | |
855 else | |
856 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
857 return; | |
858 } | |
873 | 859 for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 ) |
0 | 860 { |
419 | 861 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4, |
874 | 862 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
419 | 863 pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8], |
864 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]); | |
0 | 865 if ( uNumDialogueNPCPortraits < 4 ) |
854 | 866 { |
873 | 867 if ( v8 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
854 | 868 { |
873 | 869 pTitleText = pMapStats->pInfos[uHouse_ExitPic].pName; |
870 v9 = 94 * v8 + 113; | |
854 | 871 } |
872 else | |
873 { | |
873 | 874 if ( !v8 && dword_591080 ) |
875 { | |
876 pTitleText = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle; | |
877 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3); | |
878 continue; | |
879 } | |
1211 | 880 pTitleText = HouseNPCData[v8 +1 - (dword_591080 != 0)]->pName; |
881 v9 = pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; | |
854 | 882 } |
873 | 883 v10 = v9; |
1211 | 884 pWindow.DrawTitleText(pFontCreate, 483, v10, pColor2, pTitleText, 3); |
854 | 885 } |
874 | 886 } |
873 | 887 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
0 | 888 { |
873 | 889 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
890 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
0 | 891 } |
873 | 892 else |
893 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
894 return; | |
0 | 895 } |
457 | 896 v4 = (char *)pDialogueNPCCount - 1; |
419 | 897 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
898 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]); | |
151 | 899 if ( pCurrentScreen == SCREEN_E ) |
0 | 900 { |
984 | 901 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
854 | 902 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
903 { | |
904 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); | |
905 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
906 } | |
907 else | |
908 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); | |
909 return; | |
0 | 910 } |
1634 | 911 if ( v4 || !dword_591080 )//на изумрудном острове заходит на корабле пока не выполнены квесты |
912 SimpleHouseDialog(); | |
0 | 913 else |
914 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
915 sprintfex( pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], |
336 | 916 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName, |
917 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
|
918 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, pColor2, pTmpBuf.data(), 3); |
484 | 919 switch ( in_current_building_type ) |
0 | 920 { |
1411 | 921 case BuildingType_WeaponShop: |
405 | 922 WeaponShopDialog(); |
0 | 923 break; |
1411 | 924 case BuildingType_ArmorShop: |
405 | 925 ArmorShopDialog(); |
0 | 926 break; |
1411 | 927 case BuildingType_MagicShop: |
405 | 928 MagicShopDialog(); |
0 | 929 break; |
1411 | 930 case BuildingType_AlchemistShop: |
405 | 931 AlchemistDialog(); |
0 | 932 break; |
1411 | 933 case BuildingType_FireGuild: |
934 case BuildingType_AirGuild: | |
935 case BuildingType_WaterGuild: | |
936 case BuildingType_EarthGuild: | |
937 case BuildingType_SpiritGuild: | |
938 case BuildingType_MindGuild: | |
939 case BuildingType_BodyGuild: | |
940 case BuildingType_LightGuild: | |
941 case BuildingType_DarkGuild: | |
480 | 942 GuildDialog(); |
943 break; | |
1411 | 944 case BuildingType_18: |
987 | 945 __debugbreak(); //What over the dialog? |
480 | 946 sub_4B6478(); |
947 break; | |
1411 | 948 case BuildingType_TownHall: |
480 | 949 TownHallDialog(); |
950 break; | |
1411 | 951 case BuildingType_Tavern: |
480 | 952 TavernDialog(); |
953 break; | |
1411 | 954 case BuildingType_Bank: |
480 | 955 BankDialog(); |
956 break; | |
1411 | 957 case BuildingType_Temple: |
495 | 958 TempleDialog(); |
480 | 959 break; |
1411 | 960 case BuildingType_Stables: |
1591 | 961 case BuildingType_Boats: |
480 | 962 TravelByTransport(); |
963 break; | |
1411 | 964 case BuildingType_Training: |
480 | 965 TrainingDialog(); |
966 break; | |
1411 | 967 case BuildingType_Jail: |
480 | 968 JailDialog(); |
969 break; | |
0 | 970 default: |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1411
diff
changeset
|
971 //__debugbreak();//New BuildingType (if enter Boat) |
0 | 972 break; |
973 } | |
974 } | |
457 | 975 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) |
0 | 976 { |
370 | 977 pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
978 pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); | |
0 | 979 } |
980 else | |
526 | 981 pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]); |
0 | 982 } |
983 | |
984 //----- (004B1854) -------------------------------------------------------- | |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
985 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
|
986 { |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
987 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
|
988 signed __int64 hours; // kr00_8@1 |
1838 | 989 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
|
990 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
|
991 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
|
992 unsigned int days; // [sp+20h] [bp+4h]@1 |
0 | 993 |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
994 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
|
995 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
|
996 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
|
997 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
|
998 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
|
999 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
|
1000 if ( days ) |
0 | 1001 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1002 text = pGlobalTXT_LocalizationStrings[57];//Days |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1003 if ( days <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1004 text = pGlobalTXT_LocalizationStrings[56];//Day |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1005 sprintfex(pTmpBuf2.data(), "%d %s ", days, text); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1006 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1007 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1008 if ( hours ) |
0 | 1009 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1010 if ( hours <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1011 text = pGlobalTXT_LocalizationStrings[109];//Hour |
0 | 1012 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1013 text = pGlobalTXT_LocalizationStrings[110];//Hours |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1014 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
|
1015 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1016 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1017 if ( minutes && !days ) |
0 | 1018 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1019 if ( minutes <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1020 text = pGlobalTXT_LocalizationStrings[437];//"Minute" |
0 | 1021 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1022 text = pGlobalTXT_LocalizationStrings[436]; //"Minutes" |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1023 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
|
1024 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1025 } |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1026 if ( seconds && !hours ) |
0 | 1027 { |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1028 if ( seconds <= 1 ) |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1029 text = pGlobalTXT_LocalizationStrings[439]; //"Second" |
0 | 1030 else |
1758
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1031 text = pGlobalTXT_LocalizationStrings[438]; //"Seconds" |
24e756a50073
DrawBuff_remaind_time_string and DrawShops_next_generation_time_string fix and cleared
Ritor1
parents:
1747
diff
changeset
|
1032 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
|
1033 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
0 | 1034 } |
2069 | 1035 this->DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), this, 0, 0)) / 2 + 101, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
0 | 1036 } |
1037 | |
1038 //----- (0044D406) -------------------------------------------------------- | |
1268 | 1039 void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, |
1040 const char *pInString, unsigned int uLineSpacing ) | |
762 | 1041 { |
2271 | 1042 //GUIWindow *pWindow; // esi@1 |
0 | 1043 unsigned int v8; // ebx@1 |
1044 char *v9; // eax@1 | |
1045 unsigned int v11; // edi@1 | |
1046 signed int v12; // esi@1 | |
1047 int v13; // eax@2 | |
1048 GUIFont *pFont; // [sp+Ch] [bp-4h]@1 | |
1049 const char *Stra; // [sp+24h] [bp+14h]@5 | |
1050 | |
2271 | 1051 //pWindow = this; |
0 | 1052 pFont = a2; |
1053 v8 = this->uFrameWidth - uHorizontalMargin; | |
1054 ui_current_text_color = uDefaultColor; | |
1055 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0); | |
762 | 1056 Stra = strtok(v9, "\n"); |
2271 | 1057 v11 = uHorizontalMargin + this->uFrameX; |
1058 v12 = uVerticalMargin + this->uFrameY; | |
0 | 1059 while ( 1 ) |
1060 { | |
762 | 1061 if ( !Stra ) |
0 | 1062 break; |
762 | 1063 v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1; |
0 | 1064 if ( v13 < 0 ) |
1065 v13 = 0; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2153
diff
changeset
|
1066 pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, window->GetWidth()); |
49 | 1067 v12 += pFont->uFontHeight - uLineSpacing; |
762 | 1068 Stra = strtok(0, "\n"); |
0 | 1069 } |
1070 } | |
1071 // 5C6DB4: using guessed type int ui_current_text_color; | |
1072 | |
1073 //----- (0044CE08) -------------------------------------------------------- | |
2006 | 1074 void GUIWindow::DrawText( GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, signed int uFontShadowColor ) |
1006 | 1075 { |
0 | 1076 GUIWindow *v9; // edi@1 |
1077 GUIFont *v10; // ebx@1 | |
1078 int v11; // eax@2 | |
1079 signed int v12; // esi@9 | |
1080 signed int v13; // edi@9 | |
1081 int v14; // edx@9 | |
1082 int v15; // eax@25 | |
1083 unsigned int v16; // ecx@25 | |
1084 int v17; // eax@27 | |
1085 int v18; // edi@32 | |
1086 int v19; // esi@38 | |
1087 std::string v21; // [sp-18h] [bp-50h]@2 | |
2334 | 1088 // const char *v22; // [sp-8h] [bp-40h]@2 |
1089 // int v23; // [sp-4h] [bp-3Ch]@2 | |
0 | 1090 char Dest[6]; // [sp+Ch] [bp-2Ch]@32 |
1091 //char v25; // [sp+Fh] [bp-29h]@32 | |
1092 //char v26; // [sp+11h] [bp-27h]@34 | |
1093 const char *v27; // [sp+20h] [bp-18h]@25 | |
1094 int v28; // [sp+24h] [bp-14h]@25 | |
1095 int v29; // [sp+28h] [bp-10h]@1 | |
1096 size_t v30; // [sp+2Ch] [bp-Ch]@4 | |
1097 GUIWindow *v31; // [sp+30h] [bp-8h]@1 | |
1098 const char *v32; // [sp+34h] [bp-4h]@7 | |
1099 size_t pInString; // [sp+4Ch] [bp+14h]@11 | |
1100 | |
1980 | 1101 GUIWindow* a1 = this; |
0 | 1102 v29 = 0; |
1103 v9 = a1; | |
1104 v10 = a2; | |
1105 v31 = a1; | |
1106 if ( !Str ) | |
1107 { | |
1108 MessageBoxW(nullptr, L"Invalid string passed!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:859", 0); | |
1006 | 1109 return; |
0 | 1110 } |
1111 v11 = strcmp(Str, "null"); | |
1112 if ( v11 ) | |
1113 { | |
1114 v30 = strlen(Str); | |
1115 LOBYTE(v11) = 0; | |
1116 if ( !uX ) | |
1117 uX = 12; | |
1118 if ( a8 ) | |
1119 v32 = Str; | |
1120 else | |
1121 { | |
1122 v11 = (int)FitTextInAWindow(Str, v10, v9, uX, 0); | |
1123 v32 = (const char *)v11; | |
1124 } | |
1125 v12 = uX + v9->uFrameX; | |
1126 v13 = uY + v9->uFrameY; | |
1127 v14 = 0; | |
1128 if ( !a8 || (v11 = v13 + LOBYTE(v10->uFontHeight), v11 <= a8) ) | |
1129 { | |
1130 pInString = 0; | |
1131 if ( (signed int)v30 > 0 ) | |
1132 { | |
1133 do | |
1134 { | |
1135 LOBYTE(v11) = v32[v14]; | |
1136 if ( (unsigned __int8)v11 >= v10->cFirstChar && (unsigned __int8)v11 <= v10->cLastChar | |
1137 || (char)v11 == 12 | |
1138 || (char)v11 == 13 | |
1139 || (char)v11 == 9 | |
1140 || (char)v11 == 10 ) | |
1141 { | |
1142 switch ( (unsigned __int8)v11 ) | |
1143 { | |
1144 case 9u: | |
2271 | 1145 strncpy(Dest, &v32[v14 + 1], 3); |
0 | 1146 Dest[3] = 0; |
1147 pInString += 3; | |
1148 v29 = atoi(Dest); | |
1149 v19 = atoi(Dest); | |
1150 LOBYTE(v11) = (char)v31; | |
1151 v12 = uX + v31->uFrameX + v19; | |
1152 break; | |
1153 case 0xAu: | |
1154 v11 = LOBYTE(v10->uFontHeight); | |
1155 uY = uY + v11 - 3; | |
1156 v13 = uY + v31->uFrameY; | |
1157 v12 = uX + v29 + v31->uFrameX; | |
1158 if ( a8 ) | |
2273 | 1159 { |
1160 v11 = v11 + v13 - 3; | |
1161 if ( v11 > a8 ) | |
1162 return; | |
1163 } | |
0 | 1164 break; |
1165 case 0xCu: | |
2271 | 1166 strncpy(Dest, &v32[v14 + 1], 5); |
0 | 1167 Dest[5] = 0; |
1168 v11 = atoi(Dest); | |
1169 pInString += 5; | |
1170 uFontColor = v11; | |
1171 break; | |
1172 case 0xDu: | |
2271 | 1173 strncpy(Dest, &v32[v14 + 1], 3); |
0 | 1174 Dest[3] = 0; |
1175 pInString += 3; | |
1176 v18 = atoi(Dest); | |
1177 v11 = v10->GetLineWidth(&v32[pInString]); | |
1178 v12 = v31->uFrameZ - v11 - v18; | |
1179 v13 = uY + v31->uFrameY; | |
1180 if ( a8 ) | |
1181 { | |
1182 v11 = LOBYTE(v10->uFontHeight); | |
1183 v11 = v11 + v13 - 3; | |
1184 if ( v11 > a8 ) | |
1006 | 1185 return; |
0 | 1186 break; |
1187 } | |
1188 break; | |
1189 default: | |
1190 if ( (char)v11 == 34 && v32[v14 + 1] == 34 ) | |
1191 { | |
1192 ++v14; | |
1193 pInString = v14; | |
1194 } | |
1195 v27 = &v32[v14]; | |
1196 v15 = (unsigned __int8)v32[v14]; | |
1197 v16 = *((int *)&v10->cFirstChar + 3 * v15 + 9); | |
1198 v28 = *((int *)&v10->cFirstChar + 3 * v15 + 9); | |
1199 if ( v14 > 0 ) | |
1200 v12 += v10->pMetrics[v15].uLeftSpacing; | |
1160 | 1201 v17 = (int)((char *)&v10[1] + v10->font_pixels_offset[v15]); |
0 | 1202 if ( (short)uFontColor ) |
2271 | 1203 pRenderer->DrawText(v12, v13, (unsigned __int8 *)v17, v16, LOBYTE(v10->uFontHeight), |
1204 v10->pFontPalettes[0], uFontColor, uFontShadowColor); | |
0 | 1205 else |
2271 | 1206 pRenderer->DrawTextPalette(v12, v13, (unsigned char*)v17, v16, LOBYTE(v10->uFontHeight), |
1207 v10->pFontPalettes[0], a7); | |
0 | 1208 LOBYTE(v11) = v30; |
1209 v12 += v28; | |
1210 if ( (signed int)pInString < (signed int)v30 ) | |
1211 { | |
1212 LOBYTE(v11) = 3 * *v27; | |
1213 v12 += v10->pMetrics[(unsigned __int8)*v27].uRightSpacing; | |
1214 } | |
1215 break; | |
1216 } | |
1217 } | |
1218 v14 = pInString++ + 1; | |
1219 } | |
1220 while ( (signed int)pInString < (signed int)v30 ); | |
1221 } | |
1222 } | |
1223 } | |
1006 | 1224 return; |
0 | 1225 } |
1226 | |
1227 | |
1228 //----- (0044CB4F) -------------------------------------------------------- | |
1268 | 1229 int GUIWindow::DrawTextInRect( GUIFont *pFont, unsigned int uX, unsigned int uY, unsigned int uColor, const char *text, int rect_width, int reverse_text ) |
2273 | 1230 { |
24 | 1231 int pLineWidth; // ebx@1 |
1268 | 1232 int text_width; // esi@3 |
0 | 1233 unsigned __int8 v12; // cl@7 |
1234 signed int v13; // esi@19 | |
1235 signed int v14; // ebx@19 | |
1236 unsigned __int8 v15; // cl@21 | |
2334 | 1237 // int v16; // eax@22 |
1238 // int v17; // ecx@22 | |
1239 // int v18; // ecx@23 | |
1240 // int v19; // ecx@24 | |
0 | 1241 unsigned int v20; // ecx@26 |
1268 | 1242 unsigned char* v21; // eax@28 |
2334 | 1243 // int v22; // ebx@34 |
0 | 1244 int v23; // eax@34 |
1245 int v24; // ebx@36 | |
1268 | 1246 char Str[6]; // [sp+Ch] [bp-20h]@34 |
2334 | 1247 // char v26; // [sp+Fh] [bp-1Dh]@34 |
1248 // char v27; // [sp+11h] [bp-1Bh]@35 | |
0 | 1249 int v28; // [sp+20h] [bp-Ch]@17 |
1250 GUIWindow *pWindow; // [sp+24h] [bp-8h]@1 | |
24 | 1251 size_t pNumLen; // [sp+28h] [bp-4h]@1 |
0 | 1252 size_t Str1a; // [sp+40h] [bp+14h]@5 |
2334 | 1253 // size_t Str1b; // [sp+40h] [bp+14h]@19 |
1254 // const char *Sourcea; // [sp+44h] [bp+18h]@20 | |
1255 // int v34; // [sp+48h] [bp+1Ch]@26 | |
1268 | 1256 int i; |
0 | 1257 |
1268 | 1258 |
0 | 1259 pWindow = this; |
1268 | 1260 pNumLen = strlen(text); |
1261 pLineWidth = pFont->GetLineWidth(text); | |
1262 if ( pLineWidth < rect_width ) | |
0 | 1263 { |
1268 | 1264 pWindow->DrawText(pFont, uX, uY, uColor, text, 0, 0, 0); |
24 | 1265 return pLineWidth; |
0 | 1266 } |
1268 | 1267 strcpy(pTmpBuf2.data(), text); |
1268 text_width = 0; | |
1269 if ( reverse_text ) | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1270 _strrev(pTmpBuf2.data()); |
0 | 1271 Str1a = 0; |
2273 | 1272 for ( i = 0; i < pNumLen; ++i ) |
0 | 1273 { |
1268 | 1274 if ( text_width >= rect_width ) |
0 | 1275 break; |
1268 | 1276 v12 = pTmpBuf2[i]; |
1277 if ( pFont->IsCharValid(v12) ) | |
0 | 1278 { |
1268 | 1279 switch (v12) |
0 | 1280 { |
1268 | 1281 case '\t':// Horizontal tab 09 |
1282 case '\n': //Line Feed 0A 10 | |
1283 case '\r': //Form Feed, page eject 0C 12 | |
1284 break; | |
1285 case '\f': //Carriage Return 0D 13 | |
1286 i += 5; | |
1287 break; | |
1288 default: | |
1289 if ( i > 0 ) | |
1290 text_width += pFont->pMetrics[v12].uLeftSpacing; | |
1291 text_width += pFont->pMetrics[v12].uWidth; | |
1292 if ( i < pNumLen ) | |
1293 text_width += pFont->pMetrics[v12].uRightSpacing; | |
2273 | 1294 } |
0 | 1295 } |
1296 } | |
1268 | 1297 pTmpBuf2[i - 1] = 0; |
1298 | |
1299 | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1300 pNumLen = strlen(pTmpBuf2.data()); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1301 v28 = pFont->GetLineWidth(pTmpBuf2.data()); |
1268 | 1302 if ( reverse_text ) |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1303 _strrev(pTmpBuf2.data()); |
1268 | 1304 |
0 | 1305 v13 = uX + pWindow->uFrameX; |
1306 v14 = uY + pWindow->uFrameY; | |
1268 | 1307 for (i=0; i<pNumLen; ++i) |
0 | 1308 { |
1268 | 1309 v15 = pTmpBuf2[i]; |
1310 if ( pFont->IsCharValid(v15) ) | |
0 | 1311 { |
1268 | 1312 switch (v12) |
1313 { | |
1314 case '\t':// Horizontal tab 09 | |
1315 { | |
1316 strncpy(Str, &pTmpBuf2[i+1], 3); | |
1317 Str[3] = 0; | |
1318 // atoi(Str); | |
1319 i += 3; | |
1320 break; | |
1321 } | |
1322 case '\n': //Line Feed 0A 10 | |
1323 { | |
1324 v24 = pFont->uFontHeight; | |
1325 v13 = uX; | |
1326 uY = uY + pFont->uFontHeight - 3; | |
1327 v14 = uY+pFont->uFontHeight - 3; | |
1328 break; | |
1329 } | |
1330 case '\r': //Form Feed, page eject 0C 12 | |
0 | 1331 { |
1268 | 1332 strncpy(Str, &pTmpBuf2[i+1], 5); |
1333 Str[5] = 0; | |
1334 i += 5; | |
1335 uColor = atoi(Str); | |
1336 break; | |
1337 } | |
1338 case '\f': //Carriage Return 0D 13 | |
1339 { | |
1340 strncpy(Str, &pTmpBuf2[i+1], 3); | |
1341 Str[3] = 0; | |
1342 i += 3; | |
1343 v23 = pFont->GetLineWidth(&pTmpBuf2[i]); | |
1344 v13 = pWindow->uFrameZ - v23 - atoi(Str); | |
1345 v14 = uY; | |
1346 break; | |
0 | 1347 } |
1268 | 1348 default: |
1349 v20 = pFont->pMetrics[v15].uWidth; | |
1350 if ( i > 0 ) | |
1351 v13 += pFont->pMetrics[v15].uLeftSpacing; | |
1352 v21 = &pFont->pFontData[pFont->font_pixels_offset[v15]]; | |
1353 if ( uColor ) | |
1354 pRenderer->DrawText(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], uColor, 0); | |
1355 else | |
1356 pRenderer->DrawTextPalette(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], 0); | |
1357 v13 += v20; | |
1358 if ( i < (signed int)pNumLen ) | |
1359 v13 += pFont->pMetrics[v15].uRightSpacing; | |
2273 | 1360 } |
0 | 1361 } |
1362 } | |
1363 return v28; | |
1364 } | |
1365 | |
1366 //----- (0041D12F) -------------------------------------------------------- | |
189 | 1367 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, |
832 | 1368 int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...) |
0 | 1369 { |
17 | 1370 GUIButton *pButton; // esi@1 |
2334 | 1371 // unsigned int v13; // eax@1 |
1372 // unsigned int v14; // ebx@4 | |
1373 // unsigned int v15; // eax@4 | |
189 | 1374 unsigned int TextureNum=0; // ebx@4 |
2334 | 1375 // unsigned int v17; // eax@4 |
1376 // Texture *v18; // eax@4 | |
1377 // Texture **v19; // ecx@5 | |
1378 // Texture **v20; // edx@5 | |
1379 // GUIButton *v21; // eax@7 | |
189 | 1380 va_list texturs_ptr; |
0 | 1381 |
1583 | 1382 pButton = (GUIButton *)malloc(0xBC); |
17 | 1383 pButton->pParent = this; |
1268 | 1384 pButton->uWidth = uWidth; |
17 | 1385 pButton->uHeight = uHeight; |
1268 | 1386 |
0 | 1387 if ( a6 == 2 && !uHeight ) |
17 | 1388 pButton->uHeight = uWidth; |
1268 | 1389 |
17 | 1390 pButton->uButtonType = a6; |
1268 | 1391 pButton->uX = uX + this->uFrameX; |
1392 pButton->uY = uY + this->uFrameY; | |
1393 pButton->uZ = pButton->uX + uWidth - 1; | |
1394 pButton->uW = pButton->uY + uHeight - 1; | |
271 | 1395 pButton->field_2C_is_pushed = 0; |
17 | 1396 pButton->field_1C = a7; |
832 | 1397 pButton->msg = msg; |
1398 pButton->msg_param = msg_param; | |
17 | 1399 pButton->uHotkey = uHotkey; |
1268 | 1400 //strlen(pName); |
17 | 1401 strcpy(pButton->pButtonName, pName); |
189 | 1402 va_start(texturs_ptr, pName); |
1403 while (NULL!=(pTextures=va_arg(texturs_ptr, Texture *))) | |
0 | 1404 { |
189 | 1405 pButton->pTextures[TextureNum]=pTextures; |
1406 ++TextureNum; | |
0 | 1407 } |
189 | 1408 va_end(texturs_ptr); |
1409 pButton->uNumTextures = TextureNum; | |
1410 if ( this->pControlsTail ) | |
1411 this->pControlsTail->pNext = pButton; | |
0 | 1412 else |
17 | 1413 this->pControlsHead = pButton; |
1414 pButton->pPrev = this->pControlsTail; | |
1415 this->pControlsTail = pButton; | |
1416 pButton->pNext = 0; | |
0 | 1417 ++this->uNumControls; |
17 | 1418 return pButton; |
0 | 1419 } |
1420 | |
1421 //----- (00459C2B) -------------------------------------------------------- | |
1268 | 1422 void GUIWindow::DrawFlashingInputCursor( signed int uX, int uY, struct GUIFont *a2 ) |
2216 | 1423 { |
0 | 1424 if ( GetTickCount() % 1000 > 500 ) |
1268 | 1425 DrawText(a2, uX, uY, 0, "_", 0, 0, 0); |
0 | 1426 } |
1427 | |
1428 //----- (0041C432) -------------------------------------------------------- | |
1268 | 1429 GUIWindow * GUIWindow::Create( unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, enum WindowType eWindowType, int pButton, const char* hint ) |
2273 | 1430 { |
0 | 1431 unsigned int uNextFreeWindowID; // ebp@1 |
1432 //int *v8; // eax@1 | |
1433 //GUIWindow *pWindow; // esi@4 | |
962 | 1434 //int v10; // eax@4 |
0 | 1435 unsigned int v11; // ebx@15 |
423 | 1436 NPCData *speakingNPC; // ebp@15 |
1437 int v14; // eax@20 | |
1438 int v16; // eax@25 | |
1439 int v18; // eax@30 | |
1440 int v20; // eax@35 | |
1441 int v22; // eax@40 | |
1442 int v24; // eax@45 | |
2334 | 1443 // int v25; // eax@65 |
0 | 1444 unsigned int v26; // ebx@65 |
1445 char *v27; // eax@71 | |
1446 const char *v29; // [sp-8h] [bp-18h]@68 | |
1447 char *v30; // [sp-4h] [bp-14h]@68 | |
2334 | 1448 // int uWidtha; // [sp+14h] [bp+4h]@66 |
423 | 1449 int num_menu_buttons; // [sp+20h] [bp+10h]@15 |
0 | 1450 |
1451 for (uNextFreeWindowID = 0; uNextFreeWindowID < 20; ++uNextFreeWindowID) | |
1452 { | |
1453 if (pWindowList[uNextFreeWindowID].eWindowType == WINDOW_null) | |
1454 break; | |
1455 } | |
1456 | |
1980 | 1457 GUIWindow* pWindow = &pWindowList[uNextFreeWindowID]; |
0 | 1458 pWindow->uFrameWidth = uWidth; |
1268 | 1459 pWindow->uFrameHeight = uHeight; |
1460 | |
1461 pWindow->uFrameX = uX; | |
1462 pWindow->uFrameY = uY; | |
0 | 1463 pWindow->uFrameZ = uX + uWidth - 1; |
1464 pWindow->uFrameW = uY + uHeight - 1; | |
1268 | 1465 |
11 | 1466 pWindow->ptr_1C = (void *)pButton; |
1268 | 1467 pWindow->Hint = hint; |
1468 | |
0 | 1469 pWindow->eWindowType = eWindowType; |
972 | 1470 pWindow->receives_keyboard_input = false; |
496 | 1471 ++uNumVisibleWindows; |
1472 pWindow->numVisibleWindows = uNumVisibleWindows; | |
1473 pVisibleWindowsIdxs[uNumVisibleWindows] = uNextFreeWindowID + 1; | |
0 | 1474 if ( (signed int)eWindowType <= 20 ) |
1475 { | |
1476 if (eWindowType != WINDOW_Chest) | |
1477 { | |
1478 switch (eWindowType) | |
1479 { | |
1268 | 1480 case WINDOW_Book: { |
0 | 1481 pWindow->InitializeBookView(); |
1482 break; | |
1268 | 1483 } |
1484 case WINDOW_Dialogue: { | |
11 | 1485 pMainScreenNum = pCurrentScreen; |
151 | 1486 pCurrentScreen = SCREEN_NPC_DIALOGUE; |
832 | 1487 pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" |
735 | 1488 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
496 | 1489 if ( pWindow->par1C != 1 ) |
0 | 1490 { |
423 | 1491 num_menu_buttons = 0; |
0 | 1492 v11 = LOBYTE(pFontArrus->uFontHeight) - 3; |
602 | 1493 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
827 | 1494 if ( GetGreetType(sDialogue_SpeakingActorNPC_ID) == 1 )//QuestsNPC_greet |
0 | 1495 { |
423 | 1496 if ( speakingNPC->joins ) |
0 | 1497 { |
832 | 1498 pWindow->CreateButton(480, 130, 140, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0xDu, 0, "", 0); |
423 | 1499 num_menu_buttons = 1; |
0 | 1500 } |
423 | 1501 if ( speakingNPC->evt_A ) |
0 | 1502 { |
423 | 1503 if ( num_menu_buttons < 4 ) |
0 | 1504 { |
423 | 1505 v14 = NPC_EventProcessor(speakingNPC->evt_A); |
0 | 1506 if ( v14 == 1 || v14 == 2 ) |
832 | 1507 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x13u, 0, "", 0); |
0 | 1508 } |
1509 } | |
423 | 1510 if ( speakingNPC->evt_B ) |
0 | 1511 { |
423 | 1512 if ( num_menu_buttons < 4 ) |
0 | 1513 { |
423 | 1514 v16 = NPC_EventProcessor(speakingNPC->evt_B); |
0 | 1515 if ( v16 == 1 || v16 == 2 ) |
832 | 1516 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x14u, 0, "", 0); |
0 | 1517 } |
1518 } | |
423 | 1519 if ( speakingNPC->evt_C ) |
0 | 1520 { |
423 | 1521 if ( num_menu_buttons < 4 ) |
0 | 1522 { |
423 | 1523 v18 = NPC_EventProcessor(speakingNPC->evt_C); |
0 | 1524 if ( v18 == 1 || v18 == 2 ) |
832 | 1525 pWindow->CreateButton( 0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x15u, 0, "", 0); |
0 | 1526 } |
1527 } | |
423 | 1528 if ( speakingNPC->evt_D ) |
0 | 1529 { |
423 | 1530 if ( num_menu_buttons < 4 ) |
0 | 1531 { |
423 | 1532 v20 = NPC_EventProcessor(speakingNPC->evt_D); |
0 | 1533 if ( v20 == 1 || v20 == 2 ) |
832 | 1534 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x16u, 0, "", 0); |
0 | 1535 } |
1536 } | |
423 | 1537 if ( speakingNPC->evt_E ) |
0 | 1538 { |
423 | 1539 if ( num_menu_buttons < 4 ) |
0 | 1540 { |
423 | 1541 v22 = NPC_EventProcessor(speakingNPC->evt_E); |
0 | 1542 if ( v22 == 1 || v22 == 2 ) |
832 | 1543 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x17u, 0, "", 0); |
0 | 1544 } |
1545 } | |
423 | 1546 if (speakingNPC->evt_F ) |
0 | 1547 { |
423 | 1548 if ( num_menu_buttons < 4 ) |
0 | 1549 { |
423 | 1550 v24 = NPC_EventProcessor(speakingNPC->evt_F); |
0 | 1551 if ( v24 == 1 || v24 == 2 ) |
832 | 1552 pWindow->CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x18u, 0, "", 0); |
0 | 1553 } |
1554 } | |
1555 } | |
1556 else | |
1557 { | |
423 | 1558 if ( speakingNPC->joins ) |
0 | 1559 { |
832 | 1560 pWindow->CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);//Подробнее |
423 | 1561 if (speakingNPC->Hired()) |
0 | 1562 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1563 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[408], speakingNPC->pName); //Отпустить |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1564 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pTmpBuf.data(), 0); |
0 | 1565 } |
1566 else | |
832 | 1567 pWindow->CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять |
423 | 1568 num_menu_buttons = 2; |
0 | 1569 } |
1570 } | |
972 | 1571 pWindow->_41D08F_set_keyboard_control_group(num_menu_buttons, 1, 0, 1); |
0 | 1572 } |
1573 break; | |
1268 | 1574 } |
2273 | 1575 case WINDOW_ChangeLocation: |
1576 { | |
11 | 1577 pMainScreenNum = pCurrentScreen; |
151 | 1578 pCurrentScreen = SCREEN_CHANGE_LOCATION; |
987 | 1579 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 | 1580 pBtn_YES = pWindow->CreateButton( 486, 445, 75, 33, 1, 0, UIMSG_OnTravelByFoot, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); |
1581 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63, 73, 1, 0, UIMSG_OnTravelByFoot, 1, ' ', pWindow->Hint, 0, 0, 0); | |
1582 pWindow->CreateButton( 8, 8, 460, 344, 1, 0, UIMSG_OnTravelByFoot, 1, 0, pWindow->Hint, 0); | |
0 | 1583 break; |
2273 | 1584 } |
1268 | 1585 case WINDOW_SpellBook: {// окно книги заклов |
0 | 1586 InitializeBookTextures(); |
11 | 1587 pWindow->OpenSpellBook(); |
0 | 1588 break; |
1268 | 1589 } |
1590 case WINDOW_GreetingNPC: {// окно приветствия НПС | |
11 | 1591 pMainScreenNum = pCurrentScreen; |
3 | 1592 pKeyActionMap->EnterText(0, 15, pWindow); |
151 | 1593 pCurrentScreen = SCREEN_BRANCHLESS_NPC_DIALOG; |
0 | 1594 break; |
1268 | 1595 } |
1596 | |
0 | 1597 } |
1598 return pWindow; | |
1599 } | |
11 | 1600 //LABEL_62: |
2273 | 1601 pWindow->CreateButton(61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); |
1602 pWindow->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
1603 pWindow->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
1604 pWindow->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
1605 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, 9, "", 0); | |
0 | 1606 return pWindow; |
1607 } | |
1608 if (eWindowType == WINDOW_HouseInterior) | |
1609 { | |
151 | 1610 pCurrentScreen = SCREEN_HOUSE; |
1589 | 1611 pBtn_ExitCancel = pWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Выйти из здания |
735 | 1612 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
1589 | 1613 for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) |
1614 { | |
1615 if ( v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
0 | 1616 { |
1589 | 1617 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; |
1618 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; | |
1619 } | |
1620 else | |
1621 { | |
1622 if ( v26 || !dword_591080 ) | |
1623 v27 = HouseNPCData[v26 +1 - ((dword_591080 != 0)? 1:0)]->pName; | |
0 | 1624 else |
1589 | 1625 v27 = (char*)p2DEvents[pButton - 1].pProprieterName; |
1626 v30 = v27; | |
1627 v29 = (char*)pGlobalTXT_LocalizationStrings[435]; | |
0 | 1628 } |
1589 | 1629 sprintfex(byte_591180[v26].data(), v29, v30); |
1630 HouseNPCPortraitsButtonsList[v26] = pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], | |
1631 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], | |
1632 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0); | |
1633 } | |
1211 | 1634 if ( uNumDialogueNPCPortraits == 1 ) |
0 | 1635 { |
336 | 1636 window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; |
0 | 1637 _4B4224_UpdateNPCTopics(0); |
1638 } | |
1639 } | |
1640 else | |
1641 { | |
158 | 1642 if (eWindowType == WINDOW_Transition) |
0 | 1643 { |
11 | 1644 pMainScreenNum = pCurrentScreen; |
151 | 1645 pCurrentScreen = SCREEN_INPUT_BLV; |
960 | 1646 pBtn_ExitCancel = pWindow->CreateButton(0x236u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionWindowCloseBtn, 0, 'N', pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);//Отмена |
948 | 1647 pBtn_YES = pWindow->CreateButton(0x1E6u, 0x1BDu, 0x4Bu, 0x21u, 1, 0, UIMSG_TransitionUI_Confirm, 0, 'Y', pWindow->Hint, pIcons_LOD->GetTexture(uTextureID_BUTTYES2), 0); |
1648 pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 0x3Fu, 0x49u, 1, 0, UIMSG_TransitionUI_Confirm, 1, 0x20u, pWindow->Hint, 0); | |
1649 pWindow->CreateButton(8, 8, 0x1CCu, 0x158u, 1, 0, UIMSG_TransitionUI_Confirm, 1u, 0, pWindow->Hint, 0); | |
0 | 1650 return pWindow; |
1651 } | |
961 | 1652 if (eWindowType == WINDOW_CastSpell) |
0 | 1653 { |
1654 pEventTimer->Pause(); | |
1655 pAudioPlayer->StopChannels(-1, -1); | |
1656 pMouse->SetCursorBitmap("MICON2"); | |
11 | 1657 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u);//Выберите цель |
0 | 1658 return pWindow; |
1659 } | |
158 | 1660 if (eWindowType == WINDOW_Scroll) |
11 | 1661 { |
2216 | 1662 pWindow->CreateButton(61, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); |
1663 pWindow->CreateButton(177, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
1664 pWindow->CreateButton(292, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
1665 pWindow->CreateButton(407, 424, 31, 0, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
948 | 1666 pWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0); |
11 | 1667 return pWindow; |
1668 } | |
898 | 1669 if (eWindowType == WINDOW_CastSpell_InInventory) |
0 | 1670 { |
1671 pMouse->SetCursorBitmap("MICON2"); | |
2216 | 1672 pBtn_ExitCancel = pWindow->CreateButton(392, 318, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],//Отмена |
945 | 1673 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); |
11 | 1674 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2);//Выбрать цель |
0 | 1675 ++pIcons_LOD->uTexturePacksCount; |
1676 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 1677 pCurrentScreen = SCREEN_CASTING; |
0 | 1678 if ( !pIcons_LOD->uNumPrevLoadedFiles ) |
1679 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
1680 } | |
1681 } | |
1682 return pWindow; | |
1295 | 1683 } |
1684 //----- (004B3EF0) -------------------------------------------------------- | |
1685 void DrawJoinGuildWindow( int pEventCode ) | |
1686 { | |
1687 uDialogueType = 81;//enum JoinGuildDialog | |
1688 current_npc_text = (char *)pNPCTopics[pEventCode + 99].pText; | |
1689 ContractSelectText(pEventCode); | |
1690 pDialogueWindow->Release(); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2153
diff
changeset
|
1691 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, pEventCode, 0); |
1295 | 1692 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); // Cancel |
1693 pDialogueWindow->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); | |
1694 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); | |
1695 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); | |
1696 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | |
1697 } | |
1698 //----- (0044603D) -------------------------------------------------------- | |
1458 | 1699 void DialogueEnding() |
1295 | 1700 { |
1701 sDialogue_SpeakingActorNPC_ID = 0; | |
1702 pDialogueWindow->Release(); | |
1703 pDialogueWindow = 0; | |
1704 pMiscTimer->Resume(); | |
1705 pEventTimer->Resume(); | |
1297 | 1706 } |
1707 //----- (004156F0) -------------------------------------------------------- | |
1708 void GUI_UpdateWindows() | |
1709 { | |
1710 GUIWindow *pWindow; // esi@4 | |
1711 //unsigned int pWindowType; // eax@4 | |
1712 const char *pHint; // edx@66 | |
2334 | 1713 // GUIButton *pButtonPtr_1C; // ebp@79 |
1714 // char *pHint1; // edx@80 | |
1297 | 1715 int v26; // eax@98 |
1716 unsigned int v27; // ebp@106 | |
1717 GUIWindow *pGUIWindow2; // ecx@109 | |
2334 | 1718 // GUIFont *pGUIFont; // ST1C_4@115 |
1297 | 1719 int v31; // eax@115 |
1720 GUIButton *pButton; // ebp@118 | |
1721 int v39; // eax@129 | |
1722 unsigned int pNumMessages; // eax@142 | |
1723 GUIButton *pGUIButton; // ebp@146 | |
1724 //unsigned int pX; // [sp-1Ch] [bp-124h]@17 | |
1725 //unsigned int pY; // [sp-18h] [bp-120h]@17 | |
1726 //Texture *pTexture; // [sp-14h] [bp-11Ch]@17 | |
1727 //Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 | |
1728 int i; // [sp+0h] [bp-108h]@3 | |
2334 | 1729 // ItemGen pItemGen; // [sp+4h] [bp-104h]@98 |
1297 | 1730 GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133 |
1731 ItemGen ItemGen2; // [sp+E4h] [bp-24h]@129 | |
1732 | |
1733 if (GetCurrentMenuID() != MENU_CREATEPARTY) | |
2339 | 1734 Mouse::UI_OnKeyDown(VK_NEXT); |
1297 | 1735 |
1736 for ( i = 1; i <= uNumVisibleWindows; ++i ) | |
1737 { | |
1738 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; | |
1739 switch (pWindow->eWindowType) | |
1740 { | |
1741 case WINDOW_OptionsButtons: | |
1742 { | |
1743 pRenderer->DrawTextureIndexed(pViewport->uViewportTL_Y, | |
1744 pViewport->uViewportTL_X, pIcons_LOD->GetTexture(uTextureID_Options)); | |
1745 viewparams->bRedrawGameUI = 1; | |
1746 continue; | |
1747 } | |
1748 case WINDOW_CharacterRecord: | |
1749 { | |
1750 CharacterUI_CharacterScreen_Draw(pPlayers[uActiveCharacter]); | |
1751 continue; | |
1752 } | |
1753 case WINDOW_Options: | |
1754 { | |
1755 GameMenuUI_Options_Draw(); | |
1756 continue; | |
1757 } | |
1758 case WINDOW_Book: | |
1759 { | |
1760 BookUI_Draw((WindowType)(int)pWindow->ptr_1C); | |
1761 continue; | |
1762 } | |
1763 case WINDOW_Dialogue: | |
1764 { | |
1765 GameUI_DrawDialogue(); | |
1766 continue; | |
1767 } | |
1768 case WINDOW_QuickReference: | |
1769 { | |
1770 GameUI_QuickRef_Draw(); | |
1771 continue; | |
1772 } | |
1773 case WINDOW_Rest: | |
1774 { | |
1775 RestUI_Draw(); | |
1776 continue; | |
1777 } | |
1778 case WINDOW_ChangeLocation: | |
1779 { | |
1780 TravelUI_Draw(); | |
1781 continue; | |
1782 } | |
1783 case WINDOW_SpellBook: | |
1784 { | |
1785 DrawSpellBookContent(pPlayers[uActiveCharacter]); | |
1786 continue; | |
1787 } | |
1788 case WINDOW_GreetingNPC: | |
1789 { | |
1790 GameUI_DrawBranchlessDialogue(); | |
1791 continue; | |
1792 } | |
1793 case WINDOW_Chest: | |
1794 { | |
1795 if ( pCurrentScreen == SCREEN_CHEST ) | |
1796 { | |
1312 | 1797 Chest::DrawChestUI(pWindow->par1C); |
1297 | 1798 } |
1799 else if ( pCurrentScreen == SCREEN_CHEST_INVENTORY ) | |
1800 { | |
1801 pRenderer->ClearZBuffer(0, 479); | |
1802 draw_leather(); | |
1803 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | |
1804 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); | |
1805 } | |
1806 continue; | |
1807 } | |
1808 case WINDOW_SaveLoadButtons: | |
1809 { | |
1810 SaveUI_Draw(); | |
1811 continue; | |
1812 } | |
1813 case WINDOW_MainMenu_Load: | |
1814 { | |
1815 LoadUI_Draw(); | |
1816 continue; | |
1817 } | |
1818 case WINDOW_HouseInterior: | |
1819 { | |
1820 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager(); | |
1821 if ( !window_SpeakInHouse ) | |
1822 continue; | |
1312 | 1823 if ( window_SpeakInHouse->par1C >= 53 ) |
1297 | 1824 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
|
1825 if ( pParty->PartyTimes._shop_ban_times[window_SpeakInHouse->par1C] <=pParty->uTimePlayed ) |
1297 | 1826 { |
1312 | 1827 if ( window_SpeakInHouse->par1C < 53 ) |
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
|
1828 pParty->PartyTimes._shop_ban_times[window_SpeakInHouse->par1C] = 0; |
1297 | 1829 continue; |
1830 } | |
1831 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
2402 | 1832 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
1297 | 1833 continue; |
1834 } | |
1835 case WINDOW_Transition: | |
1836 { | |
1837 TransitionUI_Draw(); | |
1838 continue; | |
1839 } | |
1840 case WINDOW_Scroll: | |
1841 { | |
1842 CreateScrollWindow(); | |
1843 continue; | |
1844 } | |
1845 case WINDOW_CastSpell_InInventory: | |
1846 { | |
1847 pRenderer->ClearZBuffer(0, 479); | |
1848 draw_leather(); | |
1849 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | |
1850 CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); | |
1851 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); | |
1852 continue; | |
1853 } | |
1458 | 1854 case WINDOW_ModalWindow: |
1297 | 1855 { |
1458 | 1856 ModalWindow_ShowHint(); |
1297 | 1857 continue; |
1858 } | |
1859 case WINDOW_50: | |
1860 { | |
2069 | 1861 v27 = Color16(255, 255, 255); |
1297 | 1862 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) |
1863 { | |
1864 ptr_507BD0->DrawMessageBox(0); | |
2389 | 1865 ptr_507BD0->DrawText(pFontCreate, 30, 40, v27, pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); |
1866 v31 = pFontCreate->GetLineWidth(pKeyActionMap->pPressedKeysBuffer); | |
1297 | 1867 ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pFontCreate); |
1868 continue; | |
1869 } | |
1870 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
1871 { | |
1872 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
2402 | 1873 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0); |
1297 | 1874 pEventTimer->Resume(); |
1875 ptr_507BD0->Release(); | |
1876 pCurrentScreen = SCREEN_GAME; | |
1877 viewparams->bRedrawGameUI = true; | |
1878 continue; | |
1879 } | |
1880 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED) | |
1881 { | |
1882 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1883 pEventTimer->Resume(); | |
1884 ptr_507BD0->Release(); | |
1885 continue; | |
1886 } | |
1887 } | |
1888 case WINDOW_59: | |
1889 { | |
1890 pWindow->DrawMessageBox(0); | |
1891 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | |
2389 | 1892 pWindow->DrawText(pFontLucida, 10, 40, 0, pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); |
1297 | 1893 if ( !pKeyActionMap->field_204 ) |
1894 { | |
1895 ItemGen2.Reset(); | |
1896 pWindow->Release(); | |
1897 pEventTimer->Resume(); | |
1898 pCurrentScreen = 0; | |
1899 viewparams->bRedrawGameUI = true; | |
2389 | 1900 v26 = atoi(pKeyActionMap->pPressedKeysBuffer); |
1297 | 1901 if ( v26 > 0 ) |
1902 { | |
1903 if ( v26 < 800 ) | |
1904 { | |
1905 ItemGen2.uAttributes |= 1u; | |
1906 ItemGen2.uItemID = v26; | |
1907 if ( pItemsTable->pItems[v26].uEquipType == 12 ) | |
1908 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1640
diff
changeset
|
1909 ItemGen2.uNumCharges = rand() % 6 + ItemGen2.GetDamageMod() + 1; |
1297 | 1910 ItemGen2.uMaxCharges = LOBYTE(ItemGen2.uNumCharges); |
1911 } | |
1912 else | |
1913 { | |
1914 if ( v26 >= 221 && v26 < 271 ) | |
1915 ItemGen2.uEnchantmentType = rand() % 10 + 1; | |
1916 } | |
1917 pItemsTable->SetSpecialBonus(&ItemGen2); | |
1918 pParty->SetHoldingItem(&ItemGen2); | |
1919 } | |
1920 } | |
1921 } | |
1922 continue; | |
1923 } | |
1924 case WINDOW_PressedButton2: | |
1925 { | |
1926 if ( pWindow->Hint != (char *)1 ) | |
1927 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
1928 pButton = (GUIButton *)pWindow->ptr_1C; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2153
diff
changeset
|
1929 if ( pButton->uX >= 0 && pButton->uX <= window->GetWidth() ) |
1297 | 1930 { |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2153
diff
changeset
|
1931 if ( pButton->uY >= 0 && pButton->uY <= window->GetHeight() ) |
1297 | 1932 { |
1933 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
1934 viewparams->bRedrawGameUI = 1; | |
1935 if ( pWindow->Hint ) | |
1936 { | |
1937 if ( pWindow->Hint != (char *)1 ) | |
1938 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
1939 } | |
1940 pWindow->Release(); | |
1941 continue; | |
1942 } | |
1943 } | |
1944 viewparams->bRedrawGameUI = 1; | |
1945 if ( pWindow->Hint ) | |
1946 { | |
1947 if ( pWindow->Hint != (char *)1 ) | |
1948 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
1949 } | |
1950 pWindow->Release(); | |
1951 continue; | |
1952 } | |
1953 case WINDOW_CharactersPressedButton: | |
1954 { | |
1955 if ( pWindow->Hint != (char *)1 ) | |
1956 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
1957 pButton = (GUIButton *)pWindow->ptr_1C; | |
1958 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
1959 viewparams->bRedrawGameUI = 1; | |
1960 if ( pWindow->Hint ) | |
1961 { | |
1962 if ( pWindow->Hint != (char *)1 ) | |
1963 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
1964 } | |
1965 pWindow->Release(); | |
1966 continue; | |
1967 } | |
1968 case WINDOW_PressedButton: | |
1969 { | |
1970 if ( pWindow->Hint != (char *)1 ) | |
1971 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
1972 pButton = (GUIButton *)pWindow->ptr_1C; | |
1973 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
1974 viewparams->bRedrawGameUI = 1; | |
1975 if ( pWindow->Hint ) | |
1976 { | |
1977 if ( pWindow->Hint != (char *)1 ) | |
1978 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
1979 } | |
1980 pWindow->Release(); | |
1981 continue; | |
1982 } | |
1983 case WINDOW_5D: | |
1984 { | |
1985 if ( pWindow->Hint != (char *)1 ) | |
1986 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
1987 pButton = (GUIButton *)pWindow->ptr_1C; | |
1988 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
1989 viewparams->bRedrawGameUI = 1; | |
1990 pWindow->Release(); | |
1991 continue; | |
1992 } | |
1993 case WINDOW_SaveLoadBtn: | |
1994 { | |
1995 if (pWindow->Hint != (char *)1) | |
1996 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
1997 pButton = (GUIButton *)pWindow->ptr_1C; | |
1998 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
1999 pHint = pWindow->Hint; | |
2000 viewparams->bRedrawGameUI = 1; | |
2001 if ( pHint && pHint != (char *)1 ) | |
2002 pButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2003 pWindow->Release(); | |
2004 if (pCurrentScreen == SCREEN_SAVEGAME) | |
2402 | 2005 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveGame, 0, 0); |
1297 | 2006 else |
2402 | 2007 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0); |
1297 | 2008 continue; |
2009 } | |
2010 case WINDOW_LoadGame_CancelBtn: | |
2011 { | |
2012 if ( pWindow->Hint != (char *)1 ) | |
2013 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0); | |
2014 pButton = (GUIButton *)pWindow->ptr_1C; | |
2015 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]); | |
2016 viewparams->bRedrawGameUI = 1; | |
2017 if ( pWindow->Hint && pWindow->Hint != (char *)1 ) | |
2018 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0); | |
2019 pWindow->Release(); | |
2402 | 2020 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
1297 | 2021 continue; |
2022 } | |
2023 case WINDOW_CloseRestWindowBtn: | |
2024 { | |
2025 if ( pWindow->Hint != (char *)1 ) | |
2026 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2027 pGUIButton = (GUIButton *)pWindow->ptr_1C; | |
2028 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); | |
2029 pHint = pWindow->Hint; | |
2030 viewparams->bRedrawGameUI = 1; | |
2031 if ( pHint && pHint != (char *)1 ) | |
2032 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2033 pWindow->Release(); | |
2402 | 2034 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
1297 | 2035 continue; |
2036 } | |
2037 case WINDOW_ExitCharacterWindow: | |
2038 { | |
2039 if ( pWindow->Hint != (char *)1 ) | |
2040 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2041 pButton = (GUIButton *)pWindow->ptr_1C; | |
2042 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); | |
2043 pHint = pWindow->Hint; | |
2044 viewparams->bRedrawGameUI = 1; | |
2045 if ( pHint && pHint != (char *)1 ) | |
2046 pButton->DrawLabel(pHint, pFontCreate, 0, 0); | |
2047 pWindow->Release(); | |
2048 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | |
2402 | 2049 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
1297 | 2050 continue; |
2051 } | |
2052 case WINDOW_RestWindow: | |
2053 { | |
2054 memset(&GUIButton2, 0, 0xBCu); | |
2055 GUIButton2.uZ = 197; | |
2056 GUIButton2.uW = 197; | |
2057 GUIButton2.uX = 27; | |
2058 GUIButton2.uY = 161; | |
2059 GUIButton2.uWidth = 171; | |
2060 GUIButton2.uHeight = 37; | |
2061 GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
2062 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | |
2063 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15)); | |
2064 viewparams->bRedrawGameUI = 1; | |
2065 GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Отдых и лечение 8 часов | |
2066 GUIButton2.pParent = 0; | |
2067 pGUIWindow2 = pWindow; | |
2068 pGUIWindow2->Release(); | |
2069 continue; | |
2070 } | |
2071 case WINDOW_BooksWindow: | |
2072 { | |
2073 pButton = (GUIButton *)pWindow->ptr_1C; | |
2074 pRenderer->DrawTextureIndexed(pWindow->uFrameY, | |
2075 pWindow->uFrameX, pButton->pTextures[0]); | |
2076 viewparams->bRedrawGameUI = true; | |
2077 continue; | |
2078 } | |
2079 case WINDOW_CharacterWindow_Inventory: | |
2080 { | |
2081 pWindow->DrawMessageBox(0); | |
2082 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | |
2389 | 2083 pWindow->DrawText(pFontLucida, 10, 40, 0, pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); |
1297 | 2084 if ( !pKeyActionMap->field_204 ) |
2085 { | |
2086 ItemGen2.Reset(); | |
2087 pWindow->Release(); | |
2088 pEventTimer->Resume(); | |
2089 pCurrentScreen = SCREEN_GAME; | |
2090 viewparams->bRedrawGameUI = 1; | |
2389 | 2091 v39 = atoi(pKeyActionMap->pPressedKeysBuffer); |
1297 | 2092 if ( v39 > 0 ) |
2093 { | |
2094 if ( v39 < 800 ) | |
2095 SpawnActor(v39); | |
2096 } | |
2097 } | |
2098 continue; | |
2099 } | |
2100 case WINDOW_KeyMappingOptions: | |
2101 { | |
2102 GameMenuUI_DrawKeyBindings(); | |
2103 continue; | |
2104 } | |
2105 case WINDOW_VideoOptions: | |
2106 { | |
2107 GameMenuUI_DrawVideoOptions(); | |
2108 continue; | |
2109 } | |
2110 default: | |
2111 continue; | |
2112 } | |
2113 } | |
2114 if ( GetCurrentMenuID() == -1 ) | |
2115 GameUI_DrawFoodAndGold(); | |
2116 if ( sub_4637E0_is_there_popup_onscreen() ) | |
1802 | 2117 UI_OnMouseRightClick(0); |
1297 | 2118 } |
2290 | 2119 //void LoadFonts_and_DrawCopyrightWindow() |
2120 //{ | |
2121 //MainMenuUI_LoadFontsAndSomeStuff(); | |
2122 // DrawCopyrightWindow(); | |
2123 //} | |
1297 | 2124 //----- (00415485) -------------------------------------------------------- |
2290 | 2125 void DrawMM7CopyrightWindow() |
1297 | 2126 { |
2127 GUIWindow Dst; // [sp+8h] [bp-54h]@1 | |
2128 | |
2469 | 2129 memset(&Dst, 0, sizeof(Dst)); |
1297 | 2130 Dst.uFrameWidth = 624; |
2131 Dst.uFrameHeight = 256; | |
2132 Dst.uFrameX = 8; | |
2133 Dst.uFrameY = 30; // c 1999 The 3DO Company. | |
2134 Dst.uFrameHeight = pFontSmallnum->CalcTextHeight(pGlobalTXT_LocalizationStrings[157], &Dst, 24, 0) | |
2135 + 2 * LOBYTE(pFontSmallnum->uFontHeight) | |
2136 + 24; | |
2137 Dst.uFrameY = 470 - Dst.uFrameHeight; | |
2138 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; | |
2139 Dst.uFrameW = 469; | |
2140 //Dst.Hint = "abcagfdsgsg ljsrengvlkjesnfkjwnef"; | |
2141 Dst.DrawMessageBox(0); | |
2142 | |
2143 Dst.uFrameWidth -= 24; | |
2144 Dst.uFrameX += 12; | |
2145 Dst.uFrameY += 12; | |
2146 Dst.uFrameHeight -= 12; | |
2147 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; | |
2148 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; | |
2149 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); | |
2150 } | |
1458 | 2151 |
2152 int modal_window_prev_screen; | |
2153 | |
2154 //----- (004141CA) -------------------------------------------------------- | |
2155 void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message) | |
2156 { | |
2157 pEventTimer->Pause(); | |
2158 modal_window_prev_screen = pCurrentScreen; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2153
diff
changeset
|
2159 pModalWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_ModalWindow, OnRelease_message, pStrHint); |
1458 | 2160 pCurrentScreen = SCREEN_MODAL_WINDOW; |
2161 } | |
2162 | |
1297 | 2163 //----- (0041420D) -------------------------------------------------------- |
1458 | 2164 void ModalWindow_ShowHint() |
1297 | 2165 { |
2166 GUIWindow pWindow; // [sp+4h] [bp-54h]@1 | |
2167 | |
1458 | 2168 sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape |
1297 | 2169 pWindow.Hint = pTmpBuf2.data(); |
2170 pWindow.uFrameWidth = 400; | |
2171 pWindow.uFrameHeight = 100; | |
2172 pWindow.uFrameX = 120; | |
2173 pWindow.uFrameY = 140; | |
2174 pWindow.uFrameZ = 519; | |
2175 pWindow.uFrameW = 239; | |
2176 pWindow.DrawMessageBox(0); | |
2177 } | |
2178 | |
2179 //----- (0041426F) -------------------------------------------------------- | |
1458 | 2180 void ModalWindow_Release() |
1297 | 2181 { |
2402 | 2182 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)pModalWindow->par1C, 0, 0); |
1297 | 2183 |
1458 | 2184 pModalWindow->Release(); |
2185 pModalWindow = nullptr; | |
1297 | 2186 |
1458 | 2187 pCurrentScreen = modal_window_prev_screen; |
1297 | 2188 pEventTimer->Resume(); |
2189 } | |
2190 | |
2191 //----- (00467FB6) -------------------------------------------------------- | |
2192 void CreateScrollWindow() | |
2273 | 2193 { |
1297 | 2194 unsigned int v0; // eax@1 |
2195 char *v1; // ST18_4@3 | |
2196 GUIWindow a1; // [sp+Ch] [bp-54h]@1 | |
2197 | |
2198 memcpy(&a1, pGUIWindow_ScrollWindow, sizeof(a1)); | |
2199 a1.Hint = 0; | |
2200 a1.uFrameX = 1; | |
2201 a1.uFrameY = 1; | |
2202 a1.uFrameWidth = 468; | |
1312 | 2203 v0 = pFontSmallnum->CalcTextHeight(pScrolls[pGUIWindow_ScrollWindow->par1C], &a1, 0, 0) |
2273 | 2204 + 2 * LOBYTE(pFontCreate->uFontHeight) + 24; |
1297 | 2205 a1.uFrameHeight = v0; |
2206 if ( (signed int)(v0 + a1.uFrameY) > 479 ) | |
2207 { | |
2208 v0 = 479 - a1.uFrameY; | |
2209 a1.uFrameHeight = 479 - a1.uFrameY; | |
2210 } | |
2211 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | |
2212 a1.uFrameW = v0 + a1.uFrameY - 1; | |
2213 a1.DrawMessageBox(0); | |
2214 a1.uFrameX += 12; | |
2215 a1.uFrameWidth -= 24; | |
2216 a1.uFrameY += 12; | |
2217 a1.uFrameHeight -= 12; | |
2218 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | |
2219 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | |
2220 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; | |
2273 | 2221 sprintf(pTmpBuf.data(), format_4E2D80, Color16(0xFFu, 0xFFu, 0x9Bu), v1); |
2222 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
2223 a1.DrawText(pFontSmallnum, 1, LOBYTE(pFontCreate->uFontHeight) - 3, 0, | |
2224 pScrolls[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C], 0, 0, 0); | |
1297 | 2225 } |
2226 //----- (00467F48) -------------------------------------------------------- | |
2227 void CreateMsgScrollWindow( signed int mscroll_id ) | |
2273 | 2228 { |
1297 | 2229 if ( !pGUIWindow_ScrollWindow && mscroll_id >= 700 ) |
2230 { | |
2231 if ( mscroll_id <= 782 ) | |
2232 { | |
2233 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE); | |
2273 | 2234 pGUIWindow_ScrollWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Scroll, mscroll_id - 700, 0); |
1297 | 2235 } |
2236 } | |
2237 } | |
2238 //----- (00467F9F) -------------------------------------------------------- | |
1458 | 2239 void free_book_subwindow() |
1297 | 2240 { |
2241 if ( pGUIWindow_ScrollWindow ) | |
2242 { | |
2243 pGUIWindow_ScrollWindow->Release(); | |
2244 pGUIWindow_ScrollWindow = 0; | |
2245 } | |
1913 | 2246 } |
2247 //----- (004226EF) -------------------------------------------------------- | |
2248 void SetUserInterface(PartyAlignment align, bool bReplace) | |
2249 { | |
2250 extern void set_default_ui_skin(); | |
2251 set_default_ui_skin(); | |
2252 | |
2253 if (align == PartyAlignment_Evil) | |
2254 { | |
2255 if ( bReplace ) | |
2256 { | |
2257 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
2258 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
2259 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
2260 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
2261 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
2262 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
2263 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-c", 2); | |
2264 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-C", 2); | |
2265 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); | |
2266 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
2267 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
2268 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); | |
2269 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
2270 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
2271 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
2272 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2); | |
2273 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); | |
2274 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
2275 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
2276 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
2277 | |
2278 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); | |
2279 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); | |
2280 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); | |
2281 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); | |
2282 | |
2283 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
2284 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); | |
2285 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
2286 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); | |
2287 | |
2288 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); | |
2289 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); | |
2290 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-c", 2); | |
2291 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
2292 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
2293 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
2294 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
2295 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
2296 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
2297 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
2298 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
2299 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
2300 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
2301 } | |
2302 else | |
2303 { | |
2304 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
2305 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
2306 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
2307 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
2308 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
2309 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
2310 uTextureID_Minimap_Loop = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); | |
2311 uTextureID_Compas = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
2312 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); | |
2313 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
2314 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
2315 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); | |
2316 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
2317 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); | |
2318 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); | |
2319 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); | |
2320 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); | |
2321 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
2322 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
2323 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
2324 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); | |
2325 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); | |
2326 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
2327 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
2328 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
2329 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); | |
2330 uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
2331 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
2332 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
2333 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
2334 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2335 } | |
2069 | 2336 uGameUIFontMain = Color16(0xC8u, 0, 0); |
2337 uGameUIFontShadow = Color16(10, 0, 0); | |
1913 | 2338 } |
2339 else if (align == PartyAlignment_Neutral) | |
2340 { | |
2341 if ( bReplace ) | |
2342 { | |
2343 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
2344 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
2345 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
2346 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
2347 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
2348 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
2349 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-a", 2); | |
2350 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-a", 2); | |
2351 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); | |
2352 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
2353 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
2354 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); | |
2355 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
2356 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
2357 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
2358 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2); | |
2359 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); | |
2360 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
2361 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
2362 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
2363 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); | |
2364 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); | |
2365 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); | |
2366 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); | |
2367 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
2368 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
2369 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
2370 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2371 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2); | |
2372 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); | |
2373 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven", 2); | |
2374 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
2375 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
2376 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
2377 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
2378 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
2379 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
2380 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
2381 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
2382 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
2383 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
2384 } | |
2385 else | |
2386 { | |
2387 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
2388 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
2389 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
2390 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
2391 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
2392 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
2393 uTextureID_Minimap_Loop = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); | |
2394 uTextureID_Compas = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
2395 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); | |
2396 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
2397 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
2398 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); | |
2399 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
2400 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); | |
2401 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); | |
2402 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
2403 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
2404 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
2405 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); | |
2406 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); | |
2407 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); | |
2408 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); | |
2409 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
2410 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
2411 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
2412 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); | |
2413 uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
2414 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
2415 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
2416 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
2417 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2418 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
2419 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
2420 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
2421 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
2422 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
2423 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
2424 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
2425 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
2426 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
2427 pTexture_591428 = pIcons_LOD->LoadTexturePtr("endcap", TEXTURE_16BIT_PALETTE); | |
2428 } | |
2069 | 2429 uGameUIFontMain = Color16(0xAu, 0, 0); |
2430 uGameUIFontShadow = Color16(230, 214, 193); | |
1913 | 2431 } |
2432 else if (align == PartyAlignment_Good) | |
2433 { | |
2434 if ( bReplace ) | |
2435 { | |
2436 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
2437 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
2438 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
2439 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
2440 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
2441 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
2442 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-b", 2); | |
2443 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-B", 2); | |
2444 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); | |
2445 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
2446 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
2447 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); | |
2448 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
2449 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
2450 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
2451 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2); | |
2452 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); | |
2453 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
2454 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
2455 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
2456 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); | |
2457 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); | |
2458 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); | |
2459 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); | |
2460 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); | |
2461 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
2462 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
2463 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2464 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2); | |
2465 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); | |
2466 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-b", 2); | |
2467 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
2468 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
2469 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
2470 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
2471 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
2472 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
2473 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
2474 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
2475 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
2476 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
2477 } | |
2069 | 2478 uGameUIFontMain = Color16(0, 0, 0xC8u); |
2479 uGameUIFontShadow = Color16(255, 255, 255); | |
1913 | 2480 } |
2481 else Error("Invalid alignment type: %u", align); | |
2482 } | |
2483 //----- (0041D20D) -------------------------------------------------------- | |
2484 void DrawBuff_remaining_time_string( int uY, struct GUIWindow *window, __int64 remaining_time, struct GUIFont *Font ) | |
2485 { | |
2486 unsigned int full_time; // esi@1 | |
2487 signed __int64 hours; // kr00_8@1 | |
2488 const char *text; // eax@2 | |
2489 signed __int64 minutes; // [sp+10h] [bp-10h]@1 | |
2490 signed __int64 seconds; // [sp+18h] [bp-8h]@1 | |
2491 unsigned int day; // [sp+24h] [bp+4h]@1 | |
2492 | |
2493 full_time = (signed __int64)((double)remaining_time * 0.234375); | |
2494 day = (unsigned int)((full_time / 60) / 60) / 24; | |
2495 hours = ((full_time / 60) / 60) % 24; | |
2496 minutes = (signed __int64)(full_time / 60) % 60; | |
2497 seconds = (signed __int64)full_time % 60; | |
2498 strcpy(pTmpBuf.data(), "\r020"); | |
2499 if ( day ) | |
2500 { | |
2501 text = pGlobalTXT_LocalizationStrings[57]; // Days | |
2502 if ( day <= 1 ) | |
2503 text = pGlobalTXT_LocalizationStrings[56]; // Day | |
2504 sprintfex(pTmpBuf2.data(), "%d %s ", (int)day, text); | |
2505 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2506 } | |
2507 if ( hours ) | |
2508 { | |
2509 if ( hours <= 1 ) | |
2510 text = pGlobalTXT_LocalizationStrings[109];// Hour | |
2511 else | |
2512 text = pGlobalTXT_LocalizationStrings[110];// Hours | |
2513 sprintfex(pTmpBuf2.data(), "%d %s ", (int)hours, text); | |
2514 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2515 } | |
2516 if ( minutes && !day ) | |
2517 { | |
2518 if ( minutes <= 1 ) | |
2519 text = pGlobalTXT_LocalizationStrings[437];// Minute | |
2520 else | |
2521 text = pGlobalTXT_LocalizationStrings[436];// Minutes | |
2522 sprintfex(pTmpBuf2.data(), "%d %s ", (int)minutes, text); | |
2523 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2524 } | |
2525 if ( seconds && !hours ) | |
2526 { | |
2527 if ( seconds <= 1 ) | |
2528 text = pGlobalTXT_LocalizationStrings[439];// Second | |
2529 else | |
2530 text = pGlobalTXT_LocalizationStrings[438];// Seconds | |
2531 sprintfex(pTmpBuf2.data(), "%d %s ", (int)seconds, text); | |
2532 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2533 } | |
2534 window->DrawText(Font, 32, uY, 0, pTmpBuf.data(), 0, 0, 0); | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2535 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2536 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2537 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2538 //----- (0042EB8D) -------------------------------------------------------- |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2539 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2540 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2541 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2542 if (uNumMessages < 40) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2543 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2544 files[uNumMessages] = file; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2545 lines[uNumMessages] = line; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2546 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2547 pMessages[uNumMessages].eType = msg; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2548 pMessages[uNumMessages].param = param; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2549 pMessages[uNumMessages++].field_8 = a4; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2290
diff
changeset
|
2550 } |
2355 | 2551 } |
2552 | |
2553 //----- (004637E0) -------------------------------------------------------- | |
2554 char sub_4637E0_is_there_popup_onscreen() | |
2555 { | |
2556 return dword_507BF0_is_there_popup_onscreen == 1; | |
2557 } | |
2463 | 2558 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen; |
2559 | |
2560 //----- (00417AD4) -------------------------------------------------------- | |
2561 unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level) | |
2562 { | |
2563 switch (uPlayerClass % 4) | |
2564 { | |
2565 case 0: | |
2566 { | |
2567 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level) | |
2568 return ui_character_skillinfo_can_learn; | |
2569 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level && | |
2570 byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level) | |
2571 { | |
2572 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType] < skill_level) | |
2573 return ui_character_skillinfo_cant_learn; | |
2574 } | |
2575 return ui_character_skillinfo_can_learn_gm; | |
2576 } | |
2577 break; | |
2578 | |
2579 case 1: | |
2580 { | |
2581 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level) | |
2582 return ui_character_skillinfo_can_learn; | |
2583 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level) | |
2584 { | |
2585 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level) | |
2586 return ui_character_skillinfo_cant_learn; | |
2587 } | |
2588 return ui_character_skillinfo_can_learn_gm; | |
2589 } | |
2590 break; | |
2591 | |
2592 case 2: | |
2593 case 3: | |
2594 { | |
2595 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level) | |
2596 return ui_character_skillinfo_cant_learn; | |
2597 return ui_character_skillinfo_can_learn; | |
2598 } | |
2599 break; | |
2600 } | |
2601 Error("Invalid player class: %u", uPlayerClass); | |
2602 } | |
2603 | |
2604 //----- (0040F92A) -------------------------------------------------------- | |
2605 void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture *a2, int a3) | |
2606 {//срабатывает в покупке в магазине | |
2607 void *v4; // eax@3 | |
2608 //int *v5; // edi@5 | |
2609 // int v6; // ecx@6 | |
2610 // int v9; // [sp+18h] [bp-4h]@1 | |
2611 | |
2612 if (pIcons_LOD->dword_011BA4 && a2->uDecompressedSize) | |
2613 v4 = a2->UnzipPalette(); | |
2614 else | |
2615 v4 = a2->pLevelOfDetail0_prolly_alpha_mask; | |
2616 //v5 = pZBuffer; | |
2617 for (uint i = 0; i < a2->uTextureHeight; i++) | |
2618 { | |
2619 for (uint j = 0; j < a2->uTextureWidth; j++) | |
2620 { | |
2621 *pZBuffer = a3; | |
2622 ++pZBuffer; | |
2623 } | |
2624 pZBuffer += window->GetWidth() - a2->uTextureWidth; | |
2625 } | |
2626 if (pIcons_LOD->dword_011BA4) | |
2627 { | |
2628 if (a2->uDecompressedSize) | |
2629 free(v4); | |
2630 } | |
2631 } | |
2632 | |
2633 | |
2634 // 4E28F8: using guessed type int pCurrentScreen; | |
2635 | |
2636 //----- (0040F82D) -------------------------------------------------------- | |
2637 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue) | |
2638 { | |
2639 assert(uTextureId != -1); | |
2640 ZBuffer_DoFill(pZBuffer, pIcons_LOD->GetTexture(uTextureId), iZValue); | |
2641 } | |
2642 | |
2643 //----- (0040F89C) -------------------------------------------------------- | |
2644 void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue) | |
2645 {//срабатывает при продаже в магазине | |
2646 void *v3; // eax@3 | |
2647 //void *v4; // esi@5 | |
2648 //int *v5; // edi@5 | |
2649 //int v6; // eax@5 | |
2650 // int v7; // ecx@6 | |
2651 // int v11; // [sp+18h] [bp-8h]@1 | |
2652 //void *v12; // [sp+1Ch] [bp-4h]@5 | |
2653 | |
2654 if (pIcons_LOD->dword_011BA4 && pTex->uDecompressedSize) | |
2655 v3 = pTex->UnzipPalette(); | |
2656 else | |
2657 v3 = pTex->pLevelOfDetail0_prolly_alpha_mask; | |
2658 //v12 = v3; | |
2659 //v4 = v3; | |
2660 //v5 = pZBuffer; | |
2661 //v6 = 0; | |
2662 for (uint i = 0; i < pTex->uTextureHeight; i++) | |
2663 { | |
2664 for (uint j = 0; j < pTex->uTextureWidth; j++) | |
2665 { | |
2666 //LOBYTE(v6) = *(char *)v4; | |
2667 //v4 = (char *)v4 + 1; | |
2668 //if ( v6 ) | |
2669 *pZBuffer = uZValue; | |
2670 ++pZBuffer; | |
2671 } | |
2672 pZBuffer += window->GetWidth() - pTex->uTextureWidth; | |
2673 } | |
2674 if (pIcons_LOD->dword_011BA4) | |
2675 { | |
2676 if (pTex->uDecompressedSize) | |
2677 free(v3); | |
2678 } | |
2679 } | |
2680 | |
2681 //----- (004BC49B) -------------------------------------------------------- | |
2682 void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType) | |
2683 { | |
2684 NPCData *speakingNPC; // ebp@1 | |
2685 int npc_event_id; // ecx@10 | |
2686 char *v13; // [sp-8h] [bp-18h]@60 | |
2687 | |
2688 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
2689 uDialogueType = newDialogueType; | |
2690 if (!speakingNPC->uFlags) | |
2691 speakingNPC->uFlags = 1; | |
2692 if (newDialogueType == DIALOGUE_PROFESSION_DETAILS) | |
2693 dialogue_show_profession_details = ~dialogue_show_profession_details; | |
2694 else if (newDialogueType == DIALOGUE_76) | |
2695 { | |
2696 if (speakingNPC->Hired()) | |
2697 { | |
2698 if ((signed int)pNPCStats->uNumNewNPCs > 0) | |
2699 { | |
2700 for (uint i = 0; i < (unsigned int)pNPCStats->uNumNewNPCs; ++i) | |
2701 { | |
2702 if (pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName)) | |
2703 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu; | |
2704 } | |
2705 } | |
2706 if (pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName)) | |
2707 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); | |
2708 else if (pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName)) | |
2709 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); | |
2710 pParty->hirelingScrollPosition = 0; | |
2711 pParty->CountHirelings(); | |
2712 dword_591084 = 0; | |
2713 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2714 dword_7241C8 = 0; | |
2715 return; | |
2716 } | |
2717 if (pParty->pHirelings[0].pName && pParty->pHirelings[1].pName) | |
2718 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full"" | |
2719 else | |
2720 { | |
2721 if (speakingNPC->uProfession != 51) //burglars have no hiring price | |
2722 { | |
2723 if (pParty->uNumGold < pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice) | |
2724 { | |
2725 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" | |
2726 dialogue_show_profession_details = false; | |
2727 uDialogueType = 13; | |
2728 if (uActiveCharacter) | |
2729 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | |
2730 if (!dword_7241C8) | |
2731 pGame->Draw(); | |
2732 dword_7241C8 = 0; | |
2733 return; | |
2734 } | |
2735 Party::TakeGold(pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice); | |
2736 } | |
2737 LOBYTE(speakingNPC->uFlags) |= 0x80u; | |
2738 if (pParty->pHirelings[0].pName) | |
2739 { | |
2740 memcpy(&pParty->pHirelings[1], speakingNPC, sizeof(pParty->pHirelings[1])); | |
2741 v13 = pParty->pHireling2Name; | |
2742 } | |
2743 else | |
2744 { | |
2745 memcpy(&pParty->pHirelings[0], speakingNPC, sizeof(pParty->pHirelings[0])); | |
2746 v13 = pParty->pHireling1Name; | |
2747 } | |
2748 strcpy(v13, speakingNPC->pName); | |
2749 pParty->hirelingScrollPosition = 0; | |
2750 pParty->CountHirelings(); | |
2751 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2752 if (sDialogue_SpeakingActorNPC_ID >= 0) | |
2753 pDialogue_SpeakingActor->uAIState = Removed; | |
2754 if (uActiveCharacter) | |
2755 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); | |
2756 } | |
2757 } | |
2758 else if ((signed int)newDialogueType > DIALOGUE_84 && (signed int)newDialogueType <= DIALOGUE_ARENA_SELECT_CHAMPION) //выбор уровня сложности боя | |
2759 { | |
2760 ArenaFight(); | |
2761 return; | |
2762 } | |
2763 else if (newDialogueType == DIALOGUE_USE_NPC_ABILITY) | |
2764 { | |
2765 if (UseNPCSkill((NPCProf)speakingNPC->uProfession) == 0) | |
2766 { | |
2767 if (speakingNPC->uProfession != GateMaster) | |
2768 speakingNPC->bHasUsedTheAbility = 1; | |
2769 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2770 } | |
2771 else | |
2772 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2); //"Your packs are already full!" | |
2773 } | |
2774 else if (newDialogueType == DIALOGUE_13) | |
2775 { | |
2776 if (!speakingNPC->Hired()) | |
2777 { | |
2778 sub_4B3E1E(); | |
2779 dialogue_show_profession_details = false; | |
2780 } | |
2781 else | |
2782 { | |
2783 for (uint i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i) | |
2784 { | |
2785 if (pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName)) | |
2786 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu; | |
2787 } | |
2788 if (pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName)) | |
2789 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); | |
2790 else if (pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName)) | |
2791 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); | |
2792 pParty->hirelingScrollPosition = 0; | |
2793 pParty->CountHirelings(); | |
2794 dword_591084 = 0; | |
2795 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2796 dword_7241C8 = 0; | |
2797 return; | |
2798 } | |
2799 } | |
2800 else if (newDialogueType >= DIALOGUE_EVT_A && newDialogueType <= DIALOGUE_EVT_F) | |
2801 { | |
2802 switch (newDialogueType) | |
2803 { | |
2804 case DIALOGUE_EVT_A: npc_event_id = speakingNPC->evt_A; break; | |
2805 case DIALOGUE_EVT_B: npc_event_id = speakingNPC->evt_B; break; | |
2806 case DIALOGUE_EVT_C: npc_event_id = speakingNPC->evt_C; break; | |
2807 case DIALOGUE_EVT_D: npc_event_id = speakingNPC->evt_D; break; | |
2808 case DIALOGUE_EVT_E: npc_event_id = speakingNPC->evt_E; break; | |
2809 case DIALOGUE_EVT_F: npc_event_id = speakingNPC->evt_F; break; | |
2810 } | |
2811 if ((npc_event_id >= 200) && (npc_event_id <= 310)) | |
2812 _4B3FE5_training_dialogue(npc_event_id); //200-310 | |
2813 else if ((npc_event_id >= 400) && (npc_event_id <= 410)) | |
2814 { //400-410 | |
2815 dword_F8B1D8 = newDialogueType; | |
2816 DrawJoinGuildWindow(npc_event_id - 400); | |
2817 } | |
2818 else | |
2819 { | |
2820 switch (npc_event_id) | |
2821 { | |
2822 case 139: | |
2823 OracleDialogue(); | |
2824 break; | |
2825 case 311: | |
2826 CheckBountyRespawnAndAward(); | |
2827 break; | |
2828 case 399: | |
2829 Arena_SelectionFightLevel(); | |
2830 break; | |
2831 default: | |
2832 activeLevelDecoration = (LevelDecoration*)1; | |
2833 current_npc_text = 0; | |
2834 EventProcessor(npc_event_id, 0, 1); | |
2835 activeLevelDecoration = nullptr; | |
2836 break; | |
2837 } | |
2838 } | |
2839 } | |
2840 if (!dword_7241C8) | |
2841 pGame->Draw(); | |
2842 dword_7241C8 = 0; | |
2843 } | |
2844 | |
2845 //----- (004B3E1E) -------------------------------------------------------- | |
2846 void sub_4B3E1E() | |
2847 { | |
2848 NPCData *v0; // ST40_4@1 | |
2849 signed int v1; // edi@1 | |
2850 //GUIWindow *v2; // ecx@1 | |
2851 | |
2852 __debugbreak(); | |
2853 v0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
2854 v1 = 0; | |
2855 pDialogueWindow->eWindowType = WINDOW_MainMenu; | |
2856 pDialogueWindow->Release(); | |
2857 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Dialogue, 1, 0); | |
2858 if (pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) | |
2859 { | |
2860 pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0);//Подробнее | |
2861 v1 = 1; | |
2862 } | |
2863 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, UIMSG_SelectNPCDialogueOption, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять | |
2864 pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1); | |
2865 } | |
2866 | |
2867 //----- (004B2001) -------------------------------------------------------- | |
2868 void __fastcall ClickNPCTopic(signed int uMessageParam) | |
2869 { | |
2870 //signed int v1; // eax@1 | |
2871 NPCData *pCurrentNPCInfo; // ebp@1 | |
2872 int pEventNumber; // ecx@8 | |
2873 Player *v4; // esi@20 | |
2874 //int v5; // eax@28 | |
2875 //int v6; // eax@31 | |
2876 //int v7; // eax@34 | |
2877 //int v8; // eax@37 | |
2878 //int v9; // eax@40 | |
2879 //unsigned int v10; // eax@43 | |
2880 char *v12; // eax@53 | |
2881 char *v13; // eax@56 | |
2882 char *v14; // eax@57 | |
2883 char *v15; // eax@58 | |
2884 //unsigned int v16; // ebp@62 | |
2885 char *v17; // ecx@63 | |
2886 char *v18; // eax@65 | |
2887 // const char *v19; // ecx@68 | |
2888 //unsigned int v20; // eax@69 | |
2889 signed int pPrice; // ecx@70 | |
2890 char *v22; // [sp-Ch] [bp-18h]@73 | |
2891 //int v23; // [sp-8h] [bp-14h]@49 | |
2892 char *v24; // [sp-8h] [bp-14h]@73 | |
2893 //int v25; // [sp-4h] [bp-10h]@49 | |
2894 | |
2895 uDialogueType = uMessageParam + 1; | |
2896 pCurrentNPCInfo = HouseNPCData[pDialogueNPCCount - ((dword_591080 != 0) ? 1 : 0)];//- 1 | |
2897 if (uMessageParam <= 24) | |
2898 { | |
2899 switch (uMessageParam) | |
2900 { | |
2901 case 13: | |
2902 current_npc_text = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); | |
2903 current_npc_text = BuildDialogueString(current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); | |
2904 NPCHireableDialogPrepare(); | |
2905 dialogue_show_profession_details = false; | |
2906 goto _return; | |
2907 case 19: | |
2908 pEventNumber = pCurrentNPCInfo->evt_A; | |
2909 break; | |
2910 case 20: | |
2911 pEventNumber = pCurrentNPCInfo->evt_B; | |
2912 break; | |
2913 case 21: | |
2914 pEventNumber = pCurrentNPCInfo->evt_C; | |
2915 break; | |
2916 case 22: | |
2917 pEventNumber = pCurrentNPCInfo->evt_D; | |
2918 break; | |
2919 case 23: | |
2920 pEventNumber = pCurrentNPCInfo->evt_E; | |
2921 break; | |
2922 case 24: | |
2923 pEventNumber = pCurrentNPCInfo->evt_F; | |
2924 break; | |
2925 default: | |
2926 goto _return; | |
2927 } | |
2928 /*switch ( pEventNumber ) | |
2929 { | |
2930 case 139: | |
2931 OracleDialogue(); | |
2932 goto _return; | |
2933 case 311: | |
2934 CheckBountyRespawnAndAward(); | |
2935 goto _return; | |
2936 }*/ | |
2937 if (pEventNumber < 200 || pEventNumber > 310) | |
2938 { | |
2939 if (pEventNumber < 400 || pEventNumber > 410) | |
2940 { | |
2941 if (pEventNumber == 139) | |
2942 { | |
2943 OracleDialogue(); | |
2944 } | |
2945 else | |
2946 { | |
2947 if (pEventNumber == 311) | |
2948 { | |
2949 CheckBountyRespawnAndAward(); | |
2950 } | |
2951 else | |
2952 { | |
2953 current_npc_text = 0; | |
2954 activeLevelDecoration = (LevelDecoration*)1; | |
2955 EventProcessor(pEventNumber, 0, 1); | |
2956 activeLevelDecoration = nullptr; | |
2957 } | |
2958 } | |
2959 } | |
2960 else | |
2961 { | |
2962 dword_F8B1D8 = uMessageParam; | |
2963 DrawJoinGuildWindow(pEventNumber - 400); | |
2964 } | |
2965 } | |
2966 else | |
2967 { | |
2968 _4B3FE5_training_dialogue(pEventNumber); | |
2969 } | |
2970 goto _return; | |
2971 } | |
2972 if (uMessageParam != 76) | |
2973 { | |
2974 if (uMessageParam == 77) | |
2975 { | |
2976 //v16 = pCurrentNPCInfo->uProfession; | |
2977 __debugbreak(); // probably hirelings found in buildings, not present in MM7, changed "pCurrentNPCInfo->uProfession - 1" to "pCurrentNPCInfo->uProfession", have to check in other versions whether it's ok | |
2978 if (dialogue_show_profession_details) | |
2979 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText; | |
2980 else | |
2981 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pBenefits; | |
2982 current_npc_text = v17; | |
2983 v18 = BuildDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); | |
2984 dialogue_show_profession_details = ~dialogue_show_profession_details; | |
2985 current_npc_text = v18; | |
2986 } | |
2987 else | |
2988 { | |
2989 if (uMessageParam == 79) | |
2990 { | |
2991 if (contract_approved) | |
2992 { | |
2993 Party::TakeGold(gold_transaction_amount); | |
2994 if (uActiveCharacter) | |
2995 { | |
2996 v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; | |
2997 *(short *)v12 &= 0x3Fu; | |
2998 switch (dword_F8B1B0_MasteryBeingTaught) | |
2999 { | |
3000 case 2: | |
3001 v15 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; | |
3002 *v15 |= 0x40u; | |
3003 break; | |
3004 case 3: | |
3005 v14 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; | |
3006 *v14 |= 0x80u; | |
3007 break; | |
3008 case 4: | |
3009 v13 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; | |
3010 v13[1] |= 1u; | |
3011 break; | |
3012 } | |
3013 pPlayers[uActiveCharacter]->PlaySound(SPEECH_85, 0); | |
3014 } | |
3015 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
3016 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3017 { | |
3018 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3019 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; | |
3020 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3021 ++pMessageQueue_50CBD0->uNumMessages; | |
3022 }*/ | |
3023 } | |
3024 } | |
3025 else | |
3026 { | |
3027 if (uMessageParam == 82 && contract_approved) //join guild | |
3028 { | |
3029 Party::TakeGold(gold_transaction_amount); | |
3030 v4 = pParty->pPlayers.data(); | |
3031 do | |
3032 { | |
3033 v4->SetVariable(VAR_Award, dword_F8B1AC_award_bit_number); | |
3034 ++v4; | |
3035 } while ((signed int)v4 < (signed int)pParty->pHirelings.data()); | |
3036 switch (dword_F8B1D8) | |
3037 { | |
3038 case 19: | |
3039 pEventNumber = pCurrentNPCInfo->evt_A; | |
3040 if (pEventNumber >= 400 && pEventNumber <= 416) | |
3041 pCurrentNPCInfo->evt_A = 0; | |
3042 break; | |
3043 case 20: | |
3044 pEventNumber = pCurrentNPCInfo->evt_B; | |
3045 if (pEventNumber >= 400 && pEventNumber <= 416) | |
3046 pCurrentNPCInfo->evt_B = 0; | |
3047 break; | |
3048 case 21: | |
3049 pEventNumber = pCurrentNPCInfo->evt_C; | |
3050 if (pEventNumber >= 400 && pEventNumber <= 416) | |
3051 pCurrentNPCInfo->evt_C = 0; | |
3052 break; | |
3053 case 22: | |
3054 pEventNumber = pCurrentNPCInfo->evt_D; | |
3055 if (pEventNumber >= 400 && pEventNumber <= 416) | |
3056 pCurrentNPCInfo->evt_D = 0; | |
3057 break; | |
3058 case 23: | |
3059 pEventNumber = pCurrentNPCInfo->evt_E; | |
3060 if (pEventNumber >= 400 && pEventNumber <= 416) | |
3061 pCurrentNPCInfo->evt_E = 0; | |
3062 break; | |
3063 case 24: | |
3064 pEventNumber = pCurrentNPCInfo->evt_F; | |
3065 if (pEventNumber >= 400 && pEventNumber <= 416) | |
3066 pCurrentNPCInfo->evt_F = 0; | |
3067 break; | |
3068 } | |
3069 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
3070 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3071 { | |
3072 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3073 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; | |
3074 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3075 ++pMessageQueue_50CBD0->uNumMessages; | |
3076 }*/ | |
3077 //v11 = uActiveCharacter; | |
3078 if (uActiveCharacter) | |
3079 { | |
3080 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_86, 0); | |
3081 goto _return; | |
3082 } | |
3083 } | |
3084 } | |
3085 } | |
3086 goto _return; | |
3087 } | |
3088 if (pParty->pHirelings[0].pName && pParty->pHirelings[1].pName) | |
3089 { | |
3090 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full"" | |
3091 goto _return; | |
3092 } | |
3093 if (pCurrentNPCInfo->uProfession != 51) //burglars have no hiring price | |
3094 { | |
3095 __debugbreak(); // probably hirelings found in buildings, not present in MM7, changed "pCurrentNPCInfo->uProfession - 1" to "pCurrentNPCInfo->uProfession", have to check in other versions whether it's ok | |
3096 pPrice = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].uHirePrice; | |
3097 if (pParty->uNumGold < (unsigned int)pPrice) | |
3098 { | |
3099 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); | |
3100 dialogue_show_profession_details = false; | |
3101 uDialogueType = 13; | |
3102 current_npc_text = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText; | |
3103 current_npc_text = BuildDialogueString(current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); | |
3104 if (uActiveCharacter) | |
3105 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | |
3106 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); | |
3107 goto _return; | |
3108 } | |
3109 Party::TakeGold(pPrice); | |
3110 } | |
3111 //LOBYTE(v2->uFlags) |= 0x80u; | |
3112 pCurrentNPCInfo->uFlags |= 128; | |
3113 pParty->hirelingScrollPosition = 0; | |
3114 pParty->CountHirelings(); | |
3115 if (pParty->pHirelings[0].pName) | |
3116 { | |
3117 memcpy(&pParty->pHirelings[1], pCurrentNPCInfo, sizeof(pParty->pHirelings[1])); | |
3118 v24 = pCurrentNPCInfo->pName; | |
3119 v22 = pParty->pHireling2Name; | |
3120 } | |
3121 else | |
3122 { | |
3123 memcpy(pParty->pHirelings.data(), pCurrentNPCInfo, 0x4Cu); | |
3124 v24 = pCurrentNPCInfo->pName; | |
3125 v22 = pParty->pHireling1Name; | |
3126 } | |
3127 strcpy(v22, v24); | |
3128 pParty->hirelingScrollPosition = 0; | |
3129 pParty->CountHirelings(); | |
3130 PrepareHouse((HOUSE_ID)(int)window_SpeakInHouse->ptr_1C); | |
3131 dialog_menu_id = HOUSE_DIALOGUE_MAIN; | |
3132 | |
3133 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
3134 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
3135 { | |
3136 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3137 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; | |
3138 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3139 ++pMessageQueue_50CBD0->uNumMessages; | |
3140 }*/ | |
3141 if (uActiveCharacter) | |
3142 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)61, 0); | |
3143 _return: | |
3144 BackToHouseMenu(); | |
3145 } | |
3146 | |
3147 //----- (004B3FE5) -------------------------------------------------------- | |
3148 //Originally called _4B254D_SkillMasteryTeacher to have contract_approved assigned, to be able to set some button name. | |
3149 //But it the name gets immediately overwritten | |
3150 void _4B3FE5_training_dialogue(int a4) | |
3151 { | |
3152 const char *v2; // edi@1 | |
3153 | |
3154 //__debugbreak(); | |
3155 uDialogueType = DIALOGUE_SKILL_TRAINER; | |
3156 current_npc_text = (char *)pNPCTopics[a4 + 168].pText; | |
3157 _4B254D_SkillMasteryTeacher(a4); //might be needed because of contract_approved ? | |
3158 pDialogueWindow->Release(); | |
3159 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, a4, 0); | |
3160 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, | |
3161 pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); | |
3162 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); | |
3163 v2 = ""; | |
3164 if (contract_approved) | |
3165 v2 = pGlobalTXT_LocalizationStrings[535]; | |
3166 pDialogueWindow->CreateButton(480, 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Fu, 0, v2, 0); | |
3167 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); | |
3168 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | |
3169 } | |
3170 // F8B19C: using guessed type int dword_F8B19C; | |
3171 // F8B1A8: using guessed type int dword_F8B1A8; | |
3172 //----- (004B1ECE) -------------------------------------------------------- | |
3173 void OracleDialogue() | |
3174 { | |
3175 __int16 *v0; // edi@1 | |
3176 signed int v4; // eax@9 | |
3177 int v5; // ebx@11 | |
3178 signed int v8; // edi@14 | |
3179 ItemGen *v9; // [sp+Ch] [bp-Ch]@11 | |
3180 signed int v10; // [sp+10h] [bp-8h]@13 | |
3181 int v11; // [sp+14h] [bp-4h]@1 | |
3182 | |
3183 contract_approved = 0; | |
3184 v11 = 0; | |
3185 uDialogueType = 84; | |
3186 current_npc_text = (char *)pNPCTopics[667].pText; | |
3187 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals.data(); | |
3188 //while ( 1 ) | |
3189 for (uint i = 0; i <= 53; i++) | |
3190 { | |
3191 if ((unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0)) | |
3192 { | |
3193 //v1 = 0; | |
3194 //v2 = pParty->pPlayers.data(); | |
3195 for (uint pl = 0; pl < 4; pl++) | |
3196 { | |
3197 //LOBYTE(v3) = pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)); | |
3198 if (pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0 + 1))) | |
3199 break; | |
3200 //++v2; | |
3201 //++v1; | |
3202 } | |
3203 //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); | |
3204 //if ( v1 == 4 ) | |
3205 //break; | |
3206 } | |
3207 ++v11; | |
3208 //v0 += 2; | |
3209 //if ( v0 > &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | |
3210 //break; | |
3211 } | |
3212 if (v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53]) | |
3213 { | |
3214 current_npc_text = (char *)pNPCTopics[666].pText; // Here's %s that you lost. Be careful | |
3215 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; | |
3216 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; | |
3217 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); | |
3218 } | |
3219 if (contract_approved == 601) | |
3220 { | |
3221 v5 = 0; | |
3222 //v12 = pParty->pPlayers.data();//[0].uClass; | |
3223 v9 = 0; | |
3224 //while ( 1 ) | |
3225 for (uint i = 0; i < 4; i++) | |
3226 { | |
3227 if (pParty->pPlayers[i].classType == PLAYER_CLASS_LICH) | |
3228 { | |
3229 v10 = 0; | |
3230 //v6 = pParty->pPlayers.data();//[0].pInventoryItems[0].field_1A; | |
3231 for (uint pl = 0; pl < 4; pl++) | |
3232 { | |
3233 for (v8 = 0; v8 < 126; v8++)//138 | |
3234 { | |
3235 if (pParty->pPlayers[pl].pInventoryItemList[v8].uItemID == ITEM_LICH_JAR_FULL) | |
3236 { | |
3237 if (!pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer) | |
3238 v9 = &pParty->pPlayers[pl].pInventoryItemList[v8]; | |
3239 if (pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer == v5) | |
3240 v10 = 1; | |
3241 } | |
3242 } | |
3243 } | |
3244 if (!v10) | |
3245 break; | |
3246 } | |
3247 // ++v12; | |
3248 ++v5; | |
3249 // if ( v12 > &pParty->pPlayers[3] ) | |
3250 // return; | |
3251 } | |
3252 if (v9) | |
3253 v9->uHolderPlayer = v5; | |
3254 } | |
3255 } | |
3256 | |
3257 //----- (004B46A5) -------------------------------------------------------- | |
3258 void __fastcall DrawTextAtStatusBar(const char *Str, int a5) | |
3259 { | |
3260 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); | |
3261 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, Str) + 11, 357, a5, Str, 0, 0, 0); | |
3262 } | |
3263 | |
3264 //----- (004BBA85) -------------------------------------------------------- | |
3265 void CheckBountyRespawnAndAward() | |
3266 { | |
3267 int i; // eax@2 | |
3268 int rand_monster_id; // edx@3 | |
3269 | |
3270 uDialogueType = 83; | |
3271 pDialogueWindow->Release(); | |
3272 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, 0, 0); | |
3273 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel" | |
3274 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); | |
3275 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); | |
3276 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_0, 83, 0, "", 0); | |
3277 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); | |
3278 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | |
3279 //get new monster for hunting | |
3280 if (pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] < (signed __int64)pParty->uTimePlayed) | |
3281 { | |
3282 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false; | |
3283 pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = (signed __int64)((double)(0x12750000 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335); | |
3284 for (i = rand();; i = rand()) | |
3285 { | |
3286 rand_monster_id = i % 258 + 1; | |
3287 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand_monster_id; | |
3288 if ((unsigned __int16)rand_monster_id < 0x73u || (unsigned __int16)rand_monster_id > 0x84u) | |
3289 { | |
3290 if (((unsigned __int16)rand_monster_id < 0xEBu || (unsigned __int16)rand_monster_id > 0xFCu) | |
3291 && ((unsigned __int16)rand_monster_id < 0x85u || (unsigned __int16)rand_monster_id > 0x96u) | |
3292 && ((unsigned __int16)rand_monster_id < 0x97u || (unsigned __int16)rand_monster_id > 0xBAu) | |
3293 && ((unsigned __int16)rand_monster_id < 0xC4u || (unsigned __int16)rand_monster_id > 0xC6u)) | |
3294 break; | |
3295 } | |
3296 } | |
3297 } | |
3298 bountyHunting_monster_id_for_hunting = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]; | |
3299 if (!pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]) | |
3300 { | |
3301 bountyHunting_text = pNPCTopics[351].pText; | |
3302 if (!pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]) | |
3303 bountyHunting_text = pNPCTopics[353].pText; | |
3304 } | |
3305 else//get prize | |
3306 { | |
3307 if (pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]) | |
3308 { | |
3309 pParty->PartyFindsGold(100 * pMonsterStats->pInfos[(unsigned __int16)pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel, 0); | |
3310 for (uint i = 0; i < 4; ++i) | |
3311 pParty->pPlayers[i].SetVariable(VAR_Award, 86); | |
3312 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel; | |
3313 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = 0; | |
3314 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false; | |
3315 } | |
3316 bountyHunting_text = pNPCTopics[352].pText; | |
3317 } | |
3318 } | |
2464 | 3319 |
3320 //----- (004B254D) -------------------------------------------------------- | |
3321 const char * _4B254D_SkillMasteryTeacher(int trainerInfo) | |
3322 { | |
3323 int teacherLevel; // edx@1 | |
3324 int skillBeingTaught; // ecx@1 | |
3325 int pClassType; // eax@7 | |
3326 int currClassMaxMastery; // eax@7 | |
3327 int pointsInSkillWOutMastery; // ebx@7 | |
3328 int classBaseId; // eax@8 | |
3329 unsigned int skillMastery; // eax@29 | |
3330 unsigned __int16 pointsInSkill; // [sp+1Ch] [bp-10h]@7 | |
3331 int masteryLevelBeingTaught; // [sp+24h] [bp-8h]@7 | |
3332 | |
3333 contract_approved = 0; | |
3334 teacherLevel = (trainerInfo - 200) % 3; | |
3335 skillBeingTaught = (trainerInfo - 200) / 3; | |
3336 Player* activePlayer = pPlayers[uActiveCharacter]; | |
3337 pClassType = activePlayer->classType; | |
3338 currClassMaxMastery = byte_4ED970_skill_learn_ability_by_class_table[pClassType][skillBeingTaught]; | |
3339 masteryLevelBeingTaught = teacherLevel + 2; | |
3340 dword_F8B1B0_MasteryBeingTaught = masteryLevelBeingTaught; | |
3341 if (currClassMaxMastery < masteryLevelBeingTaught) | |
3342 { | |
3343 classBaseId = pClassType - pClassType % 4; | |
3344 if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 1][skillBeingTaught] >= masteryLevelBeingTaught) | |
3345 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 1]);//Вы должны достичь звания %s для обучения этому уровню навыка. You have to be promoted to %s to learn this skill level. | |
3346 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 2][skillBeingTaught] >= masteryLevelBeingTaught | |
3347 && byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 3][skillBeingTaught] >= masteryLevelBeingTaught) | |
3348 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[634], pClassNames[classBaseId + 2], pClassNames[classBaseId + 3]);//Вы должны достичь звания %s или %s для обучения этому уровню навыка. You have to be promoted to %s or %s to learn this skill level. | |
3349 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 2][skillBeingTaught] >= masteryLevelBeingTaught) | |
3350 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 2]);//Вы должны достичь звания %s для обучения этому уровню навыка. You have to be promoted to %s to learn this skill level. | |
3351 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 3][skillBeingTaught] >= masteryLevelBeingTaught) | |
3352 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 3]);//Вы должны достичь звания %s для обучения этому уровню навыка. You have to be promoted to %s to learn this skill level. | |
3353 else | |
3354 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Этот уровень навыка не может быть постигнут классом %s. This skill level can not be learned by the %s class. | |
3355 return pTmpBuf.data(); | |
3356 } | |
3357 if (!activePlayer->CanAct()) | |
3358 return pNPCTopics[122].pText; //Not in your condition! | |
3359 pointsInSkill = activePlayer->pActiveSkills[skillBeingTaught]; | |
3360 pointsInSkillWOutMastery = pointsInSkill & 0x3F; | |
3361 if (!pointsInSkillWOutMastery) | |
3362 return pNPCTopics[131].pText; //You must know the skill before you can become an expert in it! | |
3363 skillMastery = SkillToMastery(pointsInSkill); | |
3364 if ((signed int)skillMastery > teacherLevel + 1) | |
3365 return pNPCTopics[teacherLevel + 128].pText; // You are already an SKILLLEVEL in this skill. | |
3366 dword_F8B1AC_award_bit_number = skillBeingTaught; | |
3367 if (masteryLevelBeingTaught == 2 && pointsInSkillWOutMastery < 4 | |
3368 || masteryLevelBeingTaught == 3 && pointsInSkillWOutMastery < 7 | |
3369 || masteryLevelBeingTaught == 4 && pointsInSkillWOutMastery < 10 | |
3370 ) | |
3371 return pNPCTopics[127].pText; //"You don't meet the requirements, and cannot be taught until you do." | |
3372 switch (dword_F8B1AC_award_bit_number) | |
3373 { | |
3374 case PLAYER_SKILL_STAFF: | |
3375 case PLAYER_SKILL_SWORD: | |
3376 case PLAYER_SKILL_DAGGER: | |
3377 case PLAYER_SKILL_AXE: | |
3378 case PLAYER_SKILL_SPEAR: | |
3379 case PLAYER_SKILL_BOW: | |
3380 case PLAYER_SKILL_MACE: | |
3381 case PLAYER_SKILL_ARMSMASTER: | |
3382 switch (masteryLevelBeingTaught) | |
3383 { | |
3384 case 2: | |
3385 gold_transaction_amount = 2000; | |
3386 break; | |
3387 case 3: | |
3388 gold_transaction_amount = 5000; | |
3389 break; | |
3390 case 4: | |
3391 gold_transaction_amount = 8000; | |
3392 break; | |
3393 } | |
3394 break; | |
3395 case PLAYER_SKILL_BLASTER: | |
3396 switch (masteryLevelBeingTaught) | |
3397 { | |
3398 case 2: | |
3399 gold_transaction_amount = 0; | |
3400 break; | |
3401 case 3: | |
3402 gold_transaction_amount = 0; | |
3403 break; | |
3404 case 4: | |
3405 gold_transaction_amount = 0; | |
3406 break; | |
3407 } | |
3408 break; | |
3409 case PLAYER_SKILL_SHIELD: | |
3410 case PLAYER_SKILL_LEATHER: | |
3411 case PLAYER_SKILL_CHAIN: | |
3412 case PLAYER_SKILL_PLATE: | |
3413 switch (masteryLevelBeingTaught) | |
3414 { | |
3415 case 2: | |
3416 gold_transaction_amount = 1000; | |
3417 break; | |
3418 case 3: | |
3419 gold_transaction_amount = 3000; | |
3420 break; | |
3421 case 4: | |
3422 gold_transaction_amount = 7000; | |
3423 break; | |
3424 } | |
3425 break; | |
3426 case PLAYER_SKILL_FIRE: | |
3427 case PLAYER_SKILL_AIR: | |
3428 case PLAYER_SKILL_WATER: | |
3429 case PLAYER_SKILL_EARTH: | |
3430 case PLAYER_SKILL_SPIRIT: | |
3431 case PLAYER_SKILL_MIND: | |
3432 case PLAYER_SKILL_BODY: | |
3433 switch (masteryLevelBeingTaught) | |
3434 { | |
3435 case 2: | |
3436 gold_transaction_amount = 1000; | |
3437 break; | |
3438 case 3: | |
3439 gold_transaction_amount = 4000; | |
3440 break; | |
3441 case 4: | |
3442 gold_transaction_amount = 8000; | |
3443 break; | |
3444 } | |
3445 break; | |
3446 case PLAYER_SKILL_LIGHT: | |
3447 switch (masteryLevelBeingTaught) | |
3448 { | |
3449 case 2: | |
3450 gold_transaction_amount = 2000; | |
3451 break; | |
3452 case 3: | |
3453 if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 114)) | |
3454 return pNPCTopics[127].pText; | |
3455 gold_transaction_amount = 5000; | |
3456 break; | |
3457 case 4: | |
3458 if (!activePlayer->ProfessionOrGuildFlagsCorrect(0x22u, 1) || | |
3459 !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Au, 1)) | |
3460 return pNPCTopics[127].pText; | |
3461 gold_transaction_amount = 8000; | |
3462 break; | |
3463 } | |
3464 break; | |
3465 case PLAYER_SKILL_DARK: | |
3466 switch (masteryLevelBeingTaught) | |
3467 { | |
3468 case 2: | |
3469 gold_transaction_amount = 2000; | |
3470 break; | |
3471 case 3: | |
3472 if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 110)) | |
3473 return pNPCTopics[127].pText; | |
3474 gold_transaction_amount = 5000; | |
3475 break; | |
3476 case 4: | |
3477 if (!activePlayer->ProfessionOrGuildFlagsCorrect(0x23u, 1) | |
3478 || !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Bu, 1)) | |
3479 return pNPCTopics[127].pText; | |
3480 gold_transaction_amount = 8000; | |
3481 break; | |
3482 } | |
3483 break; | |
3484 case PLAYER_SKILL_ITEM_ID: | |
3485 case PLAYER_SKILL_REPAIR: | |
3486 case PLAYER_SKILL_MEDITATION: | |
3487 case PLAYER_SKILL_PERCEPTION: | |
3488 case PLAYER_SKILL_TRAP_DISARM: | |
3489 case PLAYER_SKILL_MONSTER_ID: | |
3490 case PLAYER_SKILL_STEALING: | |
3491 case PLAYER_SKILL_ALCHEMY: | |
3492 switch (masteryLevelBeingTaught) | |
3493 { | |
3494 case 2: | |
3495 gold_transaction_amount = 500; | |
3496 break; | |
3497 case 3: | |
3498 gold_transaction_amount = 2500; | |
3499 break; | |
3500 case 4: | |
3501 gold_transaction_amount = 6000; | |
3502 break; | |
3503 } | |
3504 break; | |
3505 case PLAYER_SKILL_MERCHANT: | |
3506 switch (masteryLevelBeingTaught) | |
3507 { | |
3508 case 2: | |
3509 gold_transaction_amount = 2000; | |
3510 break; | |
3511 case 3: | |
3512 if (activePlayer->GetBaseWillpower() < 50) | |
3513 return pNPCTopics[127].pText; | |
3514 gold_transaction_amount = 5000; | |
3515 break; | |
3516 case 4: | |
3517 gold_transaction_amount = 8000; | |
3518 break; | |
3519 } | |
3520 break; | |
3521 case PLAYER_SKILL_BODYBUILDING: | |
3522 switch (masteryLevelBeingTaught) | |
3523 { | |
3524 case 2: | |
3525 gold_transaction_amount = 500; | |
3526 break; | |
3527 case 3: | |
3528 if (activePlayer->GetBaseEndurance() < 50) | |
3529 return pNPCTopics[127].pText; | |
3530 gold_transaction_amount = 2500; | |
3531 break; | |
3532 case 4: | |
3533 gold_transaction_amount = 6000; | |
3534 break; | |
3535 } | |
3536 break; | |
3537 case PLAYER_SKILL_DIPLOMACY: | |
3538 Error("Diplomacy not used"); | |
3539 break; | |
3540 case PLAYER_SKILL_TIEVERY: | |
3541 Error("Thievery not used"); | |
3542 break; | |
3543 case PLAYER_SKILL_DODGE: | |
3544 switch (masteryLevelBeingTaught) | |
3545 { | |
3546 case 2: | |
3547 gold_transaction_amount = 2000; | |
3548 break; | |
3549 case 3: | |
3550 gold_transaction_amount = 5000; | |
3551 break; | |
3552 case 4: | |
3553 if ((activePlayer->pActiveSkills[PLAYER_SKILL_UNARMED] & 63) < 0xA) | |
3554 return pNPCTopics[127].pText; | |
3555 gold_transaction_amount = 8000; | |
3556 break; | |
3557 } | |
3558 break; | |
3559 case PLAYER_SKILL_UNARMED: | |
3560 switch (masteryLevelBeingTaught) | |
3561 { | |
3562 case 2: | |
3563 gold_transaction_amount = 2000; | |
3564 break; | |
3565 case 3: | |
3566 gold_transaction_amount = 5000; | |
3567 break; | |
3568 case 4: | |
3569 if ((activePlayer->pActiveSkills[PLAYER_SKILL_DODGE] & 63) < 0xA) | |
3570 return pNPCTopics[127].pText; | |
3571 gold_transaction_amount = 8000; | |
3572 break; | |
3573 } | |
3574 break; | |
3575 case PLAYER_SKILL_LEARNING: | |
3576 switch (masteryLevelBeingTaught) | |
3577 { | |
3578 case 2: | |
3579 gold_transaction_amount = 2000; | |
3580 break; | |
3581 case 3: | |
3582 if (activePlayer->GetBaseIntelligence() < 50) | |
3583 return pNPCTopics[127].pText; | |
3584 gold_transaction_amount = 5000; | |
3585 break; | |
3586 case 4: | |
3587 gold_transaction_amount = 8000; | |
3588 break; | |
3589 } | |
3590 break; | |
3591 default: | |
3592 Error("Unknown skill"); | |
3593 } | |
3594 if (gold_transaction_amount > pParty->uNumGold) | |
3595 return pNPCTopics[124].pText; //You don't have enough gold! | |
3596 contract_approved = 1; | |
3597 if (masteryLevelBeingTaught == 2) | |
3598 { | |
3599 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],//Получить степень ^Pr[%s] в навыке ^Pr[%s] за ^I[%lu] золот^L[ой;ых;ых] | |
3600 pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Эксперт | |
3601 } | |
3602 else if (masteryLevelBeingTaught == 3) | |
3603 { | |
3604 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], | |
3605 pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Мастер | |
3606 } | |
3607 else if (masteryLevelBeingTaught == 4) | |
3608 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], | |
3609 pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Великий Магистр | |
3610 return pTmpBuf2.data(); | |
3611 } | |
3612 | |
3613 //----- (00495461) -------------------------------------------------------- | |
3614 char *BuildDialogueString(const char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, __int64 *a6) | |
3615 { | |
3616 Player *pPlayer; // ebx@3 | |
3617 const char *pText; // esi@7 | |
3618 int v17; // eax@10 | |
3619 signed __int64 v18; // qax@18 | |
3620 unsigned __int8 *v20; // ebx@32 | |
3621 int v21; // ecx@34 | |
3622 int pReputation; // eax@45 | |
3623 int v29; // eax@68 | |
3624 __int16 v55[56]; // [sp+10h] [bp-128h]@34 | |
3625 stru351_summoned_item v56; // [sp+80h] [bp-B8h]@107 | |
3626 char a1[100]; // [sp+B8h] [bp-80h]@3 | |
3627 int v63; // [sp+12Ch] [bp-Ch]@32 | |
3628 | |
3629 if (IsBadStringPtrA(lpsz, 1)) | |
3630 return "Invalid String Passed"; | |
3631 | |
3632 a1[0] = 0; | |
3633 pPlayer = &pParty->pPlayers[uPlayerID]; | |
3634 memset(pTmpBuf2.data(), 0, sizeof(pTmpBuf2)); | |
3635 | |
3636 NPCData *npc = nullptr; | |
3637 if (dword_5C35D4) | |
3638 npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0))]; //- 1 | |
3639 else | |
3640 npc = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
3641 | |
3642 //pText = a4; | |
3643 uint len = strlen(lpsz); | |
3644 for (int i = 0, dst = 0; i < len; ++i) | |
3645 { | |
3646 char c = lpsz[i]; | |
3647 if (c != '%') | |
3648 pTmpBuf2[dst++] = c; | |
3649 else | |
3650 { | |
3651 v17 = 10 * (int)(lpsz[i + 1] - '0') + lpsz[i + 2] - '0'; | |
3652 | |
3653 switch (v17) | |
3654 { | |
3655 case 1://Подробнее | |
3656 strcat(pTmpBuf2.data(), npc->pName); | |
3657 dst = strlen(pTmpBuf2.data()); | |
3658 i += 2; | |
3659 break; | |
3660 case 2: | |
3661 strcat(pTmpBuf2.data(), pPlayer->pName); | |
3662 dst = strlen(pTmpBuf2.data()); | |
3663 i += 2; | |
3664 break; | |
3665 case 3: | |
3666 case 4: | |
3667 strcat(pTmpBuf2.data(), a1); | |
3668 dst = strlen(pTmpBuf2.data()); | |
3669 i += 2; | |
3670 break; | |
3671 case 5: | |
3672 v18 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24; | |
3673 pText = pGlobalTXT_LocalizationStrings[397];// "evening" | |
3674 if (SHIDWORD(v18) <= 0 && SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 5 && SHIDWORD(v18) <= 0) | |
3675 { | |
3676 if (SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 11) | |
3677 { | |
3678 if (v18 < 20) | |
3679 pText = pGlobalTXT_LocalizationStrings[396];// "day" | |
3680 } | |
3681 else | |
3682 { | |
3683 pText = pGlobalTXT_LocalizationStrings[395];// "morning" | |
3684 } | |
3685 } | |
3686 strcat(pTmpBuf2.data(), pText); | |
3687 dst = strlen(pTmpBuf2.data()); | |
3688 i += 2; | |
3689 break; | |
3690 case 6: | |
3691 if (pPlayer->uSex) | |
3692 pText = pGlobalTXT_LocalizationStrings[387];// "lady" | |
3693 else | |
3694 pText = pGlobalTXT_LocalizationStrings[385];// "sir" | |
3695 strcat(pTmpBuf2.data(), pText); | |
3696 dst = strlen(pTmpBuf2.data()); | |
3697 i += 2; | |
3698 break; | |
3699 case 7: | |
3700 if (pPlayer->uSex) | |
3701 pText = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
3702 else | |
3703 pText = pGlobalTXT_LocalizationStrings[386];// "Sir" | |
3704 strcat(pTmpBuf2.data(), pText); | |
3705 dst = strlen(pTmpBuf2.data()); | |
3706 i += 2; | |
3707 break; | |
3708 case 8: | |
3709 v63 = 0; | |
3710 v20 = (unsigned __int8 *)pPlayer->_achieved_awards_bits; | |
3711 for (uint _i = 0; _i < 28; ++_i) | |
3712 { | |
3713 if ((unsigned __int16)_449B57_test_bit(v20, word_4EE150[i])) | |
3714 { | |
3715 v21 = v63; | |
3716 ++v63; | |
3717 v55[v63] = word_4EE150[i]; | |
3718 } | |
3719 } | |
3720 if (v63) | |
3721 { | |
3722 if (dword_A74CDC == -1) | |
3723 dword_A74CDC = rand() % v63; | |
3724 pText = (char *)pAwards[v55[dword_A74CDC]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; | |
3725 } | |
3726 else | |
3727 pText = (char *)pNPCTopics[55].pText; | |
3728 strcat(pTmpBuf2.data(), pText); | |
3729 dst = strlen(pTmpBuf2.data()); | |
3730 i += 2; | |
3731 break; | |
3732 case 9: | |
3733 if (npc->uSex) | |
3734 pText = pGlobalTXT_LocalizationStrings[384];// "her" | |
3735 else | |
3736 pText = pGlobalTXT_LocalizationStrings[383];// "his" | |
3737 strcat(pTmpBuf2.data(), pText); | |
3738 dst = strlen(pTmpBuf2.data()); | |
3739 i += 2; | |
3740 break; | |
3741 case 10: | |
3742 if (pPlayer->uSex) | |
3743 pText = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
3744 else | |
3745 pText = pGlobalTXT_LocalizationStrings[388];// "Lord" | |
3746 strcat(pTmpBuf2.data(), pText); | |
3747 dst = strlen(pTmpBuf2.data()); | |
3748 i += 2; | |
3749 break; | |
3750 case 11: | |
3751 pReputation = pParty->GetPartyReputation(); | |
3752 if (pReputation >= 25) | |
3753 pText = pGlobalTXT_LocalizationStrings[379]; | |
3754 else//v25 < 25 | |
3755 { | |
3756 if (pReputation < 6) | |
3757 { | |
3758 if (pReputation >= -5)//6 >= v25 >= -5 | |
3759 pText = pGlobalTXT_LocalizationStrings[399]; | |
3760 else// v25 < -5 | |
3761 { | |
3762 if (pReputation < -24)//-24 > v25 | |
3763 pText = pGlobalTXT_LocalizationStrings[434]; | |
3764 else// -5 > v25 > -24 | |
3765 pText = pGlobalTXT_LocalizationStrings[402]; | |
3766 } | |
3767 } | |
3768 else//25 > v25 > 6 | |
3769 pText = pGlobalTXT_LocalizationStrings[392]; | |
3770 } | |
3771 strcat(pTmpBuf2.data(), pText); | |
3772 dst = strlen(pTmpBuf2.data()); | |
3773 i += 2; | |
3774 break; | |
3775 case 12: | |
3776 pReputation = npc->rep; | |
3777 if (pReputation >= 25) | |
3778 pText = pGlobalTXT_LocalizationStrings[379];//Ненавистный | |
3779 else | |
3780 { | |
3781 if (pReputation < 6) | |
3782 { | |
3783 if (pReputation >= -5) | |
3784 pText = pGlobalTXT_LocalizationStrings[399];//Нейтральная | |
3785 else | |
3786 { | |
3787 if (pReputation < -24) | |
3788 pText = pGlobalTXT_LocalizationStrings[434];//Почтенная | |
3789 else | |
3790 pText = pGlobalTXT_LocalizationStrings[402];//Дружелюбный | |
3791 } | |
3792 } | |
3793 else | |
3794 pText = pGlobalTXT_LocalizationStrings[392];//Недружелюбный | |
3795 } | |
3796 strcat(pTmpBuf2.data(), pText); | |
3797 dst = strlen(pTmpBuf2.data()); | |
3798 i += 2; | |
3799 break; | |
3800 case 13: | |
3801 strcat(pTmpBuf2.data(), pNPCStats->sub_495366_MispronounceName(pPlayer->pName[0], pPlayer->uSex)); | |
3802 dst = strlen(pTmpBuf2.data()); | |
3803 i += 2; | |
3804 break; | |
3805 case 14: | |
3806 if (npc->uSex) | |
3807 pText = pGlobalTXT_LocalizationStrings[391];// "sister" | |
3808 else | |
3809 pText = pGlobalTXT_LocalizationStrings[390];// "brother" | |
3810 strcat(pTmpBuf2.data(), pText); | |
3811 dst = strlen(pTmpBuf2.data()); | |
3812 i += 2; | |
3813 break; | |
3814 case 15: | |
3815 strcat(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[393]);// "daughter" | |
3816 dst = strlen(pTmpBuf2.data()); | |
3817 i += 2; | |
3818 break; | |
3819 case 16: | |
3820 if (npc->uSex) | |
3821 pText = pGlobalTXT_LocalizationStrings[391];// "sister" | |
3822 else | |
3823 pText = pGlobalTXT_LocalizationStrings[390];// "brother" | |
3824 strcat(pTmpBuf2.data(), pText); | |
3825 dst = strlen(pTmpBuf2.data()); | |
3826 i += 2; | |
3827 break; | |
3828 case 17://текст наёмного НПС | |
3829 { | |
3830 uint pay_percentage = pNPCStats->pProfessions[npc->uProfession].uHirePrice / 100; | |
3831 if (!pay_percentage) | |
3832 pay_percentage = 1; | |
3833 sprintf(a1, "%lu", pay_percentage); | |
3834 strcat(pTmpBuf2.data(), a1); | |
3835 dst = strlen(pTmpBuf2.data()); | |
3836 i += 2; | |
3837 break; | |
3838 } | |
3839 case 18: | |
3840 case 19: | |
3841 case 20: | |
3842 case 21: | |
3843 case 22: | |
3844 case 26: | |
3845 strncpy(a1, lpsz + i + 1, 2); | |
3846 sprintf(a1, "%lu", atoi(a1)); | |
3847 strcat(pTmpBuf2.data(), a1); | |
3848 dst = strlen(pTmpBuf2.data()); | |
3849 i += 2; | |
3850 break; | |
3851 case 23: | |
3852 if (pMapStats->GetMapInfo(pCurrentMapName)) | |
3853 pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName; | |
3854 else | |
3855 pText = pGlobalTXT_LocalizationStrings[394];// "Unknown" | |
3856 strcat(pTmpBuf2.data(), pText); | |
3857 dst = strlen(pTmpBuf2.data()); | |
3858 i += 2; | |
3859 break; | |
3860 case 24://название товара в продаже | |
3861 sprintfex(a1, format_4E2D80, Color16(255, 255, 155), a3->GetDisplayName()); | |
3862 strcat(pTmpBuf2.data(), a1); | |
3863 dst = strlen(pTmpBuf2.data()); | |
3864 i += 2; | |
3865 break; | |
3866 case 25: | |
3867 v29 = pPlayer->GetBaseBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3868 switch (a5) | |
3869 { | |
3870 case 3: | |
3871 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3872 break; | |
3873 case 4: | |
3874 v29 = pPlayer->GetBaseIdentifyPrice(p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3875 break; | |
3876 case 5: | |
3877 v29 = pPlayer->GetBaseRepairPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3878 break; | |
3879 case 6: | |
3880 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2; | |
3881 break; | |
3882 } | |
3883 sprintfex(a1, "%lu", v29); | |
3884 strcat(pTmpBuf2.data(), a1); | |
3885 dst = strlen(pTmpBuf2.data()); | |
3886 i += 2; | |
3887 break; | |
3888 case 27://текст продажи | |
3889 v29 = pPlayer->GetBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3890 if (a5 == 3) | |
3891 { | |
3892 v29 = pPlayer->GetPriceSell(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3893 if (a3->IsBroken()) | |
3894 v29 = 1; | |
3895 sprintfex(a1, "%lu", v29); | |
3896 strcat(pTmpBuf2.data(), a1); | |
3897 dst = strlen(pTmpBuf2.data()); | |
3898 i += 2; | |
3899 break; | |
3900 } | |
3901 if (a5 != 4) | |
3902 { | |
3903 if (a5 == 5) | |
3904 v29 = pPlayer->GetPriceRepair(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3905 else | |
3906 { | |
3907 if (a5 == 6) | |
3908 { | |
3909 v29 = pPlayer->GetPriceSell(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2; | |
3910 if (a3->IsBroken()) | |
3911 v29 = 1; | |
3912 if (!v29) | |
3913 v29 = 1; | |
3914 sprintfex(a1, "%lu", v29); | |
3915 strcat(pTmpBuf2.data(), a1); | |
3916 dst = strlen(pTmpBuf2.data()); | |
3917 i += 2; | |
3918 break; | |
3919 } | |
3920 } | |
3921 sprintfex(a1, "%lu", v29); | |
3922 strcat(pTmpBuf2.data(), a1); | |
3923 dst = strlen(pTmpBuf2.data()); | |
3924 i += 2; | |
3925 break; | |
3926 } | |
3927 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier)); | |
3928 strcat(pTmpBuf2.data(), a1); | |
3929 dst = strlen(pTmpBuf2.data()); | |
3930 i += 2; | |
3931 break; | |
3932 case 28://профессия | |
3933 strcat(pTmpBuf2.data(), (char *)p2DEvents[(signed int)a4 - 1].pProprieterTitle); | |
3934 dst = strlen(pTmpBuf2.data()); | |
3935 i += 2; | |
3936 break; | |
3937 case 29: | |
3938 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier)); | |
3939 strcat(pTmpBuf2.data(), a1); | |
3940 dst = strlen(pTmpBuf2.data()); | |
3941 i += 2; | |
3942 break; | |
3943 case 30: | |
3944 if (!a6) | |
3945 { | |
3946 strcat(pTmpBuf2.data(), a4); | |
3947 dst = strlen(pTmpBuf2.data()); | |
3948 i += 2; | |
3949 break; | |
3950 } | |
3951 init_summoned_item(&v56, *a6); | |
3952 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); | |
3953 strcat(pTmpBuf2.data(), a1); | |
3954 dst = strlen(pTmpBuf2.data()); | |
3955 i += 2; | |
3956 break; | |
3957 case 31: | |
3958 case 32: | |
3959 case 33: | |
3960 case 34: | |
3961 strcat(pTmpBuf2.data(), pParty->pPlayers[v17 - 31].pName); | |
3962 dst = strlen(pTmpBuf2.data()); | |
3963 i += 2; | |
3964 break; | |
3965 default: | |
3966 if (v17 <= 50 || v17 > 70) | |
3967 { | |
3968 strncpy(a1, lpsz + i + 1, 2); | |
3969 sprintf(a1, "%lu", atoi(a1)); | |
3970 strcat(pTmpBuf2.data(), a1); | |
3971 dst = strlen(pTmpBuf2.data()); | |
3972 i += 2; | |
3973 break; | |
3974 } | |
3975 if (v17 - 51 >= 20) | |
3976 { | |
3977 strcat(pTmpBuf2.data(), a4); | |
3978 dst = strlen(pTmpBuf2.data()); | |
3979 i += 2; | |
3980 break; | |
3981 } | |
3982 init_summoned_item(&v56, pParty->PartyTimes._s_times[v17 - 51]); | |
3983 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); | |
3984 strcat(pTmpBuf2.data(), a1); | |
3985 dst = strlen(pTmpBuf2.data()); | |
3986 i += 2; | |
3987 break; | |
3988 } | |
3989 } | |
3990 } | |
3991 return pTmpBuf2.data(); | |
3992 } | |
3993 | |
3994 //----- (0044C175) -------------------------------------------------------- | |
3995 void ShowStatusBarString(const char *pString, unsigned int uNumSeconds) | |
3996 { | |
3997 strcpy(GameUI_Footer_TimedString.data(), pString); | |
3998 GameUI_Footer_TimeLeft = 1000 * uNumSeconds + GetTickCount(); | |
3999 | |
4000 for (int i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); i > 450; | |
4001 i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data())) | |
4002 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; | |
4003 } | |
4004 | |
4005 //----- (0044C1D0) -------------------------------------------------------- | |
4006 void ShowNothingHereStatus() | |
4007 { | |
4008 if (!GameUI_Footer_TimeLeft) | |
4009 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2);// Nothing here | |
4010 } | |
4011 | |
4012 //----- (0044C28B) -------------------------------------------------------- | |
4013 int const_2() | |
4014 { | |
4015 return 2; | |
4016 } |