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

◆ DraggingOverGrid()

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

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

492 {
493 if( w == null )
494 {
495 return false;
496 }
497
498 EntityAI item = GetItemPreviewItem( w );
499
500 if( !item )
501 {
502 return false;
503 }
504
505 int color;
506 int idx = 0;
507 int c_x, c_y;
508
509 EntityAI target_entity;
510 CargoBase target_cargo;
511
512 target_entity = cargo.GetEntity() ;
513 if( target_entity )
514 {
515 target_cargo = target_entity.GetInventory().GetCargo();
516 }
517 else
518 return false;
519
520 if( target_cargo && target_entity )
521 {
522 c_x = target_cargo.GetHeight();
523 c_y = target_cargo.GetWidth();
524 }
525 else
526 return false;
527
528 if( c_x > x && c_y > y && target_entity.GetInventory().CanAddEntityInCargoEx( item, idx, x, y, item.GetInventory().GetFlipCargo() ) )
529 {
530 color = ColorManager.GREEN_COLOR;
531 }
532 else
533 {
534 color = ColorManager.RED_COLOR;
535 }
536
537 if( w.FindAnyWidget("Cursor") )
538 {
539 w.FindAnyWidget("Cursor").SetColor( color );
540 }
541 else
542 {
543 string name = w.GetName();
544 name.Replace( "PanelWidget", "Cursor" );
545 if( w.FindAnyWidget( name ) )
546 {
547 w.FindAnyWidget( name ).SetColor( color );
548 }
549 }
550
551 return true;
552 }
class LogManager EntityAI
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Icon x
Icon y
EntityAI GetItemPreviewItem(Widget w)
Определения AttachmentCategoriesRow.c:605
proto native int GetWidth()
proto native int GetHeight()

Перекрестные ссылки CargoBase::GetHeight(), GetItemPreviewItem(), CargoBase::GetWidth(), ColorManager::GREEN_COLOR, name, ColorManager::RED_COLOR, x и y.