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