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

◆ FlagAction()

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

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

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

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

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