Mercurial > mm7
comparison mm7_5.cpp @ 964:d7f0572335ec
Слияние
author | Ritor1 |
---|---|
date | Sat, 04 May 2013 18:19:08 +0600 |
parents | 9a5db2cf999a |
children | 5a12082c803d |
comparison
equal
deleted
inserted
replaced
963:cbf623f00e6c | 964:d7f0572335ec |
---|---|
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_5A, (int)pBtnDownArrow, 0); |
458 continue; | 458 continue; |
459 case UIMSG_Cancel: | 459 case UIMSG_Cancel: |
460 GUIWindow::Create(350, 302, 106, 42, WINDOW_60, (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_LoadSlot: |
463 GUIWindow::Create(241, 302, 106, 42, WINDOW_5E, (int)pBtnLoadSlot, 0); | 463 GUIWindow::Create(241, 302, 106, 42, WINDOW_5E, (int)pBtnLoadSlot, 0); |
464 continue; | 464 continue; |
465 case UIMSG_SelectLoadSlot: | 465 case UIMSG_SelectLoadSlot: |
920 if ( pCurrentScreen ) | 920 if ( pCurrentScreen ) |
921 pGUIWindow_CurrentMenu->Release(); | 921 pGUIWindow_CurrentMenu->Release(); |
922 pEventTimer->Pause(); | 922 pEventTimer->Pause(); |
923 pAudioPlayer->StopChannels(-1, -1); | 923 pAudioPlayer->StopChannels(-1, -1); |
924 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); | 924 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); |
925 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_63, (int)pBtn_Quests, 0); | 925 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0); |
926 bFlashQuestBook = 0; | 926 bFlashQuestBook = 0; |
927 continue; | 927 continue; |
928 case UIMSG_OpenAutonotes: | 928 case UIMSG_OpenAutonotes: |
929 if ( pMessageQueue_50CBD0->uNumMessages ) | 929 if ( pMessageQueue_50CBD0->uNumMessages ) |
930 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 930 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
931 if ( pCurrentScreen ) | 931 if ( pCurrentScreen ) |
932 pGUIWindow_CurrentMenu->Release(); | 932 pGUIWindow_CurrentMenu->Release(); |
933 pEventTimer->Pause(); | 933 pEventTimer->Pause(); |
934 pAudioPlayer->StopChannels(-1, -1); | 934 pAudioPlayer->StopChannels(-1, -1); |
935 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); | 935 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); |
936 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_63, (int)pBtn_Autonotes, 0); | 936 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0); |
937 bFlashAutonotesBook = 0; | 937 bFlashAutonotesBook = 0; |
938 continue; | 938 continue; |
939 case UIMSG_OpenMapBook: | 939 case UIMSG_OpenMapBook: |
940 if ( pMessageQueue_50CBD0->uNumMessages ) | 940 if ( pMessageQueue_50CBD0->uNumMessages ) |
941 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 941 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
943 pGUIWindow_CurrentMenu->Release(); | 943 pGUIWindow_CurrentMenu->Release(); |
944 pEventTimer->Pause(); | 944 pEventTimer->Pause(); |
945 viewparams->sViewCenterX = pParty->vPosition.x; | 945 viewparams->sViewCenterX = pParty->vPosition.x; |
946 viewparams->sViewCenterY = pParty->vPosition.y; | 946 viewparams->sViewCenterY = pParty->vPosition.y; |
947 pAudioPlayer->StopChannels(-1, -1); | 947 pAudioPlayer->StopChannels(-1, -1); |
948 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); | 948 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); |
949 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, (enum WindowType)99, (int)pBtn_Maps, 0); | 949 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0); |
950 continue; | 950 continue; |
951 case UIMSG_OpenCalendar: | 951 case UIMSG_OpenCalendar: |
952 if ( pMessageQueue_50CBD0->uNumMessages ) | 952 if ( pMessageQueue_50CBD0->uNumMessages ) |
953 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 953 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
954 if ( pCurrentScreen ) | 954 if ( pCurrentScreen ) |
955 pGUIWindow_CurrentMenu->Release(); | 955 pGUIWindow_CurrentMenu->Release(); |
956 pEventTimer->Pause(); | 956 pEventTimer->Pause(); |
957 pAudioPlayer->StopChannels(-1, -1); | 957 pAudioPlayer->StopChannels(-1, -1); |
958 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); | 958 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); |
959 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_63, (int)pBtn_Calendar, 0); | 959 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0); |
960 continue; | 960 continue; |
961 case UIMSG_OpenHistoryBook: | 961 case UIMSG_OpenHistoryBook: |
962 if ( pMessageQueue_50CBD0->uNumMessages ) | 962 if ( pMessageQueue_50CBD0->uNumMessages ) |
963 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 963 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
964 if ( pCurrentScreen ) | 964 if ( pCurrentScreen ) |
965 pGUIWindow_CurrentMenu->Release(); | 965 pGUIWindow_CurrentMenu->Release(); |
966 pEventTimer->Pause(); | 966 pEventTimer->Pause(); |
967 pAudioPlayer->StopChannels(-1, -1); | 967 pAudioPlayer->StopChannels(-1, -1); |
968 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); | 968 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); |
969 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_63, (int)pBtn_History, 0); | 969 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0); |
970 bFlashHistoryBook = 0; | 970 bFlashHistoryBook = 0; |
971 continue; | 971 continue; |
972 case UIMSG_Escape:// Escape and return to game | 972 case UIMSG_Escape:// Escape and return to game |
973 back_to_game(); | 973 back_to_game(); |
974 if ( pMessageQueue_50CBD0->uNumMessages ) | 974 if ( pMessageQueue_50CBD0->uNumMessages ) |
1549 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 1549 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
1550 dword_50CDC8 = v0; | 1550 dword_50CDC8 = v0; |
1551 sub_42FBDD(); | 1551 sub_42FBDD(); |
1552 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); | 1552 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful); |
1553 pVideoPlayer->Unload(); | 1553 pVideoPlayer->Unload(); |
1554 sub_44603D(); | 1554 DialogueEnding(); |
1555 viewparams->bRedrawGameUI = v0; | 1555 viewparams->bRedrawGameUI = v0; |
1556 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz ) | 1556 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz ) |
1557 { | 1557 { |
1558 if ( dword_59117C_teleportx ) | 1558 if ( dword_59117C_teleportx ) |
1559 { | 1559 { |
1603 } | 1603 } |
1604 start_event_seq_number = 0; | 1604 start_event_seq_number = 0; |
1605 if ( !_strcmpi(byte_6BE3B0, "d05.blv") ) | 1605 if ( !_strcmpi(byte_6BE3B0, "d05.blv") ) |
1606 pParty->uTimePlayed += 1474560i64; | 1606 pParty->uTimePlayed += 1474560i64; |
1607 continue; | 1607 continue; |
1608 case UIMSG_19C: | 1608 case UIMSG_TransitionWindowCloseBtn: |
1609 CloseWindowBackground(); | 1609 CloseWindowBackground(); |
1610 pVideoPlayer->Unload(); | 1610 pVideoPlayer->Unload(); |
1611 sub_44603D(); | 1611 DialogueEnding(); |
1612 start_event_seq_number = 0; | 1612 start_event_seq_number = 0; |
1613 viewparams->bRedrawGameUI = v0; | 1613 viewparams->bRedrawGameUI = v0; |
1614 continue; | 1614 continue; |
1615 case UIMSG_CycleCharacters: | 1615 case UIMSG_CycleCharacters: |
1616 v39 = GetAsyncKeyState(VK_SHIFT); | 1616 v39 = GetAsyncKeyState(VK_SHIFT); |
1637 if ( pParty->vPosition.y < -22528 ) | 1637 if ( pParty->vPosition.y < -22528 ) |
1638 pParty->vPosition.y = -22528; | 1638 pParty->vPosition.y = -22528; |
1639 if ( pParty->vPosition.y > 22528 ) | 1639 if ( pParty->vPosition.y > 22528 ) |
1640 pParty->vPosition.y = 22528; | 1640 pParty->vPosition.y = 22528; |
1641 LABEL_317: | 1641 LABEL_317: |
1642 sub_44603D(); | 1642 DialogueEnding(); |
1643 pCurrentScreen = SCREEN_GAME; | 1643 pCurrentScreen = SCREEN_GAME; |
1644 } | 1644 } |
1645 else | 1645 else |
1646 { | 1646 { |
1647 pParty->field_6E4 = 0; | 1647 pParty->field_6E4 = 0; |
1648 pParty->field_6E0 = 0; | 1648 pParty->field_6E0 = 0; |
1649 pCastSpellInfo->_427D48(v0); | 1649 pCastSpellInfo->_427D48(v0); |
1650 sub_44603D(); | 1650 DialogueEnding(); |
1651 pEventTimer->Pause(); | 1651 pEventTimer->Pause(); |
1652 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); | 1652 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box); |
1653 ++pGameLoadingUI_ProgressBar->uProgressMax; | 1653 ++pGameLoadingUI_ProgressBar->uProgressMax; |
1654 SaveGame(v0, 0); | 1654 SaveGame(v0, 0); |
1655 pGameLoadingUI_ProgressBar->Progress(); | 1655 pGameLoadingUI_ProgressBar->Progress(); |
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, 117, 0); |
1909 continue; | 1909 continue; |
1910 | 1910 |
1911 case UIMSG_B2: | 1911 case UIMSG_B2: |
1912 __debugbreak;//UIMSG_B2 -??? | |
1913 bRecallingBeacon = uMessageParam; | 1912 bRecallingBeacon = uMessageParam; |
1914 v127 = uMessageParam + 204; | 1913 v127 = uMessageParam + 204; |
1915 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); | 1914 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0); |
1916 continue; | 1915 continue; |
1917 case UIMSG_B4: | 1916 case UIMSG_B4: |
1942 v158 = (unsigned int)thise; | 1941 v158 = (unsigned int)thise; |
1943 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" | 1942 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s" |
1944 sub_41C0B8_set_status_string(pTmpBuf); | 1943 sub_41C0B8_set_status_string(pTmpBuf); |
1945 continue; | 1944 continue; |
1946 case UIMSG_B5: | 1945 case UIMSG_B5: |
1947 __debugbreak;//UIMSG_B5 - ??? | |
1948 dword_50CDC8 = v0; | 1946 dword_50CDC8 = v0; |
1949 //goto LABEL_453; | 1947 //goto LABEL_453; |
1950 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 1948 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
1951 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 1949 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
1952 continue; | 1950 continue; |
2235 __debugbreak; | 2233 __debugbreak; |
2236 uGameState = 0; | 2234 uGameState = 0; |
2237 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); | 2235 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2"); |
2238 goto LABEL_524; | 2236 goto LABEL_524; |
2239 case UIMSG_DD: | 2237 case UIMSG_DD: |
2240 __debugbreak; | |
2241 LABEL_524: | 2238 LABEL_524: |
2242 sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer); | 2239 sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer); |
2243 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); | 2240 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); |
2244 if ( v216.uPropCount == 1 ) | 2241 if ( v216.uPropCount == 1 ) |
2245 { | 2242 { |
2476 if ( !(pTurnEngine->field_18 & 2) ) | 2473 if ( !(pTurnEngine->field_18 & 2) ) |
2477 //LABEL_577: | 2474 //LABEL_577: |
2478 _42ECB5_PlayerAttacksActor(); | 2475 _42ECB5_PlayerAttacksActor(); |
2479 continue; | 2476 continue; |
2480 case UIMSG_ExitRest: | 2477 case UIMSG_ExitRest: |
2481 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, (WindowType)96, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" | 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" |
2482 continue; | 2479 continue; |
2483 case UIMSG_Wait5Minutes: | 2480 case UIMSG_Wait5Minutes: |
2484 if ( dword_506F14 == 2 ) | 2481 if ( dword_506F14 == 2 ) |
2485 { | 2482 { |
2486 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" | 2483 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!" |
2649 (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" | 2646 (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" |
2650 v97 = _494820_training_time(pParty->uCurrentHour); | 2647 v97 = _494820_training_time(pParty->uCurrentHour); |
2651 dword_506F14 = v0; | 2648 dword_506F14 = v0; |
2652 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; | 2649 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; |
2653 continue; | 2650 continue; |
2654 case UIMSG_4E: | 2651 case UIMSG_HintSelectRemoveQuickSpellBtn: |
2655 __debugbreak;//UIMSG_4E -??? | |
2656 if ( quick_spell_at_page && byte_506550 ) | 2652 if ( quick_spell_at_page && byte_506550 ) |
2657 { | 2653 { |
2658 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; | 2654 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; |
2659 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[483], v173); | 2655 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[483], v173); |
2660 } | 2656 } |
2687 } | 2683 } |
2688 sprintfex(pTmpBuf, v161, v178); | 2684 sprintfex(pTmpBuf, v161, v178); |
2689 sub_41C0B8_set_status_string(pTmpBuf); | 2685 sub_41C0B8_set_status_string(pTmpBuf); |
2690 v0 = 1; | 2686 v0 = 1; |
2691 continue; | 2687 continue; |
2692 case UIMSG_58: | 2688 case UIMSG_ClickInstallRemoveQuickSpellBtn: |
2693 __debugbreak;//UIMSG_58 - ??? | |
2694 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_5A, (int)pBtn_InstallRemoveSpell, 0); |
2695 if ( !uActiveCharacter ) | 2690 if ( !uActiveCharacter ) |
2696 continue; | 2691 continue; |
2697 pPlayer10 = pPlayers[uActiveCharacter]; | 2692 pPlayer10 = pPlayers[uActiveCharacter]; |
2698 if ( !byte_506550 || !quick_spell_at_page ) | 2693 if ( !byte_506550 || !quick_spell_at_page ) |
2708 if ( uActiveCharacter ) | 2703 if ( uActiveCharacter ) |
2709 pPlayer10->PlaySound(SPEECH_12, 0); | 2704 pPlayer10->PlaySound(SPEECH_12, 0); |
2710 byte_506550 = 0; | 2705 byte_506550 = 0; |
2711 continue; | 2706 continue; |
2712 case UIMSG_33: | 2707 case UIMSG_33: |
2713 __debugbreak;//UIMSG_33 - ??? | |
2714 if ( !uActiveCharacter ) | 2708 if ( !uActiveCharacter ) |
2715 continue; | 2709 continue; |
2716 pPlayer3 = pPlayers[uActiveCharacter]; | 2710 pPlayer3 = pPlayers[uActiveCharacter]; |
2717 pNPCData4 = 0; | 2711 pNPCData4 = 0; |
2718 uAction = 0; | 2712 uAction = 0; |
2806 if ( pTurnEngine->field_4 != 3 ) | 2800 if ( pTurnEngine->field_4 != 3 ) |
2807 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); | 2801 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); |
2808 continue; | 2802 continue; |
2809 | 2803 |
2810 case UIMSG_92: | 2804 case UIMSG_92: |
2811 __debugbreak;//UIMSG_92 - ??? | |
2812 if ( pTurnEngine->field_4 != 3 ) | 2805 if ( pTurnEngine->field_4 != 3 ) |
2813 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, v0, 0); | 2806 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, v0, 0); |
2814 continue; | 2807 continue; |
2815 case UIMSG_SpellBookWindow: | 2808 case UIMSG_SpellBookWindow: |
2816 if ( pTurnEngine->field_4 == 3 ) | 2809 if ( pTurnEngine->field_4 == 3 ) |
2885 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); | 2878 uNumSeconds = (unsigned int)MakeScreenshot(155, 117); |
2886 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); | 2879 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117); |
2887 free((void *)uNumSeconds); | 2880 free((void *)uNumSeconds); |
2888 stru_506E40._40E55E("gamma.pcx", 0); | 2881 stru_506E40._40E55E("gamma.pcx", 0); |
2889 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0); | 2882 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0); |
2890 uNumVisibleWindows = uNumVisibleWindows - 1; //Ritor1: Insert | |
2891 //LABEL_453: | 2883 //LABEL_453: |
2892 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | 2884 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
2893 continue; | 2885 continue; |
2894 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; | 2886 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; |
2895 //goto LABEL_770; | 2887 //goto LABEL_770; |
2897 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 2889 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
2898 ++pMessageQueue_50CBD0->uNumMessages;*/ | 2890 ++pMessageQueue_50CBD0->uNumMessages;*/ |
2899 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 2891 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
2900 continue; | 2892 continue; |
2901 case UIMSG_C0: | 2893 case UIMSG_C0: |
2902 __debugbreak;//UIMSG_C0 - ??? | |
2903 dword_50651C = v0; | 2894 dword_50651C = v0; |
2904 if ( pMouse->GetCursorPos(&v211)->y > 178 ) | 2895 if ( pMouse->GetCursorPos(&v211)->y > 178 ) |
2905 dword_50651C = -1; | 2896 dword_50651C = -1; |
2906 continue; | 2897 continue; |
2907 case UIMSG_A9: | 2898 case UIMSG_A9: |
2908 __debugbreak; | |
2909 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_5B, (int)pBtn_Up, 0); |
2910 dword_506548 = v0; | 2900 dword_506548 = v0; |
2911 continue; | 2901 continue; |
2912 case UIMSG_AA: | 2902 case UIMSG_AA: |
2913 __debugbreak; | |
2914 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_5B, (int)pBtn_Down, 0); |
2915 dword_506544 = v0; | 2904 dword_506544 = v0; |
2916 continue; | 2905 continue; |
2917 case UIMSG_ChangeDetaliz: | 2906 case UIMSG_ChangeDetaliz: |
2918 bRingsShownInCharScreen ^= v0; | 2907 bRingsShownInCharScreen ^= v0; |
2939 viewparams->bRedrawGameUI = v0; | 2928 viewparams->bRedrawGameUI = v0; |
2940 continue; | 2929 continue; |
2941 case UIMSG_ClickPaperdoll: | 2930 case UIMSG_ClickPaperdoll: |
2942 OnPaperdollLeftClick(); | 2931 OnPaperdollLeftClick(); |
2943 continue; | 2932 continue; |
2944 case UIMSG_73: | 2933 case UIMSG_ClickStatsBtn: |
2945 __debugbreak; | |
2946 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; | 2934 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; |
2947 sub_4196A0(); | 2935 sub_4196A0(); |
2948 sub_419379(); | 2936 sub_419379(); |
2949 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, (WindowType)91, (int)pCharacterScreen_StatsBtn, 0); | 2937 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_5B, (int)pCharacterScreen_StatsBtn, 0); |
2950 continue; | 2938 continue; |
2951 case UIMSG_72: | 2939 case UIMSG_ClickSkillsBtn: |
2952 __debugbreak; | |
2953 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; | 2940 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; |
2954 sub_4196A0(); | 2941 sub_4196A0(); |
2955 sub_419379(); | 2942 sub_419379(); |
2956 CharacterUI_SkillScreen_Draw(); | 2943 CharacterUI_SkillScreen_Draw(); |
2957 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, (WindowType)91, (int)pCharacterScreen_SkillsBtn, 0); | 2944 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_5B, (int)pCharacterScreen_SkillsBtn, 0); |
2958 continue; | 2945 continue; |
2959 case UIMSG_SkillUp: | 2946 case UIMSG_SkillUp: |
2960 pPlayer4 = pPlayers[uActiveCharacter]; | 2947 pPlayer4 = pPlayers[uActiveCharacter]; |
2961 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; | 2948 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; |
2962 LOWORD(v2) = *(short *)v105; | 2949 LOWORD(v2) = *(short *)v105; |
2977 } | 2964 } |
2978 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" | 2965 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!" |
2979 } | 2966 } |
2980 ShowStatusBarString(v87, 2); | 2967 ShowStatusBarString(v87, 2); |
2981 continue; | 2968 continue; |
2982 case UIMSG_74: | 2969 case UIMSG_ClickInventoryBtn: |
2983 __debugbreak; | |
2984 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | 2970 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; |
2985 sub_419379(); | 2971 sub_419379(); |
2986 sub_4196A0(); | 2972 sub_4196A0(); |
2987 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, (WindowType)91, (int)pCharacterScreen_InventoryBtn, 0); | 2973 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_5B, (int)pCharacterScreen_InventoryBtn, 0); |
2988 continue; | 2974 continue; |
2989 case UIMSG_A8: | 2975 case UIMSG_ClickExitCharacterWindowBtn: |
2990 __debugbreak; | 2976 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0); |
2991 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, (WindowType)97, (int)pCharacterScreen_ExitBtn, 0); | |
2992 continue; | 2977 continue; |
2993 case UIMSG_75: | 2978 case UIMSG_ClickAwardsBtn: |
2994 __debugbreak; | |
2995 sub_419379(); | 2979 sub_419379(); |
2996 sub_4196A0(); | 2980 sub_4196A0(); |
2997 sub_419220(); | 2981 sub_419220(); |
2998 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; | 2982 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; |
2999 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), | 2983 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_5B, (int)pCharacterScreen_AwardsBtn, 0); |
3000 (int)pCharacterScreen_AwardsBtn, 0); | |
3001 FillAwardsData(); | 2984 FillAwardsData(); |
3002 continue; | 2985 continue; |
3003 case UIMSG_AutonotesBook: | 2986 case UIMSG_AutonotesBook: |
3004 switch ( uMessageParam ) | 2987 switch ( uMessageParam ) |
3005 { | 2988 { |
3050 case 7: | 3033 case 7: |
3051 pButton = pBtn_Autonotes_Instructors; | 3034 pButton = pBtn_Autonotes_Instructors; |
3052 dword_50652C = v0; | 3035 dword_50652C = v0; |
3053 break; | 3036 break; |
3054 } | 3037 } |
3055 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (WindowType)92, (int)pButton, v0); | 3038 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, v0); |
3056 continue; | 3039 continue; |
3057 case UIMSG_SelectCharacter: | 3040 case UIMSG_SelectCharacter: |
3058 if ( pMessageQueue_50CBD0->uNumMessages ) | 3041 if ( pMessageQueue_50CBD0->uNumMessages ) |
3059 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 3042 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3060 GameUI_OnPlayerPortraitLeftClick(uMessageParam); | 3043 GameUI_OnPlayerPortraitLeftClick(uMessageParam); |
3106 v114 = v110->GetMaxHealth(); | 3089 v114 = v110->GetMaxHealth(); |
3107 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); | 3090 sprintf(pTmpBuf, "%d / %d %s %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109); |
3108 sub_41C0B8_set_status_string(pTmpBuf); | 3091 sub_41C0B8_set_status_string(pTmpBuf); |
3109 continue; | 3092 continue; |
3110 case UIMSG_C: | 3093 case UIMSG_C: |
3111 __debugbreak; | |
3112 if ( pCurrentScreen == SCREEN_F ) | 3094 if ( pCurrentScreen == SCREEN_F ) |
3113 { | 3095 { |
3114 sub_421EA6_OnInventoryLeftClick(); | 3096 sub_421EA6_OnInventoryLeftClick(); |
3115 continue; | 3097 continue; |
3116 } | 3098 } |
3117 sub_420E01(); | 3099 sub_420E01(); |
3118 continue; | 3100 continue; |
3119 case UIMSG_InventoryLeftClick: | 3101 case UIMSG_InventoryLeftClick: |
3120 sub_421EA6_OnInventoryLeftClick(); | 3102 sub_421EA6_OnInventoryLeftClick(); |
3121 continue; | 3103 continue; |
3122 case UIMSG_A: | 3104 case UIMSG_MouseLeftClickInGame: |
3123 __debugbreak; | |
3124 if ( !pRenderer->pRenderD3D ) | 3105 if ( !pRenderer->pRenderD3D ) |
3125 { | 3106 { |
3126 if ( pMessageQueue_50CBD0->uNumMessages ) | 3107 if ( pMessageQueue_50CBD0->uNumMessages ) |
3127 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 3108 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3128 OnGameViewportClick(); | 3109 OnGameViewportClick(); |
3168 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 3149 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
3169 ++pMessageQueue_50CBD0->uNumMessages; | 3150 ++pMessageQueue_50CBD0->uNumMessages; |
3170 continue; | 3151 continue; |
3171 }*/ | 3152 }*/ |
3172 continue; | 3153 continue; |
3173 case UIMSG_E: | 3154 case UIMSG_E:// UIMSG_MouseLeftClickInGame |
3174 __debugbreak; | |
3175 if ( pMessageQueue_50CBD0->uNumMessages ) | 3155 if ( pMessageQueue_50CBD0->uNumMessages ) |
3176 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 3156 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3177 OnGameViewportClick(); | 3157 OnGameViewportClick(); |
3178 continue; | 3158 continue; |
3179 case UIMSG_F: | 3159 case UIMSG_F: |
3180 __debugbreak; | |
3181 if ( pRenderer->pRenderD3D ) | 3160 if ( pRenderer->pRenderD3D ) |
3182 { | 3161 { |
3183 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); | 3162 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val(); |
3184 } | 3163 } |
3185 else | 3164 else |
3187 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); | 3166 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); |
3188 pPoint3 = pMouse->GetCursorPos(&v204); | 3167 pPoint3 = pMouse->GetCursorPos(&v204); |
3189 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; | 3168 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; |
3190 } | 3169 } |
3191 pButton2 = (GUIButton *)(unsigned __int16)v116; | 3170 pButton2 = (GUIButton *)(unsigned __int16)v116; |
3192 GUIWindow::Create(0, 0, 0, 0, (WindowType)15, (int)pButton2, 0); | 3171 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0); |
3193 continue; | 3172 continue; |
3194 case UIMSG_54: | 3173 case UIMSG_54: |
3195 __debugbreak; | |
3196 pButton2 = (GUIButton *)uMessageParam; | 3174 pButton2 = (GUIButton *)uMessageParam; |
3197 GUIWindow::Create(0, 0, 0, 0, (WindowType)22, (int)pButton2, 0); | 3175 GUIWindow::Create(0, 0, 0, 0, (WindowType)22, (int)pButton2, 0); |
3198 continue; | 3176 continue; |
3199 case UIMSG_Game_Action: | 3177 case UIMSG_Game_Action: |
3200 if ( pMessageQueue_50CBD0->uNumMessages ) | 3178 if ( pMessageQueue_50CBD0->uNumMessages ) |
3201 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 3179 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3202 OnPressSpace(); | 3180 OnPressSpace(); |
3203 continue; | 3181 continue; |
3204 case UIMSG_16F: | 3182 case UIMSG_ClickZoomOutBtn: |
3205 __debugbreak; | |
3206 if ( pCurrentScreen ) | 3183 if ( pCurrentScreen ) |
3207 continue; | 3184 continue; |
3208 pParty->uFlags |= 2u; | 3185 pParty->uFlags |= 2u; |
3209 GUIWindow::Create(0x207u, 0x88u, 0, 0, (enum WindowType)90, (int)pBtn_ZoomOut, 0); | 3186 GUIWindow::Create(0x207u, 0x88u, 0, 0, WINDOW_5A, (int)pBtn_ZoomOut, 0); |
3210 uNumSeconds = 131072; | 3187 uNumSeconds = 131072; |
3211 v118 = 2 * viewparams->uMinimapZoom; | 3188 v118 = 2 * viewparams->uMinimapZoom; |
3212 ++viewparams->field_28; | 3189 ++viewparams->field_28; |
3213 viewparams->uMinimapZoom *= 2; | 3190 viewparams->uMinimapZoom *= 2; |
3214 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) | 3191 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor) |
3220 } | 3197 } |
3221 continue; | 3198 continue; |
3222 } | 3199 } |
3223 v119 = 2048; | 3200 v119 = 2048; |
3224 if ( (signed int)v118 <= 2048 ) | 3201 if ( (signed int)v118 <= 2048 ) |
3225 goto LABEL_789; | 3202 { |
3203 dword_576E2C = v118; | |
3204 dword_576E28 = viewparams->field_28; | |
3205 break; | |
3206 } | |
3226 viewparams->field_28 = 11; | 3207 viewparams->field_28 = 11; |
3227 goto LABEL_788; | 3208 viewparams->uMinimapZoom = v119; |
3228 case UIMSG_170: | 3209 dword_576E2C = v119; |
3229 __debugbreak; | 3210 dword_576E28 = viewparams->field_28; |
3211 break; | |
3212 case UIMSG_ClickZoomInBtn: | |
3230 if ( pCurrentScreen ) | 3213 if ( pCurrentScreen ) |
3231 continue; | 3214 continue; |
3232 pParty->uFlags |= 2u; | 3215 pParty->uFlags |= 2u; |
3233 GUIWindow::Create(0x23Eu, 0x88u, 0, 0, (enum WindowType)90, (int)pBtn_ZoomIn, 0); | 3216 GUIWindow::Create(0x23Eu, 0x88u, 0, 0, WINDOW_5A, (int)pBtn_ZoomIn, 0); |
3234 uNumSeconds = 32768; | 3217 uNumSeconds = 32768; |
3235 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; | 3218 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16; |
3236 --viewparams->field_28; | 3219 --viewparams->field_28; |
3237 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; |
3238 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 3221 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
3239 { | 3222 { |
3240 v119 = 512; | 3223 v119 = 512; |
3241 if ( (signed int)v118 < 512 ) | 3224 if ( (signed int)v118 < 512 ) |
3242 { | 3225 { |
3243 viewparams->field_28 = 9; | 3226 viewparams->field_28 = 9; |
3244 LABEL_788: | |
3245 v118 = v119; | 3227 v118 = v119; |
3246 viewparams->uMinimapZoom = v119; | 3228 viewparams->uMinimapZoom = v119; |
3247 } | 3229 } |
3248 LABEL_789: | |
3249 dword_576E2C = v118; | 3230 dword_576E2C = v118; |
3250 dword_576E28 = viewparams->field_28; | 3231 dword_576E28 = viewparams->field_28; |
3251 } | 3232 } |
3252 else | 3233 else |
3253 { | 3234 { |
3362 //int pSex; // [sp+Ch] [bp-4h]@3 | 3343 //int pSex; // [sp+Ch] [bp-4h]@3 |
3363 Player *pPlayer; | 3344 Player *pPlayer; |
3364 | 3345 |
3365 if ( pMessageQueue_50CBD0->uNumMessages ) | 3346 if ( pMessageQueue_50CBD0->uNumMessages ) |
3366 { | 3347 { |
3367 //v0 = pAudioPlayer; | |
3368 //pPlayer1 = pParty->pPlayers; | |
3369 pPlayer = pParty->pPlayers; | 3348 pPlayer = pParty->pPlayers; |
3370 do | 3349 do |
3371 { | 3350 { |
3372 int param2; | 3351 int param2; |
3373 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, ¶m2); | 3352 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, ¶m2); |
3353 auto player = &pParty->pPlayers[uNum]; | |
3354 auto sex = player->GetSexByVoice(); | |
3374 | 3355 |
3375 switch (pUIMessageType) // For buttons of window MainMenu | 3356 switch (pUIMessageType) // For buttons of window MainMenu |
3376 { | 3357 { |
3377 case UIMSG_MainMenu_ShowPartyCreationWnd: | 3358 case UIMSG_MainMenu_ShowPartyCreationWnd: |
3378 { | |
3379 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); | 3359 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); |
3380 SetCurrentMenuID(MENU_NEWGAME); | 3360 SetCurrentMenuID(MENU_NEWGAME); |
3381 } | 3361 break; |
3382 continue; | |
3383 case UIMSG_MainMenu_ShowLoadWindow: | 3362 case UIMSG_MainMenu_ShowLoadWindow: |
3384 { | |
3385 GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0); | 3363 GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0); |
3386 SetCurrentMenuID(MENU_SAVELOAD); | 3364 SetCurrentMenuID(MENU_SAVELOAD); |
3387 } | 3365 break; |
3388 continue; | |
3389 case UIMSG_ShowCredits: | 3366 case UIMSG_ShowCredits: |
3390 { | |
3391 GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0); | 3367 GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0); |
3392 SetCurrentMenuID(MENU_CREDITS); | 3368 SetCurrentMenuID(MENU_CREDITS); |
3393 } | 3369 break; |
3394 continue; | |
3395 case UIMSG_ExitToWindows: | 3370 case UIMSG_ExitToWindows: |
3396 { | |
3397 GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); | 3371 GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); |
3398 SetCurrentMenuID(MENU_FINISHED); | 3372 SetCurrentMenuID(MENU_FINISHED); |
3399 } | 3373 break; |
3400 continue; | |
3401 } | |
3402 | |
3403 | |
3404 switch (pUIMessageType) // For buttons of Party Creation Window | |
3405 { | |
3406 case UIMSG_PlayerCreation_SelectAttribute: | 3374 case UIMSG_PlayerCreation_SelectAttribute: |
3407 { | 3375 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3408 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3376 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; |
3409 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3377 uPlayerCreationUI_SelectedCharacter = uNum; |
3410 uPlayerCreationUI_SelectedCharacter = uNum; | 3378 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3411 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | 3379 break; |
3412 } | |
3413 continue; | |
3414 | |
3415 case UIMSG_PlayerCreation_VoicePrev: | 3380 case UIMSG_PlayerCreation_VoicePrev: |
3416 { | 3381 do |
3417 auto player = &pParty->pPlayers[uNum]; | 3382 { |
3418 auto sex = player->GetSexByVoice(); | 3383 if (player->uVoiceID == 0) |
3419 do | 3384 player->uVoiceID = 19; |
3420 { | 3385 else --player->uVoiceID; |
3421 if (player->uVoiceID == 0) | 3386 } |
3422 player->uVoiceID = 19; | 3387 while (player->GetSexByVoice() != sex); |
3423 else --player->uVoiceID; | 3388 pButton = pCreationUI_BtnPressLeft2[uNum]; |
3424 } | 3389 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); |
3425 while (player->GetSexByVoice() != sex); | 3390 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3426 | 3391 player->PlaySound(SPEECH_PickMe, 0); |
3427 pButton = pCreationUI_BtnPressLeft2[uNum]; | 3392 break; |
3428 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); | |
3429 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
3430 player->PlaySound(SPEECH_PickMe, 0); | |
3431 } | |
3432 continue; | |
3433 | |
3434 case UIMSG_PlayerCreation_VoiceNext: | 3393 case UIMSG_PlayerCreation_VoiceNext: |
3435 { | 3394 { |
3436 auto player = &pParty->pPlayers[uNum]; | 3395 //auto player = &pParty->pPlayers[uNum]; |
3437 auto sex = player->GetSexByVoice(); | 3396 //auto sex = player->GetSexByVoice(); |
3438 do | 3397 do |
3439 { | 3398 { |
3440 player->uVoiceID = (player->uVoiceID + 1) % 20; | 3399 player->uVoiceID = (player->uVoiceID + 1) % 20; |
3441 } | 3400 } |
3442 while (player->GetSexByVoice() != sex); | 3401 while (player->GetSexByVoice() != sex); |
3443 | |
3444 pButton = pCreationUI_BtnPressRight2[uNum]; | 3402 pButton = pCreationUI_BtnPressRight2[uNum]; |
3445 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); | 3403 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pButton, 1); |
3446 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | 3404 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3447 player->PlaySound(SPEECH_PickMe, 0); | 3405 player->PlaySound(SPEECH_PickMe, 0); |
3448 } | 3406 break; |
3449 continue; | 3407 } |
3450 | |
3451 case UIMSG_PlayerCreation_FacePrev: | 3408 case UIMSG_PlayerCreation_FacePrev: |
3452 { | 3409 pPlayer = &pParty->pPlayers[uNum]; |
3453 pPlayer = &pParty->pPlayers[uNum]; | 3410 if (!pPlayer->uFace) |
3454 if (!pPlayer->uFace) | 3411 pPlayer->uFace = 19; |
3455 pPlayer->uFace = 19; | 3412 else |
3456 else | 3413 pPlayer->uFace -= 1; |
3457 pPlayer->uFace -= 1; | 3414 pPlayer->uVoiceID = pPlayer->uFace; |
3458 pPlayer->uVoiceID = pPlayer->uFace; | 3415 pPlayer->SetInitialStats(); |
3459 pPlayer->SetInitialStats(); | 3416 pPlayer->SetSexByVoice(); |
3460 pPlayer->SetSexByVoice(); | 3417 pPlayer->RandomizeName(); |
3461 pPlayer->RandomizeName(); | 3418 v25 = uNum; |
3462 v25 = uNum; | 3419 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3463 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3420 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; |
3464 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3421 uPlayerCreationUI_SelectedCharacter = v25; |
3465 uPlayerCreationUI_SelectedCharacter = v25; | 3422 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressLeft[v25], 1); |
3466 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressLeft[v25], 1); | 3423 //v0 = pAudioPlayer; |
3467 //v0 = pAudioPlayer; | 3424 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); |
3468 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); | 3425 pPlayer->PlaySound(SPEECH_PickMe, 0); |
3469 pPlayer->PlaySound(SPEECH_PickMe, 0); | 3426 //v1 = (char *)pParty->pPlayers; |
3470 //v1 = (char *)pParty->pPlayers; | 3427 break; |
3471 } | |
3472 continue; | |
3473 | |
3474 case UIMSG_PlayerCreation_FaceNext: | 3428 case UIMSG_PlayerCreation_FaceNext: |
3475 { | 3429 pPlayer = &pParty->pPlayers[uNum]; |
3476 pPlayer = &pParty->pPlayers[uNum]; | 3430 v20 = (char)((int)pPlayer->uFace + 1) % 20; |
3477 v20 = (char)((int)pPlayer->uFace + 1) % 20; | 3431 pPlayer->uFace = v20; |
3478 pPlayer->uFace = v20; | 3432 pPlayer->uVoiceID = v20; |
3479 pPlayer->uVoiceID = v20; | 3433 pPlayer->SetInitialStats(); |
3480 pPlayer->SetInitialStats(); | 3434 pPlayer->SetSexByVoice(); |
3481 pPlayer->SetSexByVoice(); | 3435 pPlayer->RandomizeName(); |
3482 pPlayer->RandomizeName(); | 3436 v21 = uNum; |
3483 v21 = uNum; | 3437 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) |
3484 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) | 3438 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; |
3485 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3439 uPlayerCreationUI_SelectedCharacter = v21; |
3486 uPlayerCreationUI_SelectedCharacter = v21; | 3440 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressRight[v21], 1); |
3487 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_VoiceSwitcherButton, (int)pCreationUI_BtnPressRight[v21], 1); | 3441 //v0 = pAudioPlayer; |
3488 //v0 = pAudioPlayer; | 3442 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); |
3489 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | 3443 pPlayer->PlaySound(SPEECH_PickMe, 0); |
3490 pPlayer->PlaySound(SPEECH_PickMe, 0); | 3444 //v1 = (char *)pParty->pPlayers; |
3491 //v1 = (char *)pParty->pPlayers; | 3445 break; |
3492 } | 3446 case UIMSG_PlayerCreationClickPlus: |
3493 continue; | 3447 GUIWindow::Create(613, 393, 0, 0, WINDOW_5A, (int)pPlayerCreationUI_BtnPlus, 1); |
3494 } | 3448 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); |
3495 | 3449 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); |
3496 switch (pUIMessageType) // For buttons of window LoadGame | 3450 break; |
3497 { | 3451 case UIMSG_PlayerCreationClickMinus: |
3452 GUIWindow::Create(523, 393, 0, 0, WINDOW_5A, (int)pPlayerCreationUI_BtnMinus, 1); | |
3453 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
3454 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); | |
3455 break; | |
3456 case UIMSG_PlayerCreationSelectActiveSkill: | |
3457 { | |
3458 auto _t = &pPlayer[uPlayerCreationUI_SelectedCharacter]; | |
3459 v6 = _t->GetSkillIdxByOrder(uNum + 4); | |
3460 if ( _t->GetSkillIdxByOrder(3) == 37 ) | |
3461 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; | |
3462 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
3463 break; | |
3464 } | |
3465 case UIMSG_PlayerCreationSelectClass: | |
3466 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum); | |
3467 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
3468 break; | |
3469 case UIMSG_PlayerCreationClickOK: | |
3470 GUIWindow::Create(580, 431, 0, 0, WINDOW_5A, (int)pPlayerCreationUI_BtnOK, 0); | |
3471 if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() ) | |
3472 GameUI_Footer_TimeLeft = GetTickCount() + 4000; | |
3473 else | |
3474 uGameState = 6; | |
3475 break; | |
3476 case UIMSG_PlayerCreationClickReset: | |
3477 GUIWindow::Create(527, 431, 0, 0, WINDOW_5A, (int)pPlayerCreationUI_BtnReset, 0); | |
3478 pParty->Reset(); | |
3479 break; | |
3480 case UIMSG_PlayerCreationRemoveUpSkill: | |
3481 uPlayerCreationUI_SelectedCharacter = uNum; | |
3482 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
3483 //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
3484 v41 = 2; | |
3485 v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | |
3486 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; | |
3487 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) | |
3488 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; | |
3489 break; | |
3490 case UIMSG_PlayerCreationChangeName: | |
3491 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
3492 v3 = (void *)uNum; | |
3493 uPlayerCreationUI_SelectedCharacter = uNum; | |
3494 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); | |
3495 pGUIWindow_CurrentMenu->ptr_1C = v3; | |
3496 break; | |
3497 case UIMSG_ChangeGameState: | |
3498 uGameState = 1; | |
3499 break; | |
3500 case UIMSG_11: | |
3501 pMouse->SetCursorBitmap("MICON2"); | |
3502 break; | |
3503 case UIMSG_3A: | |
3504 SetCurrentMenuID(MENU_10); | |
3505 break; | |
3498 case UIMSG_LoadGame: | 3506 case UIMSG_LoadGame: |
3499 { | |
3500 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) | 3507 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) |
3501 continue; | 3508 break; |
3502 SetCurrentMenuID(MENU_LOADINGPROC); | 3509 SetCurrentMenuID(MENU_LOADINGPROC); |
3503 continue; | 3510 break; |
3504 } | |
3505 case UIMSG_SelectLoadSlot: | 3511 case UIMSG_SelectLoadSlot: |
3506 { | |
3507 //main menu save/load wnd clicking on savegame lines | 3512 //main menu save/load wnd clicking on savegame lines |
3508 if (pGUIWindow_CurrentMenu->field_40 == 1) | 3513 if (pGUIWindow_CurrentMenu->field_40 == 1) |
3509 pKeyActionMap->_459ED1(0); | 3514 pKeyActionMap->_459ED1(0); |
3510 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition ) | 3515 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition ) |
3511 { | 3516 { |
3524 //typing in the line | 3529 //typing in the line |
3525 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); | 3530 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu); |
3526 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); | 3531 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); |
3527 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); | 3532 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); |
3528 } | 3533 } |
3529 continue; | 3534 break; |
3530 } | |
3531 case UIMSG_LoadSlot: | 3535 case UIMSG_LoadSlot: |
3532 { | |
3533 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_5E, (int)pBtnLoadSlot, 0); |
3534 continue; | 3537 break; |
3535 } | |
3536 case UIMSG_DownArrow: | 3538 case UIMSG_DownArrow: |
3537 { | |
3538 ++pSaveListPosition; | 3539 ++pSaveListPosition; |
3539 if ( pSaveListPosition >= uNum ) | 3540 if ( pSaveListPosition >= uNum ) |
3540 pSaveListPosition = uNum - 1; | 3541 pSaveListPosition = uNum - 1; |
3541 if ( pSaveListPosition < 1 ) | 3542 if ( pSaveListPosition < 1 ) |
3542 pSaveListPosition = 0; | 3543 pSaveListPosition = 0; |
3543 pWindow = pGUIWindow_CurrentMenu; | 3544 pWindow = pGUIWindow_CurrentMenu; |
3544 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, (WindowType)90, (int)pBtnDownArrow, 0); | 3545 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_5A, (int)pBtnDownArrow, 0); |
3545 continue; | 3546 break; |
3546 } | |
3547 case UIMSG_Cancel: | 3547 case UIMSG_Cancel: |
3548 { | 3548 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0); |
3549 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)pBtnCancel, 0); | 3549 break; |
3550 continue; | |
3551 } | |
3552 case UIMSG_ArrowUp: | 3550 case UIMSG_ArrowUp: |
3553 { | |
3554 --pSaveListPosition; | 3551 --pSaveListPosition; |
3555 if ( pSaveListPosition < 0 ) | 3552 if ( pSaveListPosition < 0 ) |
3556 pSaveListPosition = 0; | 3553 pSaveListPosition = 0; |
3557 pWindow = pGUIWindow_CurrentMenu; | 3554 pWindow = pGUIWindow_CurrentMenu; |
3558 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, (WindowType)90, (int)pBtnArrowUp, 0); | 3555 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_5A, (int)pBtnArrowUp, 0); |
3559 continue; | 3556 break; |
3560 } | 3557 case UIMSG_AD: |
3561 } | 3558 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); |
3562 | 3559 SetCurrentMenuID(MENU_LOADINGPROC); |
3563 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )// For button of window PlayerCreation | 3560 break; |
3564 { | 3561 case UIMSG_AE: |
3565 if ( pUIMessageType > UIMSG_DownArrow ) | 3562 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); |
3566 { | |
3567 if ( pUIMessageType == UIMSG_AD )//unknow | |
3568 { | |
3569 __debugbreak(); | |
3570 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0); | |
3571 SetCurrentMenuID(MENU_LOADINGPROC); | |
3572 continue; | |
3573 } | |
3574 if ( pUIMessageType != UIMSG_AE )//unknow | |
3575 { | |
3576 __debugbreak(); | |
3577 continue; | |
3578 } | |
3579 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0); | |
3580 SetCurrentMenuID(MENU_10); | 3563 SetCurrentMenuID(MENU_10); |
3581 continue; | 3564 break; |
3582 } | 3565 case UIMSG_Escape: |
3583 if ( pUIMessageType == UIMSG_GameMenuButton )//unknow | |
3584 { | |
3585 __debugbreak(); | |
3586 if ( pCurrentScreen ) | |
3587 { | |
3588 pGUIWindow_CurrentMenu->Release(); | |
3589 pEventTimer->Resume(); | |
3590 pCurrentScreen = SCREEN_GAME; | |
3591 viewparams->bRedrawGameUI = 1; | |
3592 } | |
3593 GUIWindow::Create(602, 450, 0, 0, WINDOW_VoiceSwitcherButton, (int)pBtn_GameSettings, 0); | |
3594 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
3595 continue; | |
3596 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
3597 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
3598 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
3599 ++pMessageQueue_50CBD0->uNumMessages;*/ | |
3600 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
3601 continue; | |
3602 } | |
3603 if ( pUIMessageType == UIMSG_Escape ) | |
3604 { | |
3605 if ( ptr_507BDC ) | 3566 if ( ptr_507BDC ) |
3606 { | 3567 { |
3607 sub_41426F(); | 3568 sub_41426F(); |
3608 continue; | 3569 break; |
3609 } | 3570 } |
3610 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) | 3571 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) ) |
3611 continue; | 3572 break; |
3612 v15 = 1; | 3573 v15 = 1; |
3613 pVideoPlayer->bStopBeforeSchedule = 1; | 3574 pVideoPlayer->bStopBeforeSchedule = 1; |
3614 viewparams->bRedrawGameUI = 1; | 3575 viewparams->bRedrawGameUI = 1; |
3615 viewparams->field_48 = 1; | 3576 viewparams->field_48 = 1; |
3616 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) | 3577 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC ) |
3619 if ( pCurrentScreen == SCREEN_VIDEO ) | 3580 if ( pCurrentScreen == SCREEN_VIDEO ) |
3620 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); | 3581 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag); |
3621 if (GetCurrentMenuID() == MENU_NAMEPANELESC) | 3582 if (GetCurrentMenuID() == MENU_NAMEPANELESC) |
3622 { | 3583 { |
3623 SetCurrentMenuID(MENU_CREATEPARTY); | 3584 SetCurrentMenuID(MENU_CREATEPARTY); |
3624 continue; | 3585 break; |
3625 } | 3586 } |
3626 if (GetCurrentMenuID() == MENU_CREDITSPROC) | 3587 if (GetCurrentMenuID() == MENU_CREDITSPROC) |
3627 { | 3588 { |
3628 SetCurrentMenuID(MENU_CREDITSCLOSE); | 3589 SetCurrentMenuID(MENU_CREDITSCLOSE); |
3629 continue; | 3590 break; |
3630 } | 3591 } |
3631 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | 3592 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
3632 { | 3593 { |
3633 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)5; | 3594 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)5; |
3634 //LABEL_93: | 3595 //LABEL_93: |
3636 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | 3597 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; |
3637 ++pMessageQueue_50CBD0->uNumMessages; | 3598 ++pMessageQueue_50CBD0->uNumMessages; |
3638 continue; | 3599 continue; |
3639 }*/ | 3600 }*/ |
3640 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); | 3601 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0); |
3641 continue; | 3602 break; |
3642 } | 3603 } |
3643 v16 = GetCurrentMenuID() == 8; | 3604 v16 = GetCurrentMenuID() == 8; |
3644 if ( v16 && !pCurrentScreen ) | 3605 if ( v16 && !pCurrentScreen ) |
3645 goto LABEL_83; | 3606 goto LABEL_83; |
3646 if ( pCurrentScreen == SCREEN_LOADGAME ) | 3607 if ( pCurrentScreen == SCREEN_LOADGAME ) |
3656 pGUIWindow2->Release(); | 3617 pGUIWindow2->Release(); |
3657 pGUIWindow2 = 0; | 3618 pGUIWindow2 = 0; |
3658 pEventTimer->Resume(); | 3619 pEventTimer->Resume(); |
3659 pCurrentScreen = SCREEN_GAME; | 3620 pCurrentScreen = SCREEN_GAME; |
3660 viewparams->bRedrawGameUI = v15; | 3621 viewparams->bRedrawGameUI = v15; |
3661 continue; | 3622 break; |
3662 } | 3623 } |
3663 if ( pCurrentScreen == SCREEN_VIDEO ) | 3624 if ( pCurrentScreen == SCREEN_VIDEO ) |
3664 { | 3625 { |
3665 pVideoPlayer->Unload(); | 3626 pVideoPlayer->Unload(); |
3666 } | 3627 } |
3673 pGUIWindow2->Release(); | 3634 pGUIWindow2->Release(); |
3674 pGUIWindow2 = 0; | 3635 pGUIWindow2 = 0; |
3675 pEventTimer->Resume(); | 3636 pEventTimer->Resume(); |
3676 pCurrentScreen = SCREEN_GAME; | 3637 pCurrentScreen = SCREEN_GAME; |
3677 viewparams->bRedrawGameUI = v15; | 3638 viewparams->bRedrawGameUI = v15; |
3678 continue; | 3639 break; |
3679 } | 3640 } |
3680 //VideoPlayer::dtor(); | 3641 //VideoPlayer::dtor(); |
3681 } | 3642 } |
3682 } | 3643 break; |
3683 } | 3644 case UIMSG_PlayerCreationRemoveDownSkill: |
3684 else | |
3685 { | |
3686 if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill ) | |
3687 { | |
3688 uPlayerCreationUI_SelectedCharacter = uNum; | 3645 uPlayerCreationUI_SelectedCharacter = uNum; |
3689 //v41 = 3; | 3646 //v41 = 3; |
3690 //v1 = (char *)pParty->pPlayers; | 3647 //v1 = (char *)pParty->pPlayers; |
3691 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 | 3648 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 |
3692 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; | 3649 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; |
3693 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3) | 3650 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3) |
3694 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; | 3651 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; |
3695 continue; | 3652 break; |
3696 } | 3653 default: |
3697 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationChangeName ) | 3654 break; |
3698 { | |
3699 if ( pUIMessageType == UIMSG_PlayerCreationClickPlus ) | |
3700 { | |
3701 GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1); | |
3702 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
3703 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); | |
3704 continue; | |
3705 } | |
3706 if ( pUIMessageType == UIMSG_PlayerCreationClickMinus ) | |
3707 { | |
3708 GUIWindow::Create(523, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnMinus, 1); | |
3709 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); | |
3710 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); | |
3711 continue; | |
3712 } | |
3713 if ( pUIMessageType == UIMSG_PlayerCreationSelectActiveSkill ) | |
3714 { | |
3715 auto _t = &pPlayer[uPlayerCreationUI_SelectedCharacter]; | |
3716 v6 = _t->GetSkillIdxByOrder(uNum + 4); | |
3717 if ( _t->GetSkillIdxByOrder(3) == 37 ) | |
3718 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; | |
3719 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
3720 continue; | |
3721 } | |
3722 if ( pUIMessageType == UIMSG_PlayerCreationSelectClass ) | |
3723 { | |
3724 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)uNum); | |
3725 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
3726 continue; | |
3727 } | |
3728 if ( pUIMessageType == UIMSG_PlayerCreationClickOK ) | |
3729 { | |
3730 GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); | |
3731 if ( PlayerCreation_ComputeAttributeBonus() || !PlayerCreation_Chose4Skills() ) | |
3732 GameUI_Footer_TimeLeft = GetTickCount() + 4000; | |
3733 else | |
3734 uGameState = 6; | |
3735 continue; | |
3736 } | |
3737 if ( pUIMessageType == UIMSG_PlayerCreationClickReset ) | |
3738 { | |
3739 GUIWindow::Create(527, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnReset, 0); | |
3740 pParty->Reset(); | |
3741 } | |
3742 else | |
3743 { | |
3744 if ( pUIMessageType == UIMSG_PlayerCreationRemoveUpSkill ) | |
3745 { | |
3746 uPlayerCreationUI_SelectedCharacter = uNum; | |
3747 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
3748 int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; | |
3749 v41 = 2; | |
3750 v5 = v4 % 7 + pSex + 7 * uNum; | |
3751 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; | |
3752 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) | |
3753 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; | |
3754 continue; | |
3755 } | |
3756 } | |
3757 } | |
3758 else | |
3759 { | |
3760 switch ( pUIMessageType ) | |
3761 { | |
3762 case UIMSG_PlayerCreationChangeName: | |
3763 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); | |
3764 v3 = (void *)uNum; | |
3765 uPlayerCreationUI_SelectedCharacter = uNum; | |
3766 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu); | |
3767 pGUIWindow_CurrentMenu->ptr_1C = v3; | |
3768 break; | |
3769 case UIMSG_ChangeGameState: | |
3770 uGameState = 1; | |
3771 break; | |
3772 case UIMSG_11://unknow | |
3773 __debugbreak(); | |
3774 pMouse->SetCursorBitmap("MICON2"); | |
3775 break; | |
3776 case UIMSG_3A://unknow | |
3777 __debugbreak(); | |
3778 SetCurrentMenuID(MENU_10); | |
3779 break; | |
3780 } | |
3781 } | |
3782 } | 3655 } |
3783 } | 3656 } |
3784 while ( pMessageQueue_50CBD0->uNumMessages ); | 3657 while ( pMessageQueue_50CBD0->uNumMessages ); |
3785 } | 3658 } |
3786 } | 3659 } |
10402 unsigned int v27; // ebp@106 | 10275 unsigned int v27; // ebp@106 |
10403 GUIWindow *pGUIWindow2; // ecx@109 | 10276 GUIWindow *pGUIWindow2; // ecx@109 |
10404 unsigned int v29; // eax@111 | 10277 unsigned int v29; // eax@111 |
10405 GUIFont *pGUIFont; // ST1C_4@115 | 10278 GUIFont *pGUIFont; // ST1C_4@115 |
10406 int v31; // eax@115 | 10279 int v31; // eax@115 |
10407 void *v32; // ebp@118 | 10280 GUIButton *pButton; // ebp@118 |
10408 int v33; // eax@119 | 10281 int v33; // eax@119 |
10409 int v34; // eax@120 | 10282 int v34; // eax@120 |
10410 int v35; // eax@121 | 10283 int v35; // eax@121 |
10411 int v36; // eax@122 | 10284 int v36; // eax@122 |
10412 int v37; // eax@123 | 10285 int v37; // eax@123 |
10567 GUIButton2.pParent = 0; | 10440 GUIButton2.pParent = 0; |
10568 pGUIWindow2 = pWindow; | 10441 pGUIWindow2 = pWindow; |
10569 pGUIWindow2->Release(); | 10442 pGUIWindow2->Release(); |
10570 break; | 10443 break; |
10571 } | 10444 } |
10572 case WINDOW_60: | 10445 case WINDOW_ExitRestWindow: |
10573 { | 10446 { |
10574 if ( pWindow->Hint != (char *)1 ) | 10447 if ( pWindow->Hint != (char *)1 ) |
10575 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | 10448 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
10576 pGUIButton = (GUIButton *)pWindow->ptr_1C; | 10449 pGUIButton = (GUIButton *)pWindow->ptr_1C; |
10577 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); | 10450 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]); |
10581 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); | 10454 pGUIButton->DrawLabel(pHint, pFontCreate, 0, 0); |
10582 pWindow->Release(); | 10455 pWindow->Release(); |
10583 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 10456 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
10584 break; | 10457 break; |
10585 } | 10458 } |
10586 case WINDOW_61: | 10459 case WINDOW_ExitCharacterWindow: |
10587 { | 10460 { |
10588 if ( pWindow->Hint != (char *)1 )//pWindowType == WINDOW_61 | 10461 if ( pWindow->Hint != (char *)1 ) |
10589 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); | 10462 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
10590 v32 = pWindow->ptr_1C; | 10463 pButton = (GUIButton *)pWindow->ptr_1C; |
10591 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)v32 + 16)); | 10464 pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]); |
10592 pHint = pWindow->Hint; | 10465 pHint = pWindow->Hint; |
10593 viewparams->bRedrawGameUI = 1; | 10466 viewparams->bRedrawGameUI = 1; |
10594 if ( pHint && pHint != (char *)1 ) | 10467 if ( pHint && pHint != (char *)1 ) |
10595 ((GUIButton *)v32)->DrawLabel(pHint, pFontCreate, 0, 0); | 10468 pButton->DrawLabel(pHint, pFontCreate, 0, 0); |
10596 pWindow->Release(); | 10469 pWindow->Release(); |
10597 pNumMessages = pMessageQueue_50CBD0->uNumMessages; | 10470 pNumMessages = pMessageQueue_50CBD0->uNumMessages; |
10598 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | 10471 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
10599 break; | 10472 break; |
10600 } | 10473 } |
10601 case WINDOW_63: | 10474 case WINDOW_BooksWindow: |
10602 { | 10475 { |
10603 pTexture = (Texture *)*((_DWORD *)pWindow->ptr_1C + 15);//pWindowType == 99 (0x63) WINDOW_63 | 10476 pButton = (GUIButton *)pWindow->ptr_1C; |
10604 pY = pWindow->uFrameY; | 10477 pY = pWindow->uFrameY; |
10605 pX = pWindow->uFrameX; | 10478 pX = pWindow->uFrameX; |
10606 pRenderer->DrawTextureIndexed(pX, pY, pTexture); | 10479 pRenderer->DrawTextureIndexed(pX, pY, pButton->pTextures[0]); |
10607 viewparams->bRedrawGameUI = 1; | 10480 viewparams->bRedrawGameUI = 1; |
10608 break; | 10481 break; |
10609 } | 10482 } |
10610 case WINDOW_CharacterWindow_Inventory: | 10483 case WINDOW_CharacterWindow_Inventory: |
10611 { | 10484 { |
11642 | 11515 |
11643 | 11516 |
11644 //----- (00419379) -------------------------------------------------------- | 11517 //----- (00419379) -------------------------------------------------------- |
11645 void __cdecl sub_419379() | 11518 void __cdecl sub_419379() |
11646 { | 11519 { |
11647 GUIButton *i; // esi@2 | 11520 GUIButton *pButton; // esi@2 |
11648 | 11521 |
11649 if ( dword_507CBC ) | 11522 if ( dword_507CBC ) |
11650 { | 11523 { |
11651 dword_507CBC = 0; | 11524 dword_507CBC = 0; |
11652 ptr_507BA4->Release(); | 11525 ptr_507BA4->Release(); |
11653 pBtn_Up->Release(); | 11526 pBtn_Up->Release(); |
11654 pBtn_Down->Release(); | 11527 pBtn_Down->Release(); |
11655 pBtn_Down = 0; | 11528 pBtn_Down = 0; |
11656 pBtn_Up = 0; | 11529 pBtn_Up = 0; |
11657 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) | 11530 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) |
11658 { | 11531 { |
11659 if ( i->msg == UIMSG_InventoryLeftClick ) | 11532 if ( pButton->msg == UIMSG_InventoryLeftClick ) |
11660 { | 11533 { |
11661 i->uX = dword_50698C; | 11534 pButton->uX = dword_50698C; |
11662 i->uY = dword_506988; | 11535 pButton->uY = dword_506988; |
11663 i->uZ = dword_506984; | 11536 pButton->uZ = dword_506984; |
11664 i->uW = dword_506980; | 11537 pButton->uW = dword_506980; |
11665 pGUIWindow_CurrentMenu->_41D08F(1, 0, 0, 0); | 11538 pGUIWindow_CurrentMenu->_41D08F(1, 0, 0, 0); |
11666 } | 11539 } |
11667 } | 11540 } |
11668 } | 11541 } |
11669 } | 11542 } |