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