Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ReplaceItemWithNewLambda

adds automatic QuickBar handling Подробнее...

+ Граф наследования:ReplaceItemWithNewLambda:

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

void TurnItemIntoItemLambda (EntityAI old_item, string new_item_type, PlayerBase player)
 
void SetTransferParams (bool transfer_agents=true, bool transfer_variables=true, bool transfer_health=true, bool exclude_quantity=false, float quantity_override=-1)
 
override void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
 
override void VerifyItemTypeBySlotType ()
 if attaching from att.slot to att.slot, skips the change to "ground" version. Allows for correct property transfers.
 
override void OnSuccess (EntityAI new_item)
 
void ReplaceItemWithNewLambda (EntityAI old_item, string new_item_type, PlayerBase player)
 
override void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
 
override void OnSuccess (EntityAI new_item)
 
- Закрытые члены унаследованные от ReplaceItemWithNewLambdaBase
bool WantCreateNewEntity ()
 
bool CanExecuteLambda ()
 
bool PrepareLocations ()
 Step A. - prepare inventory locations.
 
void RemoveOldItemFromLocation ()
 Step B. - free location for new item @NOTE this operation does not delete the object, only removes it from inventory location.
 
void UndoRemoveOldItemFromLocation ()
 
void RemoveNetworkObjectInfo ()
 Step C. - remove network part of the object @NOTE this operation does not delete the object, only removes its network part (and deletes it on client)
 
void UndoRemoveNetworkObjectInfo ()
 
EntityAI CreateNewEntity ()
 Step D. - create new entity (LOCAL) with specified type.
 
void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
 Step E. copy properties from old object to the created one.
 
void DeleteOldEntity ()
 Step F. - deletes physically old item.
 
void CreateNetworkObjectInfo (EntityAI new_item)
 Step G. - create NetworkObjectInfo for new item.
 
void OnSuccess (EntityAI new_item)
 Step H. - notification on finish.
 
void OnAbort ()
 Step Out - notification on abort.
 
void Execute (HumanInventoryWithFSM fsm_to_notify=null)
 
string DumpToString ()
 

Закрытые данные

bool m_TransferAgents
 
bool m_TransferVariables
 
bool m_TransferHealth
 
bool m_ExcludeQuantity
 
float m_quantity_override
 
PlayerBase m_Player
 
int m_IndexQB
 
- Закрытые данные унаследованные от ReplaceItemWithNewLambdaBase
ref InventoryLocation m_OldLocation
 
ref InventoryLocation m_NewLocation
 
bool m_RemoveFromLocationPassed = false
 

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

adds automatic QuickBar handling

Конструктор(ы)

◆ ReplaceItemWithNewLambda()

void ReplaceItemWithNewLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player )
inlineprivate
10 {
12 m_IndexQB = -1;
13
14 if (m_Player)
15 m_IndexQB = m_Player.FindQuickBarEntityIndex(old_item);
16 }
Definition EntityAI.c:95
int m_IndexQB
Definition ReplaceItemWithNewLambda.c:7
PlayerBase m_Player
Definition ReplaceItemWithNewLambda.c:6

Перекрестные ссылки m_IndexQB и m_Player.

Методы

◆ CopyOldPropertiesToNew() [1/2]

override void CopyOldPropertiesToNew ( notnull EntityAI old_item,
EntityAI new_item )
inlineprivate
24 {
25 super.CopyOldPropertiesToNew(old_item, new_item);
26
27 if (new_item)
28 {
31
32 //quantity override
33 if (ItemBase.Cast(new_item) && m_quantity_override != -1)
34 {
36 ItemBase.Cast(new_item).SetQuantity(m_quantity_override);
37 }
38 }
39 else
40 {
41 Debug.LogError("TurnItemIntoItemLambda: failed to create new item","static");
42 }
43 }
Definition Debug.c:14
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:378
Definition InventoryItem.c:731
Definition EnMath.c:7
bool m_ExcludeQuantity
Definition MiscGameplayFunctions.c:6
bool m_TransferHealth
Definition MiscGameplayFunctions.c:5
bool m_TransferAgents
Definition MiscGameplayFunctions.c:3
bool m_TransferVariables
Definition MiscGameplayFunctions.c:4
float m_quantity_override
Definition MiscGameplayFunctions.c:7
static proto float Max(float x, float y)
Returns bigger of two given values.

Перекрестные ссылки Debug::LogError(), m_Player и Math::Max().

◆ CopyOldPropertiesToNew() [2/2]

override void CopyOldPropertiesToNew ( notnull EntityAI old_item,
EntityAI new_item )
inlineprivate
24 {
25 super.CopyOldPropertiesToNew(old_item, new_item);
26
27 if (m_Player && m_IndexQB != -1)
28 {
29 m_Player.SetQuickBarEntityShortcut(new_item, m_IndexQB, true);
30 }
31 }

Перекрестные ссылки m_IndexQB и m_Player.

◆ OnSuccess() [1/2]

override void OnSuccess ( EntityAI new_item)
inlineprivate
82 {
83 super.OnSuccess(new_item);
84 if( m_Player )
85 {
86 m_Player.GetItemAccessor().OnItemInHandsChanged();
87 }
88 }

Перекрестные ссылки m_Player.

◆ OnSuccess() [2/2]

override void OnSuccess ( EntityAI new_item)
inlineprivate
34 {
35 super.OnSuccess(new_item);
36
37 if (m_Player && m_IndexQB != -1)
38 {
39 m_Player.SetQuickBarEntityShortcut(new_item, m_IndexQB, true);
40 }
41 }

Перекрестные ссылки m_IndexQB и m_Player.

◆ SetTransferParams()

void SetTransferParams ( bool transfer_agents = true,
bool transfer_variables = true,
bool transfer_health = true,
bool exclude_quantity = false,
float quantity_override = -1 )
inlineprivate

◆ TurnItemIntoItemLambda()

void TurnItemIntoItemLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player )
inlineprivate
10 {
12 }
void SetTransferParams(bool transfer_agents=true, bool transfer_variables=true, bool transfer_health=true, bool exclude_quantity=false, float quantity_override=-1)
Definition MiscGameplayFunctions.c:14

◆ VerifyItemTypeBySlotType()

override void VerifyItemTypeBySlotType ( )
inlineprivate

if attaching from att.slot to att.slot, skips the change to "ground" version. Allows for correct property transfers.

47 {
48 if (m_NewLocation.GetType() == InventoryLocationType.ATTACHMENT && m_OldItem.ConfigIsExisting("ChangeIntoOnAttach"))
49 {
50 string str;
51 int idx = -1;
55
56 m_OldItem.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
57 if (inventory_slots.Count() < 1) //is string
58 {
59 inventory_slots_idx.Insert(InventorySlots.GetSlotIdFromString(m_OldItem.ConfigGetString("ChangeInventorySlot")));
60 attach_types.Insert(m_OldItem.ConfigGetString("ChangeIntoOnAttach"));
61 }
62 else //is array
63 {
64 inventory_slots_idx.Clear();
65 for (int i = 0; i < inventory_slots.Count(); i++)
66 {
68 }
69 m_OldItem.ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
70 }
71
72 idx = m_NewLocation.GetSlot();
74 if (str != "")
75 {
77 }
78 }
79 }
InventoryLocationType
types of Inventory Location
Definition InventoryLocation.c:4
provides access to slot configuration
Definition InventorySlots.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
ref InventoryLocation m_NewLocation
Definition ReplaceItemWithNewLambdaBase.c:9
string m_NewItemType
Definition ReplaceItemWithNewLambdaBase.c:7
EntityAI m_OldItem
Definition ReplaceItemWithNewLambdaBase.c:6
array< string > TStringArray
Definition EnScript.c:685
array< int > TIntArray
Definition EnScript.c:687

Перекрестные ссылки InventorySlots::GetSlotIdFromString().

Поля

◆ m_ExcludeQuantity

bool m_ExcludeQuantity
private

◆ m_IndexQB

int m_IndexQB
private

◆ m_Player

◆ m_quantity_override

float m_quantity_override
private

◆ m_TransferAgents

bool m_TransferAgents
private

◆ m_TransferHealth

bool m_TransferHealth
private

◆ m_TransferVariables

bool m_TransferVariables
private

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