comparison mm7_5.cpp @ 961:5a12082c803d

UIMSG and WINDOW_Type(continue)
author Ritor1
date Mon, 06 May 2013 17:33:40 +0600
parents 9a5db2cf999a
children 0423c40d7e88
comparison
equal deleted inserted replaced
960:9a5db2cf999a 961:5a12082c803d
198 GUIButton *pButton2; // [sp-4h] [bp-600h]@59 198 GUIButton *pButton2; // [sp-4h] [bp-600h]@59
199 const char *v150; // [sp-4h] [bp-600h]@86 199 const char *v150; // [sp-4h] [bp-600h]@86
200 //unsigned int v151; // [sp-4h] [bp-600h]@107 200 //unsigned int v151; // [sp-4h] [bp-600h]@107
201 int v152; // [sp-4h] [bp-600h]@121 201 int v152; // [sp-4h] [bp-600h]@121
202 int v153; // [sp-4h] [bp-600h]@135 202 int v153; // [sp-4h] [bp-600h]@135
203 int v154; // [sp-4h] [bp-600h]@149 203 //int v154; // [sp-4h] [bp-600h]@149
204 int v155; // [sp-4h] [bp-600h]@165 204 int v155; // [sp-4h] [bp-600h]@165
205 int v156; // [sp-4h] [bp-600h]@204 205 int v156; // [sp-4h] [bp-600h]@204
206 //const char *v157; // [sp-4h] [bp-600h]@444 206 //const char *v157; // [sp-4h] [bp-600h]@444
207 unsigned int v158; // [sp-4h] [bp-600h]@449 207 unsigned int v158; // [sp-4h] [bp-600h]@449
208 //__int16 v159; // [sp-4h] [bp-600h]@550 208 //__int16 v159; // [sp-4h] [bp-600h]@550
381 OnSelectShopDialogueOption(uMessageParam); 381 OnSelectShopDialogueOption(uMessageParam);
382 continue; 382 continue;
383 case UIMSG_SelectNPCDialogueOption: 383 case UIMSG_SelectNPCDialogueOption:
384 OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam); 384 OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam);
385 continue; 385 continue;
386 case UIMSG_19A: 386 case UIMSG_ClickHouseNPCPortrait:
387 _4B4224_UpdateNPCTopics(uMessageParam); 387 _4B4224_UpdateNPCTopics(uMessageParam);
388 continue; 388 continue;
389 case UIMSG_StartNewGame: 389 case UIMSG_StartNewGame:
390 if ( dword_6BE138 == 124 || uMessageParam ) 390 if ( dword_6BE138 == 124 || uMessageParam )
391 { 391 {
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_5A, (int)pBtnArrowUp, 0); 451 GUIWindow::Create(215, 199, 17, 17, WINDOW_Button, (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_5A, (int)pBtnDownArrow, 0); 457 GUIWindow::Create(215, 323, 17, 17, WINDOW_Button, (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_ExitRestWindow, (int)pBtnCancel, 0);
461 continue; 461 continue;
462 case UIMSG_LoadSlot: 462 case UIMSG_SaveLoadBtn:
463 GUIWindow::Create(241, 302, 106, 42, WINDOW_5E, (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:
466 if ( pGUIWindow_CurrentMenu->field_40 == v0 ) 466 if ( pGUIWindow_CurrentMenu->field_40 == v0 )
467 pKeyActionMap->_459ED1(0); 467 pKeyActionMap->_459ED1(0);
468 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam ) 468 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
469 { 469 {
470 v10 = pSaveListPosition + uMessageParam; 470 v10 = pSaveListPosition + uMessageParam;
471 if ( dword_6BE138 == pSaveListPosition + uMessageParam ) 471 if ( dword_6BE138 == pSaveListPosition + uMessageParam )
472 { 472 {
473 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadSlot, 0, 0); 473 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0);
474 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); 474 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
475 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 475 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
476 { 476 {
477 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_LoadSlot; 477 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_SaveLoadBtn;
478 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 478 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
479 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 479 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
480 //v11 = pMessageQueue_50CBD0->uNumMessages + 1; 480 //v11 = pMessageQueue_50CBD0->uNumMessages + 1;
481 //v13 = pMessageQueue_50CBD0->uNumMessages + 1 > 40; 481 //v13 = pMessageQueue_50CBD0->uNumMessages + 1 > 40;
482 //v12 = (signed int)pMessageQueue_50CBD0->uNumMessages - 39 < 0; 482 //v12 = (signed int)pMessageQueue_50CBD0->uNumMessages - 39 < 0;
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_5A, (int)pBtn_SliderLeft, v0); 745 GUIWindow::Create(21, 161, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_SliderRight, v0); 756 GUIWindow::Create(213, 161, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_SliderLeft, v0); 785 GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_SliderRight, v0); 796 GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_SliderLeft, v0); 815 GUIWindow::Create(243, 162, 0, 0, WINDOW_Button, (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
822 ++uSoundVolumeMultiplier; 822 ++uSoundVolumeMultiplier;
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_5A, v154, v168); 828 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_SliderLeft, v0); 857 GUIWindow::Create(243, 270, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_SliderRight, v0); 868 GUIWindow::Create(435, 270, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_GameSettings, v0); 1471 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_Button, (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 )
1477 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 1477 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
1478 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_3, 0, 0); 1478 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_OptionsButtons, 0, 0);
1479 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); 1479 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
1480 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); 1480 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
1481 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); 1481 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
1482 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); 1482 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE);
1483 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); 1483 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
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_5A, (int)pBtn_NPCRight, 0); 1526 GUIWindow::Create(626, 179, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_NPCLeft, 0); 1537 GUIWindow::Create(469, 179, 0, 0, WINDOW_Button, (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;
1718 } 1718 }
1719 viewparams->bRedrawGameUI = v0; 1719 viewparams->bRedrawGameUI = v0;
1720 continue; 1720 continue;
1721 case UIMSG_5B: 1721 case UIMSG_5B:
1722 goto LABEL_387; 1722 goto LABEL_387;
1723 case UIMSG_BE: 1723 case UIMSG_CastSpell_BE:
1724 if ( pRenderer->pRenderD3D ) 1724 if ( pRenderer->pRenderD3D )
1725 { 1725 {
1726 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val(); 1726 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val();
1727 } 1727 }
1728 else 1728 else
1823 pMouse->SetCursorBitmap("MICON1"); 1823 pMouse->SetCursorBitmap("MICON1");
1824 GameUI_Footer_TimeLeft = 0; 1824 GameUI_Footer_TimeLeft = 0;
1825 unk_50C9A0 = 0; 1825 unk_50C9A0 = 0;
1826 back_to_game(); 1826 back_to_game();
1827 continue; 1827 continue;
1828 case UIMSG_45: 1828 case UIMSG_CastSpell_SPIRIT_Preservation:
1829 case UIMSG_8D: 1829 case UIMSG_CastSpell_8D:
1830 case UIMSG_8F: 1830 case UIMSG_8F:
1831 if ( pMessageQueue_50CBD0->uNumMessages ) 1831 if ( pMessageQueue_50CBD0->uNumMessages )
1832 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 1832 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1833 if ( unk_50C9A0 ) 1833 if ( unk_50C9A0 )
1834 { 1834 {
1901 case UIMSG_OnCastTownPortal: 1901 case UIMSG_OnCastTownPortal:
1902 pAudioPlayer->StopChannels(-1, -1); 1902 pAudioPlayer->StopChannels(-1, -1);
1903 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, uMessageParam); 1903 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, uMessageParam);
1904 continue; 1904 continue;
1905 1905
1906 case UIMSG_B1: 1906 case UIMSG_OnCastLloydsBeacon:
1907 pAudioPlayer->StopChannels(-1, -1); 1907 pAudioPlayer->StopChannels(-1, -1);
1908 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, 117, 0); 1908 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_LloydsBeacon, 0);
1909 continue; 1909 continue;
1910 1910
1911 case UIMSG_B2: 1911 case UIMSG_LloydsBeacon_FlippingBtn:
1912 bRecallingBeacon = uMessageParam; 1912 bRecallingBeacon = uMessageParam;
1913 v127 = uMessageParam + 204; 1913 v127 = uMessageParam + 204;
1914 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); 1914 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
1915 continue; 1915 continue;
1916 case UIMSG_B4: 1916 case UIMSG_HintBeaconSlot:
1917 if ( !pGUIWindow_CurrentMenu ) 1917 if ( !pGUIWindow_CurrentMenu )
1918 continue; 1918 continue;
1919 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; 1919 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1];
1920 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; 1920 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam];
1921 if ( bRecallingBeacon ) 1921 if ( bRecallingBeacon )
1940 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName; 1940 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName;
1941 v158 = (unsigned int)thise; 1941 v158 = (unsigned int)thise;
1942 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" 1942 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s"
1943 sub_41C0B8_set_status_string(pTmpBuf); 1943 sub_41C0B8_set_status_string(pTmpBuf);
1944 continue; 1944 continue;
1945 case UIMSG_B5: 1945 case UIMSG_CloseAfterInstallBeacon:
1946 dword_50CDC8 = v0; 1946 dword_50CDC8 = v0;
1947 //goto LABEL_453; 1947 //goto LABEL_453;
1948 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); 1948 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
1949 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 1949 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
1950 continue; 1950 continue;
1951 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 1951 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
1952 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 1952 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
1953 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 1953 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
1954 ++pMessageQueue_50CBD0->uNumMessages;*/ 1954 ++pMessageQueue_50CBD0->uNumMessages;*/
1955 continue; 1955 continue;
1956 case UIMSG_B3: 1956 case UIMSG_InstallBeacon:
1957 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; 1957 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1];
1958 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam]; 1958 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam];
1959 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon ) 1959 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon )
1960 continue; 1960 continue;
1961 byte_506360 = 1; 1961 byte_506360 = 1;
2038 continue; 2038 continue;
2039 } 2039 }
2040 HIWORD(pNPCData4->uProfession) = thisg; 2040 HIWORD(pNPCData4->uProfession) = thisg;
2041 } 2041 }
2042 continue; 2042 continue;
2043 case UIMSG_B7: 2043 case UIMSG_ClickTownInTP:
2044 if ( uMessageParam ) 2044 if ( uMessageParam )
2045 { 2045 {
2046 switch ( uMessageParam ) 2046 switch ( uMessageParam )
2047 { 2047 {
2048 case 1: 2048 case 1:
2115 v63 = 206; 2115 v63 = 206;
2116 } 2116 }
2117 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) ) 2117 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) )
2118 return; 2118 return;
2119 goto LABEL_486; 2119 goto LABEL_486;
2120 case UIMSG_B6: 2120 case UIMSG_HintTownPortal:
2121 if ( uMessageParam ) 2121 if ( uMessageParam )
2122 { 2122 {
2123 switch ( uMessageParam ) 2123 switch ( uMessageParam )
2124 { 2124 {
2125 case 1: 2125 case 1:
2339 ShowStatusBarString(v73, 6u); 2339 ShowStatusBarString(v73, 6u);
2340 //goto LABEL_90; 2340 //goto LABEL_90;
2341 v1 = ""; 2341 v1 = "";
2342 v0 = 1; 2342 v0 = 1;
2343 continue; 2343 continue;
2344 case UIMSG_19: 2344 case UIMSG_CastQuickSpell:
2345 if ( bUnderwater == 1 ) 2345 if ( bUnderwater == 1 )
2346 { 2346 {
2347 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!" 2347 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
2348 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 2348 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
2349 continue; 2349 continue;
2355 v0 = 1; 2355 v0 = 1;
2356 continue; 2356 continue;
2357 } 2357 }
2358 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter); 2358 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
2359 continue; 2359 continue;
2360 case UIMSG_46: 2360 case UIMSG_CastSpell_SmallShot://FireBlow, Lightning, Ice Lightning, Swarm, hand hammer
2361 case UIMSG_8C: 2361 case UIMSG_CastSpell_GreatShot://Fireball, Spraying poison and other
2362 if ( pRenderer->pRenderD3D ) 2362 if ( pRenderer->pRenderD3D )
2363 { 2363 {
2364 v81 = pGame->pVisInstance->get_picked_object_zbuf_val(); 2364 v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
2365 } 2365 }
2366 else 2366 else
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_5A, 2487 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_Button,
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_5A, 2499 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_Button,
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_5A, 2645 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_Button,
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_5A, (int)pBtn_InstallRemoveSpell, 0); 2689 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_CastSpell, 0); 2825 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_CastSpell, 0); 2839 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_QuickReference, 0); 2858 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_Button, (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);
2893 case UIMSG_C0: 2893 case UIMSG_C0:
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_A9: 2898 case UIMSG_ClickAwardsUpBtn:
2899 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_5B, (int)pBtn_Up, 0); 2899 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersButton, (int)pBtn_Up, 0);
2900 dword_506548 = v0; 2900 dword_506548 = v0;
2901 continue; 2901 continue;
2902 case UIMSG_AA: 2902 case UIMSG_ClickAwardsDownBtn:
2903 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_5B, (int)pBtn_Down, 0); 2903 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersButton, (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_5B, (int)pCharacterScreen_StatsBtn, 0); 2937 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersButton, (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_5B, (int)pCharacterScreen_SkillsBtn, 0); 2944 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersButton, (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_5B, (int)pCharacterScreen_InventoryBtn, 0); 2973 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersButton, (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_5B, (int)pCharacterScreen_AwardsBtn, 0); 2983 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersButton, (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 {
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_5A, (int)pBtn_ZoomOut, 0); 3186 GUIWindow::Create(0x207u, 0x88u, 0, 0, WINDOW_Button, (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_5A, (int)pBtn_ZoomIn, 0); 3216 GUIWindow::Create(0x23Eu, 0x88u, 0, 0, WINDOW_Button, (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_5A, (int)pMainMenu_BtnNew, 0); 3359 GUIWindow::Create(495, 172, 0, 0, WINDOW_Button, (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_5A, (int)pMainMenu_BtnLoad, 0); 3363 GUIWindow::Create(495, 227, 0, 0, WINDOW_Button, (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_5A, (int)pMainMenu_BtnCredits, 0); 3367 GUIWindow::Create(495, 282, 0, 0, WINDOW_Button, (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_5A, (int)pMainMenu_BtnExit, 0); 3371 GUIWindow::Create(495, 337, 0, 0, WINDOW_Button, (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;
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_5A, (int)pPlayerCreationUI_BtnPlus, 1); 3447 GUIWindow::Create(613, 393, 0, 0, WINDOW_Button, (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_5A, (int)pPlayerCreationUI_BtnMinus, 1); 3452 GUIWindow::Create(523, 393, 0, 0, WINDOW_Button, (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_5A, (int)pPlayerCreationUI_BtnOK, 0); 3470 GUIWindow::Create(580, 431, 0, 0, WINDOW_Button, (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_5A, (int)pPlayerCreationUI_BtnReset, 0); 3477 GUIWindow::Create(527, 431, 0, 0, WINDOW_Button, (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;
3504 SetCurrentMenuID(MENU_10); 3504 SetCurrentMenuID(MENU_10);
3505 break; 3505 break;
3506 case UIMSG_LoadGame: 3506 case UIMSG_LoadGame:
3507 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) 3507 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
3508 break; 3508 break;
3509 SetCurrentMenuID(MENU_LOADINGPROC); 3509 SetCurrentMenuID(MENU_LoadingProcInMainMenu);
3510 break; 3510 break;
3511 case UIMSG_SelectLoadSlot: 3511 case UIMSG_SelectLoadSlot:
3512 //main menu save/load wnd clicking on savegame lines 3512 //main menu save/load wnd clicking on savegame lines
3513 if (pGUIWindow_CurrentMenu->field_40 == 1) 3513 if (pGUIWindow_CurrentMenu->field_40 == 1)
3514 pKeyActionMap->_459ED1(0); 3514 pKeyActionMap->_459ED1(0);
3516 { 3516 {
3517 //load clicked line 3517 //load clicked line
3518 v26 = uNum + pSaveListPosition; 3518 v26 = uNum + pSaveListPosition;
3519 if ( dword_6BE138 == uNum + pSaveListPosition ) 3519 if ( dword_6BE138 == uNum + pSaveListPosition )
3520 { 3520 {
3521 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadSlot, 0, 0); 3521 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0);
3522 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); 3522 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
3523 } 3523 }
3524 uLoadGameUI_SelectedSlot = v26; 3524 uLoadGameUI_SelectedSlot = v26;
3525 dword_6BE138 = v26; 3525 dword_6BE138 = v26;
3526 } 3526 }
3530 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); 3530 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
3531 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); 3531 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
3532 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); 3532 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
3533 } 3533 }
3534 break; 3534 break;
3535 case UIMSG_LoadSlot: 3535 case UIMSG_SaveLoadBtn:
3536 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)pBtnLoadSlot, 0); 3536 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0);
3537 break; 3537 break;
3538 case UIMSG_DownArrow: 3538 case UIMSG_DownArrow:
3539 ++pSaveListPosition; 3539 ++pSaveListPosition;
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_5A, (int)pBtnDownArrow, 0); 3545 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_Button, (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_5A, (int)pBtnArrowUp, 0); 3555 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_Button, (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_5A, (int)pMainMenu_BtnNew, 0); 3558 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_Button, (int)pMainMenu_BtnNew, 0);
3559 SetCurrentMenuID(MENU_LOADINGPROC); 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_5A, (int)pMainMenu_BtnExit, 0); 3562 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_Button, (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 {
9672 } 9672 }
9673 9673
9674 //----- (00410DEC) -------------------------------------------------------- 9674 //----- (00410DEC) --------------------------------------------------------
9675 unsigned int __cdecl DrawLloydBeaconsScreen() 9675 unsigned int __cdecl DrawLloydBeaconsScreen()
9676 { 9676 {
9677 Player *v0; // esi@1 9677 Player *pPlayer; // esi@1
9678 char *v1; // eax@1 9678 char *v1; // eax@1
9679 unsigned __int16 v2; // ax@6 9679 unsigned __int16 v2; // ax@6
9680 unsigned int result; // eax@11 9680 unsigned int result; // eax@11
9681 unsigned int v4; // esi@13 9681 unsigned int v4; // esi@13
9682 unsigned int v5; // ecx@13 9682 unsigned int v5; // ecx@13
9687 unsigned int v10; // esi@14 9687 unsigned int v10; // esi@14
9688 unsigned int v11; // eax@14 9688 unsigned int v11; // eax@14
9689 char *v12; // eax@19 9689 char *v12; // eax@19
9690 char *v13; // ecx@22 9690 char *v13; // ecx@22
9691 int v14; // eax@27 9691 int v14; // eax@27
9692 unsigned int v15; // [sp-10h] [bp-98h]@25
9693 unsigned __int16 v16; // [sp-Ch] [bp-94h]@25
9694 int v17; // [sp-8h] [bp-90h]@21
9695 char *v18; // [sp-8h] [bp-90h]@25
9696 Texture *v19; // [sp-4h] [bp-8Ch]@4 9692 Texture *v19; // [sp-4h] [bp-8Ch]@4
9697 char *v20; // [sp-4h] [bp-8Ch]@21 9693 GUIWindow pWindow; // [sp+Ch] [bp-7Ch]@1
9698 unsigned int v21; // [sp-4h] [bp-8Ch]@25
9699 GUIWindow v22; // [sp+Ch] [bp-7Ch]@1
9700 unsigned int v23; // [sp+64h] [bp-24h]@14 9694 unsigned int v23; // [sp+64h] [bp-24h]@14
9701 __int64 v24; // [sp+68h] [bp-20h]@14 9695 __int64 v24; // [sp+68h] [bp-20h]@14
9702 unsigned int v25; // [sp+70h] [bp-18h]@13 9696 unsigned int v25; // [sp+70h] [bp-18h]@13
9703 char *Str; // [sp+74h] [bp-14h]@14 9697 char *Str; // [sp+74h] [bp-14h]@14
9704 int v27; // [sp+78h] [bp-10h]@11 9698 int v27; // [sp+78h] [bp-10h]@11
9705 LloydBeacon *v28; // [sp+7Ch] [bp-Ch]@12 9699 LloydBeacon *v28; // [sp+7Ch] [bp-Ch]@12
9706 RGBTexture *v29; // [sp+80h] [bp-8h]@12 9700 RGBTexture *v29; // [sp+80h] [bp-8h]@12
9707 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6 9701 int uNumMaxBeacons; // [sp+84h] [bp-4h]@6
9708 9702
9709 v0 = &pParty->pPlayers[_506348_current_lloyd_playerid]; 9703 pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid];
9710 pRenderer->DrawTextureIndexed(8u, 8u, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]); 9704 pRenderer->DrawTextureIndexed(8u, 8u, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]);
9711 v1 = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon 9705 v1 = pGlobalTXT_LocalizationStrings[523]; // Recall Beacon
9712 v22.uFrameX = game_viewport_x; 9706 pWindow.uFrameX = game_viewport_x;
9713 v22.uFrameY = game_viewport_y; 9707 pWindow.uFrameY = game_viewport_y;
9714 v22.uFrameWidth = 428; 9708 pWindow.uFrameWidth = 428;
9715 v22.uFrameHeight = game_viewport_height; 9709 pWindow.uFrameHeight = game_viewport_height;
9716 v22.uFrameZ = 435; 9710 pWindow.uFrameZ = 435;
9717 v22.uFrameW = game_viewport_w; 9711 pWindow.uFrameW = game_viewport_w;
9718 if ( !bRecallingBeacon ) 9712 if ( !bRecallingBeacon )
9719 v1 = pGlobalTXT_LocalizationStrings[375]; // Set Beacon 9713 v1 = pGlobalTXT_LocalizationStrings[375]; // Set Beacon
9720 sprintf(pTmpBuf, "%s", v1); 9714 sprintf(pTmpBuf, "%s", v1);
9721 v22.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf, 3u); 9715 pWindow.DrawTitleText(pBook2Font, 0, 22u, 0, pTmpBuf, 3u);
9722 if ( bRecallingBeacon ) 9716 if ( bRecallingBeacon )
9723 { 9717 {
9724 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on); 9718 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6b__zoom_on);
9725 v19 = pTex_tab_an_6a__zoom_off; 9719 v19 = pTex_tab_an_6a__zoom_off;
9726 } 9720 }
9728 { 9722 {
9729 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6a__zoom_off); 9723 pRenderer->DrawTextureTransparent(pBtn_Book_1->uX, pBtn_Book_1->uY, pTex_tab_an_6a__zoom_off);
9730 v19 = pTex_tab_an_6b__zoom_on; 9724 v19 = pTex_tab_an_6b__zoom_on;
9731 } 9725 }
9732 pRenderer->DrawTextureTransparent(pBtn_Book_2->uX, pBtn_Book_2->uY, v19); 9726 pRenderer->DrawTextureTransparent(pBtn_Book_2->uX, pBtn_Book_2->uY, v19);
9733 v2 = v0->pActiveSkills[14]; 9727 v2 = pPlayer->pActiveSkills[14];
9734 uNumMaxBeacons = 1; 9728 uNumMaxBeacons = 1;
9735 if ( HIBYTE(v2) & 1 || (v2 & 0x80u) != 0 ) 9729 if ( HIBYTE(v2) & 1 || (v2 & 0x80u) != 0 )
9736 { 9730 {
9737 uNumMaxBeacons = 5; 9731 uNumMaxBeacons = 5;
9738 } 9732 }
9744 result = 0; 9738 result = 0;
9745 v27 = 0; 9739 v27 = 0;
9746 if ( uNumMaxBeacons > 0 ) 9740 if ( uNumMaxBeacons > 0 )
9747 { 9741 {
9748 v29 = pSavegameThumbnails; 9742 v29 = pSavegameThumbnails;
9749 v28 = v0->pInstalledBeacons; 9743 v28 = pPlayer->pInstalledBeacons;
9750 while ( 1 ) 9744 while ( 1 )
9751 { 9745 {
9752 v22.uFrameWidth = 92; 9746 pWindow.uFrameWidth = 92;
9753 v4 = result; 9747 v4 = result;
9754 v22.uFrameHeight = 68; 9748 pWindow.uFrameHeight = 68;
9755 v5 = pLloydsBeaconsPreviewXs[result]; 9749 v5 = pLloydsBeaconsPreviewXs[result];
9756 v22.uFrameY = pLloydsBeaconsPreviewYs[result]; 9750 pWindow.uFrameY = pLloydsBeaconsPreviewYs[result];
9757 v25 = v22.uFrameY; 9751 v25 = pWindow.uFrameY;
9758 v22.uFrameX = v5; 9752 pWindow.uFrameX = v5;
9759 v22.uFrameW = v22.uFrameY + 67; 9753 pWindow.uFrameW = pWindow.uFrameY + 67;
9760 v6 = v29->pPixels == 0; 9754 v6 = v29->pPixels == 0;
9761 v22.uFrameZ = v5 + 91; 9755 pWindow.uFrameZ = v5 + 91;
9762 if ( !v6 ) 9756 if ( !v6 )
9763 break; 9757 break;
9764 if ( !bRecallingBeacon ) 9758 if ( !bRecallingBeacon )
9765 { 9759 {
9766 pRenderer->DrawTextureTransparent( 9760 pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[v4], pLloydsBeacons_SomeYs[v4], pTexture_CurrentBook);
9767 pLloydsBeacons_SomeXs[v4], 9761 v14 = pSpellFont->CalcTextHeight(pGlobalTXT_LocalizationStrings[19], &pWindow, 0, 0);
9768 pLloydsBeacons_SomeYs[v4], 9762 pWindow.DrawTitleText(pSpellFont, 0, (signed int)pWindow.uFrameHeight / 2 - v14 / 2, 1, pGlobalTXT_LocalizationStrings[19], 3);
9769 pTexture_CurrentBook);
9770 v21 = 3;
9771 v18 = pGlobalTXT_LocalizationStrings[19];
9772 v16 = 1;
9773 v14 = pSpellFont->CalcTextHeight(pGlobalTXT_LocalizationStrings[19], &v22, 0, 0);
9774 v15 = (signed int)v22.uFrameHeight / 2 - v14 / 2;
9775 goto LABEL_28;
9776 } 9763 }
9777 LABEL_29: 9764 LABEL_29:
9778 ++v29; 9765 ++v29;
9779 ++v28; 9766 ++v28;
9780 result = v27++ + 1; 9767 result = v27++ + 1;
9781 if ( v27 >= uNumMaxBeacons ) 9768 if ( v27 >= uNumMaxBeacons )
9782 goto LABEL_30; 9769 goto LABEL_30;
9783 } 9770 }
9784 pRenderer->DrawTextureTransparent( 9771 pRenderer->DrawTextureTransparent(pLloydsBeacons_SomeXs[v4], pLloydsBeacons_SomeYs[v4], pTexture_CurrentBook);
9785 pLloydsBeacons_SomeXs[v4],
9786 pLloydsBeacons_SomeYs[v4],
9787 pTexture_CurrentBook);
9788 pRenderer->DrawTextureRGB(pLloydsBeaconsPreviewXs[v4], pLloydsBeaconsPreviewYs[v4], v29); 9772 pRenderer->DrawTextureRGB(pLloydsBeaconsPreviewXs[v4], pLloydsBeaconsPreviewYs[v4], v29);
9789 v7 = v28; 9773 v7 = v28;
9790 Str = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(v28->field_18))].pName; 9774 Str = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(v28->field_18))].pName;
9791 v8 = pSpellFont->CalcTextHeight(Str, &v22, 0, 0); 9775 v8 = pSpellFont->CalcTextHeight(Str, &pWindow, 0, 0);
9792 v22.uFrameY += -6 - v8; 9776 pWindow.uFrameY += -6 - v8;
9793 v22.DrawTitleText(pSpellFont, 0, 0, 1u, Str, 3u); 9777 pWindow.DrawTitleText(pSpellFont, 0, 0, 1u, Str, 3u);
9794 v9 = v7->uBeaconTime - pParty->uTimePlayed; 9778 v9 = v7->uBeaconTime - pParty->uTimePlayed;
9795 LODWORD(v24) = LODWORD(v7->uBeaconTime) - LODWORD(pParty->uTimePlayed); 9779 LODWORD(v24) = LODWORD(v7->uBeaconTime) - LODWORD(pParty->uTimePlayed);
9796 HIDWORD(v24) = HIDWORD(v9); 9780 HIDWORD(v24) = HIDWORD(v9);
9797 v23 = (unsigned __int64)((signed __int64)((double)v24 * 0.234375) / 60 / 60) >> 32; 9781 v23 = (unsigned __int64)((signed __int64)((double)v24 * 0.234375) / 60 / 60) >> 32;
9798 v10 = (signed __int64)((double)v24 * 0.234375) / 60 / 60; 9782 v10 = (signed __int64)((double)v24 * 0.234375) / 60 / 60;
9800 if ( (unsigned int)((signed __int64)((double)v24 * 0.234375) / 60 / 60) / 0x18 ) 9784 if ( (unsigned int)((signed __int64)((double)v24 * 0.234375) / 60 / 60) / 0x18 )
9801 { 9785 {
9802 v13 = pGlobalTXT_LocalizationStrings[57]; // Days 9786 v13 = pGlobalTXT_LocalizationStrings[57]; // Days
9803 if ( v11 > 1 ) 9787 if ( v11 > 1 )
9804 { 9788 {
9805 LABEL_24: 9789 sprintf(pTmpBuf, "%lu %s", v11 + 1, v13);
9806 v20 = v13; 9790 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
9807 v17 = v11 + 1; 9791 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf, 3);
9808 LABEL_25:
9809 sprintf(pTmpBuf, "%lu %s", v17, v20);
9810 v21 = 3;
9811 v18 = pTmpBuf;
9812 v16 = 1;
9813 v22.uFrameY = v25 + v22.uFrameHeight + 4;
9814 v15 = 0;
9815 LABEL_28:
9816 v22.DrawTitleText(pSpellFont, 0, v15, v16, v18, v21);
9817 goto LABEL_29; 9792 goto LABEL_29;
9818 } 9793 }
9819 } 9794 }
9820 else 9795 else
9821 { 9796 {
9823 { 9798 {
9824 if ( (v23 & 0x80000000u) != 0 || (signed int)v23 <= 0 && v10 <= 1 ) 9799 if ( (v23 & 0x80000000u) != 0 || (signed int)v23 <= 0 && v10 <= 1 )
9825 v12 = pGlobalTXT_LocalizationStrings[109];// Hour 9800 v12 = pGlobalTXT_LocalizationStrings[109];// Hour
9826 else 9801 else
9827 v12 = pGlobalTXT_LocalizationStrings[110];// Hours 9802 v12 = pGlobalTXT_LocalizationStrings[110];// Hours
9828 v20 = v12; 9803 sprintf(pTmpBuf, "%lu %s", v10 + 1, v12);
9829 v17 = v10 + 1; 9804 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
9830 goto LABEL_25; 9805 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf, 3);
9806 goto LABEL_29;
9831 } 9807 }
9832 } 9808 }
9833 v13 = pGlobalTXT_LocalizationStrings[56]; // Day 9809 v13 = pGlobalTXT_LocalizationStrings[56]; // Day
9834 goto LABEL_24; 9810 sprintf(pTmpBuf, "%lu %s", v11 + 1, v13);
9811 pWindow.uFrameY = v25 + pWindow.uFrameHeight + 4;
9812 pWindow.DrawTitleText(pSpellFont, 0, 0, 1, pTmpBuf, 3);
9813 goto LABEL_29;
9835 } 9814 }
9836 LABEL_30: 9815 LABEL_30:
9837 if ( byte_506360 ) 9816 if ( byte_506360 )
9838 { 9817 {
9839 /*result = pMessageQueue_50CBD0->uNumMessages; 9818 /*result = pMessageQueue_50CBD0->uNumMessages;
9840 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 9819 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
9841 { 9820 {
9842 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)181; 9821 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_CloseAfterInstallBeacon;
9843 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 9822 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
9844 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; 9823 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
9845 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0; 9824 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
9846 ++pMessageQueue_50CBD0->uNumMessages; 9825 ++pMessageQueue_50CBD0->uNumMessages;
9847 }*/ 9826 }*/
9848 pMessageQueue_50CBD0->AddMessage(UIMSG_B5, 0, 0); 9827 pMessageQueue_50CBD0->AddMessage(UIMSG_CloseAfterInstallBeacon, 0, 0);
9849 } 9828 }
9850 return result; 9829 return result;
9851 } 9830 }
9852 9831
9853 9832
10305 //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]]; 10284 //v0 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[i]];
10306 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1]; 10285 pWindow = &pWindowList[pVisibleWindowsIdxs[i] - 1];
10307 pWindowType = pWindow->eWindowType; 10286 pWindowType = pWindow->eWindowType;
10308 switch (pWindow->eWindowType) 10287 switch (pWindow->eWindowType)
10309 { 10288 {
10310 case WINDOW_MainMenu_Load: 10289 case WINDOW_MainMenu_Load:
10311 { 10290 {
10312 GameUI_MainMenu_DrawLoad(); 10291 GameUI_MainMenu_DrawLoad();
10313 break; 10292 break;
10314 } 10293 }
10315 case WINDOW_5E: // window that initiates savegame loading 10294 case WINDOW_SaveLoadBtn:
10316 { 10295 {
10317 if (pWindow->Hint != (char *)1) 10296 if (pWindow->Hint != (char *)1)
10318 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); 10297 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
10319 auto pGUIButton3 = (GUIButton *)pWindow->ptr_1C; 10298 auto pGUIButton3 = (GUIButton *)pWindow->ptr_1C;
10320 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton3->pTextures[0]); 10299 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton3->pTextures[0]);
10321 pHint = pWindow->Hint; 10300 pHint = pWindow->Hint;
10322 viewparams->bRedrawGameUI = 1; 10301 viewparams->bRedrawGameUI = 1;
10323 if ( pHint && pHint != (char *)1 ) 10302 if ( pHint && pHint != (char *)1 )
10324 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0); 10303 pGUIButton3->DrawLabel(pHint, pFontCreate, 0, 0);
10325 pWindow->Release(); 10304 pWindow->Release();
10326 if (pCurrentScreen == SCREEN_SAVEGAME) 10305 if (pCurrentScreen == SCREEN_SAVEGAME)
10327 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); 10306 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0);
10328 else 10307 else
10329 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0); 10308 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
10330 break; 10309 break;
10331 } 10310 }
10332 case WINDOW_3: 10311 case WINDOW_OptionsButtons:
10333 { 10312 {
10334 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);//pWindowType == 3 (0x3) 10313 pTexture = (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0);
10335 pY = pViewport->uViewportTL_Y; 10314 pY = pViewport->uViewportTL_Y;
10336 pX = pViewport->uViewportTL_X; 10315 pX = pViewport->uViewportTL_X;
10337 pRenderer->DrawTextureIndexed(pX, pY, pTexture); 10316 pRenderer->DrawTextureIndexed(pX, pY, pTexture);
10338 viewparams->bRedrawGameUI = 1; 10317 viewparams->bRedrawGameUI = 1;
10339 break; 10318 break;
10406 case WINDOW_KeyMappingOptions: 10385 case WINDOW_KeyMappingOptions:
10407 { 10386 {
10408 GameMenuUI_DrawKeyBindings(); 10387 GameMenuUI_DrawKeyBindings();
10409 break; 10388 break;
10410 } 10389 }
10411 case WINDOW_17: 10390 case WINDOW_SaveLoadButtons:
10412 { 10391 {
10413 sub_4606FE(); 10392 sub_4606FE();
10414 break; 10393 break;
10415 } 10394 }
10416 case WINDOW_CastSpell_InInventory: 10395 case WINDOW_CastSpell_InInventory:
11470 i->uZ = 0; 11449 i->uZ = 0;
11471 i->uY = 0; 11450 i->uY = 0;
11472 i->uX = 0; 11451 i->uX = 0;
11473 } 11452 }
11474 } 11453 }
11475 pBtn_Up = pGUIWindow_CurrentMenu->CreateButton( 11454 pBtn_Up = pGUIWindow_CurrentMenu->CreateButton(438, 46, (uTextureID_ar_up_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_up_up].uTextureWidth : 24),
11476 0x1B6u,
11477 0x2Eu,
11478 (uTextureID_ar_up_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_up_up].uTextureWidth : 24),
11479 (uTextureID_ar_up_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_up_up].uTextureHeight : 26), 11455 (uTextureID_ar_up_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_up_up].uTextureHeight : 26),
11480 1, 11456 1, 0, UIMSG_ClickAwardsUpBtn, 0, 0, "", (Texture *)(uTextureID_ar_up_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_up] : 0),
11481 0, 11457 uTextureID_ar_up_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_dn] : 0, 0);
11482 UIMSG_A9, 0, 11458 pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(438, 292, (uTextureID_ar_dn_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_dn_up].uTextureWidth : 24),
11483 0,
11484 "",
11485 (Texture *)(uTextureID_ar_up_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_up] : 0),
11486 uTextureID_ar_up_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_dn] : 0,
11487 0);
11488 pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(
11489 0x1B6u,
11490 0x124u,
11491 (uTextureID_ar_dn_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_dn_up].uTextureWidth : 24),
11492 (uTextureID_ar_dn_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_dn_up].uTextureHeight : 26), 11459 (uTextureID_ar_dn_up != -1 ? pIcons_LOD->pTextures[uTextureID_ar_dn_up].uTextureHeight : 26),
11493 1, 11460 1, 0, UIMSG_ClickAwardsDownBtn, 0, 0, "", (Texture *)(uTextureID_ar_dn_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_up] : 0),
11494 0, 11461 uTextureID_ar_dn_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_dn] : 0, 0);
11495 UIMSG_AA, 0, 11462 ptr_507BA4 = pGUIWindow_CurrentMenu->CreateButton(440, 62, 16, 232, 1, 0, UIMSG_C0, 0, 0, "", 0);
11496 0,
11497 "",
11498 (Texture *)(uTextureID_ar_dn_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_up] : 0),
11499 uTextureID_ar_dn_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_dn] : 0,
11500 0);
11501 ptr_507BA4 = pGUIWindow_CurrentMenu->CreateButton(
11502 0x1B8u,
11503 0x3Eu,
11504 0x10u,
11505 0xE8u,
11506 1,
11507 0,
11508 UIMSG_C0, 0,
11509 0,
11510 "",
11511 0);
11512 } 11463 }
11513 } 11464 }
11514 11465
11515 11466
11516 11467