492 {
493 if( w == null )
494 {
495 return false;
496 }
497
499
500 if( !item )
501 {
502 return false;
503 }
504
505 int color;
506 int idx = 0;
507 int c_x, c_y;
508
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 {
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 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
EntityAI GetItemPreviewItem(Widget w)
proto native int GetWidth()
proto native int GetHeight()