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