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