comparison UI/UIPartyCreation.cpp @ 1678:6faacde46271

DrawPopupWindow
author Ritor1
date Fri, 20 Sep 2013 17:31:37 +0600
parents a699ecd7aeb3
children 28cb79ae2f6f
comparison
equal deleted inserted replaced
1677:a699ecd7aeb3 1678:6faacde46271
382 382
383 //----- (0049695A) -------------------------------------------------------- 383 //----- (0049695A) --------------------------------------------------------
384 void PlayerCreationUI_Initialize() 384 void PlayerCreationUI_Initialize()
385 { 385 {
386 unsigned int v0; // ebx@5 386 unsigned int v0; // ebx@5
387 unsigned int v1; // eax@6
388 int v2; // ecx@6
389 //unsigned int v3; // eax@8
390 //signed int v4; // ecx@8
391 signed int uControlParam; // [sp+10h] [bp-Ch]@7 387 signed int uControlParam; // [sp+10h] [bp-Ch]@7
392 unsigned int uControlParama; // [sp+10h] [bp-Ch]@9
393 unsigned int uControlParamb; // [sp+10h] [bp-Ch]@11
394 unsigned int uControlParamc; // [sp+10h] [bp-Ch]@13
395 signed int uControlParamd; // [sp+10h] [bp-Ch]@15
396 signed int uX; // [sp+14h] [bp-8h]@5 388 signed int uX; // [sp+14h] [bp-8h]@5
397 unsigned int uXa; // [sp+14h] [bp-8h]@9
398 unsigned int uXb; // [sp+14h] [bp-8h]@11
399 unsigned int uXc; // [sp+14h] [bp-8h]@13
400 signed int uXd; // [sp+14h] [bp-8h]@16
401 389
402 pMessageQueue_50CBD0->Flush(); 390 pMessageQueue_50CBD0->Flush();
403 391
404 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); 392 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
405 ++pIcons_LOD->uTexturePacksCount; 393 ++pIcons_LOD->uTexturePacksCount;
419 pTexture_IC_KNIGHT[6] = pIcons_LOD->LoadTexturePtr("IC_CLER", TEXTURE_16BIT_PALETTE); 407 pTexture_IC_KNIGHT[6] = pIcons_LOD->LoadTexturePtr("IC_CLER", TEXTURE_16BIT_PALETTE);
420 pTexture_IC_KNIGHT[7] = pIcons_LOD->LoadTexturePtr("IC_DRUID", TEXTURE_16BIT_PALETTE); 408 pTexture_IC_KNIGHT[7] = pIcons_LOD->LoadTexturePtr("IC_DRUID", TEXTURE_16BIT_PALETTE);
421 pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE); 409 pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE);
422 pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE); 410 pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE);
423 pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE); 411 pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE);
424 for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture 412 for( uX = 0; uX < 22; ++uX ) // load PlayerPortraits texture
425 { 413 {
426 sprintf(pTmpBuf.data(), "%s01", pPlayerPortraitsNames[uX]); 414 sprintf(pTmpBuf.data(), "%s01", pPlayerPortraitsNames[uX]);
427 v1 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); 415 pPlayerPortraits[uX] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE)];
428 pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1];
429 416
430 } 417 }
431 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); 418 pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE);
432 pTexture_buttminu = pIcons_LOD->LoadTexturePtr("buttminu", TEXTURE_16BIT_PALETTE); 419 pTexture_buttminu = pIcons_LOD->LoadTexturePtr("buttminu", TEXTURE_16BIT_PALETTE);
433 pTexture_buttplus = pIcons_LOD->LoadTexturePtr("buttplus", TEXTURE_16BIT_PALETTE); 420 pTexture_buttplus = pIcons_LOD->LoadTexturePtr("buttplus", TEXTURE_16BIT_PALETTE);
442 sprintf(pTmpBuf.data(), "arrowr%d", uControlParam); 429 sprintf(pTmpBuf.data(), "arrowr%d", uControlParam);
443 pTextures_arrowr[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); 430 pTextures_arrowr[uControlParam] = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
444 } 431 }
445 while ( ++uControlParam < 20 ); 432 while ( ++uControlParam < 20 );
446 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); 433 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
447 uControlParama = 0; 434 uControlParam = 0;
448 uXa = 8; 435 uX = 8;
449 do 436 do
450 { 437 {
451 pGUIWindow_CurrentMenu->CreateButton(uXa, 120, 145, 25, 1, 0, UIMSG_PlayerCreationChangeName, uControlParama, 0, "", 0); 438 pGUIWindow_CurrentMenu->CreateButton(uX, 120, 145, 25, 1, 0, UIMSG_PlayerCreationChangeName, uControlParam, 0, "", 0);
452 uXa += 158; 439 uX += 158;
453 ++uControlParama; 440 ++uControlParam;
454 } 441 }
455 while ( (signed int)uXa < 640 ); 442 while ( (signed int)uX < 640 );
456 443
457 pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton( 10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", pTexture_presleft, 0); 444 pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton( 10, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 0, 0, "", pTexture_presleft, 0);
458 pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", pTexture_presleft, 0); 445 pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 1, 0, "", pTexture_presleft, 0);
459 pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(327, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 2, 0, "", pTexture_presleft, 0); 446 pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(327, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 2, 0, "", pTexture_presleft, 0);
460 pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(486, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 3, 0, "", pTexture_presleft, 0); 447 pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(486, 32, 11, 13, 1, 0, UIMSG_PlayerCreation_FacePrev, 3, 0, "", pTexture_presleft, 0);
469 pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton( 74, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 0, 0, "", pTexture_pressrigh, 0); 456 pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton( 74, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 0, 0, "", pTexture_pressrigh, 0);
470 pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(233, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 1, 0, "", pTexture_pressrigh, 0); 457 pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(233, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 1, 0, "", pTexture_pressrigh, 0);
471 pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", pTexture_pressrigh, 0); 458 pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 2, 0, "", pTexture_pressrigh, 0);
472 pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", pTexture_pressrigh, 0); 459 pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549, 103, 11, 13, 1, 0, UIMSG_PlayerCreation_VoiceNext, 3, 0, "", pTexture_pressrigh, 0);
473 460
474 uControlParamb = 0; 461 uControlParam = 0;
475 uXb = 8; 462 uX = 8;
476 do 463 do
477 { 464 {
478 pGUIWindow_CurrentMenu->CreateButton(uXb, 308, 150, v0, 1, 0, UIMSG_48, uControlParamb, 0, "", 0); 465 pGUIWindow_CurrentMenu->CreateButton(uX, 308, 150, v0, 1, 0, UIMSG_48, uControlParam, 0, "", 0);
479 pGUIWindow_CurrentMenu->CreateButton(uXb, v0 + 308, 150, v0, 1, 0, UIMSG_49, uControlParamb, 0, "", 0); 466 pGUIWindow_CurrentMenu->CreateButton(uX, v0 + 308, 150, v0, 1, 0, UIMSG_49, uControlParam, 0, "", 0);
480 pGUIWindow_CurrentMenu->CreateButton(uXb, 2 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveUpSkill, uControlParamb, 0, "", 0); 467 pGUIWindow_CurrentMenu->CreateButton(uX, 2 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveUpSkill, uControlParam, 0, "", 0);
481 pGUIWindow_CurrentMenu->CreateButton(uXb, 3 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveDownSkill, uControlParamb, 0, "", 0); 468 pGUIWindow_CurrentMenu->CreateButton(uX, 3 * v0 + 308, 150, v0, 1, 0, UIMSG_PlayerCreationRemoveDownSkill, uControlParam, 0, "", 0);
482 uXb += 158; 469 uX += 158;
483 ++uControlParamb; 470 ++uControlParam;
484 } 471 }
485 while ( (signed int)uXb < 640 ); 472 while ( (signed int)uX < 640 );
486 473
487 pGUIWindow_CurrentMenu->CreateButton( 5, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 0, '1', "", 0); 474 pGUIWindow_CurrentMenu->CreateButton( 5, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 0, '1', "", 0);
488 pGUIWindow_CurrentMenu->CreateButton(163, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 1, '2', "", 0); 475 pGUIWindow_CurrentMenu->CreateButton(163, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 1, '2', "", 0);
489 pGUIWindow_CurrentMenu->CreateButton(321, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 2, '3', "", 0); 476 pGUIWindow_CurrentMenu->CreateButton(321, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 2, '3', "", 0);
490 pGUIWindow_CurrentMenu->CreateButton(479, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 3, '4', "", 0); 477 pGUIWindow_CurrentMenu->CreateButton(479, 21, 153, 365, 1, 0, UIMSG_PlayerCreation_SelectAttribute, 3, '4', "", 0);
491 478
492 uXc = 23; 479 uX = 23;
493 uControlParamc = 2; 480 uControlParam = 2;
494 do 481 do
495 { 482 {
496 pGUIWindow_CurrentMenu->CreateButton(uXc, 169, 120, 20, 1, 0, UIMSG_0, uControlParamc - 2, 0, "", 0); 483 pGUIWindow_CurrentMenu->CreateButton(uX, 169, 120, 20, 1, 0, UIMSG_0, uControlParam - 2, 0, "", 0);
497 pGUIWindow_CurrentMenu->CreateButton(uXc, v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc - 1, 0, "", 0); 484 pGUIWindow_CurrentMenu->CreateButton(uX, v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam - 1, 0, "", 0);
498 pGUIWindow_CurrentMenu->CreateButton(uXc, 2 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc, 0, "", 0); 485 pGUIWindow_CurrentMenu->CreateButton(uX, 2 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam, 0, "", 0);
499 pGUIWindow_CurrentMenu->CreateButton(uXc, 3 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 1, 0, "", 0); 486 pGUIWindow_CurrentMenu->CreateButton(uX, 3 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 1, 0, "", 0);
500 pGUIWindow_CurrentMenu->CreateButton(uXc, 4 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 2, 0, "", 0); 487 pGUIWindow_CurrentMenu->CreateButton(uX, 4 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 2, 0, "", 0);
501 pGUIWindow_CurrentMenu->CreateButton(uXc, 5 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 3, 0, "", 0); 488 pGUIWindow_CurrentMenu->CreateButton(uX, 5 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 3, 0, "", 0);
502 pGUIWindow_CurrentMenu->CreateButton(uXc, 6 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParamc + 4, 0, "", 0); 489 pGUIWindow_CurrentMenu->CreateButton(uX, 6 * v0 + 169, 120, 20, 1, 0, UIMSG_0, uControlParam + 4, 0, "", 0);
503 uControlParamc += 7; 490 uControlParam += 7;
504 uXc += 158; 491 uX += 158;
505 } 492 }
506 while ( (signed int)uControlParamc < 30 ); 493 while ( (signed int)uControlParam < 30 );
507 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(28, 0, 7, 40); 494 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(28, 0, 7, 40);
508 495
509 pGUIWindow_CurrentMenu->CreateButton(323, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0, 0, "", 0); 496 pGUIWindow_CurrentMenu->CreateButton(323, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0, 0, "", 0);
510 pGUIWindow_CurrentMenu->CreateButton(323, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0xC, 0, "", 0); 497 pGUIWindow_CurrentMenu->CreateButton(323, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0xC, 0, "", 0);
511 pGUIWindow_CurrentMenu->CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x14, 0, "", 0); 498 pGUIWindow_CurrentMenu->CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x14, 0, "", 0);
514 pGUIWindow_CurrentMenu->CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x20, 0, "", 0); 501 pGUIWindow_CurrentMenu->CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x20, 0, "", 0);
515 pGUIWindow_CurrentMenu->CreateButton(453, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x10, 0, "", 0); 502 pGUIWindow_CurrentMenu->CreateButton(453, 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 0x10, 0, "", 0);
516 pGUIWindow_CurrentMenu->CreateButton(453, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 8, 0, "", 0); 503 pGUIWindow_CurrentMenu->CreateButton(453, v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 8, 0, "", 0);
517 pGUIWindow_CurrentMenu->CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 4, 0, "", 0); 504 pGUIWindow_CurrentMenu->CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, UIMSG_PlayerCreationSelectClass, 4, 0, "", 0);
518 505
519 uControlParamd = 0; 506 uControlParam = 0;
520 do 507 do
521 { 508 {
522 uXd = -5; 509 uX = -5;
523 if ( uControlParamd <= 3 ) 510 if ( uControlParam <= 3 )
524 uXd = 0; 511 uX = 0;
525 pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParamd / 3) + uXd + 17, v0 * (uControlParamd % 3) + 417, 100, v0, 1, 0, UIMSG_PlayerCreationSelectActiveSkill, 512 pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParam / 3) + uX + 17, v0 * (uControlParam % 3) + 417, 100, v0, 1, 0, UIMSG_PlayerCreationSelectActiveSkill,
526 uControlParamd, 0, "", 0); 513 uControlParam, 0, "", 0);
527 ++uControlParamd; 514 ++uControlParam;
528 } 515 }
529 while ( uControlParamd < 9 ); 516 while ( uControlParam < 9 );
530 517
531 pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, '\r', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE), 0); 518 pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickOK, 0, '\r', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE), 0);
532 pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickReset, 0, 'C', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE2), 0); 519 pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, UIMSG_PlayerCreationClickReset, 0, 'C', "", pIcons_LOD->GetTexture(uTextureID_BUTTMAKE2), 0);
533 pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickMinus, 0, '-', "", pTexture_buttminu, 0); 520 pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickMinus, 0, '-', "", pTexture_buttminu, 0);
534 pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickPlus, 1, '+', "", pTexture_buttplus, 0); 521 pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, UIMSG_PlayerCreationClickPlus, 1, '+', "", pTexture_buttplus, 0);
544 pFontCChar = 0; 531 pFontCChar = 0;
545 } 532 }
546 //----- (00497526) -------------------------------------------------------- 533 //----- (00497526) --------------------------------------------------------
547 bool PlayerCreationUI_Loop() 534 bool PlayerCreationUI_Loop()
548 { 535 {
549 //RGBTexture *pTexture; // ebx@1
550 //UINT v1; // esi@1
551 unsigned int v2; // ecx@3
552 LONG uMouseX; // edi@6 536 LONG uMouseX; // edi@6
553 LONG uMouseY; // eax@6 537 LONG uMouseY; // eax@6
554 GUIButton *pControlsHead; // edx@6 538 //GUIButton *pControlsHead; // edx@6
555 //unsigned int pNumMessage; // ecx@7 539 //int pControlParam; // esi@12
556 int pControlParam; // esi@12
557 signed int v8; // edi@30 540 signed int v8; // edi@30
558 int v9; // edx@31 541 int v9; // edx@31
559 char *v10; // ebx@37 542 char *v10; // ebx@37
560 Player *v11; // esi@38
561 //signed int uSpellBookPageCount; // ecx@40
562 int v13; // eax@40
563 //signed int uSkillIdx; // eax@45
564 int v15; // eax@70
565 signed int v16; // ecx@70
566 //unsigned int v18; // [sp-4h] [bp-84h]@48
567 ItemGen item; // [sp+Ch] [bp-74h]@37 543 ItemGen item; // [sp+Ch] [bp-74h]@37
568 char v20[32]; // [sp+30h] [bp-50h]@29 544 char v20[32]; // [sp+30h] [bp-50h]@29
569 //char v21; // [sp+31h] [bp-4Fh]@29
570 //__int16 v22; // [sp+4Dh] [bp-33h]@29
571 char v23; // [sp+4Fh] [bp-31h]@29
572 MSG Msg; // [sp+50h] [bp-30h]@17 545 MSG Msg; // [sp+50h] [bp-30h]@17
573 POINT v25; // [sp+6Ch] [bp-14h]@6 546 POINT v25; // [sp+6Ch] [bp-14h]@6
574 bool v26; // [sp+74h] [bp-Ch]@1 547 bool party_not_creation_flag; // [sp+74h] [bp-Ch]@1
575 //POINT v24; // [sp+78h] [bp-8h]@6 548
576 //Player *pPlayer; 549 party_not_creation_flag = false;
577
578 //pTexture = &pTexture_PCX;
579 v26 = 0;
580 pTexture_PCX.Release(); 550 pTexture_PCX.Release();
581 pTexture_PCX.Load("makeme.pcx", 0); 551 pTexture_PCX.Load("makeme.pcx", 0);
582 552
583 v2 = 6;
584 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; 553 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
585 //LABEL_27: 554 SetCurrentMenuID(MENU_CREATEPARTY);
586 SetCurrentMenuID((MENU_STATE)v2);
587 while ( GetCurrentMenuID() == MENU_CREATEPARTY ) 555 while ( GetCurrentMenuID() == MENU_CREATEPARTY )
588 { 556 {
589 uMouseX = pMouse->GetCursorPos(&v25)->x; 557 uMouseX = pMouse->GetCursorPos(&v25)->x;
590 uMouseY = pMouse->GetCursorPos(&v25)->y; 558 uMouseY = pMouse->GetCursorPos(&v25)->y;
591 pControlsHead = pGUIWindow_CurrentMenu->pControlsHead; 559 //pControlsHead = pGUIWindow_CurrentMenu->pControlsHead;
592 560
593 //does nothing actually 561 //does nothing actually
594 /*if ( pControlsHead != (GUIButton *)v1 ) 562 /*if ( pControlsHead != (GUIButton *)v1 )
595 { 563 {
596 pNumMessage = pMessageQueue_50CBD0->uNumMessages; 564 pNumMessage = pMessageQueue_50CBD0->uNumMessages;
627 GUI_UpdateWindows(); 595 GUI_UpdateWindows();
628 pRenderer->EndScene(); 596 pRenderer->EndScene();
629 pRenderer->Present(); 597 pRenderer->Present();
630 if ( uGameState == GAME_FINISHED )//if click Esc in PlayerCreation Window 598 if ( uGameState == GAME_FINISHED )//if click Esc in PlayerCreation Window
631 { 599 {
632 v26 = 1; 600 party_not_creation_flag = true;
633 //v2 = 0;
634 //goto LABEL_27;
635 SetCurrentMenuID(MENU_MAIN); 601 SetCurrentMenuID(MENU_MAIN);
636 continue; 602 continue;
637 } 603 }
638 if ( uGameState == GAME_STATE_STARTING_NEW_GAME )//if click OK in PlayerCreation Window 604 if ( uGameState == GAME_STATE_STARTING_NEW_GAME )//if click OK in PlayerCreation Window
639 { 605 {
640 uGameState = GAME_STATE_PLAYING; 606 uGameState = GAME_STATE_PLAYING;
641 //v2 = 1;
642 //goto LABEL_27;
643 SetCurrentMenuID(MENU_NEWGAME); 607 SetCurrentMenuID(MENU_NEWGAME);
644 continue; 608 continue;
645 } 609 }
646 } 610 }
647 } 611 }
648 pTexture_PCX.Release(); 612 pTexture_PCX.Release();
649 pGUIWindow_CurrentMenu->Release(); 613 pGUIWindow_CurrentMenu->Release();
650 pIcons_LOD->RemoveTexturesPackFromTextureList(); 614 pIcons_LOD->RemoveTexturesPackFromTextureList();
651 615
652 int v1 = 0;
653 memset(v20, 0, 32); 616 memset(v20, 0, 32);
654 do 617 for ( int i = 0; i < 32; i++ )
655 { 618 {
656 v8 = 0; 619 for ( v8 = 0; v8 < 10; ++v8 )
657 do
658 { 620 {
659 v9 = rand() % 32; 621 v9 = rand() % 32;
660 if ( !v20[v9] ) 622 if ( !v20[v9] )
661 break; 623 break;
662 ++v8; 624 }
663 }
664 while ( v8 < 10 );
665 if ( v8 == 10 ) 625 if ( v8 == 10 )
666 { 626 {
667 v9 = 0; 627 v9 = 0;
668 if ( v20[0] ) 628 if ( v20[0] )
669 { 629 {
670 do 630 do
671 ++v9; 631 ++v9;
672 while ( v20[v9] ); 632 while ( v20[v9] );
673 } 633 }
674 } 634 }
675 pParty->field_854[v1++] = v9; 635 pParty->field_854[i] = v9;
676 v20[v9] = 1; 636 v20[v9] = 1;
677 } 637 }
678 while ( (signed int)v1 < 32 ); 638
679 //v10 = (char *)&pParty->pPlayers[0].sResMagicBase;
680
681 item.Reset(); 639 item.Reset();
682 //for ( pPlayer = &pParty->pPlayers[0]; pPlayer < &pParty->pPlayers[4]; pPlayer++)
683 for (uint i = 0; i < 4; ++i) 640 for (uint i = 0; i < 4; ++i)
684 { 641 {
685 auto player = &pParty->pPlayers[i]; 642 if (pParty->pPlayers[i].classType == PLAYER_CLASS_KNIGHT)
686 //v11 = pPlayer; 643 pParty->pPlayers[i].sResMagicBase = 10;
687 if (player->classType == PLAYER_CLASS_KNIGHT) 644 pParty->pPlayers[i].pPlayerBuffs[22].uExpireTime = 0;
688 player->sResMagicBase = 10;
689 //*((short *)v10 + 400) = 0;
690 player->pPlayerBuffs[22].uExpireTime = 0;
691 for (uint j = 0; j < 9; j++) 645 for (uint j = 0; j < 9; j++)
692 { 646 {
693 if (player->pActiveSkills[PLAYER_SKILL_FIRE + j]) 647 if (pParty->pPlayers[i].pActiveSkills[PLAYER_SKILL_FIRE + j])
694 { 648 {
695 player->lastOpenedSpellbookPage = j; 649 pParty->pPlayers[i].lastOpenedSpellbookPage = j;
696 break; 650 break;
697 } 651 }
698 } 652 }
699 pItemsTable->GenerateItem(2, 40, &item); 653 pItemsTable->GenerateItem(2, 40, &item);
700 player->AddItem2(-1, &item); 654 pParty->pPlayers[i].AddItem2(-1, &item);
701 //uSkillIdx = 0; 655
702 //v24.y = 0; 656 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth();
703 657 pParty->pPlayers[i].sMana = pParty->pPlayers[i].GetMaxMana();
704 player->sHealth = player->GetMaxHealth();
705 player->sMana = player->GetMaxMana();
706 for (uint j = 0; j < 37; ++j) 658 for (uint j = 0; j < 37; ++j)
707 { 659 {
708 if (!player->pActiveSkills[j]) 660 if (!pParty->pPlayers[i].pActiveSkills[j])
709 continue; 661 continue;
710 662
711 switch (j) 663 switch (j)
712 { 664 {
713 case PLAYER_SKILL_STAFF: player->AddItem(-1, 61); break; 665 case PLAYER_SKILL_STAFF: pParty->pPlayers[i].AddItem(-1, 61); break;
714 case PLAYER_SKILL_SWORD: player->AddItem(-1, 1); break; 666 case PLAYER_SKILL_SWORD: pParty->pPlayers[i].AddItem(-1, 1); break;
715 case PLAYER_SKILL_DAGGER: player->AddItem(-1, 15); break; 667 case PLAYER_SKILL_DAGGER: pParty->pPlayers[i].AddItem(-1, 15); break;
716 case PLAYER_SKILL_AXE: player->AddItem(-1, 23); break; 668 case PLAYER_SKILL_AXE: pParty->pPlayers[i].AddItem(-1, 23); break;
717 case PLAYER_SKILL_SPEAR: player->AddItem(-1, 31); break; 669 case PLAYER_SKILL_SPEAR: pParty->pPlayers[i].AddItem(-1, 31); break;
718 case PLAYER_SKILL_BOW: player->AddItem(-1, 47); break; 670 case PLAYER_SKILL_BOW: pParty->pPlayers[i].AddItem(-1, 47); break;
719 case PLAYER_SKILL_MACE: player->AddItem(-1, 50); break; 671 case PLAYER_SKILL_MACE: pParty->pPlayers[i].AddItem(-1, 50); break;
720 case PLAYER_SKILL_BLASTER: Error("No blasters at startup :p"); 672 case PLAYER_SKILL_BLASTER: Error("No blasters at startup :p");
721 case PLAYER_SKILL_SHIELD: player->AddItem(-1, 84); break; 673 case PLAYER_SKILL_SHIELD: pParty->pPlayers[i].AddItem(-1, 84); break;
722 case PLAYER_SKILL_LEATHER: player->AddItem(-1, 66); break; 674 case PLAYER_SKILL_LEATHER: pParty->pPlayers[i].AddItem(-1, 66); break;
723 case PLAYER_SKILL_CHAIN: player->AddItem(-1, 71); break; 675 case PLAYER_SKILL_CHAIN: pParty->pPlayers[i].AddItem(-1, 71); break;
724 case PLAYER_SKILL_PLATE: player->AddItem(-1, 76); break; 676 case PLAYER_SKILL_PLATE: pParty->pPlayers[i].AddItem(-1, 76); break;
725 case PLAYER_SKILL_FIRE: 677 case PLAYER_SKILL_FIRE:
726 player->AddItem(-1, 0x191); 678 pParty->pPlayers[i].AddItem(-1, 0x191);
727 player->spellbook.pFireSpellbook.bIsSpellAvailable[0] = true; 679 pParty->pPlayers[i].spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;
728 break; 680 break;
729 case PLAYER_SKILL_AIR: 681 case PLAYER_SKILL_AIR:
730 player->AddItem(-1, 0x19C); 682 pParty->pPlayers[i].AddItem(-1, 0x19C);
731 player->spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; 683 pParty->pPlayers[i].spellbook.pAirSpellbook.bIsSpellAvailable[0] = true;
732 break; 684 break;
733 case PLAYER_SKILL_WATER: 685 case PLAYER_SKILL_WATER:
734 player->AddItem(-1, 0x1A7); 686 pParty->pPlayers[i].AddItem(-1, 0x1A7);
735 player->spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; 687 pParty->pPlayers[i].spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true;
736 break; 688 break;
737 case PLAYER_SKILL_EARTH: 689 case PLAYER_SKILL_EARTH:
738 player->AddItem(-1, 0x1B2); 690 pParty->pPlayers[i].AddItem(-1, 0x1B2);
739 player->spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; 691 pParty->pPlayers[i].spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true;
740 break; 692 break;
741 case PLAYER_SKILL_SPIRIT: 693 case PLAYER_SKILL_SPIRIT:
742 player->AddItem(-1, 0x1BD); 694 pParty->pPlayers[i].AddItem(-1, 0x1BD);
743 player->spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; 695 pParty->pPlayers[i].spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true;
744 break; 696 break;
745 case PLAYER_SKILL_MIND: 697 case PLAYER_SKILL_MIND:
746 player->AddItem(-1, 0x1C8); 698 pParty->pPlayers[i].AddItem(-1, 0x1C8);
747 player->spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; 699 pParty->pPlayers[i].spellbook.pMindSpellbook.bIsSpellAvailable[0] = true;
748 break; 700 break;
749 case PLAYER_SKILL_BODY: 701 case PLAYER_SKILL_BODY:
750 player->AddItem(-1, 0x1D3); 702 pParty->pPlayers[i].AddItem(-1, 0x1D3);
751 player->spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; 703 pParty->pPlayers[i].spellbook.pBodySpellbook.bIsSpellAvailable[0] = true;
752 break; 704 break;
753 case PLAYER_SKILL_LIGHT: 705 case PLAYER_SKILL_LIGHT:
754 case PLAYER_SKILL_DARK: 706 case PLAYER_SKILL_DARK:
755 case PLAYER_SKILL_DIPLOMACY: 707 case PLAYER_SKILL_DIPLOMACY:
756 Error("No dimoplacy in mm7 (yet)"); 708 Error("No dimoplacy in mm7 (yet)");
759 case PLAYER_SKILL_REPAIR: 711 case PLAYER_SKILL_REPAIR:
760 case PLAYER_SKILL_MEDITATION: 712 case PLAYER_SKILL_MEDITATION:
761 case PLAYER_SKILL_PERCEPTION: 713 case PLAYER_SKILL_PERCEPTION:
762 case PLAYER_SKILL_TRAP_DISARM: 714 case PLAYER_SKILL_TRAP_DISARM:
763 case PLAYER_SKILL_LEARNING: 715 case PLAYER_SKILL_LEARNING:
764 player->AddItem(-1, 0xDC); 716 pParty->pPlayers[i].AddItem(-1, 0xDC);
765 player->AddItem(-1, 5 * (rand() % 3 + 40)); 717 pParty->pPlayers[i].AddItem(-1, 5 * (rand() % 3 + 40));
766 break; 718 break;
767 case PLAYER_SKILL_DODGE: player->AddItem(-1, 115); break; 719 case PLAYER_SKILL_DODGE: pParty->pPlayers[i].AddItem(-1, 115); break;
768 case PLAYER_SKILL_UNARMED: player->AddItem(-1, 110); break; 720 case PLAYER_SKILL_UNARMED: pParty->pPlayers[i].AddItem(-1, 110); break;
769 default: 721 default:
770 break; 722 break;
771 } 723 }
772 724
773 for (uint k = 0; k < 138; k++) 725 for (uint k = 0; k < 138; k++)
774 { 726 {
775 if (player->pOwnItems[k].uItemID) 727 if (pParty->pPlayers[i].pOwnItems[k].uItemID)
776 player->pOwnItems[k].SetIdentified(); 728 pParty->pPlayers[i].pOwnItems[k].SetIdentified();
777 } 729 }
778 } 730 }
779 } 731 }
780 732
781 pAudioPlayer->StopChannels(-1, -1); 733 pAudioPlayer->StopChannels(-1, -1);
782 return v26; 734 return party_not_creation_flag;
783 } 735 }