comparison mm7_2.cpp @ 1917:4ecc099ef876

sub_4BD8B5 converted to switch clause
author zipi
date Tue, 22 Oct 2013 21:31:24 +0100
parents 28fdf4e567ad
children 140ca8123384
comparison
equal deleted inserted replaced
1916:918a8cebd7a4 1917:4ecc099ef876
614 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 614 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
615 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); 615 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
616 pKeyActionMap->ResetKeys(); 616 pKeyActionMap->ResetKeys();
617 activeLevelDecoration = NULL; 617 activeLevelDecoration = NULL;
618 current_npc_text = 0; 618 current_npc_text = 0;
619 if ( pDialogueNPCCount ) 619 if ( pDialogueNPCCount == 0)
620 { 620 {
621 return 0;
622 }
623
624 v0 = dialog_menu_id;
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();
621 v0 = dialog_menu_id; 630 v0 = dialog_menu_id;
622 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD && dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL 631 ShopTexture = 0;
623 && dialog_menu_id != HOUSE_DIALOGUE_97 && dialog_menu_id != HOUSE_DIALOGUE_SHOP_REPAIR 632 }
624 && dialog_menu_id != HOUSE_DIALOGUE_SHOP_IDENTIFY && ShopTexture ) 633
625 { 634 switch(v0)
626 ShopTexture->Release(); 635 {
627 v0 = dialog_menu_id; 636 case -1:
628 ShopTexture = 0;
629 }
630 if ( v0 && v0 != 1 )
631 {
632 if ( v0 == -1 )
633 {
634 _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1)); 637 _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1));
635 pVideoPlayer->_4BF5B2(); 638 pVideoPlayer->_4BF5B2();
636 return 1; 639 break;
637 } 640
638 if ( v0 != 94 && v0 != 96 && v0 != 101 ) 641 case 94:
639 { 642 case 96:
640 if ( v0 == 3 || v0 == 5 || v0 == 4 ) 643 case 101:
641 { 644 pVideoPlayer->_4BF5B2();
642 UI_CreateEndConversationButton(); 645 UI_CreateEndConversationButton();
643 dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT; 646 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
644 InitializaDialogueOptions_Shops(in_current_building_type); 647 InitializaDialogueOptions(in_current_building_type);
645 } 648 break;
646 else 649
647 { 650 case 3:
648 if ( v0 != 102 && v0 != 103 && v0 != 104 ) 651 case 4:
649 { 652 case 5:
650 pVideoPlayer->_4BF5B2(); 653 UI_CreateEndConversationButton();
651 dialog_menu_id = HOUSE_DIALOGUE_MAIN; 654 dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT;
652 InitializaDialogueOptions(in_current_building_type); 655 InitializaDialogueOptions_Shops(in_current_building_type);
653 return 1; 656 break;
654 } 657
655 pVideoPlayer->_4BF5B2(); 658 case 102:
656 UI_CreateEndConversationButton(); 659 case 103:
657 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN; 660 case 104:
658 InitializaDialogueOptions_Tavern(in_current_building_type); 661 pVideoPlayer->_4BF5B2();
659 } 662 UI_CreateEndConversationButton();
660 return 1; 663 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN;
661 } 664 InitializaDialogueOptions_Tavern(in_current_building_type);
662 pVideoPlayer->_4BF5B2(); 665 break;
663 UI_CreateEndConversationButton(); 666
664 dialog_menu_id = HOUSE_DIALOGUE_MAIN; 667 case 0:
665 InitializaDialogueOptions(in_current_building_type); 668 case 1:
666 return 1; 669 pDialogueNPCCount = 0;
667 } 670 pDialogueWindow->Release();
668 pDialogueNPCCount = 0; 671 dialog_menu_id = HOUSE_DIALOGUE_NULL;
669 pDialogueWindow->Release(); 672 pDialogueWindow = 0;
670 dialog_menu_id = HOUSE_DIALOGUE_NULL; 673 pIcons_LOD->SyncLoadedFilesCount();
671 pDialogueWindow = 0; 674
672 pIcons_LOD->SyncLoadedFilesCount(); 675 if ( uNumDialogueNPCPortraits == 1 )
673 if ( uNumDialogueNPCPortraits != 1 ) 676 return 0;
674 { 677
675 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; 678 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead;
676 if ( uNumDialogueNPCPortraits > 0 ) 679 if ( uNumDialogueNPCPortraits > 0 )
677 { 680 {
678 for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i ) 681 for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i )
679 { 682 {
680 HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i], 683 HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i],
681 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i], 684 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i],
682 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0); 685 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0);
683 } 686 }
684 } 687 }
685 pVideoPlayer->_4BF5B2(); 688
686 return 1; 689 pVideoPlayer->_4BF5B2();
687 } 690 break;
688 } 691
689 return 0; 692 default:
693 pVideoPlayer->_4BF5B2();
694 dialog_menu_id = HOUSE_DIALOGUE_MAIN;
695 InitializaDialogueOptions(in_current_building_type);
696 break;
697 }
698
699 return 1;
690 } 700 }
691 701
692 //----- (004BF91E) -------------------------------------------------------- 702 //----- (004BF91E) --------------------------------------------------------
693 unsigned int GameOverMenu(void *ecx0) 703 unsigned int GameOverMenu(void *ecx0)
694 { 704 {