comparison mm7_5.cpp @ 165:572d821561f3

MenuID
author Ritor1
date Thu, 14 Feb 2013 14:48:43 +0600
parents a0e7ad5425d4
children 49728858c35e 038a4d09406f
comparison
equal deleted inserted replaced
164:4b61b82a0bf7 165:572d821561f3
751 v135 = -1; 751 v135 = -1;
752 v132 = 0; 752 v132 = 0;
753 v130 = 0; 753 v130 = 0;
754 v127 = 219; 754 v127 = 219;
755 goto _play_sound_and_continue; 755 goto _play_sound_and_continue;
756 case 0x1A0: 756 case UIMSG_1A0:
757 dword_506F08 = v0; 757 dword_506F08 = v0;
758 continue; 758 continue;
759 case UIMSG_1A1: 759 case UIMSG_1A1:
760 dword_506F08 = 2; 760 dword_506F08 = 2;
761 continue; 761 continue;
3788 do 3788 do
3789 { 3789 {
3790 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &pSex); 3790 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &pSex);
3791 switch (pUIMessageType) // For buttons of window MainMenu 3791 switch (pUIMessageType) // For buttons of window MainMenu
3792 { 3792 {
3793 case UIMSG_MainMenu_ShowPartyCreationWnd:// Окно создания группы 3793 case UIMSG_MainMenu_ShowPartyCreationWnd:
3794 { 3794 {
3795 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); 3795 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0);
3796 SetCurrentMenuID(MENU_NEWGAME); 3796 SetCurrentMenuID(MENU_NEWGAME);
3797 } 3797 }
3798 continue; 3798 continue;
3799 case UIMSG_MainMenu_ShowLoadWindow:// Окно Загрузка 3799 case UIMSG_MainMenu_ShowLoadWindow:
3800 { 3800 {
3801 GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0); 3801 GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0);
3802 SetCurrentMenuID(MENU_SAVELOAD); 3802 SetCurrentMenuID(MENU_SAVELOAD);
3803 } 3803 }
3804 continue; 3804 continue;
3805 case UIMSG_ShowCredits:// Окно Создатели 3805 case UIMSG_ShowCredits:
3806 { 3806 {
3807 GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0); 3807 GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0);
3808 SetCurrentMenuID(MENU_CREDITS); 3808 SetCurrentMenuID(MENU_CREDITS);
3809 } 3809 }
3810 continue; 3810 continue;
3811 case UIMSG_ExitToWindows:// Окно Выход 3811 case UIMSG_ExitToWindows:
3812 { 3812 {
3813 GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); 3813 GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0);
3814 SetCurrentMenuID(MENU_FINISHED); 3814 SetCurrentMenuID(MENU_FINISHED);
3815 } 3815 }
3816 continue; 3816 continue;
3817 } 3817 }
3818 3818
3819 switch (pUIMessageType) // For buttons of window LoadGame 3819 switch (pUIMessageType) // For buttons of window LoadGame
3820 { 3820 {
3821 case UIMSG_LoadGame:// Процесс загрузки 3821 case UIMSG_LoadGame:
3822 { 3822 {
3823 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) 3823 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
3824 continue; 3824 continue;
3825 SetCurrentMenuID(MENU_LOAD); 3825 SetCurrentMenuID(MENU_LOADINGPROC);
3826 continue; 3826 continue;
3827 } 3827 }
3828 case UIMSG_SelectLoadSlot: // Выбранный слот сохранёнки 3828 case UIMSG_SelectLoadSlot:
3829 { 3829 {
3830 //main menu save/load wnd clicking on savegame lines 3830 //main menu save/load wnd clicking on savegame lines
3831 if (pGUIWindow_CurrentMenu->field_40 == 1) 3831 if (pGUIWindow_CurrentMenu->field_40 == 1)
3832 pKeyActionMap->_459ED1(0); 3832 pKeyActionMap->_459ED1(0);
3833 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition ) 3833 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition )
3849 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); 3849 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
3850 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); 3850 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
3851 } 3851 }
3852 continue; 3852 continue;
3853 } 3853 }
3854 case UIMSG_LoadSlot: // Нажатие на слот в окне Загрузка 3854 case UIMSG_LoadSlot:
3855 { 3855 {
3856 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)pBtnLoadSlot, 0); 3856 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)pBtnLoadSlot, 0);
3857 continue; 3857 continue;
3858 } 3858 }
3859 case UIMSG_DownArrow://нажатие стрелки вниз 3859 case UIMSG_DownArrow:
3860 { 3860 {
3861 ++pSaveListPosition; 3861 ++pSaveListPosition;
3862 if ( pSaveListPosition >= uNum ) 3862 if ( pSaveListPosition >= uNum )
3863 pSaveListPosition = uNum - 1; 3863 pSaveListPosition = uNum - 1;
3864 if ( pSaveListPosition < 1 ) 3864 if ( pSaveListPosition < 1 )
3865 pSaveListPosition = 0; 3865 pSaveListPosition = 0;
3866 pWindow = pGUIWindow_CurrentMenu; 3866 pWindow = pGUIWindow_CurrentMenu;
3867 v8 = pGUIWindow_CurrentMenu->uFrameY + 323; 3867 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, (WindowType)90, (int)pBtnDownArrow, 0);
3868 GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, (int)pBtnDownArrow, 0);
3869 continue; 3868 continue;
3870 } 3869 }
3871 case UIMSG_Cancel:// Нажатие кнопки Отмена 3870 case UIMSG_Cancel:
3872 { 3871 {
3873 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)pBtnCancel, 0); 3872 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)pBtnCancel, 0);
3874 continue; 3873 continue;
3875 } 3874 }
3876 case UIMSG_ArrowUp:// Кнопка Вверх 3875 case UIMSG_ArrowUp:
3877 { 3876 {
3878 --pSaveListPosition; 3877 --pSaveListPosition;
3879 if ( pSaveListPosition < 0 ) 3878 if ( pSaveListPosition < 0 )
3880 pSaveListPosition = 0; 3879 pSaveListPosition = 0;
3881 pWindow = pGUIWindow_CurrentMenu; 3880 pWindow = pGUIWindow_CurrentMenu;
3882 v8 = pGUIWindow_CurrentMenu->uFrameY + 197; 3881 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, (WindowType)90, (int)pBtnArrowUp, 0);
3883 GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, (int)pBtnArrowUp, 0);
3884 continue; 3882 continue;
3885 } 3883 }
3886 } 3884 }
3887 3885
3888 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )// For button of window PlayerCreation 3886 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )// For button of window PlayerCreation
3889 { 3887 {
3890 if ( pUIMessageType > UIMSG_DownArrow ) 3888 if ( pUIMessageType > UIMSG_DownArrow )
3891 { 3889 {
3892 if ( pUIMessageType == UIMSG_SelectFacePlayerBack ) // Выбор лица персонажа кнопка назад 3890 if ( pUIMessageType == UIMSG_SelectFacePlayerBack )
3893 { 3891 {
3894 pPlayer = &pParty->pPlayers[uNum]; 3892 pPlayer = &pParty->pPlayers[uNum];
3895 v12 = (char)((int)pPlayer->uFace - 1) < 0; 3893 v12 = (char)((int)pPlayer->uFace - 1) < 0;
3896 --pPlayer->uFace; 3894 --pPlayer->uFace;
3897 if ( v12 ) 3895 if ( v12 )
3910 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0); 3908 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0);
3911 pPlayer->PlaySound(102, 0); 3909 pPlayer->PlaySound(102, 0);
3912 //v1 = (char *)pParty->pPlayers; 3910 //v1 = (char *)pParty->pPlayers;
3913 continue; 3911 continue;
3914 } 3912 }
3915 if ( pUIMessageType == UIMSG_SelectFacePlayerForward ) // выбор лица персонажа кнопка вперёд 3913 if ( pUIMessageType == UIMSG_SelectFacePlayerForward )
3916 { 3914 {
3917 pPlayer = &pParty->pPlayers[uNum]; 3915 pPlayer = &pParty->pPlayers[uNum];
3918 v20 = (char)((int)pPlayer->uFace + 1) % 20; 3916 v20 = (char)((int)pPlayer->uFace + 1) % 20;
3919 pPlayer->uFace = v20; 3917 pPlayer->uFace = v20;
3920 pPlayer->uVoiceID = v20; 3918 pPlayer->uVoiceID = v20;
3935 } 3933 }
3936 if ( pUIMessageType == UIMSG_AD )//unknow 3934 if ( pUIMessageType == UIMSG_AD )//unknow
3937 { 3935 {
3938 __debugbreak(); 3936 __debugbreak();
3939 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0); 3937 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0);
3940 SetCurrentMenuID(MENU_LOAD); 3938 SetCurrentMenuID(MENU_LOADINGPROC);
3941 continue; 3939 continue;
3942 } 3940 }
3943 if ( pUIMessageType != UIMSG_AE )//unknow 3941 if ( pUIMessageType != UIMSG_AE )//unknow
3944 { 3942 {
3945 __debugbreak(); 3943 __debugbreak();
3946 continue; 3944 continue;
3947 } 3945 }
3948 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0); 3946 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0);
3949 //LABEL_114: 3947 SetCurrentMenuID(MENU_10);
3950 v40 = 10;
3951 //LABEL_89:
3952 v2 = v40;
3953 SetCurrentMenuID((MENU_STATE)v2);
3954 continue; 3948 continue;
3955 } 3949 }
3956 if ( pUIMessageType == UIMSG_6B )//unknow 3950 if ( pUIMessageType == UIMSG_6B )//unknow
3957 { 3951 {
3958 __debugbreak(); 3952 __debugbreak();
3965 } 3959 }
3966 GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0); 3960 GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0);
3967 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 3961 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
3968 continue; 3962 continue;
3969 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; 3963 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
3970 //goto LABEL_93;
3971 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3964 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3972 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3965 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3973 ++pMessageQueue_50CBD0->uNumMessages; 3966 ++pMessageQueue_50CBD0->uNumMessages;
3974 continue; 3967 continue;
3975 } 3968 }
3984 continue; 3977 continue;
3985 v15 = 1; 3978 v15 = 1;
3986 pVideoPlayer->bStopBeforeSchedule = 1; 3979 pVideoPlayer->bStopBeforeSchedule = 1;
3987 viewparams->bRedrawGameUI = 1; 3980 viewparams->bRedrawGameUI = 1;
3988 viewparams->field_48 = 1; 3981 viewparams->field_48 = 1;
3989 if ( !GetCurrentMenuID() || GetCurrentMenuID() == 6 || GetCurrentMenuID() == 7 ) 3982 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC )
3990 { 3983 {
3991 v17 = pCurrentScreen;
3992 LABEL_83: 3984 LABEL_83:
3993 if ( v17 == 16 ) 3985 if ( pCurrentScreen == SCREEN_VIDEO )
3994 pVideoPlayer->FastForwardToFrame(pVideoPlayer->field_40); 3986 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
3995 if (GetCurrentMenuID() == MENU_7) 3987 if (GetCurrentMenuID() == MENU_NAMEPANELESC)
3996 { 3988 {
3997 v40 = 6; 3989 SetCurrentMenuID(MENU_CREATEPARTY);
3998 //goto LABEL_89;
3999 v2 = v40;
4000 SetCurrentMenuID((MENU_STATE)v2);
4001 continue; 3990 continue;
4002 } 3991 }
4003 if (GetCurrentMenuID() == MENU_Credits) 3992 if (GetCurrentMenuID() == MENU_CREDITSPROC)
4004 { 3993 {
4005 v40 = 11; 3994 SetCurrentMenuID(MENU_CREDITSCLOSE);
4006 //goto LABEL_89;
4007 v2 = v40;
4008 SetCurrentMenuID((MENU_STATE)v2);
4009 continue; 3995 continue;
4010 } 3996 }
4011 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 3997 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
4012 { 3998 {
4013 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)5; 3999 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)5;
4018 continue; 4004 continue;
4019 } 4005 }
4020 continue; 4006 continue;
4021 } 4007 }
4022 v16 = GetCurrentMenuID() == 8; 4008 v16 = GetCurrentMenuID() == 8;
4023 v17 = pCurrentScreen;
4024 if ( v16 && !pCurrentScreen ) 4009 if ( v16 && !pCurrentScreen )
4025 goto LABEL_83; 4010 goto LABEL_83;
4026 if ( pCurrentScreen == SCREEN_LOADGAME ) 4011 if ( pCurrentScreen == SCREEN_LOADGAME )
4027 { 4012 {
4028 pIcons_LOD->_4114F2(); 4013 pIcons_LOD->_4114F2();
4093 pCurrentPlayer = &pPlayer[uNum]; 4078 pCurrentPlayer = &pPlayer[uNum];
4094 pSex = pCurrentPlayer->GetSexByVoice(); 4079 pSex = pCurrentPlayer->GetSexByVoice();
4095 do 4080 do
4096 { 4081 {
4097 pCurrentPlayer->uVoiceID = (signed int)(pCurrentPlayer->uVoiceID + 1) % 20; 4082 pCurrentPlayer->uVoiceID = (signed int)(pCurrentPlayer->uVoiceID + 1) % 20;
4098 v10 = pCurrentPlayer->GetSexByVoice();
4099 } 4083 }
4100 while ( v10 != pSex ); 4084 while ( pCurrentPlayer->GetSexByVoice() != pSex );
4101 pButton = pCreationUI_BtnPressRight2[uNum]; 4085 pButton = pCreationUI_BtnPressRight2[uNum];
4102 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1); 4086 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1);
4103 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); 4087 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
4104 pCurrentPlayer->PlaySound(102, 0); 4088 pCurrentPlayer->PlaySound(102, 0);
4105 continue; 4089 continue;
4109 else 4093 else
4110 { 4094 {
4111 if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill ) 4095 if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill )
4112 { 4096 {
4113 uPlayerCreationUI_SelectedCharacter = uNum; 4097 uPlayerCreationUI_SelectedCharacter = uNum;
4114 v41 = 3; 4098 //v41 = 3;
4115 //v1 = (char *)pParty->pPlayers; 4099 //v1 = (char *)pParty->pPlayers;
4116 v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 4100 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
4117 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; 4101 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
4118 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; 4102 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3)
4119 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41)
4120 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; 4103 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
4121 continue; 4104 continue;
4122 } 4105 }
4123 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationChangeName ) 4106 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationChangeName )
4124 { 4107 {
4201 __debugbreak(); 4184 __debugbreak();
4202 pMouse->SetCursorBitmap("MICON2"); 4185 pMouse->SetCursorBitmap("MICON2");
4203 break; 4186 break;
4204 case UIMSG_3A://unknow 4187 case UIMSG_3A://unknow
4205 __debugbreak(); 4188 __debugbreak();
4206 v40 = 10; 4189 SetCurrentMenuID(MENU_10);
4207 v2 = v40;
4208 SetCurrentMenuID((MENU_STATE)v2);
4209 break; 4190 break;
4210 } 4191 }
4211 } 4192 }
4212 } 4193 }
4213 } 4194 }
15526 { 15507 {
15527 QuickRefDraw(); 15508 QuickRefDraw();
15528 } 15509 }
15529 continue; 15510 continue;
15530 } 15511 }
15531 if ( pWindowType != 10 ) 15512 if ( pWindowType != 10 ) //pWindowType == 10
15532 { 15513 {
15533 v2 = pWindowType - 3; 15514 v2 = pWindowType - 3;
15534 if ( v2 )//pWindowType > 3 15515 if ( v2 )//pWindowType > 3
15535 { 15516 {
15536 v3 = v2 - 1; 15517 v3 = v2 - 1;