DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ FlagAction()

bool Icon::FlagAction ( EntityAI entity1,
EntityAI entity2,
int combinationFlags )
inlineprotected

См. определение в файле Icon.c строка 733

734 {
735 int current_flag;
736 ContextMenu cmenu = ContextMenu.Cast(g_Game.GetUIManager().GetMenu().GetContextMenu());
737 m_am_entity1 = entity1;
738 m_am_entity2 = entity2;
739 cmenu.Hide();
740 cmenu.Clear();
741 int id = -1;
742
743 if (combinationFlags & InventoryCombinationFlags.COMBINE_QUANTITY2 )
744 {
745 ItemBase entity = ItemBase.Cast( entity1 );
746 entity.CombineItemsClient( ItemBase.Cast( entity2 ) );
747 return false;
748 }
749
750 if (entity1 == null || entity2 == null || combinationFlags == InventoryCombinationFlags.NONE )
751 return true;
752
753 if (combinationFlags & InventoryCombinationFlags.ADD_AS_ATTACHMENT )
754 {
755 current_flag = InventoryCombinationFlags.ADD_AS_ATTACHMENT;
756 cmenu.Add( "#inv_context_add_as_attachment", this, "OnPerformCombination", new Param1<int>( current_flag ) );
757 }
758 /*if (combinationFlags & InventoryCombinationFlags.LOAD_CHAMBER )
759 {
760 current_flag = InventoryCombinationFlags.LOAD_CHAMBER;
761 cmenu.Add( "#inv_context_load_chamber", this, "OnPerformCombination", new Param1<int>( current_flag ) );
762 }*/
763 if(combinationFlags & InventoryCombinationFlags.ATTACH_MAGAZINE)
764 {
765 current_flag = InventoryCombinationFlags.ATTACH_MAGAZINE;
766 cmenu.Add("#inv_context_attach_magazine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
767 }
768
769 if (combinationFlags & InventoryCombinationFlags.ADD_AS_CARGO )
770 {
771 current_flag = InventoryCombinationFlags.ADD_AS_CARGO;
772 cmenu.Add( "#inv_context_add_as_cargo", this, "OnPerformCombination", new Param1<int>( current_flag ) );
773 }
774
775 if (combinationFlags & InventoryCombinationFlags.SWAP )
776 {
777 current_flag = InventoryCombinationFlags.SWAP;
778 cmenu.Add( "#inv_context_swap", this, "OnPerformCombination", new Param1<int>( current_flag ) );
779 }
780
781 if (combinationFlags & InventoryCombinationFlags.COMBINE_QUANTITY2 )
782 {
783 current_flag = InventoryCombinationFlags.COMBINE_QUANTITY2;
784 cmenu.Add( "#inv_context_combine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
785 }
786
787 if(combinationFlags & InventoryCombinationFlags.SET_ACTION)
788 {
789 current_flag = InventoryCombinationFlags.SET_ACTION;
790 cmenu.Add("#inv_context_attach_magazine", this, "OnPerformCombination", new Param1<int>( current_flag ) );
791 }
792
793 if(combinationFlags & InventoryCombinationFlags.PERFORM_ACTION)
794 {
795 current_flag = InventoryCombinationFlags.PERFORM_ACTION;
796 cmenu.Add("Perform Action2", this, "OnPerformCombination", new Param1<int>( current_flag ) );
797 }
798
799 int m_am_Pos_x, m_am_Pos_y;
800 GetMousePos( m_am_Pos_x, m_am_Pos_y );
801 m_am_Pos_x -= 5;
802 m_am_Pos_y -= 5;
803
804 MissionGameplay mission = MissionGameplay.Cast( g_Game.GetMission() );
805 /*if (combinationFlags & InventoryCombinationFlags.RECIPE_HANDS || combinationFlags & InventoryCombinationFlags.RECIPE_ANYWHERE )
806 {
807 OnPerformRecipe( id );
808 return true;
809 }
810 else /*if (cmenu.Count() == 1 )*/
811 //{
812 OnPerformCombination( current_flag );
813 return true;
814 //}
815 /*else
816 {
817 cmenu.Show( m_am_Pos_x, m_am_Pos_y );
818 return true;
819 }*/
820 }
DayZGame g_Game
Определения DayZGame.c:4074
Mission mission
Определения DisplayStatus.c:28
class GP5GasMask extends MaskBase ItemBase
void OnPerformCombination(int combinationFlags)
Определения Icon.c:450
proto void GetMousePos(out int x, out int y)

Перекрестные ссылки InventoryCombinationFlags::ADD_AS_ATTACHMENT, InventoryCombinationFlags::ADD_AS_CARGO, InventoryCombinationFlags::ATTACH_MAGAZINE, InventoryCombinationFlags::COMBINE_QUANTITY2, g_Game, GetMousePos(), mission, InventoryCombinationFlags::NONE, OnPerformCombination(), InventoryCombinationFlags::PERFORM_ACTION, InventoryCombinationFlags::SET_ACTION и InventoryCombinationFlags::SWAP.

Используется в CombineItems().