706
|
1 #include <assert.h>
|
|
2
|
|
3 #include "MM7.h"
|
|
4
|
|
5 #include "MapInfo.h"
|
|
6 #include "Game.h"
|
|
7 #include "GUIWindow.h"
|
|
8 #include "GUIFont.h"
|
|
9 #include "GUIProgressBar.h"
|
|
10 #include "Party.h"
|
|
11 #include "AudioPlayer.h"
|
|
12 #include "Outdoor.h"
|
|
13 #include "IndoorCamera.h"
|
|
14 #include "Overlays.h"
|
|
15 #include "Monsters.h"
|
|
16 #include "Arcomage.h"
|
|
17 #include "LOD.h"
|
|
18 #include "Actor.h"
|
|
19 #include "Allocator.h"
|
|
20 #include "Events.h"
|
|
21 #include "Viewport.h"
|
|
22 #include "FrameTableInc.h"
|
|
23 #include "Math.h"
|
|
24 #include "SpriteObject.h"
|
|
25 #include "ObjectList.h"
|
|
26 #include "Chest.h"
|
|
27 #include "PaletteManager.h"
|
|
28 #include "DecorationList.h"
|
|
29 #include "SaveLoad.h"
|
|
30 #include "stru123.h"
|
|
31 #include "Time.h"
|
|
32 #include "IconFrameTable.h"
|
|
33 #include "Awards.h"
|
|
34 #include "Autonotes.h"
|
|
35 #include "stru160.h"
|
|
36 #include "stru279.h"
|
|
37 #include "TurnEngine.h"
|
924
|
38 #include "CastSpellInfo.h"
|
706
|
39 #include "Weather.h"
|
|
40 #include "stru272.h"
|
|
41 #include "stru298.h"
|
|
42 #include "StorylineTextTable.h"
|
|
43 #include "Events2D.h"
|
|
44 #include "texts.h"
|
|
45 #include "stru351.h"
|
|
46
|
|
47 #include "mm7_data.h"
|
|
48
|
|
49
|
|
50
|
|
51 //----- (004908DE) --------------------------------------------------------
|
|
52 signed int __cdecl PlayerCreation_Chose4Skills()
|
|
53 {
|
|
54 Player *v0; // esi@1
|
|
55 signed int v1; // edx@2
|
|
56 unsigned short *v2; // eax@2
|
|
57 signed int v3; // ecx@2
|
|
58
|
|
59 v0 = pParty->pPlayers;//[0].pActiveSkills;
|
|
60 while ( 1 )
|
|
61 {
|
|
62 v1 = 0;
|
|
63 v2 = v0->pActiveSkills;
|
|
64 v3 = 37;
|
|
65 do
|
|
66 {
|
|
67 if ( *v2 )
|
|
68 ++v1;
|
|
69 ++v2;
|
|
70 --v3;
|
|
71 }
|
|
72 while ( v3 );
|
|
73 if ( v1 < 4 )
|
|
74 break;
|
|
75 ++v0;
|
|
76 if ( v0 > &pParty->pPlayers[3] )
|
|
77 return 1;
|
|
78 }
|
|
79 return 0;
|
|
80 }
|
|
81
|
|
82
|
|
83
|
|
84
|
|
85 //----- (00491CB5) --------------------------------------------------------
|
|
86 void __cdecl LoadPlayerPortraintsAndVoices()
|
|
87 {
|
|
88 //Texture **v0; // ebx@1
|
|
89 //int v1; // eax@2
|
|
90 //int v2; // edi@3
|
|
91 char *v3; // esi@5
|
|
92 char *v4; // [sp+10h] [bp-4h]@1
|
|
93
|
|
94 pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles;
|
|
95
|
|
96 for (uint i = 0; i < 4; ++i)
|
|
97 for (uint j = 0; j < 56; ++j)
|
|
98 {
|
|
99 sprintf(pTmpBuf, "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uFace], j + 1);
|
|
100 pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE);
|
|
101 }
|
|
102
|
|
103 pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE);
|
|
104 pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE);
|
|
105 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE);
|
|
106
|
|
107 if (SoundSetAction[24][0])
|
|
108 for (uint i = 0; i < 4; ++i)
|
|
109 {
|
|
110 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0);
|
|
111 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0);
|
|
112 }
|
|
113 }
|
|
114
|
|
115 //----- (00491DE7) --------------------------------------------------------
|
|
116 int __fastcall ReloadPlayerPortraits(int a1, int a2)
|
|
117 {
|
|
118 int result; // eax@1
|
|
119 const char **v3; // ebp@1
|
|
120 Texture **v4; // ebx@1
|
|
121 int v5; // esi@2
|
|
122
|
|
123 result = 0;
|
|
124 v3 = &pPlayerPortraitsNames[a2];
|
|
125 v4 = pTextures_PlayerFaces[a1];
|
|
126 do
|
|
127 {
|
|
128 v5 = result + 1;
|
|
129 sprintf(pTmpBuf, "%s%02d", *v3, result + 1);
|
|
130 pIcons_LOD->ReloadTexture(*v4, pTmpBuf, 2);
|
|
131 result = v5;
|
|
132 ++v4;
|
|
133 }
|
|
134 while ( v5 < 56 );
|
|
135 return result;
|
|
136 }
|
|
137 //----- (00495B39) --------------------------------------------------------
|
|
138 void __cdecl PlayerCreationUI_Draw()
|
|
139 {
|
|
140 const char *uTitleText; // ST10_4@3
|
|
141 int pTextCenter; // eax@3
|
|
142 IconFrame *v3; // eax@3
|
|
143 int v4; // ecx@7
|
|
144 GUIButton *uPosActiveItem; // edi@12
|
|
145 int v6; // esi@14
|
|
146 int uNumLet; // eax@14
|
|
147 char v8; // al@17
|
|
148 int v9; // ecx@17
|
|
149 char v10; // sf@17
|
|
150 int v11; // ecx@19
|
|
151 void *v12; // eax@20
|
|
152 int v13; // ecx@21
|
|
153 int v14; // ecx@22
|
|
154 char *v15; // ST14_4@24
|
|
155 size_t v16; // eax@28
|
|
156 int v17; // eax@33
|
|
157 //enum CHARACTER_RACE uNumRace; // eax@35
|
|
158 int v19; // eax@36
|
|
159 int v20; // eax@37
|
|
160 int uNumMight; // eax@44
|
|
161 unsigned int v24; // eax@44
|
|
162 int v25; // eax@44
|
|
163 unsigned int v26; // eax@44
|
|
164 int v27; // eax@44
|
|
165 unsigned int v28; // eax@44
|
|
166 int v29; // eax@44
|
|
167 unsigned int v30; // eax@44
|
|
168 int v31; // eax@44
|
|
169 unsigned int v32; // eax@44
|
|
170 int v33; // eax@44
|
|
171 unsigned int v34; // eax@44
|
|
172 int v35; // eax@44
|
|
173 unsigned int v36; // eax@44
|
821
|
174 PLAYER_SKILL_TYPE v37; // eax@44
|
|
175 PLAYER_SKILL_TYPE v39; // eax@44
|
|
176 PLAYER_SKILL_TYPE v41; // eax@44
|
706
|
177 const char *v42; // edx@44
|
|
178 char *v43; // ST1C_4@44
|
|
179 int v45; // eax@44
|
821
|
180 PLAYER_SKILL_TYPE v46; // eax@46
|
706
|
181 const char *v47; // edx@46
|
|
182 char *v48; // ST1C_4@46
|
|
183 int v50; // eax@46
|
|
184 int v51; // eax@49
|
|
185 char *v52; // edi@52
|
|
186 char v53; // al@52
|
|
187 PLAYER_CLASS_TYPE uClassType; // edi@53
|
|
188 int v55; // ST0C_4@53
|
|
189 int v57; // eax@53
|
|
190 int v61; // ecx@55
|
|
191 int v64; // ST08_4@57
|
|
192 int v66; // ecx@57
|
|
193 int v71; // eax@59
|
|
194 int v75; // eax@61
|
|
195 int v80; // eax@63
|
|
196 int v85; // eax@65
|
|
197 int v89; // eax@67
|
|
198 int v94; // eax@69
|
821
|
199 PLAYER_SKILL_TYPE pSkillId; // edi@72
|
706
|
200 size_t pLenText; // eax@72
|
|
201 signed int v104; // ecx@72
|
|
202 int pColorText; // ecx@79
|
|
203 unsigned int v107; // ST0C_4@81
|
|
204 int pTextY; // ST08_4@81
|
|
205 int v111; // ST0C_4@82
|
|
206 signed int v113; // edi@82
|
|
207 int v114; // ST0C_4@82
|
|
208 const char *uRaceName; // [sp+0h] [bp-170h]@39
|
|
209 char pText[200]; // [sp+10h] [bp-160h]@14
|
|
210 GUIWindow pWindow; // [sp+D8h] [bp-98h]@83
|
|
211 int v119; // [sp+12Ch] [bp-44h]@18
|
|
212 size_t v120; // [sp+130h] [bp-40h]@25
|
|
213 int uY; // [sp+134h] [bp-3Ch]@18
|
|
214 int v122; // [sp+138h] [bp-38h]@18
|
|
215 int v123; // [sp+13Ch] [bp-34h]@11
|
|
216 void *v124; // [sp+140h] [bp-30h]@18
|
|
217 int uColor1; // [sp+144h] [bp-2Ch]@1
|
|
218 int v126; // [sp+148h] [bp-28h]@25
|
|
219 int uColorGreen; // [sp+14Ch] [bp-24h]@1
|
|
220 int v128; // [sp+150h] [bp-20h]@14
|
|
221 int v129; // [sp+154h] [bp-1Ch]@18
|
|
222 int uColorTeal; // [sp+158h] [bp-18h]@1
|
|
223 int uColorWhite; // [sp+15Ch] [bp-14h]@1
|
|
224 int uX; // [sp+160h] [bp-10h]@18
|
|
225 unsigned int v133; // [sp+164h] [bp-Ch]@25
|
|
226 int pOrder; // [sp+168h] [bp-8h]@14
|
|
227 //char *Str; // [sp+16Ch] [bp-4h]@18
|
|
228 //Player *pPlayer;
|
|
229 const char *pSkillName;
|
|
230
|
|
231 uColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xD1, 0xBB, 0x61);
|
|
232 uColorTeal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xF7, 0xF7);
|
|
233 uColorGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFF, 0);
|
|
234 uColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF);
|
|
235 pRenderer->BeginScene();
|
|
236 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
|
|
237 uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20;
|
|
238 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY);
|
|
239 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - 640, 2, pTexture_MAKESKY);
|
|
240 //if (uPlayerCreationUI_SkySliderPos > 640)
|
|
241 //uPlayerCreationUI_SkySliderPos = 0;
|
|
242 pRenderer->DrawTextureTransparent(0, 0, pTexture_MAKETOP);
|
|
243 uTitleText = pGlobalTXT_LocalizationStrings[51];
|
|
244 uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7;
|
|
245 pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]);
|
|
246 pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, uTitleText, 0, 0, 0);
|
|
247 pRenderer->DrawTextureTransparent(17, 35, pPlayerPortraits[pParty->pPlayers[0].uFace]);
|
|
248 pRenderer->DrawTextureTransparent(176, 35, pPlayerPortraits[pParty->pPlayers[1].uFace]);
|
|
249 pRenderer->DrawTextureTransparent(335, 35, pPlayerPortraits[pParty->pPlayers[2].uFace]);
|
|
250 pRenderer->DrawTextureTransparent(494, 35, pPlayerPortraits[pParty->pPlayers[3].uFace]);
|
|
251 v3 = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime);
|
|
252 if ( uPlayerCreationUI_SelectedCharacter )
|
|
253 {
|
|
254 switch ( uPlayerCreationUI_SelectedCharacter )
|
|
255 {
|
|
256 case 1:
|
|
257 v4 = 171;
|
|
258 break;
|
|
259 case 2:
|
|
260 v4 = 329;
|
|
261 break;
|
|
262 case 3:
|
|
263 v4 = 488;
|
|
264 break;
|
|
265 default:
|
|
266 v4 = v123;
|
|
267 break;
|
|
268 }
|
|
269 }
|
|
270 else
|
|
271 {
|
|
272 v4 = 12;
|
|
273 }
|
|
274
|
|
275 pRenderer->DrawTextureTransparent(v4, 29, &pIcons_LOD->pTextures[v3->uTextureID]);
|
|
276 uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->pCurrentPosActiveItem);
|
|
277 uPlayerCreationUI_ArrowAnim = 19 - (GetTickCount() % 500) / 25;
|
|
278 pRenderer->DrawTextureTransparent(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim]);
|
|
279 pRenderer->DrawTextureTransparent(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim]);
|
|
280 //if (uPlayerCreationUI_ArrowAnim < 0)
|
|
281 // uPlayerCreationUI_ArrowAnim = 18;
|
|
282 v6 = pFontCreate->uFontHeight - 2;
|
|
283 v128 = pFontCreate->uFontHeight - 2;
|
|
284 memset(pText, 0, 200);
|
|
285 strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills"
|
|
286 uNumLet = strlen(pText) - 1;
|
|
287 pOrder = uNumLet;
|
|
288 if ( uNumLet >= 0 )
|
|
289 {
|
|
290 while ( 1 )
|
|
291 {
|
|
292 v8 = toupper((unsigned __int8)pText[uNumLet]);
|
|
293 v9 = pOrder;
|
|
294 v10 = pOrder-- - 1 < 0;
|
|
295 pText[v9] = v8;
|
|
296 if ( v10 )
|
|
297 break;
|
|
298 uNumLet = pOrder;
|
|
299 }
|
|
300 }
|
|
301 pOrder = 18;
|
|
302 v124 = 0;
|
|
303 uX = 32;
|
|
304 uY = 3 * v6 + 169;
|
|
305 v122 = 5 * v6 + 169;
|
|
306 v123 = 3 * v6 + 311;
|
|
307 v129 = 493;
|
|
308 //pPlayer = pParty->pPlayers;
|
|
309 v119 = 6 * v6 + 169;
|
|
310 //do
|
|
311
|
|
312 //for ( pPlayer = pParty->pPlayers; (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges; pPlayer++)
|
|
313 for (int i = 0; i < 4; ++i)
|
|
314 {
|
|
315 auto player = pParty->pPlayers + i;
|
|
316
|
|
317 //Str = pPlayer->pName;
|
|
318 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pOrder + 73, 100, 0, pClassNames[player->classType], 0, 0, 0);
|
|
319 pRenderer->DrawTextureTransparent(pOrder + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]);
|
|
320 v11 = pGUIWindow_CurrentMenu->field_40;
|
|
321 if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) )
|
|
322 {
|
|
323 v13 = v11 - 1;
|
|
324 if ( v13 )
|
|
325 {
|
|
326 v14 = v13 - 1;
|
|
327 if ( v14 )
|
|
328 {
|
|
329 if ( v14 == 1 )
|
|
330 {
|
|
331 pGUIWindow_CurrentMenu->field_40 = 0;
|
|
332 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0);
|
|
333 SetCurrentMenuID(MENU_NAMEPANELESC);
|
|
334 }
|
|
335 }
|
|
336 else
|
|
337 {
|
|
338 pGUIWindow_CurrentMenu->field_40 = 0;
|
|
339 v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
340 v126 = 0;
|
|
341 v133 = 0;
|
|
342 if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) )//edit name
|
|
343 {
|
|
344 do
|
|
345 {
|
|
346 if ( pKeyActionMap->pPressedKeysBuffer[v133] == ' ' )
|
|
347 ++v126;
|
|
348 ++v133;
|
|
349 v16 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
350 }
|
|
351 while ( v133 < v16 );
|
|
352 }
|
|
353 if ( v120 && v126 != v120 )
|
|
354 strcpy(player->pName, (const char *)pKeyActionMap->pPressedKeysBuffer);
|
|
355 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0);
|
|
356 *(short *)&player->field_1988[27] = 1; //
|
|
357 }
|
|
358 }
|
|
359 else
|
|
360 {
|
|
361 v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)v12 + 18, 0x7Cu, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1);
|
|
362 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate);
|
|
363 }
|
|
364 }
|
|
365 else
|
|
366 {
|
|
367 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0);
|
|
368 }
|
|
369 switch (player->GetRace())
|
|
370 {
|
|
371 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"
|
|
372 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf"
|
|
373 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
|
|
374 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
|
|
375 };
|
|
376 strcpy(pTmpBuf, uRaceName);
|
|
377 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder + 72, v128 + 12, 0, pTmpBuf, 130, 0);
|
|
378 pTextCenter = pFontCreate->AlignText_Center(0x96, pText);
|
|
379 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0);
|
|
380 uNumMight = player->GetActualMight();
|
|
381 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might"
|
|
382 LOWORD(v24) = player->GetStatColor(0);
|
|
383 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0);
|
|
384 v25 = player->GetActualIntelligence();
|
|
385 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect"
|
|
386 LOWORD(v26) = player->GetStatColor(1);
|
|
387 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0);
|
|
388 v27 = player->GetActualWillpower();
|
|
389 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality"
|
|
390 LOWORD(v28) = player->GetStatColor(2);
|
|
391 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0);
|
|
392 v29 = player->GetActualEndurance();
|
|
393 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance"
|
|
394 LOWORD(v30) = player->GetStatColor(3);
|
|
395 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0);
|
|
396 v31 = player->GetActualAccuracy();
|
|
397 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy"
|
|
398 LOWORD(v32) = player->GetStatColor(4);
|
|
399 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0);
|
|
400 v33 = player->GetActualSpeed();
|
|
401 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed"
|
|
402 LOWORD(v34) = player->GetStatColor(5);
|
|
403 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0);
|
|
404 v35 = player->GetActualLuck();
|
|
405 sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck"
|
|
406 LOWORD(v36) = player->GetStatColor(6);
|
|
407 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0);
|
|
408 v37 = player->GetSkillIdxByOrder(0);
|
|
409 pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]);
|
|
410 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v37]);
|
|
411 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0);
|
|
412 v39 = player->GetSkillIdxByOrder(1);
|
|
413 pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v39]);
|
|
414 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v39]);
|
|
415 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0);
|
|
416 v41 = player->GetSkillIdxByOrder(2);
|
|
417 pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v41]);
|
|
418 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v41]);
|
|
419 v45 = uColorGreen;
|
|
420 if ( (signed int)v41 >= 37 )
|
|
421 v45 = uColorTeal;
|
|
422 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0);
|
|
423 v46 = player->GetSkillIdxByOrder(3);
|
|
424 pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v46]);
|
|
425 sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v46]);
|
|
426 v50 = uColorGreen;
|
|
427 if ( (signed int)v46 >= 37 )
|
|
428 v50 = uColorTeal;
|
|
429 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v123, v50, pTmpBuf, 0, 0, 0);
|
|
430 //pPlayer++;
|
|
431 v124 = (char *)v124 + 1;
|
|
432 pOrder += 159;
|
|
433 v129 -= 158;
|
|
434 uX += 158;
|
|
435 }
|
|
436
|
|
437 //while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges );
|
|
438 strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class"
|
|
439 v51 = strlen(pText) - 1;
|
|
440 pOrder = v51;
|
|
441 if ( v51 >= 0 )
|
|
442 {
|
|
443 while ( 1 )
|
|
444 {
|
|
445 v52 = &pText[v51];
|
|
446 v53 = toupper((unsigned __int8)pText[v51]);
|
|
447 v10 = pOrder-- - 1 < 0;
|
|
448 *v52 = v53;
|
|
449 if ( v10 )
|
|
450 break;
|
|
451 v51 = pOrder;
|
|
452 }
|
|
453 }
|
|
454 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType;
|
|
455 pTextCenter = pFontCreate->AlignText_Center(193u, pText);
|
|
456 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0);
|
|
457 v57 = uColorTeal;
|
|
458 if ( uClassType )
|
|
459 v57 = uColorWhite;
|
|
460 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]);
|
|
461 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, v57, pClassNames[0], 0, 0, 0);
|
|
462 v61 = uColorTeal;
|
|
463 if ( uClassType != PLAYER_CLASS_PALADIN )
|
|
464 v61 = uColorWhite;
|
|
465 uColorGreen = v128 + 417;
|
|
466 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]);
|
|
467 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, v128 + 417, v61, pClassNames[12], 0, 0, 0);
|
|
468 v66 = uColorTeal;
|
|
469 if ( uClassType != PLAYER_CLASS_DRUID )
|
|
470 v66 = uColorWhite;
|
|
471 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]);
|
|
472 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * v128 + 417, v66, pClassNames[20], 0, 0, 0);
|
|
473 v71 = uColorTeal;
|
|
474 if ( uClassType != PLAYER_CLASS_CLERIC )
|
|
475 v71 = uColorWhite;
|
|
476 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]);
|
|
477 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, v71, pClassNames[24], 0, 0, 0);
|
|
478 v75 = uColorTeal;
|
|
479 if ( uClassType != PLAYER_CLASS_DRUID)
|
|
480 v75 = uColorWhite;
|
|
481 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]);
|
|
482 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, uColorGreen, v75, pClassNames[28], 0, 0, 0);
|
|
483 v80 = uColorTeal;
|
|
484 if ( uClassType != PLAYER_CLASS_SORCERER )
|
|
485 v80 = uColorWhite;
|
|
486 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]);
|
|
487 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * v128 + 417, v80, pClassNames[32], 0, 0, 0);
|
|
488 v85 = uColorTeal;
|
|
489 if ( uClassType != PLAYER_CLASS_ARCHER )
|
|
490 v85 = uColorWhite;
|
|
491 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]);
|
|
492 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, v85, pClassNames[16], 0, 0, 0);
|
|
493 v89 = uColorTeal;
|
|
494 if ( uClassType != PLAYER_CLASS_MONK )
|
|
495 v89 = uColorWhite;
|
|
496 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]);
|
|
497 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, uColorGreen, v89, pClassNames[8], 0, 0, 0);
|
|
498 v94 = uColorTeal;
|
|
499 if ( uClassType != PLAYER_CLASS_THEIF )
|
|
500 v94 = uColorWhite;
|
|
501 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]);
|
|
502 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * v128 + 417, v94, pClassNames[4], 0, 0, 0);
|
|
503 pTextCenter = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]); // "Available Skills"
|
|
504 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0);
|
|
505 //pOrder = 0;
|
|
506 //do
|
|
507 for (pOrder = 0; pOrder < 9; ++pOrder)
|
|
508 {
|
|
509 pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pOrder + 4);
|
|
510 strcpy(pText, pSkillNames[pSkillId]);
|
|
511 pLenText = strlen(pText);
|
|
512 v104 = 0;
|
|
513 if ( (signed int)pLenText > 0 )
|
|
514 {
|
|
515 if ( pText[v104] == 32 )
|
|
516 {
|
|
517 pText[v104] = 0;
|
|
518 }
|
|
519 else
|
|
520 {
|
|
521 while ( pText[v104] != 32 )
|
|
522 //for (v104 = 0; v104 < (signed int)pLenText || pText[v104] != 32; ++v104)
|
|
523 {
|
|
524 ++v104;
|
|
525 if ( v104 >= (signed int)pLenText )
|
|
526 break;
|
|
527 }
|
|
528 }
|
|
529 }
|
|
530 uColorGreen = -5;
|
|
531 if ( (signed int)v124 > 2 )
|
|
532 uColorGreen = 0;
|
|
533 pColorText = uColorTeal;
|
|
534 if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] )
|
|
535 pColorText = uColorWhite;
|
|
536 pTextCenter = pFontCreate->AlignText_Center(100, pText);
|
|
537 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (pOrder / 3) + pTextCenter + uColorGreen + 17, v128 * (pOrder % 3) + 417, pColorText, pText, 0, 0, 0);
|
|
538 //++pOrder;
|
|
539 }
|
|
540 //while ( pOrder < 9 );
|
|
541 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
|
|
542 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
|
|
543 v113 = PlayerCreation_ComputeAttributeBonus();
|
|
544 sprintf(pTmpBuf, "%d", v113);
|
|
545 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf);
|
|
546 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf, 0, 0, 0);
|
783
|
547 if ( GameUI_Footer_TimeLeft > GetTickCount() )
|
706
|
548 {
|
|
549 pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points."
|
|
550 if ( v113 < 0 )
|
|
551 pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points."
|
|
552 pWindow.uFrameWidth = 300;
|
|
553 pWindow.uFrameHeight = 100;
|
|
554 pWindow.uFrameX = 170;
|
|
555 pWindow.uFrameY = 140;
|
|
556 pWindow.uFrameZ = 469;
|
|
557 pWindow.uFrameW = 239;
|
|
558 pWindow.DrawMessageBox(0);
|
|
559 }
|
|
560 pRenderer->EndScene();
|
|
561 }
|
|
562
|
|
563 //----- (0049695A) --------------------------------------------------------
|
|
564 void __cdecl PlayerCreationUI_Initialize()
|
|
565 {
|
|
566 unsigned int v0; // ebx@5
|
|
567 unsigned int v1; // eax@6
|
|
568 int v2; // ecx@6
|
|
569 unsigned int v3; // eax@8
|
|
570 signed int v4; // ecx@8
|
|
571 signed int uControlParam; // [sp+10h] [bp-Ch]@7
|
|
572 unsigned int uControlParama; // [sp+10h] [bp-Ch]@9
|
|
573 unsigned int uControlParamb; // [sp+10h] [bp-Ch]@11
|
|
574 unsigned int uControlParamc; // [sp+10h] [bp-Ch]@13
|
|
575 signed int uControlParamd; // [sp+10h] [bp-Ch]@15
|
|
576 signed int uX; // [sp+14h] [bp-8h]@5
|
|
577 unsigned int uXa; // [sp+14h] [bp-8h]@9
|
|
578 unsigned int uXb; // [sp+14h] [bp-8h]@11
|
|
579 unsigned int uXc; // [sp+14h] [bp-8h]@13
|
|
580 signed int uXd; // [sp+14h] [bp-8h]@16
|
|
581
|
783
|
582 pMessageQueue_50CBD0->Flush();
|
|
583
|
706
|
584 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
|
|
585 ++pIcons_LOD->uTexturePacksCount;
|
|
586 if ( !pIcons_LOD->uNumPrevLoadedFiles )
|
|
587 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
|
|
588 pCurrentScreen = SCREEN_PARTY_CREATION;
|
|
589 uPlayerCreationUI_ArrowAnim = 0;
|
|
590 uPlayerCreationUI_SkySliderPos = 0;
|
|
591 uPlayerCreationUI_SelectedCharacter = 0;
|
|
592 v0 = LOBYTE(pFontCreate->uFontHeight) - 2;
|
|
593 pTexture_IC_KNIGHT[0] = pIcons_LOD->LoadTexturePtr("IC_KNIGHT", TEXTURE_16BIT_PALETTE);
|
|
594 pTexture_IC_KNIGHT[1] = pIcons_LOD->LoadTexturePtr("IC_THIEF", TEXTURE_16BIT_PALETTE);
|
|
595 pTexture_IC_KNIGHT[2] = pIcons_LOD->LoadTexturePtr("IC_MONK", TEXTURE_16BIT_PALETTE);
|
|
596 pTexture_IC_KNIGHT[3] = pIcons_LOD->LoadTexturePtr("IC_PALAD", TEXTURE_16BIT_PALETTE);
|
|
597 pTexture_IC_KNIGHT[4] = pIcons_LOD->LoadTexturePtr("IC_ARCH", TEXTURE_16BIT_PALETTE);
|
|
598 pTexture_IC_KNIGHT[5] = pIcons_LOD->LoadTexturePtr("IC_RANGER", TEXTURE_16BIT_PALETTE);
|
|
599 pTexture_IC_KNIGHT[6] = pIcons_LOD->LoadTexturePtr("IC_CLER", TEXTURE_16BIT_PALETTE);
|
|
600 pTexture_IC_KNIGHT[7] = pIcons_LOD->LoadTexturePtr("IC_DRUID", TEXTURE_16BIT_PALETTE);
|
|
601 pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE);
|
|
602 pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE);
|
|
603 pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE);
|
|
604 for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture
|
|
605 {
|
|
606 sprintf(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]);
|
|
607 v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE);
|
|
608 pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1];
|
|
609
|
|
610 }
|
|
611 pTexture_PlayerFaceMask = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("FACEMASK", TEXTURE_16BIT_PALETTE)];
|
|
612 pTexture_buttminu = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("buttminu", TEXTURE_16BIT_PALETTE)];
|
|
613 pTexture_buttplus = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("buttplus", TEXTURE_16BIT_PALETTE)];
|
|
614 pTexture_pressrigh = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("presrigh", TEXTURE_16BIT_PALETTE)];
|
|
615 pTexture_presleft = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("presleft", TEXTURE_16BIT_PALETTE)];
|
|
616 uControlParam = 1;
|
|
617 do
|
|
618 {
|
|
619 sprintf(pTmpBuf, "arrowl%d", uControlParam);
|
|
620 pTextures_arrowl[uControlParam] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)];
|
|
621 sprintf(pTmpBuf, "arrowr%d", uControlParam);
|
|
622 v3 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE);
|
|
623 v4 = uControlParam++;
|
|
624 pTextures_arrowr[v4] = &pIcons_LOD->pTextures[v3];
|
|
625 }
|
|
626 while ( uControlParam < 20 );
|
|
627 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
|
|
628 uControlParama = 0;
|
|
629 uXa = 8;
|
|
630 do
|
|
631 {
|
832
|
632 pGUIWindow_CurrentMenu->CreateButton(uXa, 120u, 145u, 25u, 1, 0, UIMSG_PlayerCreationChangeName, uControlParama, 0, "", 0);
|
706
|
633 uXa += 158;
|
|
634 ++uControlParama;
|
|
635 }
|
|
636 while ( (signed int)uXa < 640 );
|
832
|
637 pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton(10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", pTexture_presleft, 0);
|
|
638 pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", pTexture_presleft, 0);
|
|
639 pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(327, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 2, 0, "", pTexture_presleft, 0);
|
|
640 pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(486, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 3, 0, "", pTexture_presleft, 0);
|
|
641 pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton(74, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 0, 0, "", pTexture_pressrigh, 0);
|
|
642 pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton(233, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 1, 0, "", pTexture_pressrigh, 0);
|
|
643 pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton(391, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 2, 0, "", pTexture_pressrigh, 0);
|
|
644 pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton(549, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FaceNext, 3, 0, "", pTexture_pressrigh, 0);
|
|
645 pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton(10, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 0, 0, "", pTexture_presleft, 0);
|
|
646 pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton(169, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 1, 0, "", pTexture_presleft, 0);
|
|
647 pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton(327, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 2, 0, "", pTexture_presleft, 0);
|
|
648 pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton(486, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoicePrev, 3, 0, "", pTexture_presleft, 0);
|
|
649 pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton(74, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 0, 0, "", pTexture_pressrigh, 0);
|
|
650 pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(233, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 1, 0, "", pTexture_pressrigh, 0);
|
|
651 pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", pTexture_pressrigh, 0);
|
|
652 pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", pTexture_pressrigh, 0);
|
706
|
653 uControlParamb = 0;
|
|
654 uXb = 8;
|
|
655 do
|
|
656 {
|
832
|
657 pGUIWindow_CurrentMenu->CreateButton(uXb, 308, 150, v0, 1, 0, UIMSG_48, uControlParamb, 0, "", 0);
|
|
658 pGUIWindow_CurrentMenu->CreateButton(uXb, v0 + 308, 150, v0, 1, 0, UIMSG_49, uControlParamb, 0, "", 0);
|
|
659 pGUIWindow_CurrentMenu->CreateButton(uXb, 2 * v0 + 308, 150u, v0, 1, 0, UIMSG_PlayerCreationRemoveUpSkill, uControlParamb, 0, "", 0);
|
|
660 pGUIWindow_CurrentMenu->CreateButton(uXb, 3 * v0 + 308, 150u, v0, 1, 0, UIMSG_PlayerCreationRemoveDownSkill, uControlParamb, 0, "", 0);
|
706
|
661 uXb += 158;
|
|
662 ++uControlParamb;
|
|
663 }
|
|
664 while ( (signed int)uXb < 640 );
|
832
|
665 pGUIWindow_CurrentMenu->CreateButton(5u, 21u, 0x99u, 0x16Du, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 0, 0x31u, "", 0);
|
|
666 pGUIWindow_CurrentMenu->CreateButton(163u, 21u, 0x99u, 0x16Du, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 1u, 0x32u, "", 0);
|
|
667 pGUIWindow_CurrentMenu->CreateButton(321u, 21u, 0x99u, 0x16Du, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 2u, 0x33u, "", 0);
|
|
668 pGUIWindow_CurrentMenu->CreateButton(479u, 21u, 0x99u, 0x16Du, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 3u, 0x34u, "", 0);
|
706
|
669 uXc = 23;
|
|
670 uControlParamc = 2;
|
|
671 do
|
|
672 {
|
832
|
673 pGUIWindow_CurrentMenu->CreateButton(uXc, 169, 120, 20, 1, 0, UIMSG_0, uControlParamc - 2, 0, "", 0);
|
|
674 pGUIWindow_CurrentMenu->CreateButton(uXc, v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc - 1, 0, "", 0);
|
|
675 pGUIWindow_CurrentMenu->CreateButton(uXc, 2 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc, 0, "", 0);
|
|
676 pGUIWindow_CurrentMenu->CreateButton(uXc, 3 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 1, 0, "", 0);
|
|
677 pGUIWindow_CurrentMenu->CreateButton(uXc, 4 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 2, 0, "", 0);
|
|
678 pGUIWindow_CurrentMenu->CreateButton(uXc, 5 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 3, 0, "", 0);
|
|
679 pGUIWindow_CurrentMenu->CreateButton(uXc, 6 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 4, 0, "", 0);
|
706
|
680 uControlParamc += 7;
|
|
681 uXc += 158;
|
|
682 }
|
|
683 while ( (signed int)uControlParamc < 30 );
|
|
684 pGUIWindow_CurrentMenu->_41D08F(28, 0, 7, 40);
|
832
|
685 pGUIWindow_CurrentMenu->CreateButton(323, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0, 0, "", 0);
|
|
686 pGUIWindow_CurrentMenu->CreateButton(323, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0xC, 0, "", 0);
|
|
687 pGUIWindow_CurrentMenu->CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x14, 0, "", 0);
|
|
688 pGUIWindow_CurrentMenu->CreateButton(388, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x18, 0, "", 0);
|
|
689 pGUIWindow_CurrentMenu->CreateButton(388, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x1C, 0, "", 0);
|
|
690 pGUIWindow_CurrentMenu->CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x20, 0, "", 0);
|
|
691 pGUIWindow_CurrentMenu->CreateButton(453, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x10, 0, "", 0);
|
|
692 pGUIWindow_CurrentMenu->CreateButton(453, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 8, 0, "", 0);
|
|
693 pGUIWindow_CurrentMenu->CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 4, 0, "", 0);
|
706
|
694 uControlParamd = 0;
|
|
695 do
|
|
696 {
|
|
697 uXd = -5;
|
|
698 if ( uControlParamd <= 3 )
|
|
699 uXd = 0;
|
832
|
700 pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParamd / 3) + uXd + 17, v0 * (uControlParamd % 3) + 417, 100, v0, 1, 0, UIMSG_PlayerCreationSelectActiveSkill,
|
706
|
701 uControlParamd, 0, "", 0);
|
|
702 ++uControlParamd;
|
|
703 }
|
|
704 while ( uControlParamd < 9 );
|
832
|
705 pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, 0xD, "",
|
706
|
706 (Texture *)(uTextureID_BUTTMAKE != -1 ? &pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0), 0);
|
832
|
707 pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickReset, 0, 0x43, "",
|
706
|
708 (Texture *)(uTextureID_BUTTMAKE2 != -1 ? &pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0), 0);
|
832
|
709 pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickMinus, 0, 0x2D, "", pTexture_buttminu, 0);
|
|
710 pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickPlus, 1, 0x2B, "", pTexture_buttplus, 0);
|
706
|
711 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL);
|
|
712 }
|
|
713 // 4E28F8: using guessed type int pCurrentScreen;
|
|
714
|
|
715 //----- (0049750E) --------------------------------------------------------
|
|
716 void __cdecl DeleteCCharFont()
|
|
717 {
|
|
718 pAllocator->FreeChunk(pFontCChar);
|
|
719 pFontCChar = 0;
|
|
720 }
|
|
721 //----- (00497526) --------------------------------------------------------
|
|
722 bool __cdecl PlayerCreationUI_Loop()
|
|
723 {
|
|
724 //RGBTexture *pTexture; // ebx@1
|
|
725 UINT v1; // esi@1
|
|
726 unsigned int v2; // ecx@3
|
|
727 LONG uMouseX; // edi@6
|
|
728 LONG uMouseY; // eax@6
|
|
729 GUIButton *pControlsHead; // edx@6
|
|
730 //unsigned int pNumMessage; // ecx@7
|
|
731 int pControlParam; // esi@12
|
|
732 signed int v8; // edi@30
|
|
733 int v9; // edx@31
|
|
734 char *v10; // ebx@37
|
|
735 Player *v11; // esi@38
|
|
736 //signed int uSpellBookPageCount; // ecx@40
|
|
737 int v13; // eax@40
|
|
738 //signed int uSkillIdx; // eax@45
|
|
739 int v15; // eax@70
|
|
740 signed int v16; // ecx@70
|
|
741 //unsigned int v18; // [sp-4h] [bp-84h]@48
|
|
742 ItemGen item; // [sp+Ch] [bp-74h]@37
|
|
743 char v20[32]; // [sp+30h] [bp-50h]@29
|
|
744 //char v21; // [sp+31h] [bp-4Fh]@29
|
|
745 //__int16 v22; // [sp+4Dh] [bp-33h]@29
|
|
746 char v23; // [sp+4Fh] [bp-31h]@29
|
|
747 MSG Msg; // [sp+50h] [bp-30h]@17
|
|
748 POINT v25; // [sp+6Ch] [bp-14h]@6
|
|
749 bool v26; // [sp+74h] [bp-Ch]@1
|
|
750 //POINT v24; // [sp+78h] [bp-8h]@6
|
|
751 //Player *pPlayer;
|
|
752
|
|
753 //pTexture = &pTexture_PCX;
|
|
754 v1 = 0;
|
|
755 v26 = 0;
|
|
756 pTexture_PCX.Release();
|
|
757 pTexture_PCX.Load("makeme.pcx", 0);
|
|
758 if (pAsyncMouse)
|
|
759 pAsyncMouse->Resume();
|
|
760 v2 = 6;
|
|
761 pGUIWindow_CurrentMenu->field_40 = 0;
|
|
762 //LABEL_27:
|
|
763 SetCurrentMenuID((MENU_STATE)v2);
|
|
764 while ( GetCurrentMenuID() == MENU_CREATEPARTY )
|
|
765 {
|
|
766 if ( pAsyncMouse != (void *)v1 )
|
|
767 pAsyncMouse->_46B736_consume_click_lists(1);
|
|
768 uMouseX = pMouse->GetCursorPos(&v25)->x;
|
|
769 uMouseY = pMouse->GetCursorPos(&v25)->y;
|
|
770 pControlsHead = pGUIWindow_CurrentMenu->pControlsHead;
|
|
771
|
|
772 //does nothing actually
|
|
773 /*if ( pControlsHead != (GUIButton *)v1 )
|
|
774 {
|
|
775 pNumMessage = pMessageQueue_50CBD0->uNumMessages;
|
|
776 do
|
|
777 {
|
|
778 if ( uMouseX >= (signed int)pControlsHead->uX && uMouseX <= (signed int)pControlsHead->uZ
|
|
779 && uMouseY >= (signed int)pControlsHead->uY && uMouseY <= (signed int)pControlsHead->uW )//mouse movement
|
|
780 {
|
|
781 pControlParam = pControlsHead->uControlParam;
|
|
782 pMessageQueue_50CBD0->AddMessage((UIMessageType)pControlsHead->field_1C, pControlParam, 0);
|
|
783 v1 = 0;
|
|
784 }
|
|
785 pControlsHead = pControlsHead->pNext;
|
|
786 }
|
|
787 while ( pControlsHead != (GUIButton *)v1 );
|
|
788 }*/
|
|
789
|
|
790 while ( PeekMessageA(&Msg, (HWND)v1, v1, v1, PM_REMOVE) )
|
|
791 {
|
|
792 if ( Msg.message == WM_QUIT )
|
|
793 Game_DeinitializeAndTerminate(0);
|
|
794 TranslateMessage(&Msg);
|
|
795 DispatchMessageA(&Msg);
|
|
796 }
|
|
797 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
|
|
798 {
|
|
799 WaitMessage();
|
|
800 }
|
|
801 else
|
|
802 {
|
|
803 PlayerCreationUI_Draw();
|
|
804 GUI_MainMenuMessageProc();
|
|
805 pRenderer->BeginScene();
|
|
806 GUI_UpdateWindows();
|
|
807 pRenderer->EndScene();
|
|
808 pRenderer->Present();
|
|
809 if ( uGameState == 1 )
|
|
810 {
|
|
811 v26 = 1;
|
|
812 v2 = 0;
|
|
813 //goto LABEL_27;
|
|
814 SetCurrentMenuID((MENU_STATE)v2);
|
|
815 continue;
|
|
816 }
|
|
817 if ( uGameState == 6 )
|
|
818 {
|
|
819 uGameState = v1;
|
|
820 v2 = 1;
|
|
821 //goto LABEL_27;
|
|
822 SetCurrentMenuID((MENU_STATE)v2);
|
|
823 continue;
|
|
824 }
|
|
825 }
|
|
826 }
|
|
827 pTexture_PCX.Release();
|
|
828 pGUIWindow_CurrentMenu->Release();
|
|
829 pIcons_LOD->_4114F2();
|
|
830
|
|
831 memset(v20, 0, 32);
|
|
832 do
|
|
833 {
|
|
834 v8 = 0;
|
|
835 do
|
|
836 {
|
|
837 v9 = rand() % 32;
|
|
838 if ( !v20[v9] )
|
|
839 break;
|
|
840 ++v8;
|
|
841 }
|
|
842 while ( v8 < 10 );
|
|
843 if ( v8 == 10 )
|
|
844 {
|
|
845 v9 = 0;
|
|
846 if ( v20[0] )
|
|
847 {
|
|
848 do
|
|
849 ++v9;
|
|
850 while ( v20[v9] );
|
|
851 }
|
|
852 }
|
|
853 pParty->field_854[v1++] = v9;
|
|
854 v20[v9] = 1;
|
|
855 }
|
|
856 while ( (signed int)v1 < 32 );
|
|
857 //v10 = (char *)&pParty->pPlayers[0].sResMagicBase;
|
|
858
|
|
859 item.Reset();
|
|
860 //for ( pPlayer = &pParty->pPlayers[0]; pPlayer < &pParty->pPlayers[4]; pPlayer++)
|
|
861 for (uint i = 0; i < 4; ++i)
|
|
862 {
|
|
863 auto player = &pParty->pPlayers[i];
|
|
864 //v11 = pPlayer;
|
|
865 if (player->classType == PLAYER_CLASS_KNIGHT)
|
|
866 player->sResMagicBase = 10;
|
|
867 //*((short *)v10 + 400) = 0;
|
|
868 player->pPlayerBuffs[22].uExpireTime = 0;
|
|
869 for (uint j = 0; j < 9; j++)
|
|
870 {
|
|
871 if (player->pActiveSkills[PLAYER_SKILL_FIRE + j])
|
|
872 {
|
|
873 player->lastOpenedSpellbookPage = j;
|
|
874 break;
|
|
875 }
|
|
876 }
|
|
877 pItemsTable->GenerateItem(2, 40, &item);
|
|
878 player->AddItem2(-1, &item);
|
|
879 //uSkillIdx = 0;
|
|
880 //v24.y = 0;
|
|
881
|
|
882 player->sHealth = player->GetMaxHealth();
|
|
883 player->sMana = player->GetMaxMana();
|
|
884 for (uint j = 0; j < 37; ++j)
|
|
885 {
|
|
886 if (!player->pActiveSkills[j])
|
|
887 continue;
|
|
888
|
|
889 switch (j)
|
|
890 {
|
|
891 case PLAYER_SKILL_STAFF: player->AddItem(-1, 61); break;
|
|
892 case PLAYER_SKILL_SWORD: player->AddItem(-1, 1); break;
|
|
893 case PLAYER_SKILL_DAGGER: player->AddItem(-1, 15); break;
|
|
894 case PLAYER_SKILL_AXE: player->AddItem(-1, 23); break;
|
|
895 case PLAYER_SKILL_SPEAR: player->AddItem(-1, 31); break;
|
|
896 case PLAYER_SKILL_BOW: player->AddItem(-1, 47); break;
|
|
897 case PLAYER_SKILL_MACE: player->AddItem(-1, 50); break;
|
|
898 case PLAYER_SKILL_BLASTER: assert(false); break;
|
|
899 case PLAYER_SKILL_SHIELD: player->AddItem(-1, 84); break;
|
|
900 case PLAYER_SKILL_LEATHER: player->AddItem(-1, 66); break;
|
|
901 case PLAYER_SKILL_CHAIN: player->AddItem(-1, 71); break;
|
|
902 case PLAYER_SKILL_PLATE: player->AddItem(-1, 76); break;
|
|
903 case PLAYER_SKILL_FIRE:
|
|
904 player->AddItem(-1, 0x191);
|
|
905 player->spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;
|
|
906 break;
|
|
907 case PLAYER_SKILL_AIR:
|
|
908 player->AddItem(-1, 0x19C);
|
|
909 player->spellbook.pAirSpellbook.bIsSpellAvailable[0] = true;
|
|
910 break;
|
|
911 case PLAYER_SKILL_WATER:
|
|
912 player->AddItem(-1, 0x1A7);
|
|
913 player->spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true;
|
|
914 break;
|
|
915 case PLAYER_SKILL_EARTH:
|
|
916 player->AddItem(-1, 0x1B2);
|
|
917 player->spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true;
|
|
918 break;
|
|
919 case PLAYER_SKILL_SPIRIT:
|
|
920 player->AddItem(-1, 0x1BD);
|
|
921 player->spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true;
|
|
922 break;
|
|
923 case PLAYER_SKILL_MIND:
|
|
924 player->AddItem(-1, 0x1C8);
|
|
925 player->spellbook.pMindSpellbook.bIsSpellAvailable[0] = true;
|
|
926 break;
|
|
927 case PLAYER_SKILL_BODY:
|
|
928 player->AddItem(-1, 0x1D3);
|
|
929 player->spellbook.pBodySpellbook.bIsSpellAvailable[0] = true;
|
|
930 break;
|
|
931 case PLAYER_SKILL_LIGHT:
|
|
932 case PLAYER_SKILL_DARK:
|
|
933 case PLAYER_SKILL_DIPLOMACY:
|
|
934 assert(false);
|
|
935 break;
|
|
936 case PLAYER_SKILL_ITEM_ID:
|
|
937 case PLAYER_SKILL_REPAIR:
|
|
938 case PLAYER_SKILL_MEDITATION:
|
|
939 case PLAYER_SKILL_PERCEPTION:
|
|
940 case PLAYER_SKILL_TRAP_DISARM:
|
|
941 case PLAYER_SKILL_LEARNING:
|
|
942 player->AddItem(-1, 0xDC);
|
|
943 player->AddItem(-1, 5 * (rand() % 3 + 40));
|
|
944 break;
|
|
945 case PLAYER_SKILL_DODGE: player->AddItem(-1, 115); break;
|
|
946 case PLAYER_SKILL_UNARMED: player->AddItem(-1, 110); break;
|
|
947 default:
|
|
948 break;
|
|
949 }
|
|
950
|
|
951 for (uint k = 0; k < 138; k++)
|
|
952 {
|
|
953 if (&player->pInventoryItems[k])
|
|
954 player->pInventoryItems[k].SetIdentified();
|
|
955 }
|
|
956 }
|
|
957 }
|
|
958
|
|
959 pAudioPlayer->StopChannels(-1, -1);
|
|
960 if (pAsyncMouse)
|
|
961 pAsyncMouse->Suspend();
|
|
962 return v26;
|
|
963 } |