Mercurial > might-and-magic-trilogy
comparison mm7_5.cpp @ 60:30ec77bbd018
Merge
author | Nomad |
---|---|
date | Fri, 26 Oct 2012 02:42:38 +0200 |
parents | 5159d2e6f559 6b3a5283b107 |
children | 476145dc3441 |
comparison
equal
deleted
inserted
replaced
59:5159d2e6f559 | 60:30ec77bbd018 |
---|---|
2669 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; | 2669 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; |
2670 goto _continue; | 2670 goto _continue; |
2671 case 0x4E: | 2671 case 0x4E: |
2672 if ( dword_50654C && byte_506550 ) | 2672 if ( dword_50654C && byte_506550 ) |
2673 { | 2673 { |
2674 v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->field_1A4E].pName; | 2674 v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage].pName; |
2675 v157 = pGlobalTXT_LocalizationStrings[483]; | 2675 v157 = pGlobalTXT_LocalizationStrings[483]; |
2676 _sprintex_2args_draw_status_and_continue: | 2676 _sprintex_2args_draw_status_and_continue: |
2677 sprintf(pTmpBuf, v157, v173); | 2677 sprintf(pTmpBuf, v157, v173); |
2678 } | 2678 } |
2679 else | 2679 else |
2725 v130 = 0; | 2725 v130 = 0; |
2726 dword_50654C = 0; | 2726 dword_50654C = 0; |
2727 v127 = 203; | 2727 v127 = 203; |
2728 goto _play_sound_and_continue; | 2728 goto _play_sound_and_continue; |
2729 } | 2729 } |
2730 v99 = dword_50654C + 11 * pPlayers[uActiveCharacter]->field_1A4E; | 2730 v99 = dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage; |
2731 pPlayers[uActiveCharacter]->uQuickSpell = v99; | 2731 pPlayers[uActiveCharacter]->uQuickSpell = v99; |
2732 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter); | 2732 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter); |
2733 if ( uActiveCharacter ) | 2733 if ( uActiveCharacter ) |
2734 thisk->PlaySound(12, 0); | 2734 thisk->PlaySound(12, 0); |
2735 byte_506550 = 0; | 2735 byte_506550 = 0; |
2744 thisl = (int)&v100->pActiveSkills[12]; | 2744 thisl = (int)&v100->pActiveSkills[12]; |
2745 do | 2745 do |
2746 { | 2746 { |
2747 if ( *(short *)thisl ) | 2747 if ( *(short *)thisl ) |
2748 { | 2748 { |
2749 if ( v100->field_1A4E == v101 ) | 2749 if ( v100->pNumSpellBookPage == v101 ) |
2750 uAction = (int)v195; | 2750 uAction = (int)v195; |
2751 v102 = (int)v195; | 2751 v102 = (int)v195; |
2752 v195 = (NPCData *)((char *)v195 + 1); | 2752 v195 = (NPCData *)((char *)v195 + 1); |
2753 v217[v102] = v101; | 2753 v217[v102] = v101; |
2754 } | 2754 } |
2769 ++uAction; | 2769 ++uAction; |
2770 if ( uAction >= (signed int)v195 ) | 2770 if ( uAction >= (signed int)v195 ) |
2771 uAction = 0; | 2771 uAction = 0; |
2772 } | 2772 } |
2773 sub_41140B(); | 2773 sub_41140B(); |
2774 pPlayers[uActiveCharacter]->field_1A4E = LOBYTE(v217[uAction]); | 2774 pPlayers[uActiveCharacter]->pNumSpellBookPage = LOBYTE(v217[uAction]); |
2775 goto LABEL_661; | 2775 goto LABEL_661; |
2776 case UIMSG_SaveGame|0x4: | 2776 case UIMSG_SaveGame|0x4: |
2777 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->field_1A4E ) | 2777 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->pNumSpellBookPage ) |
2778 goto _continue; | 2778 goto _continue; |
2779 sub_41140B(); | 2779 sub_41140B(); |
2780 pPlayers[uActiveCharacter]->field_1A4E = uMessageParam; | 2780 pPlayers[uActiveCharacter]->pNumSpellBookPage = uMessageParam; |
2781 LABEL_661: | 2781 LABEL_661: |
2782 pGUIWindow_CurrentMenu->_411621(); | 2782 pGUIWindow_CurrentMenu->_411621(); |
2783 LABEL_662: | 2783 LABEL_662: |
2784 v165 = 0; | 2784 v165 = 0; |
2785 v151 = 0; | 2785 v151 = 0; |
3415 signed int v40; // [sp-10h] [bp-20h]@15 | 3415 signed int v40; // [sp-10h] [bp-20h]@15 |
3416 signed int v41; // [sp-10h] [bp-20h]@29 | 3416 signed int v41; // [sp-10h] [bp-20h]@29 |
3417 int v42; // [sp-10h] [bp-20h]@36 | 3417 int v42; // [sp-10h] [bp-20h]@36 |
3418 int v43; // [sp-10h] [bp-20h]@56 | 3418 int v43; // [sp-10h] [bp-20h]@56 |
3419 int uNum; // [sp+4h] [bp-Ch]@3 | 3419 int uNum; // [sp+4h] [bp-Ch]@3 |
3420 UIMessageType v45; // [sp+8h] [bp-8h]@3 | 3420 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 |
3421 int v46; // [sp+Ch] [bp-4h]@3 | 3421 int v46; // [sp+Ch] [bp-4h]@3 |
3422 Player *pPlayer; | 3422 Player *pPlayer; |
3423 | 3423 |
3424 if ( pMessageQueue_50CBD0->uNumMessages ) | 3424 if ( pMessageQueue_50CBD0->uNumMessages ) |
3425 { | 3425 { |
3426 //v0 = pAudioPlayer; | 3426 //v0 = pAudioPlayer; |
3427 v1 = (char *)pParty->pPlayers; | 3427 v1 = (char *)pParty->pPlayers; |
3428 pPlayer = pParty->pPlayers; | 3428 pPlayer = pParty->pPlayers; |
3429 do | 3429 do |
3430 { | 3430 { |
3431 pMessageQueue_50CBD0->PopMessage(&v45, &uNum, &v46); | 3431 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &v46); |
3432 switch (v45) | 3432 switch (pUIMessageType) |
3433 { | 3433 { |
3434 case UIMSG_MainMenu_ShowPartyCreationWnd: | 3434 case UIMSG_MainMenu_ShowPartyCreationWnd: |
3435 { | 3435 { |
3436 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); | 3436 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); |
3437 SetCurrentMenuID(MENU_NEWGAME); | 3437 SetCurrentMenuID(MENU_NEWGAME); |
3468 } | 3468 } |
3469 continue; | 3469 continue; |
3470 } | 3470 } |
3471 | 3471 |
3472 | 3472 |
3473 switch (v45) | 3473 switch (pUIMessageType) |
3474 { | 3474 { |
3475 case UIMSG_A5: // WINDOW_5A | 3475 case UIMSG_A5: // WINDOW_5A |
3476 { | 3476 { |
3477 //main menu save/load wnd clicking on savegame lines | 3477 //main menu save/load wnd clicking on savegame lines |
3478 if (pGUIWindow_CurrentMenu->field_40 == 1) | 3478 if (pGUIWindow_CurrentMenu->field_40 == 1) |
3479 pKeyActionMap->_459ED1(0); | 3479 pKeyActionMap->_459ED1(0); |
3480 if ( pCurrentScreen != 11 | 3480 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + dword_6A0C9C ) |
3481 || uLoadGameUI_SelectedSlot != uNum + dword_6A0C9C ) | |
3482 { | 3481 { |
3483 //load clicked line | 3482 //load clicked line |
3484 v26 = uNum + dword_6A0C9C; | 3483 v26 = uNum + dword_6A0C9C; |
3485 if ( dword_6BE138 == uNum + dword_6A0C9C ) | 3484 if ( dword_6BE138 == uNum + dword_6A0C9C ) |
3486 { | 3485 { |
3503 continue; | 3502 continue; |
3504 | 3503 |
3505 | 3504 |
3506 case UIMSG_A4: | 3505 case UIMSG_A4: |
3507 { | 3506 { |
3508 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, | 3507 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, |
3509 pGUIWindow_CurrentMenu->uFrameY + 302, | |
3510 61, 28, WINDOW_5E, (int)ptr_69BD64, 0); | 3508 61, 28, WINDOW_5E, (int)ptr_69BD64, 0); |
3511 } | 3509 } |
3512 continue; | 3510 continue; |
3513 } | 3511 } |
3514 | 3512 |
3515 if ( (signed int)v45 > 75 ) | 3513 if ( (signed int)pUIMessageType > 75 ) |
3516 { | 3514 { |
3517 if ( v45 > UIMSG_A3 ) | 3515 if ( pUIMessageType > UIMSG_A3 ) |
3518 { | 3516 { |
3519 if ( v45 == UIMSG_A6 ) | 3517 if ( pUIMessageType == UIMSG_A6 ) |
3520 { | 3518 { |
3521 v43 = 0; | 3519 v43 = 0; |
3522 v39 = (int)ptr_69BD60; | 3520 v39 = (int)ptr_69BD60; |
3523 v8 = pGUIWindow_CurrentMenu->uFrameY + 302; | 3521 v8 = pGUIWindow_CurrentMenu->uFrameY + 302; |
3524 v37 = (WindowType)95; | 3522 v37 = (WindowType)95; |
3526 v35 = 28; | 3524 v35 = 28; |
3527 v33 = 61; | 3525 v33 = 61; |
3528 GUIWindow::Create(v18, v8, v33, v35, v37, v39, v43); | 3526 GUIWindow::Create(v18, v8, v33, v35, v37, v39, v43); |
3529 continue; | 3527 continue; |
3530 } | 3528 } |
3531 if ( v45 == UIMSG_AB ) // sellect face -1 | 3529 if ( pUIMessageType == UIMSG_SelectFacePlayerBack ) |
3532 { | 3530 { |
3533 pPlayer = &pParty->pPlayers[uNum]; | 3531 pPlayer = &pParty->pPlayers[uNum]; |
3534 v12 = (char)((int)pPlayer->uFace - 1) < 0; | 3532 v12 = (char)((int)pPlayer->uFace - 1) < 0; |
3535 --pPlayer->uFace; | 3533 --pPlayer->uFace; |
3536 if ( v12 ) | 3534 if ( v12 ) |
3538 pPlayer->uVoiceID = pPlayer->uFace; | 3536 pPlayer->uVoiceID = pPlayer->uFace; |
3539 pPlayer->SetInitialStats(); | 3537 pPlayer->SetInitialStats(); |
3540 pPlayer->SetSexByVoice(); | 3538 pPlayer->SetSexByVoice(); |
3541 pPlayer->RandomizeName(); | 3539 pPlayer->RandomizeName(); |
3542 v25 = uNum; | 3540 v25 = uNum; |
3543 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem | 3541 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3544 - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3542 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; |
3545 % 7 | |
3546 + pGUIWindow_CurrentMenu->pStartingPosActiveItem | |
3547 + 7 * uNum; | |
3548 uPlayerCreationUI_SelectedCharacter = v25; | 3543 uPlayerCreationUI_SelectedCharacter = v25; |
3549 GUIWindow::Create( | 3544 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, |
3550 pCreationUI_BtnPressLeft[v25]->uX, | 3545 (enum WindowType)92, (int)pCreationUI_BtnPressLeft[v25], 1); |
3551 pCreationUI_BtnPressLeft[v25]->uY, | |
3552 0, | |
3553 0, | |
3554 (enum WindowType)92, | |
3555 (int)pCreationUI_BtnPressLeft[v25], | |
3556 1); | |
3557 //v0 = pAudioPlayer; | 3546 //v0 = pAudioPlayer; |
3558 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0); | 3547 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0); |
3559 v22 = pPlayer; | 3548 v22 = pPlayer; |
3560 goto LABEL_117; | 3549 v22->PlaySound(102, 0); |
3561 } | 3550 v1 = (char *)pParty->pPlayers; |
3562 if ( v45 == UIMSG_AC ) //sellect face +1 | 3551 continue; |
3552 } | |
3553 if ( pUIMessageType == UIMSG_SelectFacePlayerForward ) | |
3563 { | 3554 { |
3564 pPlayer = &pParty->pPlayers[uNum]; | 3555 pPlayer = &pParty->pPlayers[uNum]; |
3565 v20 = (char)((int)pPlayer->uFace + 1) % 20; | 3556 v20 = (char)((int)pPlayer->uFace + 1) % 20; |
3566 pPlayer->uFace = v20; | 3557 pPlayer->uFace = v20; |
3567 pPlayer->uVoiceID = v20; | 3558 pPlayer->uVoiceID = v20; |
3568 pPlayer->SetInitialStats(); | 3559 pPlayer->SetInitialStats(); |
3569 pPlayer->SetSexByVoice(); | 3560 pPlayer->SetSexByVoice(); |
3570 pPlayer->RandomizeName(); | 3561 pPlayer->RandomizeName(); |
3571 v21 = uNum; | 3562 v21 = uNum; |
3572 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem | 3563 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3573 - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3564 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; |
3574 % 7 | |
3575 + pGUIWindow_CurrentMenu->pStartingPosActiveItem | |
3576 + 7 * uNum; | |
3577 uPlayerCreationUI_SelectedCharacter = v21; | 3565 uPlayerCreationUI_SelectedCharacter = v21; |
3578 GUIWindow::Create( | 3566 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, (enum WindowType)92, |
3579 pCreationUI_BtnPressRight[v21]->uX, | 3567 (int)pCreationUI_BtnPressRight[v21], 1); |
3580 pCreationUI_BtnPressRight[v21]->uY, | |
3581 0, | |
3582 0, | |
3583 (enum WindowType)92, | |
3584 (int)pCreationUI_BtnPressRight[v21], | |
3585 1); | |
3586 //v0 = pAudioPlayer; | 3568 //v0 = pAudioPlayer; |
3587 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); | 3569 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); |
3588 v22 = pPlayer; | 3570 v22 = pPlayer; |
3589 LABEL_117: | |
3590 v22->PlaySound(102, 0); | 3571 v22->PlaySound(102, 0); |
3591 v1 = (char *)pParty->pPlayers; | 3572 v1 = (char *)pParty->pPlayers; |
3592 continue; | 3573 continue; |
3593 } | 3574 } |
3594 if ( v45 == UIMSG_AD ) | 3575 if ( pUIMessageType == UIMSG_AD ) |
3595 { | 3576 { |
3596 GUIWindow::Create( | 3577 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0); |
3597 pMainMenu_BtnNew->uX, | |
3598 pMainMenu_BtnNew->uY, | |
3599 0, | |
3600 0, | |
3601 (enum WindowType)90, | |
3602 (int)pMainMenu_BtnNew, | |
3603 0); | |
3604 SetCurrentMenuID(MENU_LOAD); | 3578 SetCurrentMenuID(MENU_LOAD); |
3605 continue; | 3579 continue; |
3606 } | 3580 } |
3607 if ( v45 != 174 ) | 3581 if ( pUIMessageType != UIMSG_AE ) |
3608 continue; | 3582 continue; |
3609 GUIWindow::Create( | 3583 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0); |
3610 pMainMenu_BtnExit->uX, | |
3611 pMainMenu_BtnExit->uY, | |
3612 0, | |
3613 0, | |
3614 (enum WindowType)90, | |
3615 (int)pMainMenu_BtnExit, | |
3616 0); | |
3617 LABEL_114: | 3584 LABEL_114: |
3618 v40 = 10; | 3585 v40 = 10; |
3619 LABEL_89: | 3586 LABEL_89: |
3620 v2 = v40; | 3587 v2 = v40; |
3621 LABEL_90: | |
3622 SetCurrentMenuID((MENU_STATE)v2); | 3588 SetCurrentMenuID((MENU_STATE)v2); |
3623 continue; | 3589 continue; |
3624 } | 3590 } |
3625 if ( v45 == UIMSG_A3 ) | 3591 if ( pUIMessageType == UIMSG_A3 ) |
3626 { | 3592 { |
3627 ++dword_6A0C9C; | 3593 ++dword_6A0C9C; |
3628 if ( dword_6A0C9C >= uNum ) | 3594 if ( dword_6A0C9C >= uNum ) |
3629 dword_6A0C9C = uNum - 1; | 3595 dword_6A0C9C = uNum - 1; |
3630 if ( dword_6A0C9C < 1 ) | 3596 if ( dword_6A0C9C < 1 ) |
3633 v43 = 0; | 3599 v43 = 0; |
3634 v39 = (int)ptr_69BD58; | 3600 v39 = (int)ptr_69BD58; |
3635 v8 = pGUIWindow_CurrentMenu->uFrameY + 323; | 3601 v8 = pGUIWindow_CurrentMenu->uFrameY + 323; |
3636 goto LABEL_105; | 3602 goto LABEL_105; |
3637 } | 3603 } |
3638 if ( v45 == 107 ) | 3604 if ( pUIMessageType == UIMSG_6B ) |
3639 { | 3605 { |
3640 if ( pCurrentScreen ) | 3606 if ( pCurrentScreen ) |
3641 { | 3607 { |
3642 pGUIWindow_CurrentMenu->Release(); | 3608 pGUIWindow_CurrentMenu->Release(); |
3643 pEventTimer->Resume(); | 3609 pEventTimer->Resume(); |
3648 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 3614 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
3649 continue; | 3615 continue; |
3650 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 3616 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; |
3651 goto LABEL_93; | 3617 goto LABEL_93; |
3652 } | 3618 } |
3653 if ( v45 == UIMSG_CloseBook ) | 3619 if ( pUIMessageType == UIMSG_CloseBook ) |
3654 { | 3620 { |
3655 if ( ptr_507BDC ) | 3621 if ( ptr_507BDC ) |
3656 { | 3622 { |
3657 sub_41426F(); | 3623 sub_41426F(); |
3658 continue; | 3624 continue; |
3690 } | 3656 } |
3691 continue; | 3657 continue; |
3692 } | 3658 } |
3693 v16 = GetCurrentMenuID() == 8; | 3659 v16 = GetCurrentMenuID() == 8; |
3694 v17 = pCurrentScreen; | 3660 v17 = pCurrentScreen; |
3695 if ( v16 | 3661 if ( v16 && !pCurrentScreen ) |
3696 && !pCurrentScreen ) | |
3697 goto LABEL_83; | 3662 goto LABEL_83; |
3698 if ( pCurrentScreen == 12 ) | 3663 if ( pCurrentScreen == 12 ) |
3699 { | 3664 { |
3700 pIcons_LOD->_4114F2(); | 3665 pIcons_LOD->_4114F2(); |
3701 //crt_deconstruct_ptr_6A0118(); | 3666 //crt_deconstruct_ptr_6A0118(); |
3723 //VideoPlayer::dtor(); | 3688 //VideoPlayer::dtor(); |
3724 } | 3689 } |
3725 } | 3690 } |
3726 else | 3691 else |
3727 { | 3692 { |
3728 if ( v45 == 118 ) | 3693 if ( pUIMessageType == UIMSG_PlayerCreationSelectQuality ) |
3729 { | 3694 { |
3730 v14 = uNum; | 3695 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3731 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem | 3696 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; |
3732 - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3697 uPlayerCreationUI_SelectedCharacter = uNum; |
3733 % 7 | |
3734 + pGUIWindow_CurrentMenu->pStartingPosActiveItem | |
3735 + 7 * uNum; | |
3736 uPlayerCreationUI_SelectedCharacter = v14; | |
3737 LABEL_36: | 3698 LABEL_36: |
3738 v42 = 0; | 3699 v42 = 0; |
3739 v38 = 0; | 3700 v38 = 0; |
3740 v36 = 0; | 3701 v36 = 0; |
3741 v34 = 0; | 3702 v34 = 0; |
3745 pSoundID = (SoundID)66; | 3706 pSoundID = (SoundID)66; |
3746 LABEL_40: | 3707 LABEL_40: |
3747 pAudioPlayer->PlaySound(pSoundID, v30, v31, v32, v34, v36, v38, v42); | 3708 pAudioPlayer->PlaySound(pSoundID, v30, v31, v32, v34, v36, v38, v42); |
3748 continue; | 3709 continue; |
3749 } | 3710 } |
3750 if ( v45 == 144 ) | 3711 if ( pUIMessageType == UIMSG_PlayerCreationVoiceBack ) |
3751 { | 3712 { |
3752 v9 = &pPlayer[uNum]; | 3713 v9 = &pPlayer[uNum]; |
3753 v46 = v9->GetSexByVoice(); | 3714 v46 = v9->GetSexByVoice(); |
3754 do | 3715 do |
3755 { | 3716 { |
3760 } | 3721 } |
3761 while ( v13 != v46 ); | 3722 while ( v13 != v46 ); |
3762 v11 = pCreationUI_BtnPressLeft2[uNum]; | 3723 v11 = pCreationUI_BtnPressLeft2[uNum]; |
3763 goto LABEL_60; | 3724 goto LABEL_60; |
3764 } | 3725 } |
3765 if ( v45 == 145 ) | 3726 if ( pUIMessageType == UIMSG_PlayerCreationVoiceForward ) |
3766 { | 3727 { |
3767 v9 = &pPlayer[uNum]; | 3728 v9 = &pPlayer[uNum]; |
3768 v46 = v9->GetSexByVoice(); | 3729 v46 = v9->GetSexByVoice(); |
3769 do | 3730 do |
3770 { | 3731 { |
3777 GUIWindow::Create(v11->uX, v11->uY, 0, 0, (enum WindowType)92, (int)v11, 1); | 3738 GUIWindow::Create(v11->uX, v11->uY, 0, 0, (enum WindowType)92, (int)v11, 1); |
3778 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); | 3739 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); |
3779 v9->PlaySound(102, 0); | 3740 v9->PlaySound(102, 0); |
3780 continue; | 3741 continue; |
3781 } | 3742 } |
3782 if ( v45 == UIMSG_A2 ) | 3743 if ( pUIMessageType == UIMSG_A2 ) |
3783 { | 3744 { |
3784 --dword_6A0C9C; | 3745 --dword_6A0C9C; |
3785 if ( dword_6A0C9C < 0 ) | 3746 if ( dword_6A0C9C < 0 ) |
3786 dword_6A0C9C = 0; | 3747 dword_6A0C9C = 0; |
3787 v7 = pGUIWindow_CurrentMenu; | 3748 v7 = pGUIWindow_CurrentMenu; |
3788 v43 = 0; | 3749 v43 = 0; |
3789 v39 = (int)ptr_69BD5C; | 3750 v39 = (int)ptr_69BD5C; |
3790 v8 = pGUIWindow_CurrentMenu->uFrameY + 197; | 3751 v8 = pGUIWindow_CurrentMenu->uFrameY + 197; |
3791 LABEL_105: | 3752 LABEL_105: |
3792 v37 = (WindowType)90; | 3753 GUIWindow::Create(v7->uFrameX + 215, v8, 0, 0, (WindowType)90, v39, v43); |
3793 v35 = 0; | |
3794 v33 = 0; | |
3795 v18 = v7->uFrameX + 215; | |
3796 GUIWindow::Create(v18, v8, v33, v35, v37, v39, v43); | |
3797 continue; | 3754 continue; |
3798 } | 3755 } |
3799 } | 3756 } |
3800 } | 3757 } |
3801 else | 3758 else |
3802 { | 3759 { |
3803 if ( v45 == 75 ) | 3760 if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill ) |
3804 { | 3761 { |
3805 uPlayerCreationUI_SelectedCharacter = uNum; | 3762 uPlayerCreationUI_SelectedCharacter = uNum; |
3806 v41 = 3; | 3763 v41 = 3; |
3807 v1 = (char *)pParty->pPlayers; | 3764 v1 = (char *)pParty->pPlayers; |
3808 v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 | 3765 v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 |
3809 + pGUIWindow_CurrentMenu->pStartingPosActiveItem | 3766 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; |
3810 + 7 * uNum; | |
3811 goto LABEL_44; | 3767 goto LABEL_44; |
3812 } | 3768 } |
3813 if ( (signed int)v45 > 60 ) | 3769 if ( (signed int)pUIMessageType > UIMSG_3C ) |
3814 { | 3770 { |
3815 if ( v45 == 62 ) //click + | 3771 if ( pUIMessageType == UIMSG_PlayerCreationClickPlus ) |
3816 { | 3772 { |
3817 GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1); | 3773 GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1); |
3818 (&pPlayer[uPlayerCreationUI_SelectedCharacter])->IncreaseAttribute( | 3774 (&pPlayer[uPlayerCreationUI_SelectedCharacter])->IncreaseAttribute( |
3819 (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | 3775 (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); |
3820 v42 = 0; | 3776 v42 = 0; |
3825 v31 = 0; | 3781 v31 = 0; |
3826 v30 = 0; | 3782 v30 = 0; |
3827 pSoundID = (SoundID)20; | 3783 pSoundID = (SoundID)20; |
3828 goto LABEL_40; | 3784 goto LABEL_40; |
3829 } | 3785 } |
3830 if ( v45 == 63 ) // click - | 3786 if ( pUIMessageType == UIMSG_PlayerCreationClickMinus ) |
3831 { | 3787 { |
3832 GUIWindow::Create(523, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnMinus, 1); | 3788 GUIWindow::Create(523, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnMinus, 1); |
3833 (&pPlayer[uPlayerCreationUI_SelectedCharacter])->DecreaseAttribute( | 3789 (&pPlayer[uPlayerCreationUI_SelectedCharacter])->DecreaseAttribute( |
3834 (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | 3790 (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); |
3835 v42 = 0; | 3791 v42 = 0; |
3840 v31 = 0; | 3796 v31 = 0; |
3841 v30 = 0; | 3797 v30 = 0; |
3842 pSoundID = (SoundID)23; | 3798 pSoundID = (SoundID)23; |
3843 goto LABEL_40; | 3799 goto LABEL_40; |
3844 } | 3800 } |
3845 if ( v45 == 64 ) // sellect active skill | 3801 if ( pUIMessageType == UIMSG_PlayerCreationSelectActiveSkill ) |
3846 { | 3802 { |
3847 auto _t = &pPlayer[uPlayerCreationUI_SelectedCharacter]; | 3803 auto _t = &pPlayer[uPlayerCreationUI_SelectedCharacter]; |
3848 v6 = _t->GetSkillIdxByOrder(uNum + 4); | 3804 v6 = _t->GetSkillIdxByOrder(uNum + 4); |
3849 if ( _t->GetSkillIdxByOrder(3) == 37 ) | 3805 if ( _t->GetSkillIdxByOrder(3) == 37 ) |
3850 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; | 3806 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; |
3856 v31 = 0; | 3812 v31 = 0; |
3857 v30 = 0; | 3813 v30 = 0; |
3858 pSoundID = (SoundID)24; | 3814 pSoundID = (SoundID)24; |
3859 goto LABEL_40; | 3815 goto LABEL_40; |
3860 } | 3816 } |
3861 if ( v45 == 65 ) | 3817 if ( pUIMessageType == UIMSG_41 ) |
3862 { | 3818 { |
3863 (&pPlayer[uPlayerCreationUI_SelectedCharacter])->Reset(0); | 3819 (&pPlayer[uPlayerCreationUI_SelectedCharacter])->Reset(0); |
3864 goto LABEL_36; | 3820 goto LABEL_36; |
3865 } | 3821 } |
3866 if ( v45 == 66 ) // click ok | 3822 if ( pUIMessageType == UIMSG_PlayerCreationClickOK ) |
3867 { | 3823 { |
3868 GUIWindow::Create(0x244u, 0x1AFu, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); | 3824 GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); |
3869 if ( PlayerCreation_ComputeAttributeBonus() || !sub_4908DE() ) | 3825 if ( PlayerCreation_ComputeAttributeBonus() || !sub_4908DE() ) |
3870 GameUI_StatusBar_TimedStringTimeLeft = GetTickCount() + 4000; | 3826 GameUI_StatusBar_TimedStringTimeLeft = GetTickCount() + 4000; |
3871 else | 3827 else |
3872 uGameState = 6; | 3828 uGameState = 6; |
3873 continue; | 3829 continue; |
3874 } | 3830 } |
3875 if ( v45 == 67 ) // click reset | 3831 if ( pUIMessageType == UIMSG_PlayerCreationClickReset ) |
3876 { | 3832 { |
3877 GUIWindow::Create(0x20Fu, 0x1AFu, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnReset, 0); | 3833 GUIWindow::Create(527, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnReset, 0); |
3878 pParty->Reset(); | 3834 pParty->Reset(); |
3879 } | 3835 } |
3880 else | 3836 else |
3881 { | 3837 { |
3882 if ( v45 == 74 ) | 3838 if ( pUIMessageType == UIMSG_PlayerCreationRemoveUpSkill ) |
3883 { | 3839 { |
3884 uPlayerCreationUI_SelectedCharacter = uNum; | 3840 uPlayerCreationUI_SelectedCharacter = uNum; |
3885 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | 3841 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; |
3886 v46 = pGUIWindow_CurrentMenu->pStartingPosActiveItem; | 3842 v46 = pGUIWindow_CurrentMenu->pStartingPosActiveItem; |
3887 v41 = 2; | 3843 v41 = 2; |
3888 v5 = (v4 % 7) + v46 + 7 * uNum; | 3844 v5 = v4 % 7 + v46 + 7 * uNum; |
3889 LABEL_44: | 3845 LABEL_44: |
3890 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; | 3846 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; |
3891 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) | 3847 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) |
3892 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; | 3848 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; |
3893 continue; | 3849 continue; |
3894 } | 3850 } |
3895 } | 3851 } |
3896 } | 3852 } |
3897 else | 3853 else |
3898 { | 3854 { |
3899 switch ( v45 ) | 3855 switch ( pUIMessageType ) |
3900 { | 3856 { |
3901 case 60: | 3857 case 60: |
3902 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | 3858 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); |
3903 v3 = (void *)uNum; | 3859 v3 = (void *)uNum; |
3904 uPlayerCreationUI_SelectedCharacter = uNum; | 3860 uPlayerCreationUI_SelectedCharacter = uNum; |
3910 break; | 3866 break; |
3911 case 17: | 3867 case 17: |
3912 pMouse->SetCursorBitmap("MICON2"); | 3868 pMouse->SetCursorBitmap("MICON2"); |
3913 break; | 3869 break; |
3914 default: | 3870 default: |
3915 if ( v45 == 58 ) | 3871 if ( pUIMessageType == 58 ) |
3916 goto LABEL_114; | 3872 goto LABEL_114; |
3917 break; | 3873 break; |
3918 } | 3874 } |
3919 } | 3875 } |
3920 } | 3876 } |
12561 int v12; // [sp+6Ch] [bp-8h]@4 | 12517 int v12; // [sp+6Ch] [bp-8h]@4 |
12562 int v13; // [sp+70h] [bp-4h]@4 | 12518 int v13; // [sp+70h] [bp-4h]@4 |
12563 | 12519 |
12564 v1 = pPlayers[uActiveCharacter]; | 12520 v1 = pPlayers[uActiveCharacter]; |
12565 v10 = _this; | 12521 v10 = _this; |
12566 v2 = &pSpellStats->pInfos[(signed int)((char *)_this + 11 * v1->field_1A4E) + 1]; | 12522 v2 = &pSpellStats->pInfos[(signed int)((char *)_this + 11 * v1->pNumSpellBookPage) + 1]; |
12567 if ( pMouse->GetCursorPos(&a2)->y <= 250 ) | 12523 if ( pMouse->GetCursorPos(&a2)->y <= 250 ) |
12568 v3 = pMouse->GetCursorPos(&a2)->y + 30; | 12524 v3 = pMouse->GetCursorPos(&a2)->y + 30; |
12569 else | 12525 else |
12570 v3 = 30; | 12526 v3 = 30; |
12571 a1.uFrameY = v3; | 12527 a1.uFrameY = v3; |
12620 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 12576 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
12621 a1.DrawText2(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); | 12577 a1.DrawText2(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); |
12622 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0); | 12578 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0); |
12623 a1.uFrameWidth = 108; | 12579 a1.uFrameWidth = 108; |
12624 a1.uFrameZ = a1.uFrameX + 107; | 12580 a1.uFrameZ = a1.uFrameX + 107; |
12625 a1.DrawText2(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->field_1A4E + 12], 3u); | 12581 a1.DrawText2(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->pNumSpellBookPage + 12], 3u); |
12626 sprintfex( | 12582 sprintfex( |
12627 pTmpBuf, | 12583 pTmpBuf, |
12628 "%s\n%d", | 12584 "%s\n%d", |
12629 pGlobalTXT_LocalizationStrings[522], | 12585 pGlobalTXT_LocalizationStrings[522], |
12630 *(&pSpellDatas[0].field_14 | 12586 *(&pSpellDatas[0].field_14 |
12631 + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->field_1A4E + 12]) >> 6) | 12587 + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->pNumSpellBookPage + 12]) >> 6) |
12632 + 10 * (int)((char *)v10 + 11 * v1->field_1A4E))); | 12588 + 10 * (int)((char *)v10 + 11 * v1->pNumSpellBookPage))); |
12633 a1.DrawText2(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u); | 12589 a1.DrawText2(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u); |
12634 dword_507B00_spell_info_to_draw_in_popup = 0; | 12590 dword_507B00_spell_info_to_draw_in_popup = 0; |
12635 } | 12591 } |
12636 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; | 12592 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; |
12637 | 12593 |
13139 int v23[2]; // [sp+10h] [bp-10h]@5 | 13095 int v23[2]; // [sp+10h] [bp-10h]@5 |
13140 POINT a2; // [sp+18h] [bp-8h]@13 | 13096 POINT a2; // [sp+18h] [bp-8h]@13 |
13141 | 13097 |
13142 sub_412AF9(); | 13098 sub_412AF9(); |
13143 v0 = pPlayers[uActiveCharacter]; | 13099 v0 = pPlayers[uActiveCharacter]; |
13144 v1 = 11 * v0->field_1A4E; | 13100 v1 = 11 * v0->pNumSpellBookPage; |
13145 v2 = pIcons_LOD->FindTextureByName("Pending"); | 13101 v2 = pIcons_LOD->FindTextureByName("Pending"); |
13146 v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); | 13102 v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); |
13147 pRenderer->ClearZBuffer(0, 479); | 13103 pRenderer->ClearZBuffer(0, 479); |
13148 v4 = 1; | 13104 v4 = 1; |
13149 if ( __OFSUB__(v1, v1 + 11) ^ 1 ) | 13105 if ( __OFSUB__(v1, v1 + 11) ^ 1 ) |
13165 v23[0] = dword_506408[v4]; | 13121 v23[0] = dword_506408[v4]; |
13166 v6 = v5; | 13122 v6 = v5; |
13167 } | 13123 } |
13168 if ( v6->pLevelOfDetail0 ) | 13124 if ( v6->pLevelOfDetail0 ) |
13169 { | 13125 { |
13170 v7 = 2 * (12 * v0->field_1A4E + (unsigned __int8)*(&byte_4E2430[12 * v0->field_1A4E] + v4)); | 13126 v7 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage + v4])); |
13171 v19 = pViewport->uViewportY + dword_4E20D0[v7 + 1]; | 13127 v19 = pViewport->uViewportY + dword_4E20D0[v7 + 1]; |
13172 v17 = pViewport->uViewportX + dword_4E20D0[v7]; | 13128 v17 = pViewport->uViewportX + dword_4E20D0[v7]; |
13173 if ( BYTE1(v6->pBits) & 2 ) | 13129 if ( BYTE1(v6->pBits) & 2 ) |
13174 pRenderer->DrawTextureTransparent(v17, v19, v6); | 13130 pRenderer->DrawTextureTransparent(v17, v19, v6); |
13175 else | 13131 else |
13176 pRenderer->DrawTextureIndexed(v17, v19, v6); | 13132 pRenderer->DrawTextureIndexed(v17, v19, v6); |
13177 v8 = 2 * (12 * v0->field_1A4E + (unsigned __int8)*(&byte_4E2430[12 * v0->field_1A4E] + v4)); | 13133 v8 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage] + v4)); |
13178 pRenderer->_4A612A(dword_4E20D0[v8], dword_4E20D0[v8 + 1], (Texture *)v23[0], v4); | 13134 pRenderer->_4A612A(dword_4E20D0[v8], dword_4E20D0[v8 + 1], (Texture *)v23[0], v4); |
13179 } | 13135 } |
13180 } | 13136 } |
13181 } | 13137 } |
13182 ++v4; | 13138 ++v4; |
13189 { | 13145 { |
13190 v11 = dword_5063D8[v10]; | 13146 v11 = dword_5063D8[v10]; |
13191 if ( v11->pLevelOfDetail0 ) | 13147 if ( v11->pLevelOfDetail0 ) |
13192 { | 13148 { |
13193 v21 = dword_5063D8[v10]; | 13149 v21 = dword_5063D8[v10]; |
13194 v12 = 2 * (12 * v0->field_1A4E + (unsigned __int8)*(&byte_4E2430[12 * v0->field_1A4E] + v10)); | 13150 v12 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage] + v10)); |
13195 v20 = pViewport->uViewportY + dword_4E20D0[v12 + 1]; | 13151 v20 = pViewport->uViewportY + dword_4E20D0[v12 + 1]; |
13196 v18 = pViewport->uViewportX + dword_4E20D0[v12]; | 13152 v18 = pViewport->uViewportX + dword_4E20D0[v12]; |
13197 if ( BYTE1(v11->pBits) & 2 ) | 13153 if ( BYTE1(v11->pBits) & 2 ) |
13198 pRenderer->DrawTextureTransparent(v18, v20, v21); | 13154 pRenderer->DrawTextureTransparent(v18, v20, v21); |
13199 else | 13155 else |
13207 v23[0] = 0; | 13163 v23[0] = 0; |
13208 do | 13164 do |
13209 { | 13165 { |
13210 if ( *(short *)a2.x ) | 13166 if ( *(short *)a2.x ) |
13211 { | 13167 { |
13212 if ( v0->field_1A4E == v13 ) | 13168 if ( v0->pNumSpellBookPage == v13 ) |
13213 { | 13169 { |
13214 v16 = *(Texture **)&pTextures_tabs[0][0].pName[8 * v13 + 4]; | 13170 v16 = *(Texture **)&pTextures_tabs[0][0].pName[8 * v13 + 4]; |
13215 switch ( v13 ) | 13171 switch ( v13 ) |
13216 { | 13172 { |
13217 case 0: | 13173 case 0: |