comparison mm7_2.cpp @ 1919:140ca8123384

Tavern rest fix
author Ritor1
date Wed, 23 Oct 2013 10:24:38 +0600
parents 4ecc099ef876
children 1cbfb6e50e48
comparison
equal deleted inserted replaced
1918:c77935190b51 1919:140ca8123384
604 } 604 }
605 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); 605 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0);
606 } 606 }
607 607
608 //----- (004BD8B5) -------------------------------------------------------- 608 //----- (004BD8B5) --------------------------------------------------------
609 int sub_4BD8B5() 609 int HouseDialogPressCloseBtn()
610 { 610 {
611 int v0; // eax@4
612
613 if ( pMessageQueue_50CBD0->uNumMessages ) 611 if ( pMessageQueue_50CBD0->uNumMessages )
614 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 612 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
615 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); 613 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
616 pKeyActionMap->ResetKeys(); 614 pKeyActionMap->ResetKeys();
617 activeLevelDecoration = NULL; 615 activeLevelDecoration = NULL;
618 current_npc_text = 0; 616 current_npc_text = 0;
619 if ( pDialogueNPCCount == 0) 617 if ( pDialogueNPCCount == 0)
620 { 618 return 0;
621 return 0; 619
622 } 620 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture )
623 621 {
624 v0 = dialog_menu_id; 622 ShopTexture->Release();
625 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD && dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL
626 && dialog_menu_id != HOUSE_DIALOGUE_97 && dialog_menu_id != HOUSE_DIALOGUE_SHOP_REPAIR
627 && dialog_menu_id != HOUSE_DIALOGUE_SHOP_IDENTIFY && ShopTexture )
628 {
629 ShopTexture->Release();
630 v0 = dialog_menu_id;
631 ShopTexture = 0; 623 ShopTexture = 0;
632 } 624 }
633 625
634 switch(v0) 626 switch(dialog_menu_id)
635 { 627 {
636 case -1: 628 case -1:
637 _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1)); 629 _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1));
638 pVideoPlayer->_4BF5B2(); 630 pVideoPlayer->_4BF5B2();
639 break; 631 break;
640 632
641 case 94: 633 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
642 case 96: 634 case HOUSE_DIALOGUE_LEARN_SKILLS:
643 case 101: 635 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
644 pVideoPlayer->_4BF5B2(); 636 pVideoPlayer->_4BF5B2();
645 UI_CreateEndConversationButton(); 637 UI_CreateEndConversationButton();
646 dialog_menu_id = HOUSE_DIALOGUE_MAIN; 638 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
647 InitializaDialogueOptions(in_current_building_type); 639 InitializaDialogueOptions(in_current_building_type);
648 break; 640 break;
649 641
650 case 3: 642 case HOUSE_DIALOGUE_SHOP_SELL:
651 case 4: 643 case HOUSE_DIALOGUE_SHOP_IDENTIFY:
652 case 5: 644 case HOUSE_DIALOGUE_SHOP_REPAIR:
653 UI_CreateEndConversationButton(); 645 UI_CreateEndConversationButton();
654 dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT; 646 dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT;
655 InitializaDialogueOptions_Shops(in_current_building_type); 647 InitializaDialogueOptions_Shops(in_current_building_type);
656 break; 648 break;
657 649
658 case 102: 650 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
659 case 103: 651 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
660 case 104: 652 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
661 pVideoPlayer->_4BF5B2(); 653 pVideoPlayer->_4BF5B2();
662 UI_CreateEndConversationButton(); 654 UI_CreateEndConversationButton();
663 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN; 655 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN;
664 InitializaDialogueOptions_Tavern(in_current_building_type); 656 InitializaDialogueOptions_Tavern(in_current_building_type);
665 break; 657 break;
666 658
667 case 0: 659 case HOUSE_DIALOGUE_NULL:
668 case 1: 660 case HOUSE_DIALOGUE_MAIN:
669 pDialogueNPCCount = 0; 661 pDialogueNPCCount = 0;
670 pDialogueWindow->Release(); 662 pDialogueWindow->Release();
671 dialog_menu_id = HOUSE_DIALOGUE_NULL; 663 dialog_menu_id = HOUSE_DIALOGUE_NULL;
672 pDialogueWindow = 0; 664 pDialogueWindow = 0;
673 pIcons_LOD->SyncLoadedFilesCount(); 665 pIcons_LOD->SyncLoadedFilesCount();
674 666
675 if ( uNumDialogueNPCPortraits == 1 ) 667 if ( uNumDialogueNPCPortraits == 1 )
676 return 0; 668 return 0;
677 669
678 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; 670 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead;
679 if ( uNumDialogueNPCPortraits > 0 ) 671 if ( uNumDialogueNPCPortraits > 0 )
680 { 672 {
681 for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i ) 673 for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i )
682 { 674 {
683 HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i], 675 HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i],
684 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i], 676 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i],
685 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0); 677 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0);
686 } 678 }
687 } 679 }
688 680
689 pVideoPlayer->_4BF5B2(); 681 pVideoPlayer->_4BF5B2();
690 break; 682 break;
691 683
692 default: 684 default:
693 pVideoPlayer->_4BF5B2(); 685 pVideoPlayer->_4BF5B2();
694 dialog_menu_id = HOUSE_DIALOGUE_MAIN; 686 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
695 InitializaDialogueOptions(in_current_building_type); 687 InitializaDialogueOptions(in_current_building_type);
696 break; 688 break;
697 } 689 }
698
699 return 1; 690 return 1;
700 } 691 }
701 692
702 //----- (004BF91E) -------------------------------------------------------- 693 //----- (004BF91E) --------------------------------------------------------
703 unsigned int GameOverMenu(void *ecx0) 694 unsigned int GameOverMenu(void *ecx0)