DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ DraggingOverGrid() [2/2]

bool ClosableContainer::DraggingOverGrid ( Widget w,
int x,
int y,
Widget reciever,
CargoContainer cargo )
inlineprotected

См. определение в файле ContainerWithCargoAndAttachments.c строка 760

761 {
762 if( w == NULL )
763 {
764 return false;
765 }
766
767 EntityAI item = GetItemPreviewItem( w );
768
769 if( !item )
770 {
771 return false;
772 }
773
774 int color;
775 int idx = 0;
776 int c_x, c_y;
777
778 EntityAI target_entity;
779 CargoBase target_cargo;
780
781 if( cargo == m_CargoGrid )
782 {
783 target_entity = m_Entity;
784 target_cargo = m_Entity.GetInventory().GetCargo();
785 }
786 else
787 {
788 target_entity = m_AttachmentCargos.GetKeyByValue( cargo );
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 {
799 c_x = target_cargo.GetHeight();
800 c_y = target_cargo.GetWidth();
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;
808 if( target_entity.GetHierarchyRootPlayer() == GetGame().GetPlayer() )
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 }
class LogManager EntityAI
EntityAI m_Entity
Определения ActionDebug.c:11
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Icon x
Icon y
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native int GetWidth()
proto native int GetHeight()
ref map< EntityAI, ref CargoContainer > m_AttachmentCargos
ref CargoContainer m_CargoGrid
Определения ContainerWithCargo.c:3
EntityAI GetItemPreviewItem(Widget w)
Определения ContainerWithCargo.c:224
proto native CGame GetGame()

Перекрестные ссылки GetGame(), CargoBase::GetHeight(), ItemManager::GetInstance(), GetItemPreviewItem(), ItemManager::GetLeftDropzone(), GetPlayer(), ItemManager::GetRightDropzone(), CargoBase::GetWidth(), ColorManager::GREEN_COLOR, m_AttachmentCargos, m_CargoGrid, m_Entity, name, ColorManager::RED_COLOR, x и y.