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