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