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