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