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