comparison UI/UIPartyCreation.cpp @ 1677:a699ecd7aeb3

PlayerCreationUI_Draw()
author Ritor1
date Fri, 20 Sep 2013 14:31:42 +0600
parents 75fafd8ced59
children 6faacde46271
comparison
equal deleted inserted replaced
1676:483cc7f0d86c 1677:a699ecd7aeb3
19 #include "..\mm7_data.h" 19 #include "..\mm7_data.h"
20 20
21 21
22 22
23 //----- (004908DE) -------------------------------------------------------- 23 //----- (004908DE) --------------------------------------------------------
24 int PlayerCreation_Choose4Skills() 24 bool PlayerCreation_Choose4Skills()
25 { 25 {
26 Player *v0; // esi@1 26 signed int skills_count; // edx@2
27 signed int v1; // edx@2 27
28 unsigned short *v2; // eax@2 28 for ( uint j = 0; j < 4; ++j )
29 signed int v3; // ecx@2 29 {
30 30 skills_count = 0;
31 v0 = pParty->pPlayers;//[0].pActiveSkills; 31 for ( uint i = 0; i < 37; ++i )
32 while ( 1 ) 32 {
33 { 33 if ( pParty->pPlayers[j].pActiveSkills[i] )
34 v1 = 0; 34 ++skills_count;
35 v2 = v0->pActiveSkills; 35 }
36 v3 = 37; 36 if ( skills_count < 4 )
37 do 37 return false;
38 { 38 }
39 if ( *v2 ) 39 return true;
40 ++v1; 40 }
41 ++v2;
42 --v3;
43 }
44 while ( v3 );
45 if ( v1 < 4 )
46 break;
47 ++v0;
48 if ( v0 > &pParty->pPlayers[3] )
49 return 1;
50 }
51 return 0;
52 }
53
54
55
56 41
57 //----- (00491CB5) -------------------------------------------------------- 42 //----- (00491CB5) --------------------------------------------------------
58 void LoadPlayerPortraintsAndVoices() 43 void LoadPlayerPortraintsAndVoices()
59 { 44 {
60 //Texture **v0; // ebx@1 45 pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles;
61 //int v1; // eax@2 46
62 //int v2; // edi@3 47 for (uint i = 0; i < 4; ++i)
63 char *v3; // esi@5 48 for (uint j = 0; j < 56; ++j)
64 char *v4; // [sp+10h] [bp-4h]@1 49 {
65 50 sprintf(pTmpBuf.data(), "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uCurrentFace], j + 1);
66 pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles; 51 pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
67 52 }
53
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);
57
58 if (SoundSetAction[24][0])
68 for (uint i = 0; i < 4; ++i) 59 for (uint i = 0; i < 4; ++i)
69 for (uint j = 0; j < 56; ++j) 60 {
70 { 61 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0);
71 sprintf(pTmpBuf.data(), "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uCurrentFace], j + 1); 62 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0);
72 pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); 63 }
73 } 64 }
74
75 pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE);
76 pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE);
77 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE);
78
79 if (SoundSetAction[24][0])
80 for (uint i = 0; i < 4; ++i)
81 {
82 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0);
83 pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0);
84 }
85 }
86 65
87 //----- (00491DE7) -------------------------------------------------------- 66 //----- (00491DE7) --------------------------------------------------------
88 int __fastcall ReloadPlayerPortraits(int a1, int a2) 67 void ReloadPlayerPortraits(int player_id, int face_id)//the transition from the zombies in the normal state
89 { 68 {
90 int result; // eax@1 69 for ( uint i = 0; i <= 55; ++i )
91 const char **v3; // ebp@1 70 {
92 Texture **v4; // ebx@1 71 sprintf(pTmpBuf.data(), "%s%02d", pPlayerPortraitsNames[face_id], i + 1);
93 int v5; // esi@2 72 pIcons_LOD->ReloadTexture(pTextures_PlayerFaces[player_id][i], pTmpBuf.data(), 2);
94 73 }
95 result = 0; 74 }
96 v3 = &pPlayerPortraitsNames[a2];
97 v4 = pTextures_PlayerFaces[a1].data();
98 do
99 {
100 v5 = result + 1;
101 sprintf(pTmpBuf.data(), "%s%02d", *v3, result + 1);
102 pIcons_LOD->ReloadTexture(*v4, pTmpBuf.data(), 2);
103 result = v5;
104 ++v4;
105 }
106 while ( v5 < 56 );
107 return result;
108 }
109 //----- (00495B39) -------------------------------------------------------- 75 //----- (00495B39) --------------------------------------------------------
110 void PlayerCreationUI_Draw() 76 void PlayerCreationUI_Draw()
111 { 77 {
112 int pTextCenter; // eax@3 78 int pTextCenter; // eax@3
113 IconFrame *pFrame; // eax@3 79 IconFrame *pFrame; // eax@3
114 int pX; // ecx@7 80 int pX; // ecx@7
115 GUIButton *uPosActiveItem; // edi@12 81 GUIButton *uPosActiveItem; // edi@12
116 int uNumLet; // eax@14
117 char v8; // al@17
118 int v9; // ecx@17
119 char v10; // sf@17
120 size_t v16; // eax@28
121 int v17; // eax@33 82 int v17; // eax@33
122 int uStatLevel; // eax@44 83 int uStatLevel; // eax@44
123 unsigned int pStatColor; // eax@44 84 unsigned int pStatColor; // eax@44
124 PLAYER_SKILL_TYPE pSkillsType; // eax@44 85 PLAYER_SKILL_TYPE pSkillsType; // eax@44
125 int v51; // eax@49
126 char *v52; // edi@52
127 char v53; // al@52
128 PLAYER_CLASS_TYPE uClassType; // edi@53 86 PLAYER_CLASS_TYPE uClassType; // edi@53
129 int pColorText; // eax@53 87 int pColorText; // eax@53
130 PLAYER_SKILL_TYPE pSkillId; // edi@72 88 PLAYER_SKILL_TYPE pSkillId; // edi@72
131 size_t pLenText; // eax@72 89 size_t pLenText; // eax@72
132 signed int v104; // ecx@72 90 signed int v104; // ecx@72
133 int pTextY; // ST08_4@81 91 int pTextY; // ST08_4@81
134 signed int pBonusNum; // edi@82 92 signed int pBonusNum; // edi@82
135 const char *uRaceName; // [sp+0h] [bp-170h]@39 93 const char *uRaceName; // [sp+0h] [bp-170h]@39
136 char pText[200]; // [sp+10h] [bp-160h]@14 94 char pText[200]; // [sp+10h] [bp-160h]@14
137 GUIWindow pWindow; // [sp+D8h] [bp-98h]@83 95 GUIWindow message_window; // [sp+D8h] [bp-98h]@83
138 size_t v120; // [sp+130h] [bp-40h]@25
139 int uColor1; // [sp+144h] [bp-2Ch]@1
140 int v126; // [sp+148h] [bp-28h]@25 96 int v126; // [sp+148h] [bp-28h]@25
141 int uColorGreen; // [sp+14Ch] [bp-24h]@1
142 int pIntervalY; // [sp+150h] [bp-20h]@14 97 int pIntervalY; // [sp+150h] [bp-20h]@14
143 int pX_Numbers; // [sp+154h] [bp-1Ch]@18 98 int pX_Numbers; // [sp+154h] [bp-1Ch]@18
144 int uColorTeal; // [sp+158h] [bp-18h]@1
145 int uColorWhite; // [sp+15Ch] [bp-14h]@1
146 int uX; // [sp+160h] [bp-10h]@18 99 int uX; // [sp+160h] [bp-10h]@18
147 unsigned int v133; // [sp+164h] [bp-Ch]@25
148 int pOrder; // [sp+168h] [bp-8h]@14
149 int pIntervalX; 100 int pIntervalX;
150 int pCorrective; 101 int pCorrective;
151 const char *pSkillName; 102
152 103 //move sky
153 uColor1 = TargetColor(0xD1, 0xBB, 0x61);
154 uColorTeal = TargetColor(0, 0xF7, 0xF7);
155 uColorGreen = TargetColor(0, 0xFF, 0);
156 uColorWhite = TargetColor(0xFF, 0xFF, 0xFF);
157 pRenderer->BeginScene(); 104 pRenderer->BeginScene();
158 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); 105 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
159 uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20; 106 uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20;
160 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY); 107 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY);
161 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - 640, 2, pTexture_MAKESKY); 108 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - 640, 2, pTexture_MAKESKY);
171 default: 118 default:
172 Error("Invalid selected character"); 119 Error("Invalid selected character");
173 } 120 }
174 121
175 pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]); 122 pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]);
176 pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, pGlobalTXT_LocalizationStrings[51], 0, 0, 0); 123 pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, pGlobalTXT_LocalizationStrings[51], 0, 0, 0);//Ñ Î Ç Ä À Ò Ü Î Ò Ð ß Ä
177 pRenderer->DrawTextureTransparent(17, 35, pPlayerPortraits[pParty->pPlayers[0].uCurrentFace]); 124 pRenderer->DrawTextureTransparent(17, 35, pPlayerPortraits[pParty->pPlayers[0].uCurrentFace]);
178 pRenderer->DrawTextureTransparent(176, 35, pPlayerPortraits[pParty->pPlayers[1].uCurrentFace]); 125 pRenderer->DrawTextureTransparent(176, 35, pPlayerPortraits[pParty->pPlayers[1].uCurrentFace]);
179 pRenderer->DrawTextureTransparent(335, 35, pPlayerPortraits[pParty->pPlayers[2].uCurrentFace]); 126 pRenderer->DrawTextureTransparent(335, 35, pPlayerPortraits[pParty->pPlayers[2].uCurrentFace]);
180 pRenderer->DrawTextureTransparent(494, 35, pPlayerPortraits[pParty->pPlayers[3].uCurrentFace]); 127 pRenderer->DrawTextureTransparent(494, 35, pPlayerPortraits[pParty->pPlayers[3].uCurrentFace]);
181 pFrame = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime); 128 pFrame = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime);
187 pRenderer->DrawTextureTransparent(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim]); 134 pRenderer->DrawTextureTransparent(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim]);
188 pRenderer->DrawTextureTransparent(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim]); 135 pRenderer->DrawTextureTransparent(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim]);
189 136
190 memset(pText, 0, 200); 137 memset(pText, 0, 200);
191 strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills" 138 strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills"
192 uNumLet = strlen(pText) - 1; 139 for ( int i = strlen(pText) - 1; i >= 0; i-- )//???
193 pOrder = uNumLet; 140 pText[i] = toupper((unsigned __int8)pText[i]);
194 if ( uNumLet >= 0 )
195 {
196 while ( 1 )
197 {
198 v8 = toupper((unsigned __int8)pText[uNumLet]);
199 v9 = pOrder;
200 v10 = pOrder-- - 1 < 0;
201 pText[v9] = v8;
202 if ( v10 )
203 break;
204 uNumLet = pOrder;
205 }
206 }
207 141
208 pIntervalX = 18; 142 pIntervalX = 18;
209 pIntervalY = pFontCreate->uFontHeight - 2; 143 pIntervalY = pFontCreate->uFontHeight - 2;
210 //v124 = 0;
211 uX = 32; 144 uX = 32;
212 pX_Numbers = 493; 145 pX_Numbers = 493;
213 146
214 for (int i = 0; i < 4; ++i) 147 for (int i = 0; i < 4; ++i)
215 { 148 {
216 auto player = pParty->pPlayers + i; 149 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pIntervalX + 73, 100, 0, pClassNames[pParty->pPlayers[i].classType], 0, 0, 0);
217 150 pRenderer->DrawTextureTransparent(pIntervalX + 77, 50, pTexture_IC_KNIGHT[pParty->pPlayers[i].classType / 4]);
218 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pIntervalX + 73, 100, 0, pClassNames[player->classType], 0, 0, 0);
219 pRenderer->DrawTextureTransparent(pIntervalX + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]);
220 151
221 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 != WINDOW_INPUT_NONE && pGUIWindow_CurrentMenu->ptr_1C == (void *)i ) 152 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 != WINDOW_INPUT_NONE && pGUIWindow_CurrentMenu->ptr_1C == (void *)i )
222 { 153 {
223 switch ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 ) 154 switch ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 )
224 { 155 {
226 v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)pGUIWindow_CurrentMenu->ptr_1C + 18, 124, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1); 157 v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)pGUIWindow_CurrentMenu->ptr_1C + 18, 124, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1);
227 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate); 158 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate);
228 break; 159 break;
229 case WINDOW_INPUT_CONFIRMED: // press enter 160 case WINDOW_INPUT_CONFIRMED: // press enter
230 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; 161 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
231 v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
232 v126 = 0; 162 v126 = 0;
233 v133 = 0; 163 for ( int i = 0; i < strlen((const char *)pKeyActionMap->pPressedKeysBuffer); ++i )//edit name
234 if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) )//edit name
235 { 164 {
236 do 165 if ( pKeyActionMap->pPressedKeysBuffer[i] == ' ' )
237 { 166 ++v126;
238 if ( pKeyActionMap->pPressedKeysBuffer[v133] == ' ' )
239 ++v126;
240 ++v133;
241 v16 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
242 }
243 while ( v133 < v16 );
244 } 167 }
245 if ( v120 && v126 != v120 ) 168 if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) && v126 != strlen((const char *)pKeyActionMap->pPressedKeysBuffer) )
246 strcpy(player->pName, (const char *)pKeyActionMap->pPressedKeysBuffer); 169 strcpy(pParty->pPlayers[i].pName, (const char *)pKeyActionMap->pPressedKeysBuffer);
247 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0); 170 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, pParty->pPlayers[i].pName, 130, 0);
248 *(short *)&player->field_1988[27] = 1; 171 pParty->pPlayers[i].field_1988[27] = 1;
249 break; 172 break;
250 case WINDOW_INPUT_CANCELLED: // press escape 173 case WINDOW_INPUT_CANCELLED: // press escape
251 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; 174 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
252 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0); 175 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, pParty->pPlayers[i].pName, 130, 0);
253 SetCurrentMenuID(MENU_NAMEPANELESC); 176 SetCurrentMenuID(MENU_NAMEPANELESC);
254 break; 177 break;
255 } 178 }
256 } 179 }
257 else 180 else
258 { 181 {
259 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, player->pName, 130, 0); 182 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX, 124, 0, pParty->pPlayers[i].pName, 130, 0);
260 } 183 }
261 184
262 switch (player->GetRace()) 185 switch (pParty->pPlayers[i].GetRace())
263 { 186 {
264 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human" 187 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"
265 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf" 188 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf"
266 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin" 189 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
267 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf" 190 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
268 }; 191 };
269 strcpy(pTmpBuf.data(), uRaceName); 192 strcpy(pTmpBuf.data(), uRaceName);
270 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf.data(), 130, 0);//Race Name 193 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pIntervalX + 72, pIntervalY + 12, 0, pTmpBuf.data(), 130, 0);//Race Name
271 194
272 pTextCenter = pFontCreate->AlignText_Center(150, pText); 195 pTextCenter = pFontCreate->AlignText_Center(150, pText);
273 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); // Skills 196 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, TargetColor(0xD1, 0xBB, 0x61), pText, 0, 0, 0); // Skills
274 197
275 uStatLevel = player->GetActualMight(); 198 uStatLevel = pParty->pPlayers[i].GetActualMight();
276 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might" 199 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], pX_Numbers, uStatLevel);// "Might"
277 pStatColor = player->GetStatColor(0); 200 pStatColor = pParty->pPlayers[i].GetStatColor(0);
278 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf.data(), 0, 0, 0); 201 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
279 202
280 uStatLevel = player->GetActualIntelligence(); 203 uStatLevel = pParty->pPlayers[i].GetActualIntelligence();
281 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect" 204 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], pX_Numbers, uStatLevel);// "Intellect"
282 pStatColor = player->GetStatColor(1); 205 pStatColor = pParty->pPlayers[i].GetStatColor(1);
283 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0); 206 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
284 207
285 uStatLevel = player->GetActualWillpower(); 208 uStatLevel = pParty->pPlayers[i].GetActualWillpower();
286 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality" 209 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], pX_Numbers, uStatLevel);// "Personality"
287 pStatColor = player->GetStatColor(2); 210 pStatColor = pParty->pPlayers[i].GetStatColor(2);
288 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0); 211 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
289 212
290 uStatLevel = player->GetActualEndurance(); 213 uStatLevel = pParty->pPlayers[i].GetActualEndurance();
291 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance" 214 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], pX_Numbers, uStatLevel);// "Endurance"
292 pStatColor = player->GetStatColor(3); 215 pStatColor = pParty->pPlayers[i].GetStatColor(3);
293 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0); 216 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 3 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
294 217
295 uStatLevel = player->GetActualAccuracy(); 218 uStatLevel = pParty->pPlayers[i].GetActualAccuracy();
296 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy" 219 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], pX_Numbers, uStatLevel);// "Accuracy"
297 pStatColor = player->GetStatColor(4); 220 pStatColor = pParty->pPlayers[i].GetStatColor(4);
298 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0); 221 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
299 222
300 uStatLevel = player->GetActualSpeed(); 223 uStatLevel = pParty->pPlayers[i].GetActualSpeed();
301 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed" 224 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], pX_Numbers, uStatLevel);// "Speed"
302 pStatColor = player->GetStatColor(5); 225 pStatColor = pParty->pPlayers[i].GetStatColor(5);
303 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0); 226 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 5 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
304 227
305 uStatLevel = player->GetActualLuck(); 228 uStatLevel = pParty->pPlayers[i].GetActualLuck();
306 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck" 229 sprintf(pTmpBuf.data(), "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], pX_Numbers, uStatLevel);// "Luck"
307 pStatColor = player->GetStatColor(6); 230 pStatColor = pParty->pPlayers[i].GetStatColor(6);
308 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0); 231 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 6 * pIntervalY + 169, pStatColor, pTmpBuf.data(), 0, 0, 0);
309 232
310 233
311 pSkillsType = player->GetSkillIdxByOrder(0); 234 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(0);
312 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 235 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
313 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 236 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
314 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf.data(), 0, 0, 0); 237 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, TargetColor(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
315 238
316 pSkillsType = player->GetSkillIdxByOrder(1); 239 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(1);
317 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 240 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
318 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 241 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
319 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, uColorWhite, pTmpBuf.data(), 0, 0, 0); 242 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, TargetColor(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
320 243
321 pSkillsType = player->GetSkillIdxByOrder(2); 244 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(2);
322 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 245 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
323 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 246 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
324 pColorText = uColorGreen; 247 pColorText = TargetColor(0, 0xFF, 0);
325 if ( (signed int)pSkillsType >= 37 ) 248 if ( (signed int)pSkillsType >= 37 )
326 pColorText = uColorTeal; 249 pColorText = TargetColor(0, 0xF7, 0xF7);
327 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0); 250 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
328 251
329 pSkillsType = player->GetSkillIdxByOrder(3); 252 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(3);
330 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 253 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
331 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 254 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
332 pColorText = uColorGreen; 255 pColorText = TargetColor(0, 0xFF, 0);
333 if ( (signed int)pSkillsType >= 37 ) 256 if ( (signed int)pSkillsType >= 37 )
334 pColorText = uColorTeal; 257 pColorText = TargetColor(0, 0xF7, 0xF7);
335 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0); 258 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, pTmpBuf.data(), 0, 0, 0);
336 259
337 //v124 = (char *)v124 + 1;
338 pIntervalX += 159; 260 pIntervalX += 159;
339 pX_Numbers -= 158; 261 pX_Numbers -= 158;
340 uX += 158; 262 uX += 158;
341 } 263 }
342 264
343 strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class" 265 strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class"
344 v51 = strlen(pText) - 1; 266 for ( int i = strlen(pText) - 1; i >= 0; i-- )
345 pOrder = v51; 267 pText[i] = toupper((unsigned __int8)pText[i]);
346 if ( v51 >= 0 ) 268
347 {
348 while ( 1 )
349 {
350 v52 = &pText[v51];
351 v53 = toupper((unsigned __int8)pText[v51]);
352 v10 = pOrder-- - 1 < 0;
353 *v52 = v53;
354 if ( v10 )
355 break;
356 v51 = pOrder;
357 }
358 }
359 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType; 269 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType;
360 pTextCenter = pFontCreate->AlignText_Center(193, pText); 270 pTextCenter = pFontCreate->AlignText_Center(193, pText);
361 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0);//Classes 271 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, TargetColor(0xD1, 0xBB, 0x61), pText, 0, 0, 0);//Classes
362 272
363 pColorText = uColorTeal; 273 pColorText = TargetColor(0, 0xF7, 0xF7);
364 if ( uClassType ) 274 if ( uClassType )
365 pColorText = uColorWhite; 275 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
366 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]); 276 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]);
367 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, pColorText, pClassNames[0], 0, 0, 0); 277 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, pColorText, pClassNames[0], 0, 0, 0);
368 278
369 pColorText = uColorTeal; 279 pColorText = TargetColor(0, 0xF7, 0xF7);
370 if ( uClassType != PLAYER_CLASS_PALADIN ) 280 if ( uClassType != PLAYER_CLASS_PALADIN )
371 pColorText = uColorWhite; 281 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
372 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]); 282 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]);
373 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, pIntervalY + 417, pColorText, pClassNames[12], 0, 0, 0); 283 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, pIntervalY + 417, pColorText, pClassNames[12], 0, 0, 0);
374 284
375 pColorText = uColorTeal; 285 pColorText = TargetColor(0, 0xF7, 0xF7);
376 if ( uClassType != PLAYER_CLASS_DRUID ) 286 if ( uClassType != PLAYER_CLASS_DRUID )
377 pColorText = uColorWhite; 287 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
378 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]); 288 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]);
379 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * pIntervalY + 417, pColorText, pClassNames[20], 0, 0, 0); 289 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * pIntervalY + 417, pColorText, pClassNames[20], 0, 0, 0);
380 290
381 pColorText = uColorTeal; 291 pColorText = TargetColor(0, 0xF7, 0xF7);
382 if ( uClassType != PLAYER_CLASS_CLERIC ) 292 if ( uClassType != PLAYER_CLASS_CLERIC )
383 pColorText = uColorWhite; 293 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
384 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]); 294 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]);
385 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, pColorText, pClassNames[24], 0, 0, 0); 295 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, pColorText, pClassNames[24], 0, 0, 0);
386 296
387 pColorText = uColorTeal; 297 pColorText = TargetColor(0, 0xF7, 0xF7);
388 if ( uClassType != PLAYER_CLASS_DRUID) 298 if ( uClassType != PLAYER_CLASS_DRUID)
389 pColorText = uColorWhite; 299 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
390 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]); 300 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]);
391 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, pIntervalY + 417, pColorText, pClassNames[28], 0, 0, 0); 301 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, pIntervalY + 417, pColorText, pClassNames[28], 0, 0, 0);
392 302
393 pColorText = uColorTeal; 303 pColorText = TargetColor(0, 0xF7, 0xF7);
394 if ( uClassType != PLAYER_CLASS_SORCERER ) 304 if ( uClassType != PLAYER_CLASS_SORCERER )
395 pColorText = uColorWhite; 305 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
396 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]); 306 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]);
397 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * pIntervalY + 417, pColorText, pClassNames[32], 0, 0, 0); 307 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * pIntervalY + 417, pColorText, pClassNames[32], 0, 0, 0);
398 308
399 pColorText = uColorTeal; 309 pColorText = TargetColor(0, 0xF7, 0xF7);
400 if ( uClassType != PLAYER_CLASS_ARCHER ) 310 if ( uClassType != PLAYER_CLASS_ARCHER )
401 pColorText = uColorWhite; 311 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
402 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]); 312 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]);
403 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, pColorText, pClassNames[16], 0, 0, 0); 313 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, pColorText, pClassNames[16], 0, 0, 0);
404 314
405 pColorText = uColorTeal; 315 pColorText = TargetColor(0, 0xF7, 0xF7);
406 if ( uClassType != PLAYER_CLASS_MONK ) 316 if ( uClassType != PLAYER_CLASS_MONK )
407 pColorText = uColorWhite; 317 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
408 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]); 318 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]);
409 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, pIntervalY + 417, pColorText, pClassNames[8], 0, 0, 0); 319 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, pIntervalY + 417, pColorText, pClassNames[8], 0, 0, 0);
410 320
411 pColorText = uColorTeal; 321 pColorText = TargetColor(0, 0xF7, 0xF7);
412 if ( uClassType != PLAYER_CLASS_THEIF ) 322 if ( uClassType != PLAYER_CLASS_THEIF )
413 pColorText = uColorWhite; 323 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
414 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]); 324 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]);
415 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * pIntervalY + 417, pColorText, pClassNames[4], 0, 0, 0); 325 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * pIntervalY + 417, pColorText, pClassNames[4], 0, 0, 0);
416 326
417 pTextCenter = pFontCreate->AlignText_Center(236, pGlobalTXT_LocalizationStrings[20]); // "Available Skills" 327 pTextCenter = pFontCreate->AlignText_Center(236, pGlobalTXT_LocalizationStrings[20]); // "Available Skills"
418 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0); 328 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, TargetColor(0xD1, 0xBB, 0x61), pGlobalTXT_LocalizationStrings[20], 0, 0, 0);
419 for (uint i = 0; i < 9; ++i) 329 for (uint i = 0; i < 9; ++i)
420 { 330 {
421 pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(i + 4); 331 pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(i + 4);
422 strcpy(pText, pSkillNames[pSkillId]); 332 strcpy(pText, pSkillNames[pSkillId]);
423 pLenText = strlen(pText); 333 pLenText = strlen(pText);
439 } 349 }
440 } 350 }
441 pCorrective = -10;//-5 351 pCorrective = -10;//-5
442 if ( (signed int)pLenText < 8 )//if ( (signed int)v124 > 2 ) 352 if ( (signed int)pLenText < 8 )//if ( (signed int)v124 > 2 )
443 pCorrective = 0; 353 pCorrective = 0;
444 pColorText = uColorTeal; 354 pColorText = TargetColor(0, 0xF7, 0xF7);
445 if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] ) 355 if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] )
446 pColorText = uColorWhite; 356 pColorText = TargetColor(0xFF, 0xFF, 0xFF);
447 pTextCenter = pFontCreate->AlignText_Center(100, pText); 357 pTextCenter = pFontCreate->AlignText_Center(100, pText);
448 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17, pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0); 358 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17, pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0);
449 } 359 }
450 360
451 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus" 361 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
452 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0); 362 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, TargetColor(0xD1, 0xBB, 0x61), pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
453 pBonusNum = PlayerCreation_GetUnspentAttributePointCount(); 363 pBonusNum = PlayerCreation_GetUnspentAttributePointCount();
454 sprintf(pTmpBuf.data(), "%d", pBonusNum); 364 sprintf(pTmpBuf.data(), "%d", pBonusNum);
455 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf.data()); 365 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf.data());
456 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf.data(), 0, 0, 0); 366 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, TargetColor(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
457 if ( GameUI_Footer_TimeLeft > GetTickCount() ) 367 if ( GameUI_Footer_TimeLeft > GetTickCount() )
458 { 368 {
459 pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points." 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."
460 if ( pBonusNum < 0 ) 370 if ( pBonusNum < 0 )
461 pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points." 371 message_window.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points."
462 pWindow.uFrameWidth = 300; 372 message_window.uFrameWidth = 300;
463 pWindow.uFrameHeight = 100; 373 message_window.uFrameHeight = 100;
464 pWindow.uFrameX = 170; 374 message_window.uFrameX = 170;
465 pWindow.uFrameY = 140; 375 message_window.uFrameY = 140;
466 pWindow.uFrameZ = 469; 376 message_window.uFrameZ = 469;
467 pWindow.uFrameW = 239; 377 message_window.uFrameW = 239;
468 pWindow.DrawMessageBox(0); 378 message_window.DrawMessageBox(0);
469 } 379 }
470 pRenderer->EndScene(); 380 pRenderer->EndScene();
471 } 381 }
472 382
473 //----- (0049695A) -------------------------------------------------------- 383 //----- (0049695A) --------------------------------------------------------