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 {
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
759
760
761
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;
801 m_am_Pos_x -= 5;
802 m_am_Pos_y -= 5;
803
804 MissionGameplay
mission = MissionGameplay.Cast(
g_Game.GetMission() );
805
806
807
808
809
810
811
813 return true;
814
815
816
817
818
819
820 }
class GP5GasMask extends MaskBase ItemBase
void OnPerformCombination(int combinationFlags)
proto void GetMousePos(out int x, out int y)