comparison mm7_5.cpp @ 962:0423c40d7e88

UpdateWindows and pWindow->Release
author Ritor1
date Tue, 07 May 2013 17:32:23 +0600
parents 5a12082c803d
children e655624e4b7c 96f7beed452f
comparison
equal deleted inserted replaced
961:5a12082c803d 962:0423c40d7e88
446 continue; 446 continue;
447 case UIMSG_ArrowUp: 447 case UIMSG_ArrowUp:
448 --pSaveListPosition; 448 --pSaveListPosition;
449 if ( pSaveListPosition < 0 ) 449 if ( pSaveListPosition < 0 )
450 pSaveListPosition = 0; 450 pSaveListPosition = 0;
451 GUIWindow::Create(215, 199, 17, 17, WINDOW_Button, (int)pBtnArrowUp, 0); 451 GUIWindow::Create(215, 199, 17, 17, WINDOW_PressedButton2, (int)pBtnArrowUp, 0);
452 continue; 452 continue;
453 case UIMSG_DownArrow: 453 case UIMSG_DownArrow:
454 ++pSaveListPosition; 454 ++pSaveListPosition;
455 if ( pSaveListPosition >= uMessageParam ) 455 if ( pSaveListPosition >= uMessageParam )
456 pSaveListPosition = uMessageParam - 1; 456 pSaveListPosition = uMessageParam - 1;
457 GUIWindow::Create(215, 323, 17, 17, WINDOW_Button, (int)pBtnDownArrow, 0); 457 GUIWindow::Create(215, 323, 17, 17, WINDOW_PressedButton2, (int)pBtnDownArrow, 0);
458 continue; 458 continue;
459 case UIMSG_Cancel: 459 case UIMSG_Cancel:
460 GUIWindow::Create(350, 302, 106, 42, WINDOW_ExitRestWindow, (int)pBtnCancel, 0); 460 GUIWindow::Create(350, 302, 106, 42, WINDOW_CloseRestWindowBtn, (int)pBtnCancel, 0);
461 continue; 461 continue;
462 case UIMSG_SaveLoadBtn: 462 case UIMSG_SaveLoadBtn:
463 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0); 463 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0);
464 continue; 464 continue;
465 case UIMSG_SelectLoadSlot: 465 case UIMSG_SelectLoadSlot:
740 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); 740 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
741 continue; 741 continue;
742 } 742 }
743 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6; 743 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
744 pGame->pGammaController->Initialize(v19); 744 pGame->pGammaController->Initialize(v19);
745 GUIWindow::Create(21, 161, 0, 0, WINDOW_Button, (int)pBtn_SliderLeft, v0); 745 GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, v0);
746 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); 746 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
747 continue; 747 continue;
748 } 748 }
749 if ( uMessageParam == 5 ) 749 if ( uMessageParam == 5 )
750 { 750 {
751 ++uGammaPos; 751 ++uGammaPos;
752 if ( (signed int)uGammaPos <= 9 ) 752 if ( (signed int)uGammaPos <= 9 )
753 { 753 {
754 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6; 754 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
755 pGame->pGammaController->Initialize(v21); 755 pGame->pGammaController->Initialize(v21);
756 GUIWindow::Create(213, 161, 0, 0, WINDOW_Button, (int)pBtn_SliderRight, v0); 756 GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, v0);
757 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); 757 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
758 continue; 758 continue;
759 } 759 }
760 uGammaPos = 9; 760 uGammaPos = 9;
761 } 761 }
780 if ( uMessageParam == 4 ) 780 if ( uMessageParam == 4 )
781 { 781 {
782 --uMusicVolimeMultiplier; 782 --uMusicVolimeMultiplier;
783 if ( (char)uMusicVolimeMultiplier < 1 ) 783 if ( (char)uMusicVolimeMultiplier < 1 )
784 uMusicVolimeMultiplier = 0; 784 uMusicVolimeMultiplier = 0;
785 GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_Button, (int)pBtn_SliderLeft, v0); 785 GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, v0);
786 if ( uMusicVolimeMultiplier ) 786 if ( uMusicVolimeMultiplier )
787 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0); 787 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0);
788 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f); 788 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f);
789 continue; 789 continue;
790 } 790 }
791 if ( uMessageParam == 5 ) 791 if ( uMessageParam == 5 )
792 { 792 {
793 ++uMusicVolimeMultiplier; 793 ++uMusicVolimeMultiplier;
794 if ( (char)uMusicVolimeMultiplier > 9 ) 794 if ( (char)uMusicVolimeMultiplier > 9 )
795 uMusicVolimeMultiplier = 9; 795 uMusicVolimeMultiplier = 9;
796 GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_Button, (int)pBtn_SliderRight, v0); 796 GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, v0);
797 if ( uMusicVolimeMultiplier ) 797 if ( uMusicVolimeMultiplier )
798 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0); 798 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0);
799 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f); 799 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f);
800 continue; 800 continue;
801 } 801 }
810 if ( uMessageParam == 4 )//reduce sound level button left 810 if ( uMessageParam == 4 )//reduce sound level button left
811 { 811 {
812 --uSoundVolumeMultiplier; 812 --uSoundVolumeMultiplier;
813 if ( (char)uSoundVolumeMultiplier < 1 ) 813 if ( (char)uSoundVolumeMultiplier < 1 )
814 uSoundVolumeMultiplier = 0; 814 uSoundVolumeMultiplier = 0;
815 GUIWindow::Create(243, 162, 0, 0, WINDOW_Button, (int)pBtn_SliderLeft, v0); 815 GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, v0);
816 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); 816 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
817 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); 817 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
818 continue; 818 continue;
819 } 819 }
820 if ( uMessageParam == 5 )//Increase sound level button right 820 if ( uMessageParam == 5 )//Increase sound level button right
823 if ( (char)uSoundVolumeMultiplier > 8 ) 823 if ( (char)uSoundVolumeMultiplier > 8 )
824 uSoundVolumeMultiplier = 9; 824 uSoundVolumeMultiplier = 9;
825 v168 = v0; 825 v168 = v0;
826 v24 = 435; 826 v24 = 435;
827 //v154 = (int)pBtn_SliderRight; 827 //v154 = (int)pBtn_SliderRight;
828 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_Button, (int)pBtn_SliderRight, v168); 828 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, v168);
829 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); 829 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
830 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); 830 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
831 continue; 831 continue;
832 } 832 }
833 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17; 833 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
852 if ( uMessageParam == 4 ) 852 if ( uMessageParam == 4 )
853 { 853 {
854 --uVoicesVolumeMultiplier; 854 --uVoicesVolumeMultiplier;
855 if ( (char)uVoicesVolumeMultiplier < 1 ) 855 if ( (char)uVoicesVolumeMultiplier < 1 )
856 uVoicesVolumeMultiplier = 0; 856 uVoicesVolumeMultiplier = 0;
857 GUIWindow::Create(243, 270, 0, 0, WINDOW_Button, (int)pBtn_SliderLeft, v0); 857 GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, v0);
858 if ( !uVoicesVolumeMultiplier ) 858 if ( !uVoicesVolumeMultiplier )
859 continue; 859 continue;
860 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); 860 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
861 continue; 861 continue;
862 } 862 }
863 if ( uMessageParam == 5 ) 863 if ( uMessageParam == 5 )
864 { 864 {
865 ++uVoicesVolumeMultiplier; 865 ++uVoicesVolumeMultiplier;
866 if ( (char)uVoicesVolumeMultiplier > 8 ) 866 if ( (char)uVoicesVolumeMultiplier > 8 )
867 uVoicesVolumeMultiplier = 9; 867 uVoicesVolumeMultiplier = 9;
868 GUIWindow::Create(435, 270, 0, 0, WINDOW_Button, (int)pBtn_SliderRight, v0); 868 GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, v0);
869 if ( !uVoicesVolumeMultiplier ) 869 if ( !uVoicesVolumeMultiplier )
870 continue; 870 continue;
871 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); 871 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
872 continue; 872 continue;
873 } 873 }
1466 } 1466 }
1467 pWindow3 = pGUIWindow_Settings; 1467 pWindow3 = pGUIWindow_Settings;
1468 if ( !pGUIWindow_Settings )//Draw Menu 1468 if ( !pGUIWindow_Settings )//Draw Menu
1469 { 1469 {
1470 dword_6BE138 = -1; 1470 dword_6BE138 = -1;
1471 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_Button, (int)pBtn_GameSettings, v0); 1471 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, v0);
1472 pEventTimer->Pause(); 1472 pEventTimer->Pause();
1473 pAudioPlayer->StopChannels(-1, -1); 1473 pAudioPlayer->StopChannels(-1, -1);
1474 ++pIcons_LOD->uTexturePacksCount; 1474 ++pIcons_LOD->uTexturePacksCount;
1475 pCurrentScreen = v0; 1475 pCurrentScreen = v0;
1476 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 1476 if ( !pIcons_LOD->uNumPrevLoadedFiles )
1521 sub_41426F(); 1521 sub_41426F();
1522 continue; 1522 continue;
1523 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel 1523 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
1524 if ( uMessageParam ) 1524 if ( uMessageParam )
1525 { 1525 {
1526 GUIWindow::Create(626, 179, 0, 0, WINDOW_Button, (int)pBtn_NPCRight, 0); 1526 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0);
1527 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; 1527 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2;
1528 if ( (unsigned __int8)pParty->field_709 < v37 ) 1528 if ( (unsigned __int8)pParty->field_709 < v37 )
1529 { 1529 {
1530 ++pParty->field_709;//??? maybe number of the first cell??? 1530 ++pParty->field_709;//??? maybe number of the first cell???
1531 if ( (unsigned __int8)pParty->field_709 >= v37 ) 1531 if ( (unsigned __int8)pParty->field_709 >= v37 )
1532 pParty->field_709 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2; 1532 pParty->field_709 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
1533 } 1533 }
1534 } 1534 }
1535 else 1535 else
1536 { 1536 {
1537 GUIWindow::Create(469, 179, 0, 0, WINDOW_Button, (int)pBtn_NPCLeft, 0); 1537 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0);
1538 if ( pParty->field_709 ) 1538 if ( pParty->field_709 )
1539 { 1539 {
1540 --pParty->field_709; 1540 --pParty->field_709;
1541 if ( pParty->field_709 < 1 ) 1541 if ( pParty->field_709 < 1 )
1542 pParty->field_709 = 0; 1542 pParty->field_709 = 0;
2473 if ( !(pTurnEngine->field_18 & 2) ) 2473 if ( !(pTurnEngine->field_18 & 2) )
2474 //LABEL_577: 2474 //LABEL_577:
2475 _42ECB5_PlayerAttacksActor(); 2475 _42ECB5_PlayerAttacksActor();
2476 continue; 2476 continue;
2477 case UIMSG_ExitRest: 2477 case UIMSG_ExitRest:
2478 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_ExitRestWindow, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" 2478 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest"
2479 continue; 2479 continue;
2480 case UIMSG_Wait5Minutes: 2480 case UIMSG_Wait5Minutes:
2481 if ( dword_506F14 == 2 ) 2481 if ( dword_506F14 == 2 )
2482 { 2482 {
2483 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" 2483 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
2484 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 2484 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
2485 continue; 2485 continue;
2486 } 2486 }
2487 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_Button, 2487 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2,
2488 (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" 2488 (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
2489 dword_506F14 = v0; 2489 dword_506F14 = v0;
2490 _506F18_num_hours_to_sleep = 5; 2490 _506F18_num_hours_to_sleep = 5;
2491 continue; 2491 continue;
2492 case UIMSG_Wait1Hour: 2492 case UIMSG_Wait1Hour:
2494 { 2494 {
2495 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" 2495 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
2496 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 2496 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
2497 continue; 2497 continue;
2498 } 2498 }
2499 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_Button, 2499 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2,
2500 (int)pButton_RestUI_Wait1Hour, (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" 2500 (int)pButton_RestUI_Wait1Hour, (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
2501 dword_506F14 = v0; 2501 dword_506F14 = v0;
2502 _506F18_num_hours_to_sleep = 60; 2502 _506F18_num_hours_to_sleep = 60;
2503 continue; 2503 continue;
2504 case UIMSG_RentRoom: 2504 case UIMSG_RentRoom:
2640 { 2640 {
2641 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" 2641 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
2642 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 2642 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
2643 continue; 2643 continue;
2644 } 2644 }
2645 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_Button, 2645 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2,
2646 (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" 2646 (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
2647 v97 = _494820_training_time(pParty->uCurrentHour); 2647 v97 = _494820_training_time(pParty->uCurrentHour);
2648 dword_506F14 = v0; 2648 dword_506F14 = v0;
2649 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; 2649 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute;
2650 continue; 2650 continue;
2684 sprintfex(pTmpBuf, v161, v178); 2684 sprintfex(pTmpBuf, v161, v178);
2685 sub_41C0B8_set_status_string(pTmpBuf); 2685 sub_41C0B8_set_status_string(pTmpBuf);
2686 v0 = 1; 2686 v0 = 1;
2687 continue; 2687 continue;
2688 case UIMSG_ClickInstallRemoveQuickSpellBtn: 2688 case UIMSG_ClickInstallRemoveQuickSpellBtn:
2689 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_Button, (int)pBtn_InstallRemoveSpell, 0); 2689 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0);
2690 if ( !uActiveCharacter ) 2690 if ( !uActiveCharacter )
2691 continue; 2691 continue;
2692 pPlayer10 = pPlayers[uActiveCharacter]; 2692 pPlayer10 = pPlayers[uActiveCharacter];
2693 if ( !byte_506550 || !quick_spell_at_page ) 2693 if ( !byte_506550 || !quick_spell_at_page )
2694 { 2694 {
2820 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery ) 2820 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery )
2821 { 2821 {
2822 if ( !pCurrentScreen ) 2822 if ( !pCurrentScreen )
2823 //goto LABEL_693; 2823 //goto LABEL_693;
2824 { 2824 {
2825 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_Button, (int)pBtn_CastSpell, 0); 2825 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
2826 pCurrentScreen = SCREEN_SPELL_BOOK; 2826 pCurrentScreen = SCREEN_SPELL_BOOK;
2827 pEventTimer->Pause(); 2827 pEventTimer->Pause();
2828 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); 2828 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0);
2829 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); 2829 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
2830 viewparams->field_48 = v0; 2830 viewparams->field_48 = v0;
2834 && pCurrentScreen != SCREEN_CHARACTERS 2834 && pCurrentScreen != SCREEN_CHARACTERS
2835 && (pCurrentScreen <= SCREEN_63 2835 && (pCurrentScreen <= SCREEN_63
2836 || pCurrentScreen > SCREEN_67) ) 2836 || pCurrentScreen > SCREEN_67) )
2837 { 2837 {
2838 pGUIWindow_CurrentMenu->Release(); 2838 pGUIWindow_CurrentMenu->Release();
2839 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_Button, (int)pBtn_CastSpell, 0); 2839 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
2840 pCurrentScreen = SCREEN_SPELL_BOOK; 2840 pCurrentScreen = SCREEN_SPELL_BOOK;
2841 pEventTimer->Pause(); 2841 pEventTimer->Pause();
2842 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0); 2842 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0);
2843 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0); 2843 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
2844 viewparams->field_48 = v0; 2844 viewparams->field_48 = v0;
2853 if ( pCurrentScreen ) 2853 if ( pCurrentScreen )
2854 pGUIWindow_CurrentMenu->Release(); 2854 pGUIWindow_CurrentMenu->Release();
2855 ++pIcons_LOD->uTexturePacksCount; 2855 ++pIcons_LOD->uTexturePacksCount;
2856 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 2856 if ( !pIcons_LOD->uNumPrevLoadedFiles )
2857 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 2857 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
2858 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_Button, (int)pBtn_QuickReference, 0); 2858 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0);
2859 viewparams->bRedrawGameUI = v0; 2859 viewparams->bRedrawGameUI = v0;
2860 pEventTimer->Pause(); 2860 pEventTimer->Pause();
2861 pAudioPlayer->StopChannels(-1, -1); 2861 pAudioPlayer->StopChannels(-1, -1);
2862 pCurrentScreen = SCREEN_QUICK_REFERENCE; 2862 pCurrentScreen = SCREEN_QUICK_REFERENCE;
2863 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0); 2863 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0);
2877 stru_506E40.Release(); 2877 stru_506E40.Release();
2878 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); 2878 uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
2879 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); 2879 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
2880 free((void *)uNumSeconds); 2880 free((void *)uNumSeconds);
2881 stru_506E40._40E55E("gamma.pcx", 0); 2881 stru_506E40._40E55E("gamma.pcx", 0);
2882 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0); 2882 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0);
2883 //LABEL_453: 2883 //LABEL_453:
2884 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 2884 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
2885 continue; 2885 continue;
2886 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 2886 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
2887 //goto LABEL_770; 2887 //goto LABEL_770;
2894 dword_50651C = v0; 2894 dword_50651C = v0;
2895 if ( pMouse->GetCursorPos(&v211)->y > 178 ) 2895 if ( pMouse->GetCursorPos(&v211)->y > 178 )
2896 dword_50651C = -1; 2896 dword_50651C = -1;
2897 continue; 2897 continue;
2898 case UIMSG_ClickAwardsUpBtn: 2898 case UIMSG_ClickAwardsUpBtn:
2899 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersButton, (int)pBtn_Up, 0); 2899 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0);
2900 dword_506548 = v0; 2900 dword_506548 = v0;
2901 continue; 2901 continue;
2902 case UIMSG_ClickAwardsDownBtn: 2902 case UIMSG_ClickAwardsDownBtn:
2903 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersButton, (int)pBtn_Down, 0); 2903 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0);
2904 dword_506544 = v0; 2904 dword_506544 = v0;
2905 continue; 2905 continue;
2906 case UIMSG_ChangeDetaliz: 2906 case UIMSG_ChangeDetaliz:
2907 bRingsShownInCharScreen ^= v0; 2907 bRingsShownInCharScreen ^= v0;
2908 pCharacterScreen_DetalizBtn->Release(); 2908 pCharacterScreen_DetalizBtn->Release();
2932 continue; 2932 continue;
2933 case UIMSG_ClickStatsBtn: 2933 case UIMSG_ClickStatsBtn:
2934 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; 2934 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
2935 sub_4196A0(); 2935 sub_4196A0();
2936 sub_419379(); 2936 sub_419379();
2937 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersButton, (int)pCharacterScreen_StatsBtn, 0); 2937 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0);
2938 continue; 2938 continue;
2939 case UIMSG_ClickSkillsBtn: 2939 case UIMSG_ClickSkillsBtn:
2940 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; 2940 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101;
2941 sub_4196A0(); 2941 sub_4196A0();
2942 sub_419379(); 2942 sub_419379();
2943 CharacterUI_SkillScreen_Draw(); 2943 CharacterUI_SkillScreen_Draw();
2944 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersButton, (int)pCharacterScreen_SkillsBtn, 0); 2944 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0);
2945 continue; 2945 continue;
2946 case UIMSG_SkillUp: 2946 case UIMSG_SkillUp:
2947 pPlayer4 = pPlayers[uActiveCharacter]; 2947 pPlayer4 = pPlayers[uActiveCharacter];
2948 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; 2948 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam];
2949 LOWORD(v2) = *(short *)v105; 2949 LOWORD(v2) = *(short *)v105;
2968 continue; 2968 continue;
2969 case UIMSG_ClickInventoryBtn: 2969 case UIMSG_ClickInventoryBtn:
2970 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; 2970 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
2971 sub_419379(); 2971 sub_419379();
2972 sub_4196A0(); 2972 sub_4196A0();
2973 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersButton, (int)pCharacterScreen_InventoryBtn, 0); 2973 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0);
2974 continue; 2974 continue;
2975 case UIMSG_ClickExitCharacterWindowBtn: 2975 case UIMSG_ClickExitCharacterWindowBtn:
2976 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); 2976 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0);
2977 continue; 2977 continue;
2978 case UIMSG_ClickAwardsBtn: 2978 case UIMSG_ClickAwardsBtn:
2979 sub_419379(); 2979 sub_419379();
2980 sub_4196A0(); 2980 sub_4196A0();
2981 sub_419220(); 2981 sub_419220();
2982 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; 2982 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102;
2983 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersButton, (int)pCharacterScreen_AwardsBtn, 0); 2983 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0);
2984 FillAwardsData(); 2984 FillAwardsData();
2985 continue; 2985 continue;
2986 case UIMSG_AutonotesBook: 2986 case UIMSG_AutonotesBook:
2987 switch ( uMessageParam ) 2987 switch ( uMessageParam )
2988 { 2988 {
3033 case 7: 3033 case 7:
3034 pButton = pBtn_Autonotes_Instructors; 3034 pButton = pBtn_Autonotes_Instructors;
3035 dword_50652C = v0; 3035 dword_50652C = v0;
3036 break; 3036 break;
3037 } 3037 }
3038 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, v0); 3038 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, v0);
3039 continue; 3039 continue;
3040 case UIMSG_SelectCharacter: 3040 case UIMSG_SelectCharacter:
3041 if ( pMessageQueue_50CBD0->uNumMessages ) 3041 if ( pMessageQueue_50CBD0->uNumMessages )
3042 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 3042 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
3043 GameUI_OnPlayerPortraitLeftClick(uMessageParam); 3043 GameUI_OnPlayerPortraitLeftClick(uMessageParam);
3181 continue; 3181 continue;
3182 case UIMSG_ClickZoomOutBtn: 3182 case UIMSG_ClickZoomOutBtn:
3183 if ( pCurrentScreen ) 3183 if ( pCurrentScreen )
3184 continue; 3184 continue;
3185 pParty->uFlags |= 2u; 3185 pParty->uFlags |= 2u;
3186 GUIWindow::Create(0x207u, 0x88u, 0, 0, WINDOW_Button, (int)pBtn_ZoomOut, 0); 3186 GUIWindow::Create(0x207u, 0x88u, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0);
3187 uNumSeconds = 131072; 3187 uNumSeconds = 131072;
3188 v118 = 2 * viewparams->uMinimapZoom; 3188 v118 = 2 * viewparams->uMinimapZoom;
3189 ++viewparams->field_28; 3189 ++viewparams->field_28;
3190 viewparams->uMinimapZoom *= 2; 3190 viewparams->uMinimapZoom *= 2;
3191 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) 3191 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
3211 break; 3211 break;
3212 case UIMSG_ClickZoomInBtn: 3212 case UIMSG_ClickZoomInBtn:
3213 if ( pCurrentScreen ) 3213 if ( pCurrentScreen )
3214 continue; 3214 continue;
3215 pParty->uFlags |= 2u; 3215 pParty->uFlags |= 2u;
3216 GUIWindow::Create(0x23Eu, 0x88u, 0, 0, WINDOW_Button, (int)pBtn_ZoomIn, 0); 3216 GUIWindow::Create(0x23Eu, 0x88u, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0);
3217 uNumSeconds = 32768; 3217 uNumSeconds = 32768;
3218 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; 3218 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
3219 --viewparams->field_28; 3219 --viewparams->field_28;
3220 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; 3220 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
3221 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) 3221 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
3354 auto sex = player->GetSexByVoice(); 3354 auto sex = player->GetSexByVoice();
3355 3355
3356 switch (pUIMessageType) // For buttons of window MainMenu 3356 switch (pUIMessageType) // For buttons of window MainMenu
3357 { 3357 {
3358 case UIMSG_MainMenu_ShowPartyCreationWnd: 3358 case UIMSG_MainMenu_ShowPartyCreationWnd:
3359 GUIWindow::Create(495, 172, 0, 0, WINDOW_Button, (int)pMainMenu_BtnNew, 0); 3359 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
3360 SetCurrentMenuID(MENU_NEWGAME); 3360 SetCurrentMenuID(MENU_NEWGAME);
3361 break; 3361 break;
3362 case UIMSG_MainMenu_ShowLoadWindow: 3362 case UIMSG_MainMenu_ShowLoadWindow:
3363 GUIWindow::Create(495, 227, 0, 0, WINDOW_Button, (int)pMainMenu_BtnLoad, 0); 3363 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0);
3364 SetCurrentMenuID(MENU_SAVELOAD); 3364 SetCurrentMenuID(MENU_SAVELOAD);
3365 break; 3365 break;
3366 case UIMSG_ShowCredits: 3366 case UIMSG_ShowCredits:
3367 GUIWindow::Create(495, 282, 0, 0, WINDOW_Button, (int)pMainMenu_BtnCredits, 0); 3367 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0);
3368 SetCurrentMenuID(MENU_CREDITS); 3368 SetCurrentMenuID(MENU_CREDITS);
3369 break; 3369 break;
3370 case UIMSG_ExitToWindows: 3370 case UIMSG_ExitToWindows:
3371 GUIWindow::Create(495, 337, 0, 0, WINDOW_Button, (int)pMainMenu_BtnExit, 0); 3371 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
3372 SetCurrentMenuID(MENU_FINISHED); 3372 SetCurrentMenuID(MENU_FINISHED);
3373 break; 3373 break;
3374 case UIMSG_PlayerCreation_SelectAttribute: 3374 case UIMSG_PlayerCreation_SelectAttribute:
3375 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) 3375 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3376 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; 3376 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3384 player->uVoiceID = 19; 3384 player->uVoiceID = 19;
3385 else --player->uVoiceID; 3385 else --player->uVoiceID;
3386 } 3386 }
3387 while (player->GetSexByVoice() != sex); 3387 while (player->GetSexByVoice() != sex);
3388 pButton = pCreationUI_BtnPressLeft2[uNum]; 3388 pButton = pCreationUI_BtnPressLeft2[uNum];
3389 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); 3389 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1);
3390 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); 3390 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3391 player->PlaySound(SPEECH_PickMe, 0); 3391 player->PlaySound(SPEECH_PickMe, 0);
3392 break; 3392 break;
3393 case UIMSG_PlayerCreation_VoiceNext: 3393 case UIMSG_PlayerCreation_VoiceNext:
3394 { 3394 {
3398 { 3398 {
3399 player->uVoiceID = (player->uVoiceID + 1) % 20; 3399 player->uVoiceID = (player->uVoiceID + 1) % 20;
3400 } 3400 }
3401 while (player->GetSexByVoice() != sex); 3401 while (player->GetSexByVoice() != sex);
3402 pButton = pCreationUI_BtnPressRight2[uNum]; 3402 pButton = pCreationUI_BtnPressRight2[uNum];
3403 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); 3403 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1);
3404 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); 3404 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3405 player->PlaySound(SPEECH_PickMe, 0); 3405 player->PlaySound(SPEECH_PickMe, 0);
3406 break; 3406 break;
3407 } 3407 }
3408 case UIMSG_PlayerCreation_FacePrev: 3408 case UIMSG_PlayerCreation_FacePrev:
3417 pPlayer->RandomizeName(); 3417 pPlayer->RandomizeName();
3418 v25 = uNum; 3418 v25 = uNum;
3419 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) 3419 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3420 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; 3420 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3421 uPlayerCreationUI_SelectedCharacter = v25; 3421 uPlayerCreationUI_SelectedCharacter = v25;
3422 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressLeft[v25], 1); 3422 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], 1);
3423 //v0 = pAudioPlayer; 3423 //v0 = pAudioPlayer;
3424 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); 3424 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0);
3425 pPlayer->PlaySound(SPEECH_PickMe, 0); 3425 pPlayer->PlaySound(SPEECH_PickMe, 0);
3426 //v1 = (char *)pParty->pPlayers; 3426 //v1 = (char *)pParty->pPlayers;
3427 break; 3427 break;
3435 pPlayer->RandomizeName(); 3435 pPlayer->RandomizeName();
3436 v21 = uNum; 3436 v21 = uNum;
3437 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) 3437 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3438 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; 3438 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3439 uPlayerCreationUI_SelectedCharacter = v21; 3439 uPlayerCreationUI_SelectedCharacter = v21;
3440 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressRight[v21], 1); 3440 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], 1);
3441 //v0 = pAudioPlayer; 3441 //v0 = pAudioPlayer;
3442 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); 3442 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3443 pPlayer->PlaySound(SPEECH_PickMe, 0); 3443 pPlayer->PlaySound(SPEECH_PickMe, 0);
3444 //v1 = (char *)pParty->pPlayers; 3444 //v1 = (char *)pParty->pPlayers;
3445 break; 3445 break;
3446 case UIMSG_PlayerCreationClickPlus: 3446 case UIMSG_PlayerCreationClickPlus:
3447 GUIWindow::Create(613, 393, 0, 0, WINDOW_Button, (int)pPlayerCreationUI_BtnPlus, 1); 3447 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, 1);
3448 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); 3448 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
3449 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); 3449 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0);
3450 break; 3450 break;
3451 case UIMSG_PlayerCreationClickMinus: 3451 case UIMSG_PlayerCreationClickMinus:
3452 GUIWindow::Create(523, 393, 0, 0, WINDOW_Button, (int)pPlayerCreationUI_BtnMinus, 1); 3452 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, 1);
3453 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); 3453 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
3454 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); 3454 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0);
3455 break; 3455 break;
3456 case UIMSG_PlayerCreationSelectActiveSkill: 3456 case UIMSG_PlayerCreationSelectActiveSkill:
3457 { 3457 {
3465 case UIMSG_PlayerCreationSelectClass: 3465 case UIMSG_PlayerCreationSelectClass:
3466 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum); 3466 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum);
3467 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); 3467 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3468 break; 3468 break;
3469 case UIMSG_PlayerCreationClickOK: 3469 case UIMSG_PlayerCreationClickOK:
3470 GUIWindow::Create(580, 431, 0, 0, WINDOW_Button, (int)pPlayerCreationUI_BtnOK, 0); 3470 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0);
3471 if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() ) 3471 if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() )
3472 GameUI_Footer_TimeLeft = GetTickCount() + 4000; 3472 GameUI_Footer_TimeLeft = GetTickCount() + 4000;
3473 else 3473 else
3474 uGameState = 6; 3474 uGameState = 6;
3475 break; 3475 break;
3476 case UIMSG_PlayerCreationClickReset: 3476 case UIMSG_PlayerCreationClickReset:
3477 GUIWindow::Create(527, 431, 0, 0, WINDOW_Button, (int)pPlayerCreationUI_BtnReset, 0); 3477 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0);
3478 pParty->Reset(); 3478 pParty->Reset();
3479 break; 3479 break;
3480 case UIMSG_PlayerCreationRemoveUpSkill: 3480 case UIMSG_PlayerCreationRemoveUpSkill:
3481 uPlayerCreationUI_SelectedCharacter = uNum; 3481 uPlayerCreationUI_SelectedCharacter = uNum;
3482 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; 3482 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
3540 if ( pSaveListPosition >= uNum ) 3540 if ( pSaveListPosition >= uNum )
3541 pSaveListPosition = uNum - 1; 3541 pSaveListPosition = uNum - 1;
3542 if ( pSaveListPosition < 1 ) 3542 if ( pSaveListPosition < 1 )
3543 pSaveListPosition = 0; 3543 pSaveListPosition = 0;
3544 pWindow = pGUIWindow_CurrentMenu; 3544 pWindow = pGUIWindow_CurrentMenu;
3545 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_Button, (int)pBtnDownArrow, 0); 3545 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0);
3546 break; 3546 break;
3547 case UIMSG_Cancel: 3547 case UIMSG_Cancel:
3548 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0); 3548 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0);
3549 break; 3549 break;
3550 case UIMSG_ArrowUp: 3550 case UIMSG_ArrowUp:
3551 --pSaveListPosition; 3551 --pSaveListPosition;
3552 if ( pSaveListPosition < 0 ) 3552 if ( pSaveListPosition < 0 )
3553 pSaveListPosition = 0; 3553 pSaveListPosition = 0;
3554 pWindow = pGUIWindow_CurrentMenu; 3554 pWindow = pGUIWindow_CurrentMenu;
3555 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_Button, (int)pBtnArrowUp, 0); 3555 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_PressedButton2, (int)pBtnArrowUp, 0);
3556 break; 3556 break;
3557 case UIMSG_AD: 3557 case UIMSG_AD:
3558 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_Button, (int)pMainMenu_BtnNew, 0); 3558 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
3559 SetCurrentMenuID(MENU_LoadingProcInMainMenu); 3559 SetCurrentMenuID(MENU_LoadingProcInMainMenu);
3560 break; 3560 break;
3561 case UIMSG_AE: 3561 case UIMSG_AE:
3562 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_Button, (int)pMainMenu_BtnExit, 0); 3562 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
3563 SetCurrentMenuID(MENU_10); 3563 SetCurrentMenuID(MENU_10);
3564 break; 3564 break;
3565 case UIMSG_Escape: 3565 case UIMSG_Escape:
3566 if ( ptr_507BDC ) 3566 if ( ptr_507BDC )
3567 { 3567 {
10284 //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]]; 10284 //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]];
10285 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; 10285 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1];
10286 pWindowType = pWindow->eWindowType; 10286 pWindowType = pWindow->eWindowType;
10287 switch (pWindow->eWindowType) 10287 switch (pWindow->eWindowType)
10288 { 10288 {
10289 case WINDOW_MainMenu_Load: 10289 case WINDOW_OptionsButtons://3
10290 {
10291 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);
10292 pY = pViewport->uViewportTL_Y;
10293 pX = pViewport->uViewportTL_X;
10294 pRenderer->DrawTextureIndexed(pX, pY, pTexture);
10295 viewparams->bRedrawGameUI = 1;
10296 continue;
10297 }
10298 case WINDOW_CharacterRecord://4
10299 {
10300 CharacterUI_CharacterScreen_Draw(uActiveCharacter);
10301 continue;
10302 }
10303 case WINDOW_Options://6
10304 {
10305 DrawGameOptions();
10306 continue;
10307 }
10308 case WINDOW_Book://9
10309 {
10310 DrawCurrentBook((unsigned int)pWindow->ptr_1C);
10311 continue;
10312 }
10313 case WINDOW_Dialogue://10
10314 {
10315 DrawDialogueUI();
10316 continue;
10317 }
10318 case WINDOW_QuickReference://12
10319 {
10320 QuickRefDraw();
10321 continue;
10322 }
10323 case WINDOW_Rest://16
10324 {
10325 RestUI_Draw();
10326 continue;
10327 }
10328 case WINDOW_ChangeLocation://17
10329 {
10330 TravelUI_Draw();
10331 continue;
10332 }
10333 case WINDOW_SpellBook://18
10334 {
10335 DrawSpellBookContent();
10336 continue;
10337 }
10338 case WINDOW_GreetingNPC://19
10339 {
10340 DrawBranchlessDialogueUI();
10341 continue;
10342 }
10343 case WINDOW_Chest://20
10344 {
10345 if ( pCurrentScreen == SCREEN_CHEST )
10346 {
10347 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C);
10348 }
10349 else if ( pCurrentScreen == SCREEN_F )
10350 {
10351 pRenderer->ClearZBuffer(0, 479);
10352 draw_leather();
10353 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
10354 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
10355 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
10356 }
10357 continue;
10358 }
10359 case WINDOW_SaveLoadButtons://23
10360 {
10361 sub_4606FE();
10362 continue;
10363 }
10364 case WINDOW_MainMenu_Load://24
10290 { 10365 {
10291 GameUI_MainMenu_DrawLoad(); 10366 GameUI_MainMenu_DrawLoad();
10292 break; 10367 continue;
10293 } 10368 }
10294 case WINDOW_SaveLoadBtn: 10369 case WINDOW_HouseInterior://25
10370 {
10371 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager();
10372 if ( !window_SpeakInHouse )
10373 continue;
10374 v10 = window_SpeakInHouse->ptr_1C;
10375 if ( (signed int)v10 >= 53 )
10376 continue;
10377 if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed )
10378 {
10379 if ( (signed int)v10 < 53 )
10380 {
10381 pParty->field_3C._shop_ban_times[(signed int)v10] = 0;
10382 }
10383 continue;
10384 }
10385 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
10386 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
10387 continue;
10388 }
10389 case WINDOW_Transition://26
10390 {
10391 TransitionUI_Draw();
10392 continue;
10393 }
10394 case WINDOW_Scroll://30
10395 {
10396 CreateScrollWindow();
10397 continue;
10398 }
10399 case WINDOW_CastSpell_InInventory://31
10400 {
10401 pRenderer->ClearZBuffer(0, 479);
10402 draw_leather();
10403 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
10404 CharacterUI_DrawPaperdoll(uActiveCharacter);
10405 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
10406 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
10407 continue;
10408 }
10409 case WINDOW_FinalWindow://70
10410 {
10411 sub_41420D_press_esc();
10412 continue;
10413 }
10414 case WINDOW_50://80
10415 {
10416 v27 = TargetColor(255, 255, 255);
10417 if ( ptr_507BD0->field_40 == 1 )
10418 {
10419 ptr_507BD0->DrawMessageBox(0);
10420 ptr_507BD0->DrawText(pFontCreate, 30, 40, v27, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
10421 v31 = pFontCreate->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
10422 ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pFontCreate);
10423 continue;
10424 }
10425 if ( ptr_507BD0->field_40 == 2 )
10426 {
10427 //v29 = pMessageQueue_50CBD0->uNumMessages;
10428 pWindow->field_40 = 0;
10429 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
10430 {
10431 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)(int)ptr_507BD0->ptr_1C;
10432 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
10433 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
10434 ++pMessageQueue_50CBD0->uNumMessages;
10435 }*/
10436 pMessageQueue_50CBD0->AddMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0);
10437 pEventTimer->Resume();
10438 ptr_507BD0->Release();
10439 pCurrentScreen = 0;
10440 viewparams->bRedrawGameUI = 1;
10441 continue;
10442 }
10443 if ( ptr_507BD0->field_40 == 3 )
10444 {
10445 pWindow->field_40 = 0;
10446 pEventTimer->Resume();
10447 ptr_507BD0->Release();
10448 continue;
10449 }
10450 }
10451 case WINDOW_59://89
10452 {
10453 pWindow->DrawMessageBox(0);
10454 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
10455 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
10456 if ( !pKeyActionMap->field_204 )
10457 {
10458 ItemGen2.Reset();
10459 pWindow->Release();
10460 pEventTimer->Resume();
10461 pCurrentScreen = 0;
10462 viewparams->bRedrawGameUI = 1;
10463 v26 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
10464 if ( v26 > 0 )
10465 {
10466 if ( v26 < 800 )
10467 {
10468 ItemGen2.uAttributes |= 1u;
10469 ItemGen2.uItemID = v26;
10470 if ( pItemsTable->pItems[v26].uEquipType == 12 )
10471 {
10472 ItemGen2.uNumCharges = rand() % 6 + pItemsTable->pItems[ItemGen2.uItemID].uDamageMod + 1;
10473 ItemGen2.uMaxCharges = LOBYTE(ItemGen2.uNumCharges);
10474 }
10475 else
10476 {
10477 if ( v26 >= 221 && v26 < 271 )
10478 ItemGen2.uEnchantmentType = rand() % 10 + 1;
10479 }
10480 pItemsTable->SetSpecialBonus(&ItemGen2);
10481 pParty->SetHoldingItem(&ItemGen2);
10482 }
10483 }
10484 }
10485 continue;
10486 }
10487 case WINDOW_PressedButton2://90
10488 {
10489 if ( pWindow->Hint != (char *)1 )
10490 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
10491 pButton = (GUIButton *)pWindow->ptr_1C;
10492 if ( pButton->uX >= 0 && pButton->uX <= 640 )
10493 {
10494 if ( pButton->uY >= 0 && pButton->uY <= 480 )
10495 {
10496 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]);
10497 viewparams->bRedrawGameUI = 1;
10498 if ( pWindow->Hint )
10499 {
10500 v24 = pWindow->Hint == (char *)1;
10501 if ( !v24 )
10502 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
10503 }
10504 pWindow->Release();
10505 continue;
10506 }
10507 }
10508 viewparams->bRedrawGameUI = 1;
10509 if ( pWindow->Hint )
10510 {
10511 v24 = pWindow->Hint == (char *)1;
10512 if ( !v24 )
10513 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
10514 }
10515 pWindow->Release();
10516 continue;
10517 }
10518 case WINDOW_CharactersPressedButton://91
10519 {
10520 if ( pWindow->Hint != (char *)1 )
10521 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
10522 pButton = (GUIButton *)pWindow->ptr_1C;
10523 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]);
10524 viewparams->bRedrawGameUI = 1;
10525 if ( pWindow->Hint )
10526 {
10527 v24 = pWindow->Hint == (char *)1;
10528 if ( !v24 )
10529 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
10530 }
10531 pWindow->Release();
10532 continue;
10533 }
10534 case WINDOW_PressedButton://92
10535 {
10536 if ( pWindow->Hint != (char *)1 )
10537 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
10538 pButton = (GUIButton *)pWindow->ptr_1C;
10539 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]);
10540 viewparams->bRedrawGameUI = 1;
10541 if ( pWindow->Hint )
10542 {
10543 v24 = pWindow->Hint == (char *)1;
10544 if ( !v24 )
10545 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
10546 }
10547 pWindow->Release();
10548 continue;
10549 }
10550 case WINDOW_5D://93
10551 {
10552 if ( pWindow->Hint != (char *)1 )
10553 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
10554 pButton = (GUIButton *)pWindow->ptr_1C;
10555 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]);
10556 viewparams->bRedrawGameUI = 1;
10557 pWindow->Release();
10558 continue;
10559 }
10560 case WINDOW_SaveLoadBtn://94
10295 { 10561 {
10296 if (pWindow->Hint != (char *)1) 10562 if (pWindow->Hint != (char *)1)
10297 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); 10563 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
10298 auto pGUIButton3 = (GUIButton *)pWindow->ptr_1C; 10564 pButton = (GUIButton *)pWindow->ptr_1C;
10299 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton3->pTextures[0]); 10565 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]);
10300 pHint = pWindow->Hint; 10566 pHint = pWindow->Hint;
10301 viewparams->bRedrawGameUI = 1; 10567 viewparams->bRedrawGameUI = 1;
10302 if ( pHint && pHint != (char *)1 ) 10568 if ( pHint && pHint != (char *)1 )
10303 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0); 10569 pButton->DrawLabel(pHint, pFontCreate, 0, 0);
10304 pWindow->Release(); 10570 pWindow->Release();
10305 if (pCurrentScreen == SCREEN_SAVEGAME) 10571 if (pCurrentScreen == SCREEN_SAVEGAME)
10306 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); 10572 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0);
10307 else 10573 else
10308 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); 10574 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
10309 break; 10575 continue;
10310 } 10576 }
10311 case WINDOW_OptionsButtons: 10577 case WINDOW_LoadGame_CancelBtn://95
10312 { 10578 {
10313 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0); 10579 if ( pWindow->Hint != (char *)1 )
10314 pY = pViewport->uViewportTL_Y; 10580 pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
10315 pX = pViewport->uViewportTL_X; 10581 pButton = (GUIButton *)pWindow->ptr_1C;
10316 pRenderer->DrawTextureIndexed(pX, pY, pTexture); 10582 pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]);
10317 viewparams->bRedrawGameUI = 1; 10583 viewparams->bRedrawGameUI = 1;
10318 break; 10584 if ( pWindow->Hint && pWindow->Hint != (char *)1 )
10319 } 10585 pButton->DrawLabel(pWindow->Hint, pFontCreate, 0, 0);
10320 case WINDOW_CharacterRecord: 10586 pWindow->Release();
10321 { 10587 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
10322 CharacterUI_CharacterScreen_Draw(uActiveCharacter); 10588 {
10323 break; 10589 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
10324 } 10590 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
10325 case WINDOW_Options: 10591 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
10326 { 10592 ++pMessageQueue_50CBD0->uNumMessages;
10327 DrawGameOptions(); 10593 continue;
10328 break; 10594 }*/
10329 } 10595 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
10330 case WINDOW_Book: 10596 continue;
10331 { 10597 }
10332 DrawCurrentBook((unsigned int)pWindow->ptr_1C); 10598 case WINDOW_CloseRestWindowBtn://96
10333 break; 10599 {
10334 } 10600 if ( pWindow->Hint != (char *)1 )
10335 case WINDOW_QuickReference: 10601 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
10336 { 10602 pGUIButton = (GUIButton *)pWindow->ptr_1C;
10337 QuickRefDraw(); 10603 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]);
10338 break; 10604 pHint = pWindow->Hint;
10339 } 10605 viewparams->bRedrawGameUI = 1;
10340 case WINDOW_Rest: 10606 if ( pHint && pHint != (char *)1 )
10341 { 10607 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0);
10342 RestUI_Draw(); 10608 pWindow->Release();
10343 break; 10609 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
10344 } 10610 continue;
10345 case WINDOW_Dialogue: 10611 }
10346 { 10612 case WINDOW_ExitCharacterWindow://97
10347 DrawDialogueUI(); 10613 {
10348 break; 10614 if ( pWindow->Hint != (char *)1 )
10349 } 10615 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
10350 case WINDOW_ChangeLocation: 10616 pButton = (GUIButton *)pWindow->ptr_1C;
10351 { 10617 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]);
10352 TravelUI_Draw(); 10618 pHint = pWindow->Hint;
10353 break; 10619 viewparams->bRedrawGameUI = 1;
10354 } 10620 if ( pHint && pHint != (char *)1 )
10355 case WINDOW_SpellBook: 10621 pButton->DrawLabel(pHint, pFontCreate, 0, 0);
10356 { 10622 pWindow->Release();
10357 DrawSpellBookContent(); 10623 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
10358 break; 10624 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
10359 } 10625 continue;
10360 case WINDOW_GreetingNPC: 10626 }
10361 { 10627 case WINDOW_RestWindow://98
10362 DrawBranchlessDialogueUI(); 10628 {
10363 break; 10629 memset(&GUIButton2, 0, 0xBCu);
10364 } 10630 GUIButton2.uZ = 197;
10365 case WINDOW_Transition: 10631 GUIButton2.uW = 197;
10366 { 10632 GUIButton2.uX = 27;
10367 TransitionUI_Draw(); 10633 GUIButton2.uY = 161;
10368 break; 10634 GUIButton2.uWidth = 171;
10369 } 10635 GUIButton2.uHeight = 37;
10370 case WINDOW_Scroll: 10636 GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent;
10371 { 10637 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
10372 CreateScrollWindow(); 10638 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15));
10373 break; 10639 viewparams->bRedrawGameUI = 1;
10374 } 10640 GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Отдых и лечение 8 часов
10375 case WINDOW_FinalWindow: 10641 GUIButton2.pParent = 0;
10376 { 10642 pGUIWindow2 = pWindow;
10377 sub_41420D_press_esc(); 10643 pGUIWindow2->Release();
10378 break; 10644 continue;
10379 } 10645 }
10380 case WINDOW_VideoOptions: 10646 case WINDOW_BooksWindow://99
10381 { 10647 {
10382 GameMenuUI_DrawVideoOptions(); 10648 pButton = (GUIButton *)pWindow->ptr_1C;
10383 break; 10649 pY = pWindow->uFrameY;
10384 } 10650 pX = pWindow->uFrameX;
10385 case WINDOW_KeyMappingOptions: 10651 pRenderer->DrawTextureIndexed(pX, pY, pButton->pTextures[0]);
10386 { 10652 viewparams->bRedrawGameUI = 1;
10387 GameMenuUI_DrawKeyBindings(); 10653 continue;
10388 break; 10654 }
10389 } 10655 case WINDOW_CharacterWindow_Inventory://103
10390 case WINDOW_SaveLoadButtons: 10656 {
10391 { 10657 pWindow->DrawMessageBox(0);
10392 sub_4606FE(); 10658 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
10393 break; 10659 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
10394 } 10660 if ( !pKeyActionMap->field_204 )
10395 case WINDOW_CastSpell_InInventory: 10661 {
10396 { 10662 ItemGen2.Reset();
10397 pRenderer->ClearZBuffer(0, 479); 10663 pWindow->Release();
10398 draw_leather(); 10664 pEventTimer->Resume();
10399 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1); 10665 pCurrentScreen = SCREEN_GAME;
10400 CharacterUI_DrawPaperdoll(uActiveCharacter); 10666 viewparams->bRedrawGameUI = 1;
10401 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, 10667 v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
10402 (Texture *)(uTextureID_x_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_x_u] : 0)); 10668 if ( v39 > 0 )
10403 break; 10669 {
10404 } 10670 if ( v39 < 800 )
10405 case WINDOW_RestWindow: 10671 SpawnActor(v39);
10406 { 10672 }
10407 memset(&GUIButton2, 0, 0xBCu);//pWindowType == 98 (0x62) WINDOW_RestWindow 10673 }
10408 GUIButton2.uZ = 197; 10674 continue;
10409 GUIButton2.uW = 197; 10675 }
10410 GUIButton2.uX = 27; 10676 case WINDOW_KeyMappingOptions://105
10411 GUIButton2.uY = 161; 10677 {
10412 GUIButton2.uWidth = 171; 10678 GameMenuUI_DrawKeyBindings();
10413 GUIButton2.uHeight = 37; 10679 continue;
10414 GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent; 10680 }
10415 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); 10681 case WINDOW_VideoOptions://106
10416 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15)); 10682 {
10417 viewparams->bRedrawGameUI = 1; 10683 GameMenuUI_DrawVideoOptions();
10418 GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Отдых и лечение 8 часов 10684 continue;
10419 GUIButton2.pParent = 0; 10685 }
10420 pGUIWindow2 = pWindow; 10686 default:
10421 pGUIWindow2->Release(); 10687 {
10422 break; 10688 continue;
10423 } 10689 }
10424 case WINDOW_ExitRestWindow: 10690 }
10425 {
10426 if ( pWindow->Hint != (char *)1 )
10427 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
10428 pGUIButton = (GUIButton *)pWindow->ptr_1C;
10429 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]);
10430 pHint = pWindow->Hint;
10431 viewparams->bRedrawGameUI = 1;
10432 if ( pHint && pHint != (char *)1 )
10433 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0);
10434 pWindow->Release();
10435 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
10436 break;
10437 }
10438 case WINDOW_ExitCharacterWindow:
10439 {
10440 if ( pWindow->Hint != (char *)1 )
10441 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
10442 pButton = (GUIButton *)pWindow->ptr_1C;
10443 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]);
10444 pHint = pWindow->Hint;
10445 viewparams->bRedrawGameUI = 1;
10446 if ( pHint && pHint != (char *)1 )
10447 pButton->DrawLabel(pHint, pFontCreate, 0, 0);
10448 pWindow->Release();
10449 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
10450 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
10451 break;
10452 }
10453 case WINDOW_BooksWindow:
10454 {
10455 pButton = (GUIButton *)pWindow->ptr_1C;
10456 pY = pWindow->uFrameY;
10457 pX = pWindow->uFrameX;
10458 pRenderer->DrawTextureIndexed(pX, pY, pButton->pTextures[0]);
10459 viewparams->bRedrawGameUI = 1;
10460 break;
10461 }
10462 case WINDOW_CharacterWindow_Inventory:
10463 {
10464 pWindow->DrawMessageBox(0);
10465 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0);
10466 pWindow->DrawText(pFontLucida, 10, 40, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 0, 0, 0);
10467 if ( !pKeyActionMap->field_204 )
10468 {
10469 ItemGen2.Reset();
10470 pWindow->Release();
10471 pEventTimer->Resume();
10472 pCurrentScreen = SCREEN_GAME;
10473 viewparams->bRedrawGameUI = 1;
10474 v39 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
10475 if ( v39 > 0 )
10476 {
10477 if ( v39 < 800 )
10478 SpawnActor(v39);
10479 }
10480 }
10481 break;
10482 }
10483 case WINDOW_Chest:
10484 {
10485 if ( pCurrentScreen == SCREEN_CHEST )
10486 {
10487 Chest::DrawChestUI((unsigned int)pWindow->ptr_1C);
10488 }
10489 else if ( pCurrentScreen == SCREEN_F )
10490 {
10491 pRenderer->ClearZBuffer(0, 479);
10492 draw_leather();
10493 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
10494 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY,
10495 (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
10496 }
10497 break;
10498 }
10499 case WINDOW_HouseInterior:
10500 {
10501 pWindowList[pVisibleWindowsIdxs[i] - 1].HouseDialogManager();
10502 if ( !window_SpeakInHouse )
10503 continue;
10504 v10 = window_SpeakInHouse->ptr_1C;
10505 if ( (signed int)v10 >= 53 )
10506 continue;
10507 if ( pParty->field_3C._shop_ban_times[(signed int)v10] <=pParty->uTimePlayed )
10508 {
10509 if ( (signed int)v10 < 53 )
10510 {
10511 pParty->field_3C._shop_ban_times[(signed int)v10] = 0;
10512 }
10513 continue;
10514 }
10515 pNumMessages = pMessageQueue_50CBD0->uNumMessages;
10516 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
10517 break;
10518 }
10519 default:
10520 {
10521 break;
10522 }
10523 }
10524 } 10691 }
10525 if ( GetCurrentMenuID() == -1 ) 10692 if ( GetCurrentMenuID() == -1 )
10526 GameUI_DrawFoodAndGold(); 10693 GameUI_DrawFoodAndGold();
10527 if ( sub_4637E0_is_there_popup_onscreen() ) 10694 if ( sub_4637E0_is_there_popup_onscreen() )
10528 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0); 10695 sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(0);