40 private int m_FastConstructionMode;
175 target.GetActionComponentNameList(component_index, compNames,
LOD.
NAME_VIEW);
177 foreach (
string compName : compNames)
180 con.GetConstructionPartsToBuild(compName, tmp, tool,
m_MainPartName,
true);
210 ShelterSite shelter = ShelterSite.Cast(target);
212 if (!tool && shelter &&
Class.
CastTo(con,shelter.GetConstructionBasic()))
215 target.GetActionComponentNameList(component_index, compNames,
LOD.
NAME_VIEW);
217 foreach (
string compName : compNames)
243 if (!tool && ent &&
Class.
CastTo(con,ent.GetConstructionBasic()))
246 target.GetActionComponentNameList(componentIndex, compNames,
LOD.
NAME_VIEW);
248 foreach (
string compName : compNames)
279 target.GetActionComponentNameList(component_index, compNames,
LOD.
NAME_VIEW);
281 foreach (
string compName : compNames)
284 con.GetConstructionPartsUnableToBuild(compName, tmp, tool,
m_MainPartName, tool != null);
309 #ifdef DIAG_DEVELOPER
310 void OnUpdateActionsInstant(
Object item,
Object target,
int componentIndex)
319 target.GetActionComponentNameList(componentIndex, compNames,
LOD.
NAME_VIEW);
320 m_BuildPartsInstant.Clear();
321 foreach (
string compName : compNames)
327 if (m_BuildPartsInstant.Find(part) == -1)
328 m_BuildPartsInstant.Insert(part);
335 m_BuildPartsInstant.Clear();
336 m_ActionVariantManagerInstant.
Clear();
382 #ifdef DIAG_DEVELOPER
385 if (m_BuildPartsInstant.Count() > idx)
387 return m_BuildPartsInstant[idx];
412 string combinationText;
424 for (
int i = 0; i < lengthDiff; ++i)
426 combinationText =
"0" + combinationText;
444 dialText +=
string.
Format(
"[%1]", combinationText.
Get(j));
448 dialText +=
string.
Format(
" %1 ", combinationText.
Get(j));
481 foreach (
string slotName : data.m_AttSlots)
487 if ((inventory.
CanAddAttachmentEx(item_to_attach, slotId)) || (attachment && attachment.CanBeCombined(item_to_attach)))
489 if(target.CanDisplayAttachmentSlot(slotId) && target.CanDisplayAttachmentCategory(data.GetAttachmentGroupClassName()))
511 foreach (
string slotName : data.m_AttSlots)
517 attachments.Insert(attachment);
526 if ( target.ConfigGetBool(
"canBeSplit" ) && item && !target.IsFullQuantity() )
528 int quantity_used = target.ComputeQuantityUsed( item,
true );
529 if( quantity_used != 0 )
531 target.AddQuantity( quantity_used );
532 item.AddQuantity( -quantity_used );
594 void SetFastConstructionMode(
int mode)
596 m_FastConstructionMode = mode;
599 int GetFastConstructionMode()
601 return m_FastConstructionMode;
617 [
Obsolete(
"1.30: Unsafe, overridden ActionData used in-system instead")]
623 [
Obsolete(
"1.30: Unsafe, overridden ActionData used in-system instead")]
ActionBuildPart ActionContinuousBase ActionBuildPartHandsGeneric()
PlayerSpawnPreset slotName
void ConstructionBase(EntityAI parent)
static ActionVariantManager GetVariantManager(typename actionName)
ScriptInvoker GetOnUpdateInvoker()
void SetActionVariantCount(int count)
Super root of all classes in Enforce script.
ref array< EntityAI > m_Attachments
void Invalidate()
to be called from outside
void ResetActionIndexes()
ref array< ConstructionPart > m_BuildParts
EntityAI GetActualAttachmentToDetach()
void SetCombinationLock(CombinationLock combination_lock)
void ConstructionActionData()
ConstructionPart GetCurrentBuildPart()
CombinationLock m_CombinationLock
string GetDialNumberText()
ActionVariantManager m_ActionHandsGenericVariantManager
CombinationLock GetCombinationLock()
void OnUpdateInfoActions(Object item, Object target, int component_index)
int GetAttachmentsToDetachCount()
ref array< ConstructionPart > m_BuildPartsHandsGeneric
int GetCombinationLockSide()
void SetCombinationLockSide(int lockSide)
string GetMainPartNameNoTool()
string m_MainPartNameNoTool
ActionVariantManager m_ActionNoToolVariantManager
ConstructionPart GetBuildPartNoToolAtIndex(int idx)
void ~ConstructionActionData()
int GetConstructionPartsCount()
void CombineItems(ItemBase target, ItemBase item)
ConstructionPart GetBuildPartHandsGenericAtIndex(int idx)
ActionVariantManager m_ActionInfoContinuousVariantManager
ConstructionPart GetBuildPartInfoAtIndex(int idx)
void RefreshPartsToBuild(string main_part_name, ItemBase tool, bool use_tool=true)
void SetTarget(Object target)
void OnUpdateActionsNoTool(Object item, Object target, int component_index)
used for ShelterSite only (legacy)
int GetAttachmentSlotFromSelection(PlayerBase player, EntityAI target, ItemBase item_to_attach, string selection)
ActionVariantManager m_ActionVariantManager
void SetSlotId(int slot_id)
ConstructionPart GetBuildPartAtIndex(int idx)
void ValidateConstructionData(Object item, Object target, int component_index)
Single update method to prepare and validate all construction data for the update,...
void OnUpdateActionsHandsGeneric(Object item, Object target, int componentIndex)
void SetNextAttachmentIndex()
PlayerBase GetActionInitiator()
ConstructionPart GetTargetPart()
int m_CombinationLockSide
void GetAttachmentsFromSelection(EntityAI target, string selection, out array< EntityAI > attachments)
ref array< ConstructionPart > m_BuildPartsJustInfos
void SetActionInitiator(PlayerBase action_initiator)
PlayerBase m_ActionInitiator
void RefreshAttachmentsToDetach(EntityAI target, string main_part_name)
ref ConstructionPart m_TargetPart
void OnUpdateActions(Object item, Object target, int component_index)
regular tool actions
ref array< ConstructionPart > m_BuildPartsNoTool
void SetTargetPart(ConstructionPart target_part)
Instanced construction part data classes for dynamic data, statics now stored on EntityType level in ...
proto native bool CanRemoveAttachmentEx(EntityAI attachment, int slot)
proto native bool GetSlotLock(int slot)
proto native bool CanAddAttachmentEx(notnull EntityAI e, int slot)
Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID!...
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
script counterpart to engine's class Inventory
const int INVALID
Invalid slot (-1)
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
static const string NAME_VIEW
proto native void Clear()
remove all calls from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
Data for one attachment group.
array< TypeAttachmentGroupData > GetAttGroupsDataBySelectionParam(string selectionName)
Returns an array of 'GUIInventoryAttachmentsProps' subclasses that use the same 'selection'.
Data holder for attachment group classes.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
void Obsolete(string msg="")
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'.
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.