728 {
729 if ( entity1 && entity2 )
PrintString(
"Showing action menu for " + entity1.GetDisplayName() +
" and " + entity2.GetDisplayName() );
730
732 m_am_entity1 = entity1;
733 m_am_entity2 = entity2;
734 cmenu.Hide();
735 cmenu.Clear();
736
737 if( combinationFlags & InventoryCombinationFlags.COMBINE_QUANTITY2 )
738 {
740 entity.CombineItemsClient(
ItemBase.Cast( entity2 ) );
741 return;
742 }
743
744 if ( entity1 == null || entity2 == null ) return;
745
746 if ( combinationFlags == InventoryCombinationFlags.NONE ) return;
747
748 if ( combinationFlags & InventoryCombinationFlags.ADD_AS_ATTACHMENT )
749 {
750 cmenu.Add( "#inv_context_add_as_attachment", this, "OnPerformCombination", new Param1<int>( InventoryCombinationFlags.ADD_AS_ATTACHMENT ) );
751 }
752 if ( combinationFlags & InventoryCombinationFlags.LOAD_CHAMBER )
753 {
754 cmenu.Add( "#inv_context_load_chamber", this, "OnPerformCombination", new Param1<int>( InventoryCombinationFlags.LOAD_CHAMBER ) );
755 }
756
757 if ( combinationFlags & InventoryCombinationFlags.ADD_AS_CARGO )
758 {
759 cmenu.Add( "#inv_context_add_as_cargo", this, "OnPerformCombination", new Param1<int>( InventoryCombinationFlags.ADD_AS_CARGO ) );
760 }
761
762 if ( combinationFlags & InventoryCombinationFlags.SWAP )
763 {
764 cmenu.Add( "#inv_context_swap", this, "OnPerformCombination", new Param1<int>( InventoryCombinationFlags.SWAP ) );
765 }
766
767 if ( combinationFlags & InventoryCombinationFlags.TAKE_TO_HANDS )
768 {
769 cmenu.Add( "#inv_context_take_to_hands", this, "OnPerformCombination", new Param1<int>( InventoryCombinationFlags.TAKE_TO_HANDS ) );
770 }
771
772 if ( combinationFlags & InventoryCombinationFlags.COMBINE_QUANTITY2 )
773 {
774 cmenu.Add( "#inv_context_combine", this, "OnPerformCombination", new Param1<int>( InventoryCombinationFlags.COMBINE_QUANTITY2 ) );
775 }
776
777 int m_am_pos_x, m_am_pos_y;
779 m_am_pos_x -= 5;
780 m_am_pos_y -= 5;
781
782 cmenu.Show( m_am_pos_x, m_am_pos_y );
783 }
class GP5GasMask extends MaskBase ItemBase
proto native CGame GetGame()
class array< Class T > PrintString
proto void GetMousePos(out int x, out int y)