761 {
762 if( w == NULL )
763 {
764 return false;
765 }
766
768
769 if( !item )
770 {
771 return false;
772 }
773
774 int color;
775 int idx = 0;
776 int c_x, c_y;
777
779 CargoBase target_cargo;
780
782 {
784 target_cargo =
m_Entity.GetInventory().GetCargo();
785 }
786 else
787 {
789 if( target_entity )
790 {
791 target_cargo = target_entity.GetInventory().GetCargo();
792 }
793 else
794 return false;
795 }
796
797 if( target_cargo && target_entity )
798 {
801 }
802 else
803 return false;
804
805 if( c_x >
x && c_y >
y && target_entity.GetInventory().CanAddEntityInCargoEx( item, idx,
x,
y, item.GetInventory().GetFlipCargo() ) )
806 {
807 color = ColorManager.GREEN_COLOR;
809 {
810 ItemManager.GetInstance().GetRightDropzone().SetAlpha( 1 );
811 }
812 else
813 {
814 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
815 }
816 }
817 else
818 {
819 color = ColorManager.RED_COLOR;
820 }
821
822 if( w.FindAnyWidget("Cursor") )
823 {
824 w.FindAnyWidget("Cursor").SetColor( color );
825 }
826 else
827 {
828 string name = w.GetName();
829 name.Replace(
"PanelWidget",
"Cursor" );
830 if( w.FindAnyWidget(
name ) )
831 {
832 w.FindAnyWidget(
name ).SetColor( color );
833 }
834 }
835
836 return true;
837 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native int GetWidth()
proto native int GetHeight()
ref map< EntityAI, ref CargoContainer > m_AttachmentCargos
ref CargoContainer m_CargoGrid
EntityAI GetItemPreviewItem(Widget w)
proto native CGame GetGame()