738 {
739 int current_flag;
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 {
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
763
764
765
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;
805 m_am_Pos_x -= 5;
806 m_am_Pos_y -= 5;
807
808 MissionGameplay
mission = MissionGameplay.Cast(
GetGame().GetMission() );
809
810
811
812
813
814
815
817 return true;
818
819
820
821
822
823
824 }
class GP5GasMask extends MaskBase ItemBase
void OnPerformCombination(int combinationFlags)
proto native CGame GetGame()
proto void GetMousePos(out int x, out int y)