334 {
335 float xx, yy;
336 GetMainWidget().Update();
337 GetMainWidget().GetScreenSize( xx, yy );
339 {
340 GetMainWidget().FindAnyWidget("Background").Show( true );
341 GetMainWidget().FindAnyWidget("Background").SetSize( xx, yy );
342 }
344 if( !item )
345 {
346 return;
347 }
348
349 #ifdef PLATFORM_CONSOLE
351 {
352 return;
353 }
354 #endif
355
356 #ifdef PLATFORM_CONSOLE
357 int idx = -1;
358 #else
359 int idx = 0;
360 #endif
361 int c_x, c_y;
362
364
365 if( cargo )
366 {
369 }
370
371 InventoryLocation dst = new InventoryLocation;
372 #ifdef PLATFORM_CONSOLE
376 #else
377 dst.
SetCargoAuto(cargo, item,
x,
y, item.GetInventory().GetFlipCargo());
378 #endif
379
380 InventoryLocation src = new InventoryLocation;
381 item.GetInventory().GetCurrentInventoryLocation(src);
382
384 return;
385
386 #ifdef PLATFORM_CONSOLE
387 if(dst.
IsValid() &&
m_Entity.GetInventory().LocationCanAddEntityEx(dst))
388 #else
389 if( c_x >
x && c_y >
y &&
m_Entity.GetInventory().LocationCanAddEntityEx(dst))
390 #endif
391 {
393
394 SplitItemUtils.TakeOrSplitToInventoryLocation( player, dst );
395
397
398 if( icon && w && w.FindAnyWidget("Cursor") )
399 {
400 w.FindAnyWidget("Cursor").SetColor( ColorManager.BASE_COLOR );
403 }
404 }
405
406 ItemManager.GetInstance().HideDropzones();
407 ItemManager.GetInstance().SetIsDragging( false );
408 }
FindInventoryLocationType
flags for searching locations in inventory
proto native int GetItemCount()
proto native int GetWidth()
proto native int GetHeight()
ref CargoContainer m_CargoGrid
EntityAI GetItemPreviewItem(Widget w)
proto native bool IsValid()
verify current set inventory location
proto native void SetCargoAuto(notnull CargoBase cargo, EntityAI e, int row, int col, bool flip)
based on Cargo.IsProxyCargo uses SetProxyCargo or SetCargo respectively
proto native bool CompareLocationOnly(notnull InventoryLocation other)
proto native bool GetFlip()
returns flip status of cargo
proto native CGame GetGame()