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

Закрытые статические члены

static void TakeOrSplitToInventory (notnull PlayerBase player, notnull EntityAI target, notnull EntityAI item)
 
static void TakeOrSplitToInventoryLocation (notnull PlayerBase player, notnull InventoryLocation dst)
 

Подробное описание

Методы

◆ TakeOrSplitToInventory()

static void TakeOrSplitToInventory ( notnull PlayerBase player,
notnull EntityAI target,
notnull EntityAI item )
inlinestaticprivate
4 {
6
7 if( !item.GetInventory().CanRemoveEntity() || !player.CanManipulateInventory() )
8 return;
9
11 if( target.GetInventory().FindFreeLocationFor( item, FindInventoryLocationType.ANY, il) )
12 {
13 if( item_base.GetTargetQuantityMax(il.GetSlot()) >= item_base.GetQuantity() )
14 {
15 if( il.GetType() == InventoryLocationType.ATTACHMENT )
16 {
17 player.PredictiveTakeEntityToTargetAttachmentEx(il.GetParent(), item, il.GetSlot());
18 }
19 else
20 {
22 if (item.GetInventory().GetCurrentInventoryLocation(src))
23 player.PredictiveTakeToDst(src, il);
24
25 }
26 }
27 else
28 {
29 item_base.SplitIntoStackMaxClient( il.GetParent(), il.GetSlot() );
30 }
31 }
32 }
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
InventoryLocationType
types of Inventory Location
Definition InventoryLocation.c:4
InventoryLocation.
Definition InventoryLocation.c:29
Definition InventoryItem.c:731
Definition EntityAI.c:95

Используется в AttachmentCategoriesRow::Combine(), PlayerContainer::OnDropReceivedFromGhostArea(), ClosableContainer::OnDropReceivedFromHeader(), Icon::OnPerformCombination(), HandsContainer::OnPerformCombination(), OnRightPanelDropReceived(), Icon::PerformCombination(), AttachmentCategoriesRow::Select(), HandsContainer::TakeAsAttachment() и ClosableContainer::TakeAsAttachment().

◆ TakeOrSplitToInventoryLocation()

static void TakeOrSplitToInventoryLocation ( notnull PlayerBase player,
notnull InventoryLocation dst )
inlinestaticprivate
35 {
36 ItemBase item_base = ItemBase.Cast( dst.GetItem() );
37 int slot = dst.GetSlot();
38
39 if( !dst.GetItem().GetInventory().CanRemoveEntity() || !player.CanManipulateInventory() )
40 return;
41
42 float stack_max = item_base.GetTargetQuantityMax(slot);
43
44 if( stack_max >= item_base.GetQuantity() )
45 {
47 if (dst.GetItem().GetInventory().GetCurrentInventoryLocation(src))
48 {
49 player.PredictiveTakeToDst(src, dst);
50 }
51 else
52 Error("TakeIntoCargoEx cannot get src for dst=" + dst.DumpToString());
53 }
54 else
55 {
56 item_base.SplitIntoStackMaxToInventoryLocationClient( dst );
57 }
58 }
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки Error().

Используется в Icon::DoubleClick(), VicinitySlotsContainer::DoubleClick(), ClosableContainer::DropReceived(), HandsContainer::DropReceived(), AttachmentCategoriesRow::DropReceived(), ClosableContainer::DropReceived(), Icon::DropReceivedFromMain(), OnCenterPanelDropReceived() и VicinitySlotsContainer::TransferItem().


Объявления и описания членов класса находятся в файле: