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