comparison mm7_5.cpp @ 208:af624eaf2fc5 tip

14.01.13
author Ritor1
date Mon, 14 Jan 2013 10:39:01 +0600
parents 8e3fea954768
children
comparison
equal deleted inserted replaced
207:8e3fea954768 208:af624eaf2fc5
454 pCurrentScreen = 2; 454 pCurrentScreen = 2;
455 v162 = 0; 455 v162 = 0;
456 v148 = 0; 456 v148 = 0;
457 pWindowType = (WindowType)8; 457 pWindowType = (WindowType)8;
458 goto LABEL_439; 458 goto LABEL_439;
459 case UIMSG_A2: 459 case UIMSG_ArrowUp:
460 --dword_6A0C9C; 460 --pSaveListPosition;
461 if ( dword_6A0C9C < 0 ) 461 if ( pSaveListPosition < 0 )
462 dword_6A0C9C = 0; 462 pSaveListPosition = 0;
463 v163 = 0; 463 v163 = 0;
464 v8 = 199; 464 v8 = 199;
465 pButton2 = ptr_69BD5C; 465 pButton2 = pBtnArrowUp;
466 //goto LABEL_60; 466 //goto LABEL_60;
467 pWindowType1 = (WindowType)90; 467 pWindowType1 = (WindowType)90;
468 v137 = 17; 468 v137 = 17;
469 v133 = 17; 469 v133 = 17;
470 v9 = 215; 470 v9 = 215;
471 goto LABEL_733; 471 goto LABEL_733;
472 case UIMSG_A3: 472 case UIMSG_DownArrow:
473 ++dword_6A0C9C; 473 ++pSaveListPosition;
474 if ( dword_6A0C9C >= uMessageParam ) 474 if ( pSaveListPosition >= uMessageParam )
475 dword_6A0C9C = uMessageParam - 1; 475 pSaveListPosition = uMessageParam - 1;
476 v163 = 0; 476 v163 = 0;
477 v8 = 323; 477 v8 = 323;
478 pButton2 = ptr_69BD58; 478 pButton2 = pBtnDownArrow;
479 //LABEL_60: 479 //LABEL_60:
480 pWindowType1 = (WindowType)90; 480 pWindowType1 = (WindowType)90;
481 v137 = 17; 481 v137 = 17;
482 v133 = 17; 482 v133 = 17;
483 v9 = 215; 483 v9 = 215;
484 goto LABEL_733; 484 goto LABEL_733;
485 case UIMSG_A6: 485 case UIMSG_Cancel:
486 v163 = 0; 486 v163 = 0;
487 v8 = 302; 487 v8 = 302;
488 pButton2 = ptr_69BD60; 488 pButton2 = pBtnCancel;
489 v9 = 350; 489 v9 = 350;
490 pWindowType1 = (WindowType)96; 490 pWindowType1 = (WindowType)96;
491 v137 = 42; 491 v137 = 42;
492 v133 = 106; 492 v133 = 106;
493 goto LABEL_733; 493 goto LABEL_733;
494 case UIMSG_A4: 494 case UIMSG_LoadSlot:
495 v163 = 0; 495 v163 = 0;
496 v8 = 302; 496 v8 = 302;
497 pButton2 = ptr_69BD64; 497 pButton2 = pBtnLoadSlot;
498 v9 = 241; 498 v9 = 241;
499 pWindowType1 = (WindowType)94; 499 pWindowType1 = (WindowType)94;
500 v137 = 42; 500 v137 = 42;
501 v133 = 106; 501 v133 = 106;
502 goto LABEL_733; 502 goto LABEL_733;
503 case UIMSG_A5: 503 case UIMSG_SelectLoadSlot:
504 if ( pGUIWindow_CurrentMenu->field_40 == v0 ) 504 if ( pGUIWindow_CurrentMenu->field_40 == v0 )
505 pKeyActionMap->_459ED1(0); 505 pKeyActionMap->_459ED1(0);
506 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != dword_6A0C9C + uMessageParam ) 506 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
507 { 507 {
508 v10 = dword_6A0C9C + uMessageParam; 508 v10 = pSaveListPosition + uMessageParam;
509 if ( dword_6BE138 == dword_6A0C9C + uMessageParam ) 509 if ( dword_6BE138 == pSaveListPosition + uMessageParam )
510 { 510 {
511 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 511 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
512 { 512 {
513 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)164; 513 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)164;
514 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 514 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
515 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 515 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
516 v11 = pMessageQueue_50CBD0->uNumMessages + 1; 516 v11 = pMessageQueue_50CBD0->uNumMessages + 1;
517 v13 = __OFSUB__(pMessageQueue_50CBD0->uNumMessages + 1, 40); 517 v13 = pMessageQueue_50CBD0->uNumMessages + 1 > 40;
518 v12 = (signed int)pMessageQueue_50CBD0->uNumMessages - 39 < 0; 518 v12 = (signed int)pMessageQueue_50CBD0->uNumMessages - 39 < 0;
519 ++pMessageQueue_50CBD0->uNumMessages; 519 ++pMessageQueue_50CBD0->uNumMessages;
520 if ( v12 ^ v13 ) 520 if ( v12 ^ v13 )
521 { 521 {
522 pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)82; 522 pMessageQueue_50CBD0->pMessages[v11].eType = (UIMessageType)82;
529 uLoadGameUI_SelectedSlot = v10; 529 uLoadGameUI_SelectedSlot = v10;
530 dword_6BE138 = v10; 530 dword_6BE138 = v10;
531 } 531 }
532 else 532 else
533 { 533 {
534 pKeyActionMap->_459E5A(0, 19, pGUIWindow_CurrentMenu); 534 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
535 if ( strcmp((const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, pGlobalTXT_LocalizationStrings[72]) )// "Empty" 535 if ( strcmp((const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, pGlobalTXT_LocalizationStrings[72]) )// "Empty"
536 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); 536 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot);
537 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); 537 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
538 } 538 }
539 goto _continue; 539 goto _continue;
689 goto LABEL_623; 689 goto LABEL_623;
690 v14 = uMessageParam; 690 v14 = uMessageParam;
691 if ( dword_506F08 != v0 ) 691 if ( dword_506F08 != v0 )
692 v14 = uMessageParam + 14; 692 v14 = uMessageParam + 14;
693 dword_506E68 = v14; 693 dword_506E68 = v14;
694 pKeyActionMap->_459E5A(0, v0, pGUIWindow_CurrentMenu); 694 pKeyActionMap->EnterText(0, v0, pGUIWindow_CurrentMenu);
695 goto _continue; 695 goto _continue;
696 case UIMSG_ResetKeyMapping: 696 case UIMSG_ResetKeyMapping:
697 v197 = 1; 697 v197 = 1;
698 pKeyActionMap->SetDefaultMapping(); 698 pKeyActionMap->SetDefaultMapping();
699 uAction = 0; 699 uAction = 0;
1071 pAudioPlayer->StopChannels(-1, -1); 1071 pAudioPlayer->StopChannels(-1, -1);
1072 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); 1072 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
1073 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, (enum WindowType)99, (int)pBtn_History, 0); 1073 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, (enum WindowType)99, (int)pBtn_History, 0);
1074 bFlashHistoryBook = 0; 1074 bFlashHistoryBook = 0;
1075 goto _continue; 1075 goto _continue;
1076 case UIMSG_CloseBook: 1076 case UIMSG_Escape:
1077 back_to_game(); 1077 back_to_game();
1078 if ( pMessageQueue_50CBD0->uNumMessages ) 1078 if ( pMessageQueue_50CBD0->uNumMessages )
1079 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 1079 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
1080 if ( pCurrentScreen > 15 ) 1080 if ( pCurrentScreen > 15 )
1081 { 1081 {
2721 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, 0x85u, 0, 0, v1, 0); 2721 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, 0x85u, 0, 0, v1, 0);
2722 goto LABEL_422; 2722 goto LABEL_422;
2723 case UIMSG_Quit|0x1: 2723 case UIMSG_Quit|0x1:
2724 OnPaperdollLeftClick(); 2724 OnPaperdollLeftClick();
2725 goto _continue; 2725 goto _continue;
2726 case UIMSG_CloseBook|0x2: 2726 case UIMSG_Escape|0x2:
2727 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; 2727 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
2728 sub_4196A0(); 2728 sub_4196A0();
2729 sub_419379(); 2729 sub_419379();
2730 pButton = pCharacterScreen_StatsBtn; 2730 pButton = pCharacterScreen_StatsBtn;
2731 goto LABEL_716; 2731 goto LABEL_716;
2781 pButton = pCharacterScreen_ExitBtn; 2781 pButton = pCharacterScreen_ExitBtn;
2782 v163 = 0; 2782 v163 = 0;
2783 pButton2 = pCharacterScreen_ExitBtn; 2783 pButton2 = pCharacterScreen_ExitBtn;
2784 pWindowType1 = (WindowType)97; 2784 pWindowType1 = (WindowType)97;
2785 goto LABEL_731; 2785 goto LABEL_731;
2786 case UIMSG_CloseBook|0x4: 2786 case UIMSG_Escape|0x4:
2787 sub_419379(); 2787 sub_419379();
2788 sub_4196A0(); 2788 sub_4196A0();
2789 sub_419220(); 2789 sub_419220();
2790 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; 2790 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102;
2791 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), 2791 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42),
2792 (int)pCharacterScreen_AwardsBtn, 0); 2792 (int)pCharacterScreen_AwardsBtn, 0);
2793 sub_419100(); 2793 sub_419100();
2794 goto _continue; 2794 goto _continue;
2795 case 71://0x47: 2795 case 71://0x47:
2796 switch ( uMessageParam ) 2796 switch ( uMessageParam )
2797 { 2797 {
2798 default: 2798 default:
2799 goto _continue; 2799 goto _continue;
2800 case 11: 2800 case 11:
3079 } 3079 }
3080 //----- (00435748) -------------------------------------------------------- 3080 //----- (00435748) --------------------------------------------------------
3081 void __cdecl GUI_MainMenuMessageProc() 3081 void __cdecl GUI_MainMenuMessageProc()
3082 { 3082 {
3083 //AudioPlayer *v0; // ebp@2 3083 //AudioPlayer *v0; // ebp@2
3084 char *v1; // ebx@2 3084 //Player *pPlayer1; // ebx@2
3085 unsigned int v2; // ecx@18 3085 unsigned int v2; // ecx@18
3086 void *v3; // edi@21 3086 void *v3; // edi@21
3087 signed int v4; // eax@29 3087 signed int v4; // eax@29
3088 int v5; // ecx@29 3088 int v5; // ecx@29
3089 enum PLAYER_SKILL_TYPE v6; // edi@37 3089 enum PLAYER_SKILL_TYPE v6; // edi@37
3126 Player *pPlayer; 3126 Player *pPlayer;
3127 3127
3128 if ( pMessageQueue_50CBD0->uNumMessages ) 3128 if ( pMessageQueue_50CBD0->uNumMessages )
3129 { 3129 {
3130 //v0 = pAudioPlayer; 3130 //v0 = pAudioPlayer;
3131 v1 = (char *)pParty->pPlayers; 3131 //pPlayer1 = pParty->pPlayers;
3132 pPlayer = pParty->pPlayers; 3132 pPlayer = pParty->pPlayers;
3133 do 3133 do
3134 { 3134 {
3135 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &pSex); 3135 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &pSex);
3136 switch (pUIMessageType) 3136 switch (pUIMessageType) // For buttons of window MainMenu
3137 { 3137 {
3138 case UIMSG_MainMenu_ShowPartyCreationWnd: 3138 case UIMSG_MainMenu_ShowPartyCreationWnd:// Окно создания группы
3139 { 3139 {
3140 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0); 3140 GUIWindow::Create(495, 172, 0, 0, WINDOW_5A, (int)pMainMenu_BtnNew, 0);
3141 SetCurrentMenuID(MENU_NEWGAME); 3141 SetCurrentMenuID(MENU_NEWGAME);
3142 } 3142 }
3143 continue; 3143 continue;
3144 case UIMSG_MainMenu_ShowLoadWindow: 3144 case UIMSG_MainMenu_ShowLoadWindow:// Окно Загрузка
3145 { 3145 {
3146 GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0); 3146 GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0);
3147 SetCurrentMenuID(MENU_SAVELOAD); 3147 SetCurrentMenuID(MENU_SAVELOAD);
3148 } 3148 }
3149 continue; 3149 continue;
3150 case UIMSG_ShowCredits: 3150 case UIMSG_ShowCredits:// Окно Создатели
3151 { 3151 {
3152 GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0); 3152 GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0);
3153 SetCurrentMenuID(MENU_CREDITS); 3153 SetCurrentMenuID(MENU_CREDITS);
3154 } 3154 }
3155 continue; 3155 continue;
3156 case UIMSG_ExitToWindows: 3156 case UIMSG_ExitToWindows:// Окно Выход
3157 { 3157 {
3158 GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); 3158 GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0);
3159 SetCurrentMenuID(MENU_FINISHED); 3159 SetCurrentMenuID(MENU_FINISHED);
3160 } 3160 }
3161 continue; 3161 continue;
3162 case UIMSG_LoadGame: 3162 }
3163
3164 switch (pUIMessageType) // For buttons of window LoadGame
3165 {
3166 case UIMSG_LoadGame:// Процесс загрузки
3163 { 3167 {
3164 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) 3168 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
3165 continue; 3169 continue;
3166 SetCurrentMenuID(MENU_LOAD); 3170 SetCurrentMenuID(MENU_LOAD);
3171 continue;
3167 } 3172 }
3168 continue; 3173 case UIMSG_SelectLoadSlot: // Выбранный слот сохранёнки
3169 }
3170 switch (pUIMessageType)
3171 {
3172 case UIMSG_A5: // WINDOW_5A
3173 { 3174 {
3174 //main menu save/load wnd clicking on savegame lines 3175 //main menu save/load wnd clicking on savegame lines
3175 if (pGUIWindow_CurrentMenu->field_40 == 1) 3176 if (pGUIWindow_CurrentMenu->field_40 == 1)
3176 pKeyActionMap->_459ED1(0); 3177 pKeyActionMap->_459ED1(0);
3177 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + dword_6A0C9C ) 3178 if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + pSaveListPosition )
3178 { 3179 {
3179 //load clicked line 3180 //load clicked line
3180 v26 = uNum + dword_6A0C9C; 3181 v26 = uNum + pSaveListPosition;
3181 if ( dword_6BE138 == uNum + dword_6A0C9C ) 3182 if ( dword_6BE138 == uNum + pSaveListPosition )
3182 { 3183 {
3183 pMessageQueue_50CBD0->SendMessage(UIMSG_A4, 0, 0); 3184 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadSlot, 0, 0);
3184 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0); 3185 pMessageQueue_50CBD0->SendMessage(UIMSG_LoadGame, 0, 0);
3185 } 3186 }
3186 uLoadGameUI_SelectedSlot = v26; 3187 uLoadGameUI_SelectedSlot = v26;
3187 dword_6BE138 = v26; 3188 dword_6BE138 = v26;
3188 } 3189 }
3189 else 3190 else
3190 { 3191 {
3191 //typing in the line 3192 //typing in the line
3192 pKeyActionMap->_459E5A(0, 19, pGUIWindow_CurrentMenu); 3193 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
3193 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName); 3194 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
3194 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); 3195 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
3195 } 3196 }
3197 continue;
3196 } 3198 }
3199 case UIMSG_LoadSlot: // Нажатие на слот в окне Загрузка
3200 {
3201 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)pBtnLoadSlot, 0);
3197 continue; 3202 continue;
3198 case UIMSG_A4: 3203 }
3204 case UIMSG_DownArrow://нажатие стрелки вниз
3199 { 3205 {
3200 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)ptr_69BD64, 0); 3206 ++pSaveListPosition;
3207 if ( pSaveListPosition >= uNum )
3208 pSaveListPosition = uNum - 1;
3209 if ( pSaveListPosition < 1 )
3210 pSaveListPosition = 0;
3211 pWindow = pGUIWindow_CurrentMenu;
3212 v8 = pGUIWindow_CurrentMenu->uFrameY + 323;
3213 GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, (int)pBtnDownArrow, 0);
3214 continue;
3201 } 3215 }
3202 continue; 3216 case UIMSG_Cancel:// Нажатие кнопки Отмена
3217 {
3218 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)pBtnCancel, 0);
3219 continue;
3220 }
3221 case UIMSG_ArrowUp:// Кнопка Вверх
3222 {
3223 --pSaveListPosition;
3224 if ( pSaveListPosition < 0 )
3225 pSaveListPosition = 0;
3226 pWindow = pGUIWindow_CurrentMenu;
3227 v8 = pGUIWindow_CurrentMenu->uFrameY + 197;
3228 GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, (int)pBtnArrowUp, 0);
3229 continue;
3230 }
3203 } 3231 }
3204 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill ) 3232
3233 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill )// For button of window PlayerCreation
3205 { 3234 {
3206 if ( pUIMessageType > UIMSG_A3 ) 3235 if ( pUIMessageType > UIMSG_DownArrow )
3207 { 3236 {
3208 if ( pUIMessageType == UIMSG_A6 ) 3237 if ( pUIMessageType == UIMSG_SelectFacePlayerBack ) // Выбор лица персонажа кнопка назад
3209 {
3210 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, (WindowType)95, (int)ptr_69BD60, 0);
3211 continue;
3212 }
3213 if ( pUIMessageType == UIMSG_SelectFacePlayerBack )
3214 { 3238 {
3215 pPlayer = &pParty->pPlayers[uNum]; 3239 pPlayer = &pParty->pPlayers[uNum];
3216 v12 = (char)((int)pPlayer->uFace - 1) < 0; 3240 v12 = (char)((int)pPlayer->uFace - 1) < 0;
3217 --pPlayer->uFace; 3241 --pPlayer->uFace;
3218 if ( v12 ) 3242 if ( v12 )
3227 uPlayerCreationUI_SelectedCharacter = v25; 3251 uPlayerCreationUI_SelectedCharacter = v25;
3228 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, 3252 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0,
3229 (enum WindowType)92, (int)pCreationUI_BtnPressLeft[v25], 1); 3253 (enum WindowType)92, (int)pCreationUI_BtnPressLeft[v25], 1);
3230 //v0 = pAudioPlayer; 3254 //v0 = pAudioPlayer;
3231 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0); 3255 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0);
3232 v22 = pPlayer; 3256 pPlayer->PlaySound(102, 0);
3233 v22->PlaySound(102, 0); 3257 //v1 = (char *)pParty->pPlayers;
3234 v1 = (char *)pParty->pPlayers;
3235 continue; 3258 continue;
3236 } 3259 }
3237 if ( pUIMessageType == UIMSG_SelectFacePlayerForward ) 3260 if ( pUIMessageType == UIMSG_SelectFacePlayerForward ) // выбор лица персонажа кнопка вперёд
3238 { 3261 {
3239 pPlayer = &pParty->pPlayers[uNum]; 3262 pPlayer = &pParty->pPlayers[uNum];
3240 v20 = (char)((int)pPlayer->uFace + 1) % 20; 3263 v20 = (char)((int)pPlayer->uFace + 1) % 20;
3241 pPlayer->uFace = v20; 3264 pPlayer->uFace = v20;
3242 pPlayer->uVoiceID = v20; 3265 pPlayer->uVoiceID = v20;
3243 pPlayer->SetInitialStats(); 3266 pPlayer->SetInitialStats();
3244 pPlayer->SetSexByVoice(); 3267 pPlayer->SetSexByVoice();
3245 pPlayer->RandomizeName(); 3268 pPlayer->RandomizeName();
3246 v21 = uNum; 3269 v21 = uNum;
3247 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) 3270 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3248 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; 3271 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3249 uPlayerCreationUI_SelectedCharacter = v21; 3272 uPlayerCreationUI_SelectedCharacter = v21;
3250 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, (enum WindowType)92, 3273 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, (enum WindowType)92,
3251 (int)pCreationUI_BtnPressRight[v21], 1); 3274 (int)pCreationUI_BtnPressRight[v21], 1);
3252 //v0 = pAudioPlayer; 3275 //v0 = pAudioPlayer;
3253 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); 3276 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
3254 v22 = pPlayer; 3277 pPlayer->PlaySound(102, 0);
3255 v22->PlaySound(102, 0); 3278 //v1 = (char *)pParty->pPlayers;
3256 v1 = (char *)pParty->pPlayers;
3257 continue; 3279 continue;
3258 } 3280 }
3259 if ( pUIMessageType == UIMSG_AD ) 3281 if ( pUIMessageType == UIMSG_AD )//unknow
3260 { 3282 {
3283 __debugbreak();
3261 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0); 3284 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0);
3262 SetCurrentMenuID(MENU_LOAD); 3285 SetCurrentMenuID(MENU_LOAD);
3263 continue;
3264 }
3265 if ( pUIMessageType != UIMSG_AE )
3266 continue; 3286 continue;
3287 }
3288 if ( pUIMessageType != UIMSG_AE )//unknow
3289 {
3290 __debugbreak();
3291 continue;
3292 }
3267 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0); 3293 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0);
3268 LABEL_114: 3294 //LABEL_114:
3269 v40 = 10; 3295 v40 = 10;
3270 LABEL_89: 3296 //LABEL_89:
3271 v2 = v40; 3297 v2 = v40;
3272 SetCurrentMenuID((MENU_STATE)v2); 3298 SetCurrentMenuID((MENU_STATE)v2);
3273 continue; 3299 continue;
3274 } 3300 }
3275 if ( pUIMessageType == UIMSG_A3 ) 3301 if ( pUIMessageType == UIMSG_6B )//unknow
3276 { 3302 {
3277 ++dword_6A0C9C; 3303 __debugbreak();
3278 if ( dword_6A0C9C >= uNum )
3279 dword_6A0C9C = uNum - 1;
3280 if ( dword_6A0C9C < 1 )
3281 dword_6A0C9C = 0;
3282 pWindow = pGUIWindow_CurrentMenu;
3283 v43 = 0;
3284 v39 = (int)ptr_69BD58;
3285 v8 = pGUIWindow_CurrentMenu->uFrameY + 323;
3286 goto LABEL_105;
3287 }
3288 if ( pUIMessageType == UIMSG_6B )
3289 {
3290 if ( pCurrentScreen ) 3304 if ( pCurrentScreen )
3291 { 3305 {
3292 pGUIWindow_CurrentMenu->Release(); 3306 pGUIWindow_CurrentMenu->Release();
3293 pEventTimer->Resume(); 3307 pEventTimer->Resume();
3294 pCurrentScreen = 0; 3308 pCurrentScreen = 0;
3295 viewparams->bRedrawGameUI = 1; 3309 viewparams->bRedrawGameUI = 1;
3296 } 3310 }
3297 GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0); 3311 GUIWindow::Create(602, 450, 0, 0, (enum WindowType)92, (int)pBtn_GameSettings, 0);
3298 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) 3312 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
3299 continue; 3313 continue;
3300 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_CloseBook; 3314 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
3301 goto LABEL_93; 3315 //goto LABEL_93;
3316 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3317 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3318 ++pMessageQueue_50CBD0->uNumMessages;
3319 continue;
3302 } 3320 }
3303 if ( pUIMessageType == UIMSG_CloseBook ) 3321 if ( pUIMessageType == UIMSG_Escape )
3304 { 3322 {
3305 if ( ptr_507BDC ) 3323 if ( ptr_507BDC )
3306 { 3324 {
3307 sub_41426F(); 3325 sub_41426F();
3308 continue; 3326 continue;
3320 if ( v17 == 16 ) 3338 if ( v17 == 16 )
3321 pVideoPlayer->FastForwardToFrame(pVideoPlayer->field_40); 3339 pVideoPlayer->FastForwardToFrame(pVideoPlayer->field_40);
3322 if (GetCurrentMenuID() == MENU_7) 3340 if (GetCurrentMenuID() == MENU_7)
3323 { 3341 {
3324 v40 = 6; 3342 v40 = 6;
3325 goto LABEL_89; 3343 //goto LABEL_89;
3344 v2 = v40;
3345 SetCurrentMenuID((MENU_STATE)v2);
3346 continue;
3326 } 3347 }
3327 if (GetCurrentMenuID() == MENU_Credits) 3348 if (GetCurrentMenuID() == MENU_Credits)
3328 { 3349 {
3329 v40 = 11; 3350 v40 = 11;
3330 goto LABEL_89; 3351 //goto LABEL_89;
3352 v2 = v40;
3353 SetCurrentMenuID((MENU_STATE)v2);
3354 continue;
3331 } 3355 }
3332 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 3356 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
3333 { 3357 {
3334 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)5; 3358 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)5;
3335 LABEL_93: 3359 //LABEL_93:
3336 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; 3360 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
3337 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 3361 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
3338 ++pMessageQueue_50CBD0->uNumMessages; 3362 ++pMessageQueue_50CBD0->uNumMessages;
3339 continue; 3363 continue;
3340 } 3364 }
3350 //crt_deconstruct_ptr_6A0118(); 3374 //crt_deconstruct_ptr_6A0118();
3351 pTexture_PCX.Release(); 3375 pTexture_PCX.Release();
3352 pTexture_PCX.Load("title.pcx", 0); 3376 pTexture_PCX.Load("title.pcx", 0);
3353 SetCurrentMenuID(MENU_MAIN); 3377 SetCurrentMenuID(MENU_MAIN);
3354 v15 = 1; 3378 v15 = 1;
3355 LABEL_81: 3379 //LABEL_81:
3356 pGUIWindow_CurrentMenu->Release(); 3380 pGUIWindow_CurrentMenu->Release();
3357 pGUIWindow2->Release(); 3381 pGUIWindow2->Release();
3358 pGUIWindow2 = 0; 3382 pGUIWindow2 = 0;
3359 pEventTimer->Resume(); 3383 pEventTimer->Resume();
3360 pCurrentScreen = 0; 3384 pCurrentScreen = 0;
3366 pVideoPlayer->Unload(); 3390 pVideoPlayer->Unload();
3367 } 3391 }
3368 else 3392 else
3369 { 3393 {
3370 if ( pCurrentScreen != 27 ) 3394 if ( pCurrentScreen != 27 )
3371 goto LABEL_81; 3395 //goto LABEL_81;
3396 {
3397 pGUIWindow_CurrentMenu->Release();
3398 pGUIWindow2->Release();
3399 pGUIWindow2 = 0;
3400 pEventTimer->Resume();
3401 pCurrentScreen = 0;
3402 viewparams->bRedrawGameUI = v15;
3403 continue;
3404 }
3372 //VideoPlayer::dtor(); 3405 //VideoPlayer::dtor();
3373 } 3406 }
3374 } 3407 }
3375 else 3408 else
3376 { 3409 {
3380 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; 3413 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3381 uPlayerCreationUI_SelectedCharacter = uNum; 3414 uPlayerCreationUI_SelectedCharacter = uNum;
3382 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); 3415 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
3383 continue; 3416 continue;
3384 } 3417 }
3385 if ( pUIMessageType == UIMSG_PlayerCreationVoiceBack ) 3418 if ( pUIMessageType == UIMSG_PlayerCreationVoiceBack )// есть проблема со звуками
3386 { 3419 {
3387 pCurrentPlayer = &pPlayer[uNum]; 3420 pCurrentPlayer = &pPlayer[uNum];
3388 pSex = pCurrentPlayer->GetSexByVoice(); 3421 pSex = pCurrentPlayer->GetSexByVoice();
3389 do 3422 do
3390 { 3423 {
3391 v12 = (/*(*/pCurrentPlayer->uVoiceID-- - 1/*) & 0x80000000u */) != 0; 3424 v12 = (pCurrentPlayer->uVoiceID-- - 1) == 0;
3392 if ( v12 ) 3425 if ( v12 )
3393 pCurrentPlayer->uVoiceID = 19; 3426 pCurrentPlayer->uVoiceID = 19;
3394 v13 = pCurrentPlayer->GetSexByVoice(); 3427 v13 = pCurrentPlayer->GetSexByVoice();
3395 } 3428 }
3396 while ( v13 != pSex ); 3429 while ( v13 != pSex );
3414 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1); 3447 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1);
3415 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); 3448 pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0);
3416 pCurrentPlayer->PlaySound(102, 0); 3449 pCurrentPlayer->PlaySound(102, 0);
3417 continue; 3450 continue;
3418 } 3451 }
3419 if ( pUIMessageType == UIMSG_A2 )
3420 {
3421 --dword_6A0C9C;
3422 if ( dword_6A0C9C < 0 )
3423 dword_6A0C9C = 0;
3424 pWindow = pGUIWindow_CurrentMenu;
3425 v43 = 0;
3426 v39 = (int)ptr_69BD5C;
3427 v8 = pGUIWindow_CurrentMenu->uFrameY + 197;
3428 LABEL_105:
3429 GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, v39, v43);
3430 continue;
3431 }
3432 } 3452 }
3433 } 3453 }
3434 else 3454 else
3435 { 3455 {
3436 if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill ) 3456 if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill )
3437 { 3457 {
3438 uPlayerCreationUI_SelectedCharacter = uNum; 3458 uPlayerCreationUI_SelectedCharacter = uNum;
3439 v41 = 3; 3459 v41 = 3;
3440 v1 = (char *)pParty->pPlayers; 3460 //v1 = (char *)pParty->pPlayers;
3441 v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 3461 v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
3442 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; 3462 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum;
3443 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; 3463 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5;
3444 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) 3464 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41)
3445 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; 3465 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
3446 continue; 3466 continue;
3447 } 3467 }
3448 if ( (signed int)pUIMessageType > UIMSG_3C ) 3468 if ( (signed int)pUIMessageType > UIMSG_PlayerCreationChangeName )
3449 { 3469 {
3450 if ( pUIMessageType == UIMSG_PlayerCreationClickPlus ) 3470 if ( pUIMessageType == UIMSG_PlayerCreationClickPlus )
3451 { 3471 {
3452 GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1); 3472 GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1);
3453 (&pPlayer[uPlayerCreationUI_SelectedCharacter])->IncreaseAttribute( 3473 (&pPlayer[uPlayerCreationUI_SelectedCharacter])->IncreaseAttribute(
3510 } 3530 }
3511 else 3531 else
3512 { 3532 {
3513 switch ( pUIMessageType ) 3533 switch ( pUIMessageType )
3514 { 3534 {
3515 case 60: 3535 case UIMSG_PlayerCreationChangeName:
3516 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); 3536 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
3517 v3 = (void *)uNum; 3537 v3 = (void *)uNum;
3518 uPlayerCreationUI_SelectedCharacter = uNum; 3538 uPlayerCreationUI_SelectedCharacter = uNum;
3519 pKeyActionMap->_459E5A(0, 15, pGUIWindow_CurrentMenu); 3539 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu);
3520 pGUIWindow_CurrentMenu->ptr_1C = v3; 3540 pGUIWindow_CurrentMenu->ptr_1C = v3;
3521 break; 3541 break;
3522 case 5: 3542 case UIMSG_ChangeGameState:
3523 uGameState = 1; 3543 uGameState = 1;
3524 break; 3544 break;
3525 case 17: 3545 case UIMSG_11://unknow
3546 __debugbreak();
3526 pMouse->SetCursorBitmap("MICON2"); 3547 pMouse->SetCursorBitmap("MICON2");
3527 break; 3548 break;
3528 default: 3549 case UIMSG_3A://unknow
3529 if ( pUIMessageType == 58 ) 3550 __debugbreak();
3530 goto LABEL_114; 3551 v40 = 10;
3552 v2 = v40;
3553 SetCurrentMenuID((MENU_STATE)v2);
3531 break; 3554 break;
3532 } 3555 }
3533 } 3556 }
3534 } 3557 }
3535 } 3558 }