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

◆ DropReceived() [1/2]

void ClosableContainer::DropReceived ( Widget w,
int x,
int y )
inlineprotected

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

334 {
335 float xx, yy;
336 GetMainWidget().Update();
337 GetMainWidget().GetScreenSize( xx, yy );
338 if( GetMainWidget().FindAnyWidget("Background") )
339 {
340 GetMainWidget().FindAnyWidget("Background").Show( true );
341 GetMainWidget().FindAnyWidget("Background").SetSize( xx, yy );
342 }
343 EntityAI item = GetItemPreviewItem( w );
344 if( !item )
345 {
346 return;
347 }
348
349 #ifdef PLATFORM_CONSOLE
350 if( m_CargoGrid.HasItem( item ) )
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
363 CargoBase cargo = m_Entity.GetInventory().GetCargoFromIndex(m_CargoIndex);
364
365 if( cargo )
366 {
367 c_x = cargo.GetHeight();
368 c_y = cargo.GetWidth();
369 }
370
371 InventoryLocation dst = new InventoryLocation;
372 #ifdef PLATFORM_CONSOLE
373 x = 0;
374 y = cargo.GetItemCount();
375 m_Entity.GetInventory().FindFreeLocationFor( item, FindInventoryLocationType.CARGO, dst );
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
383 if(src.CompareLocationOnly(dst) && src.GetFlip() == dst.GetFlip())
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 {
392 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
393
394 SplitItemUtils.TakeOrSplitToInventoryLocation( player, dst );
395
396 Icon icon = m_CargoGrid.GetIcon( item );
397
398 if( icon && w && w.FindAnyWidget("Cursor") )
399 {
400 w.FindAnyWidget("Cursor").SetColor( ColorManager.BASE_COLOR );
401 icon.Refresh();
402 Refresh();
403 }
404 }
405
406 ItemManager.GetInstance().HideDropzones();
407 ItemManager.GetInstance().SetIsDragging( false );
408 }
class LogManager EntityAI
EntityAI m_Entity
Определения ActionDebug.c:11
Icon x
Icon y
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
PlayerBase GetPlayer()
Определения ModifierBase.c:51
void Refresh()
Определения SizeToChild.c:108
proto native int GetItemCount()
proto native int GetWidth()
proto native int GetHeight()
int m_CargoIndex
Определения ContainerWithCargo.c:4
ref CargoContainer m_CargoGrid
Определения ContainerWithCargo.c:3
EntityAI GetItemPreviewItem(Widget w)
Определения ContainerWithCargo.c:224
override void Refresh()
Определения Icon.c:1216
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()
proto native Widget FindAnyWidget(string pathname)

Перекрестные ссылки ColorManager::BASE_COLOR, InventoryLocation::CompareLocationOnly(), FindAnyWidget(), InventoryLocation::GetFlip(), GetGame(), CargoBase::GetHeight(), ItemManager::GetInstance(), CargoBase::GetItemCount(), GetItemPreviewItem(), GetPlayer(), CargoBase::GetWidth(), ItemManager::HideDropzones(), InventoryLocation::IsValid(), m_CargoGrid, m_CargoIndex, m_Entity, Icon::Refresh(), Refresh(), InventoryLocation::SetCargoAuto(), ItemManager::SetIsDragging(), SplitItemUtils::TakeOrSplitToInventoryLocation(), x и y.