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

Защищенные члены

void ConstructionActionData ()
 
string GetMainPartName ()
 
string GetMainPartNameNoTool ()
 
void SetTarget (Object target)
 
Object GetTarget ()
 
void SetTargetPart (ConstructionPart target_part)
 
ConstructionPart GetTargetPart ()
 
void SetSlotId (int slot_id)
 
int GetSlotId ()
 
void SetActionInitiator (PlayerBase action_initiator)
 
PlayerBase GetActionInitiator ()
 
void SetNextIndex ()
 
void RefreshPartsToBuild (string main_part_name, ItemBase tool, bool use_tool=true)
 
void OnUpdateActions (Object item, Object target, int component_index)
 
void OnUpdateActionsNoTool (Object item, Object target, int component_index)
 
int GetConstructionPartsCount ()
 
ConstructionPart GetCurrentBuildPart ()
 
ConstructionPart GetBuildPartAtIndex (int idx)
 
ConstructionPart GetBuildPartNoToolAtIndex (int idx)
 
CombinationLock GetCombinationLock ()
 
void SetCombinationLock (CombinationLock combination_lock)
 
string GetDialNumberText ()
 
int GetAttachmentSlotFromSelection (PlayerBase player, EntityAI target, ItemBase item_to_attach, string selection)
 
void GetAttachmentsFromSelection (EntityAI target, string selection, out array< EntityAI > attachments)
 
void CombineItems (ItemBase target, ItemBase item)
 
void RefreshAttachmentsToDetach (EntityAI target, string main_part_name)
 
void SetNextAttachmentIndex ()
 
int GetAttachmentsToDetachCount ()
 
EntityAI GetActualAttachmentToDetach ()
 
void ResetActionIndexes ()
 

Защищенные данные

ActionVariantManager m_ActionVariantManager
 
ActionVariantManager m_ActionNoToolVariantManager
 
int m_AttachmentsIndex
 

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

Object m_Target
 
ref array< ConstructionPartm_BuildParts
 
ref array< ConstructionPartm_BuildPartsNoTool
 
int m_PartIndex
 
string m_MainPartName
 
string m_MainPartNameNoTool
 
ref ConstructionPart m_TargetPart
 
CombinationLock m_CombinationLock
 
int m_SlotId
 
PlayerBase m_ActionInitiator
 
ref array< EntityAIm_Attachments
 

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

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

◆ ConstructionActionData()

void ConstructionActionData ( )
inlineprotected
29 {
32 m_PartIndex = 0;
33
36
37 if ( GetGame().IsClient() || !GetGame().IsMultiplayer() )
38 {
42
46 }
47 }
Definition ActionBuildPart.c:26
Definition ActionBuildShelter.c:2
Definition ActionManagerClient.c:5
static ActionVariantManager GetVariantManager(typename actionName)
Definition ActionManagerClient.c:253
ScriptInvoker GetOnUpdateInvoker()
Definition ActionVariantsManager.c:14
ActionVariantManager m_ActionVariantManager
Definition ConstructionActionData.c:23
ref array< ConstructionPart > m_BuildPartsNoTool
Definition ConstructionActionData.c:7
ref array< EntityAI > m_Attachments
Definition ConstructionActionData.c:21
int m_PartIndex
Definition ConstructionActionData.c:9
ref array< ConstructionPart > m_BuildParts
Definition ConstructionActionData.c:6
void OnUpdateActionsNoTool(Object item, Object target, int component_index)
Definition ConstructionActionData.c:141
ActionVariantManager m_ActionNoToolVariantManager
Definition ConstructionActionData.c:24
int m_AttachmentsIndex
Definition ConstructionActionData.c:26
void OnUpdateActions(Object item, Object target, int component_index)
Definition ConstructionActionData.c:113
Definition EntityAI.c:95
proto native void Clear()
remove all calls from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
proto native CGame GetGame()

Перекрестные ссылки ScriptInvoker::Clear(), GetGame(), ActionVariantManager::GetOnUpdateInvoker(), ActionManagerClient::GetVariantManager(), ScriptInvoker::Insert(), m_ActionNoToolVariantManager, m_ActionVariantManager, m_Attachments, m_AttachmentsIndex, m_BuildParts, m_BuildPartsNoTool, m_PartIndex, OnUpdateActions() и OnUpdateActionsNoTool().

Методы

◆ CombineItems()

void CombineItems ( ItemBase target,
ItemBase item )
inlineprotected
323 {
324 if ( target.ConfigGetBool( "canBeSplit" ) && item && !target.IsFullQuantity() )
325 {
326 int quantity_used = target.ComputeQuantityUsed( item, true );
327 if( quantity_used != 0 )
328 {
329 target.AddQuantity( quantity_used );
330 item.AddQuantity( -quantity_used );
331 }
332 }
333 }

◆ GetActionInitiator()

PlayerBase GetActionInitiator ( )
inlineprotected
98 {
99 return m_ActionInitiator;
100 }
PlayerBase m_ActionInitiator
Definition ConstructionActionData.c:19

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

◆ GetActualAttachmentToDetach()

EntityAI GetActualAttachmentToDetach ( )
inlineprotected
365 {
366 if ( GetAttachmentsToDetachCount() > 0 )
367 {
369
371 {
372 return m_Attachments.Get( m_AttachmentsIndex );
373 }
374 }
375
376 return NULL;
377 }
int GetAttachmentsToDetachCount()
Definition ConstructionActionData.c:359
Definition EnMath.c:7
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), GetAttachmentsToDetachCount(), m_Attachments и m_AttachmentsIndex.

◆ GetAttachmentsFromSelection()

void GetAttachmentsFromSelection ( EntityAI target,
string selection,
out array< EntityAI > attachments )
inlineprotected
285 {
286 attachments.Clear(); //clear output
287
288 string cfg_path = "cfgVehicles" + " " + target.GetType() + " "+ "GUIInventoryAttachmentsProps";
289 if ( GetGame().ConfigIsExisting( cfg_path ) )
290 {
291 int child_count = GetGame().ConfigGetChildrenCount( cfg_path );
292
293 for ( int i = 0; i < child_count; i++ )
294 {
295 string child_name;
296 GetGame().ConfigGetChildName( cfg_path, i, child_name );
297
298 string child_selection;
299 GetGame().ConfigGetText( cfg_path + " " + child_name + " " + "selection", child_selection );
300
301 if ( selection == child_selection )
302 {
304 GetGame().ConfigGetTextArray( cfg_path + " " + child_name + " " + "attachmentSlots", attachment_slots );
305
306 for ( int j = 0; j < attachment_slots.Count(); ++j )
307 {
309
310 //is attached and can be detached
311 EntityAI attachment = target.GetInventory().FindAttachment( target_slot_id );
312 if ( attachment && target.GetInventory().CanRemoveAttachmentEx( attachment, target_slot_id ) && !target.GetInventory().GetSlotLock( target_slot_id ) )
313 {
314 attachments.Insert( attachment );
315 }
316 }
317 }
318 }
319 }
320 }
Definition Building.c:6
provides access to slot configuration
Definition InventorySlots.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

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

Используется в RefreshAttachmentsToDetach().

◆ GetAttachmentSlotFromSelection()

int GetAttachmentSlotFromSelection ( PlayerBase player,
EntityAI target,
ItemBase item_to_attach,
string selection )
inlineprotected
235 {
236 string cfg_path = "cfgVehicles" + " " + target.GetType() + " "+ "GUIInventoryAttachmentsProps";
237
238 if ( GetGame().ConfigIsExisting( cfg_path ) )
239 {
240 int child_count = GetGame().ConfigGetChildrenCount( cfg_path );
241
242 for ( int i = 0; i < child_count; i++ )
243 {
244 string child_name;
245 GetGame().ConfigGetChildName( cfg_path, i, child_name );
246
247 string child_selection;
248 GetGame().ConfigGetText( cfg_path + " " + child_name + " " + "selection", child_selection );
249
250 if ( selection == child_selection )
251 {
253 GetGame().ConfigGetTextArray( cfg_path + " " + child_name + " " + "attachmentSlots", attachment_slots );
254
255 for ( int j = 0; j < attachment_slots.Count(); ++j )
256 {
258 int item_slot_count = item_to_attach.GetInventory().GetSlotIdCount();
259
260 for ( int k = 0; k < item_slot_count; ++k )
261 {
262 int item_slot_id = item_to_attach.GetInventory().GetSlotId( k );
263 ItemBase attachment_item = ItemBase.Cast( target.GetInventory().FindAttachment( item_slot_id ) );
264
266 {
267 if ( target.GetInventory().CanAddAttachmentEx( item_to_attach, item_slot_id ) && target.CanReceiveAttachment( item_to_attach, item_slot_id ) || attachment_item && attachment_item.CanBeCombined( item_to_attach ) )
268 {
269 if(target.CanDisplayAttachmentSlot(target_slot_id))
270 return item_slot_id;
271 else
272 return -1;
273 }
274 }
275 }
276 }
277 }
278 }
279 }
280
281 return -1;
282 }
Definition InventoryItem.c:731

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

◆ GetAttachmentsToDetachCount()

int GetAttachmentsToDetachCount ( )
inlineprotected
360 {
361 return m_Attachments.Count();
362 }

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

Используется в GetActualAttachmentToDetach() и SetNextAttachmentIndex().

◆ GetBuildPartAtIndex()

ConstructionPart GetBuildPartAtIndex ( int idx)
inlineprotected
169 {
170 if( m_BuildParts.Count() > idx )
171 {
172 return m_BuildParts.Get( idx );
173 }
174 return null;
175 }

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

◆ GetBuildPartNoToolAtIndex()

ConstructionPart GetBuildPartNoToolAtIndex ( int idx)
inlineprotected
178 {
179 if( m_BuildPartsNoTool.Count() > idx )
180 {
181 return m_BuildPartsNoTool.Get( idx );
182 }
183 return null;
184 }

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

◆ GetCombinationLock()

CombinationLock GetCombinationLock ( )
inlineprotected
190 {
191 return m_CombinationLock;
192 }
CombinationLock m_CombinationLock
Definition ConstructionActionData.c:15

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

◆ GetConstructionPartsCount()

int GetConstructionPartsCount ( )
inlineprotected
158 {
159 return m_BuildParts.Count();
160 }

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

◆ GetCurrentBuildPart()

ConstructionPart GetCurrentBuildPart ( )
inlineprotected
164 {
165 return null;
166 }

◆ GetDialNumberText()

string GetDialNumberText ( )
inlineprotected
200 {
201 string dial_text;
202
203 if ( m_CombinationLock )
204 {
205 string combination_text = m_CombinationLock.GetCombination().ToString();
206
207 //insert zeros to dials with 0 value
208 int length_diff = m_CombinationLock.GetLockDigits() - combination_text.Length();
209 for ( int i = 0; i < length_diff; ++i )
210 {
212 }
213
214 //assemble the whole combination with selected part
215 for ( int j = 0; j < m_CombinationLock.GetLockDigits(); ++j )
216 {
217 if ( j == m_CombinationLock.GetDialIndex() )
218 {
219 dial_text += string.Format( "[%1]", combination_text.Get( j ) );
220 }
221 else
222 {
223 dial_text += string.Format( " %1 ", combination_text.Get( j ) );
224 }
225 }
226 }
227
228 return dial_text;
229 }

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

◆ GetMainPartName()

string GetMainPartName ( )
inlineprotected
53 {
54 return m_MainPartName;
55 }
string m_MainPartName
Definition ConstructionActionData.c:10

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

◆ GetMainPartNameNoTool()

string GetMainPartNameNoTool ( )
inlineprotected
58 {
60 }
string m_MainPartNameNoTool
Definition ConstructionActionData.c:11

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

◆ GetSlotId()

int GetSlotId ( )
inlineprotected
88 {
89 return m_SlotId;
90 }
int m_SlotId
Definition ConstructionActionData.c:18

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

◆ GetTarget()

Object GetTarget ( )
inlineprotected
68 {
69 return m_Target;
70 }
Object m_Target
Definition ConstructionActionData.c:3

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

◆ GetTargetPart()

ConstructionPart GetTargetPart ( )
inlineprotected
78 {
79 return m_TargetPart;
80 }
ref ConstructionPart m_TargetPart
Definition ConstructionActionData.c:12

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

◆ OnUpdateActions()

void OnUpdateActions ( Object item,
Object target,
int component_index )
inlineprotected
114 {
115 ItemBase tool = ItemBase.Cast( item );
116 if ( tool )
117 {
120 {
121 string main_part_name = target.GetActionComponentName( component_index );
122 base_building_object.GetConstruction().GetConstructionPartsToBuild( main_part_name, m_BuildParts, tool, m_MainPartName, true );
124 }
125 else
126 {
127 m_BuildParts.Clear();
129 }
130
131 }
132 else
133 {
134 m_BuildParts.Clear();
136 }
137 //not needed
138 //m_Target = target;
139 }
void SetActionVariantCount(int count)
Definition ActionVariantsManager.c:24
void Clear()
Definition ActionVariantsManager.c:19
Definition Fence.c:2

Перекрестные ссылки ActionVariantManager::Clear(), m_ActionVariantManager, m_BuildParts, m_MainPartName и ActionVariantManager::SetActionVariantCount().

Используется в ConstructionActionData().

◆ OnUpdateActionsNoTool()

void OnUpdateActionsNoTool ( Object item,
Object target,
int component_index )
inlineprotected

◆ RefreshAttachmentsToDetach()

void RefreshAttachmentsToDetach ( EntityAI target,
string main_part_name )
inlineprotected
336 {
338 }
void GetAttachmentsFromSelection(EntityAI target, string selection, out array< EntityAI > attachments)
Definition ConstructionActionData.c:284

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

◆ RefreshPartsToBuild()

void RefreshPartsToBuild ( string main_part_name,
ItemBase tool,
bool use_tool = true )
inlineprotected
109 {
110
111 }

◆ ResetActionIndexes()

void ResetActionIndexes ( )
inlineprotected
383 {
384 m_PartIndex = 0;
386 }

Перекрестные ссылки m_AttachmentsIndex и m_PartIndex.

◆ SetActionInitiator()

void SetActionInitiator ( PlayerBase action_initiator)
inlineprotected

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

◆ SetCombinationLock()

void SetCombinationLock ( CombinationLock combination_lock)
inlineprotected
195 {
197 }
Definition CombinationLock4.c:2

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

◆ SetNextAttachmentIndex()

void SetNextAttachmentIndex ( )
inlineprotected
341 {
342 if ( GetAttachmentsToDetachCount() > 1 )
343 {
345 {
347 }
349 {
351 }
352 }
353 else
354 {
356 }
357 }

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

◆ SetNextIndex()

void SetNextIndex ( )
inlineprotected
104 {
105 }

◆ SetSlotId()

void SetSlotId ( int slot_id)
inlineprotected
83 {
85 }

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

◆ SetTarget()

void SetTarget ( Object target)
inlineprotected
63 {
65 }

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

◆ SetTargetPart()

void SetTargetPart ( ConstructionPart target_part)
inlineprotected
73 {
75 }

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

Поля

◆ m_ActionInitiator

PlayerBase m_ActionInitiator
private

Используется в GetActionInitiator() и SetActionInitiator().

◆ m_ActionNoToolVariantManager

ActionVariantManager m_ActionNoToolVariantManager
protected

Используется в ConstructionActionData() и OnUpdateActionsNoTool().

◆ m_ActionVariantManager

ActionVariantManager m_ActionVariantManager
protected

Используется в ConstructionActionData() и OnUpdateActions().

◆ m_Attachments

◆ m_AttachmentsIndex

int m_AttachmentsIndex
protected

◆ m_BuildParts

◆ m_BuildPartsNoTool

ref array<ConstructionPart> m_BuildPartsNoTool
private

◆ m_CombinationLock

CombinationLock m_CombinationLock
private

◆ m_MainPartName

string m_MainPartName
private

Используется в GetMainPartName() и OnUpdateActions().

◆ m_MainPartNameNoTool

string m_MainPartNameNoTool
private

Используется в GetMainPartNameNoTool() и OnUpdateActionsNoTool().

◆ m_PartIndex

int m_PartIndex
private

Используется в ConstructionActionData() и ResetActionIndexes().

◆ m_SlotId

int m_SlotId
private

Используется в GetSlotId() и SetSlotId().

◆ m_Target

Object m_Target
private

Используется в GetTarget() и SetTarget().

◆ m_TargetPart

ref ConstructionPart m_TargetPart
private

Используется в GetTargetPart() и SetTargetPart().


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