comparison UI/UIPartyCreation.cpp @ 2069:259df09dfb50

32bits almost there
author Nomad
date Tue, 03 Dec 2013 20:18:17 +0200
parents b2a434d65344
children d28d3c006077
comparison
equal deleted inserted replaced
2061:b2a434d65344 2069:259df09dfb50
191 }; 191 };
192 strcpy(pTmpBuf.data(), uRaceName); 192 strcpy(pTmpBuf.data(), uRaceName);
193 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
194 194
195 pTextCenter = pFontCreate->AlignText_Center(150, pText); 195 pTextCenter = pFontCreate->AlignText_Center(150, pText);
196 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, TargetColor(0xD1, 0xBB, 0x61), pText, 0, 0, 0); // Skills 196 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, Color16(0xD1, 0xBB, 0x61), pText, 0, 0, 0); // Skills
197 197
198 uStatLevel = pParty->pPlayers[i].GetActualMight(); 198 uStatLevel = pParty->pPlayers[i].GetActualMight();
199 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"
200 pStatColor = pParty->pPlayers[i].GetStatColor(0); 200 pStatColor = pParty->pPlayers[i].GetStatColor(0);
201 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);
232 232
233 233
234 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(0); 234 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(0);
235 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 235 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
236 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 236 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
237 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, TargetColor(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0); 237 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, Color16(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
238 238
239 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(1); 239 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(1);
240 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 240 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
241 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 241 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
242 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, TargetColor(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0); 242 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, pIntervalY + 311, Color16(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
243 243
244 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(2); 244 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(2);
245 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 245 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
246 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 246 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
247 pColorText = TargetColor(0, 0xFF, 0); 247 pColorText = Color16(0, 0xFF, 0);
248 if ( (signed int)pSkillsType >= 37 ) 248 if ( (signed int)pSkillsType >= 37 )
249 pColorText = TargetColor(0, 0xF7, 0xF7); 249 pColorText = Color16(0, 0xF7, 0xF7);
250 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);
251 251
252 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(3); 252 pSkillsType = pParty->pPlayers[i].GetSkillIdxByOrder(3);
253 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]); 253 pTextCenter = pFontCreate->AlignText_Center(150, pSkillNames[pSkillsType]);
254 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]); 254 sprintf(pTmpBuf.data(), "\t%03u%s", pTextCenter, pSkillNames[pSkillsType]);
255 pColorText = TargetColor(0, 0xFF, 0); 255 pColorText = Color16(0, 0xFF, 0);
256 if ( (signed int)pSkillsType >= 37 ) 256 if ( (signed int)pSkillsType >= 37 )
257 pColorText = TargetColor(0, 0xF7, 0xF7); 257 pColorText = Color16(0, 0xF7, 0xF7);
258 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);
259 259
260 pIntervalX += 159; 260 pIntervalX += 159;
261 pX_Numbers -= 158; 261 pX_Numbers -= 158;
262 uX += 158; 262 uX += 158;
266 for ( int i = strlen(pText) - 1; i >= 0; i-- ) 266 for ( int i = strlen(pText) - 1; i >= 0; i-- )
267 pText[i] = toupper((unsigned __int8)pText[i]); 267 pText[i] = toupper((unsigned __int8)pText[i]);
268 268
269 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType; 269 uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType;
270 pTextCenter = pFontCreate->AlignText_Center(193, pText); 270 pTextCenter = pFontCreate->AlignText_Center(193, pText);
271 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, TargetColor(0xD1, 0xBB, 0x61), pText, 0, 0, 0);//Classes 271 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, Color16(0xD1, 0xBB, 0x61), pText, 0, 0, 0);//Classes
272 272
273 pColorText = TargetColor(0, 0xF7, 0xF7); 273 pColorText = Color16(0, 0xF7, 0xF7);
274 if ( uClassType ) 274 if ( uClassType )
275 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 275 pColorText = Color16(0xFF, 0xFF, 0xFF);
276 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]); 276 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]);
277 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);
278 278
279 pColorText = TargetColor(0, 0xF7, 0xF7); 279 pColorText = Color16(0, 0xF7, 0xF7);
280 if ( uClassType != PLAYER_CLASS_PALADIN ) 280 if ( uClassType != PLAYER_CLASS_PALADIN )
281 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 281 pColorText = Color16(0xFF, 0xFF, 0xFF);
282 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]); 282 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]);
283 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);
284 284
285 pColorText = TargetColor(0, 0xF7, 0xF7); 285 pColorText = Color16(0, 0xF7, 0xF7);
286 if ( uClassType != PLAYER_CLASS_DRUID ) 286 if ( uClassType != PLAYER_CLASS_DRUID )
287 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 287 pColorText = Color16(0xFF, 0xFF, 0xFF);
288 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]); 288 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]);
289 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);
290 290
291 pColorText = TargetColor(0, 0xF7, 0xF7); 291 pColorText = Color16(0, 0xF7, 0xF7);
292 if ( uClassType != PLAYER_CLASS_CLERIC ) 292 if ( uClassType != PLAYER_CLASS_CLERIC )
293 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 293 pColorText = Color16(0xFF, 0xFF, 0xFF);
294 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]); 294 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]);
295 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);
296 296
297 pColorText = TargetColor(0, 0xF7, 0xF7); 297 pColorText = Color16(0, 0xF7, 0xF7);
298 if ( uClassType != PLAYER_CLASS_DRUID) 298 if ( uClassType != PLAYER_CLASS_DRUID)
299 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 299 pColorText = Color16(0xFF, 0xFF, 0xFF);
300 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]); 300 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]);
301 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);
302 302
303 pColorText = TargetColor(0, 0xF7, 0xF7); 303 pColorText = Color16(0, 0xF7, 0xF7);
304 if ( uClassType != PLAYER_CLASS_SORCERER ) 304 if ( uClassType != PLAYER_CLASS_SORCERER )
305 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 305 pColorText = Color16(0xFF, 0xFF, 0xFF);
306 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]); 306 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]);
307 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);
308 308
309 pColorText = TargetColor(0, 0xF7, 0xF7); 309 pColorText = Color16(0, 0xF7, 0xF7);
310 if ( uClassType != PLAYER_CLASS_ARCHER ) 310 if ( uClassType != PLAYER_CLASS_ARCHER )
311 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 311 pColorText = Color16(0xFF, 0xFF, 0xFF);
312 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]); 312 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]);
313 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);
314 314
315 pColorText = TargetColor(0, 0xF7, 0xF7); 315 pColorText = Color16(0, 0xF7, 0xF7);
316 if ( uClassType != PLAYER_CLASS_MONK ) 316 if ( uClassType != PLAYER_CLASS_MONK )
317 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 317 pColorText = Color16(0xFF, 0xFF, 0xFF);
318 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]); 318 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]);
319 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);
320 320
321 pColorText = TargetColor(0, 0xF7, 0xF7); 321 pColorText = Color16(0, 0xF7, 0xF7);
322 if ( uClassType != PLAYER_CLASS_THEIF ) 322 if ( uClassType != PLAYER_CLASS_THEIF )
323 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 323 pColorText = Color16(0xFF, 0xFF, 0xFF);
324 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]); 324 pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]);
325 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);
326 326
327 pTextCenter = pFontCreate->AlignText_Center(236, pGlobalTXT_LocalizationStrings[20]); // "Available Skills" 327 pTextCenter = pFontCreate->AlignText_Center(236, pGlobalTXT_LocalizationStrings[20]); // "Available Skills"
328 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, TargetColor(0xD1, 0xBB, 0x61), pGlobalTXT_LocalizationStrings[20], 0, 0, 0); 328 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, Color16(0xD1, 0xBB, 0x61), pGlobalTXT_LocalizationStrings[20], 0, 0, 0);
329 for (uint i = 0; i < 9; ++i) 329 for (uint i = 0; i < 9; ++i)
330 { 330 {
331 pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(i + 4); 331 pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(i + 4);
332 strcpy(pText, pSkillNames[pSkillId]); 332 strcpy(pText, pSkillNames[pSkillId]);
333 pLenText = strlen(pText); 333 pLenText = strlen(pText);
349 } 349 }
350 } 350 }
351 pCorrective = -10;//-5 351 pCorrective = -10;//-5
352 if ( (signed int)pLenText < 8 )//if ( (signed int)v124 > 2 ) 352 if ( (signed int)pLenText < 8 )//if ( (signed int)v124 > 2 )
353 pCorrective = 0; 353 pCorrective = 0;
354 pColorText = TargetColor(0, 0xF7, 0xF7); 354 pColorText = Color16(0, 0xF7, 0xF7);
355 if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] ) 355 if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] )
356 pColorText = TargetColor(0xFF, 0xFF, 0xFF); 356 pColorText = Color16(0xFF, 0xFF, 0xFF);
357 pTextCenter = pFontCreate->AlignText_Center(100, pText); 357 pTextCenter = pFontCreate->AlignText_Center(100, pText);
358 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17, pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0); 358 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17, pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0);
359 } 359 }
360 360
361 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus" 361 pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus"
362 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, TargetColor(0xD1, 0xBB, 0x61), pGlobalTXT_LocalizationStrings[30], 0, 0, 0); 362 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, Color16(0xD1, 0xBB, 0x61), pGlobalTXT_LocalizationStrings[30], 0, 0, 0);
363 pBonusNum = PlayerCreation_GetUnspentAttributePointCount(); 363 pBonusNum = PlayerCreation_GetUnspentAttributePointCount();
364 sprintf(pTmpBuf.data(), "%d", pBonusNum); 364 sprintf(pTmpBuf.data(), "%d", pBonusNum);
365 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf.data()); 365 pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf.data());
366 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, TargetColor(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0); 366 pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, Color16(0xFF, 0xFF, 0xFF), pTmpBuf.data(), 0, 0, 0);
367 if ( GameUI_Footer_TimeLeft > GetTickCount() ) 367 if ( GameUI_Footer_TimeLeft > GetTickCount() )
368 { 368 {
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." 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."
370 if ( pBonusNum < 0 ) 370 if ( pBonusNum < 0 )
371 message_window.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."