119 if ( base_building_object )
121 string main_part_name = target.GetActionComponentName( component_index );
122 base_building_object.GetConstruction().GetConstructionPartsToBuild( main_part_name,
m_BuildParts, tool,
m_MainPartName,
true );
144 if ( base_building_object )
146 string main_part_name = target.GetActionComponentName( component_index );
209 for (
int i = 0; i < length_diff; ++i )
211 combination_text =
"0" + combination_text;
219 dial_text +=
string.
Format(
"[%1]", combination_text.
Get( j ) );
223 dial_text +=
string.
Format(
" %1 ", combination_text.
Get( j ) );
236 string cfg_path =
"cfgVehicles" +
" " + target.GetType() +
" "+
"GUIInventoryAttachmentsProps";
238 if (
GetGame().ConfigIsExisting( cfg_path ) )
242 for (
int i = 0; i < child_count; i++ )
247 string child_selection;
250 if ( selection == child_selection )
255 for (
int j = 0; j < attachment_slots.Count(); ++j )
258 int item_slot_count = item_to_attach.GetInventory().GetSlotIdCount();
260 for (
int k = 0; k < item_slot_count; ++k )
262 int item_slot_id = item_to_attach.GetInventory().GetSlotId( k );
263 ItemBase attachment_item =
ItemBase.Cast( target.GetInventory().FindAttachment( item_slot_id ) );
265 if ( target_slot_id == item_slot_id )
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 ) )
269 if(target.CanDisplayAttachmentSlot(target_slot_id))
288 string cfg_path =
"cfgVehicles" +
" " + target.GetType() +
" "+
"GUIInventoryAttachmentsProps";
289 if (
GetGame().ConfigIsExisting( cfg_path ) )
293 for (
int i = 0; i < child_count; i++ )
298 string child_selection;
301 if ( selection == child_selection )
306 for (
int j = 0; j < attachment_slots.Count(); ++j )
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 ) )
314 attachments.Insert( attachment );
324 if ( target.ConfigGetBool(
"canBeSplit" ) && item && !target.IsFullQuantity() )
326 int quantity_used = target.ComputeQuantityUsed( item,
true );
327 if( quantity_used != 0 )
329 target.AddQuantity( quantity_used );
330 item.AddQuantity( -quantity_used );
static ActionVariantManager GetVariantManager(typename actionName)
void SetActionVariantCount(int count)
ScriptInvoker GetOnUpdateInvoker()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
void CombineItems(ItemBase target, ItemBase item)
void GetAttachmentsFromSelection(EntityAI target, string selection, out array< EntityAI > attachments)
ref array< ConstructionPart > m_BuildPartsNoTool
ref array< EntityAI > m_Attachments
void ResetActionIndexes()
void SetSlotId(int slot_id)
int GetAttachmentSlotFromSelection(PlayerBase player, EntityAI target, ItemBase item_to_attach, string selection)
ConstructionPart GetTargetPart()
ref array< ConstructionPart > m_BuildParts
string GetDialNumberText()
void RefreshAttachmentsToDetach(EntityAI target, string main_part_name)
void OnUpdateActionsNoTool(Object item, Object target, int component_index)
CombinationLock GetCombinationLock()
int GetAttachmentsToDetachCount()
void SetCombinationLock(CombinationLock combination_lock)
PlayerBase GetActionInitiator()
int GetConstructionPartsCount()
EntityAI GetActualAttachmentToDetach()
void SetActionInitiator(PlayerBase action_initiator)
ConstructionPart GetBuildPartNoToolAtIndex(int idx)
ref ConstructionPart m_TargetPart
PlayerBase m_ActionInitiator
void ConstructionActionData()
void SetTargetPart(ConstructionPart target_part)
protected ActionVariantManager m_ActionNoToolVariantManager
CombinationLock m_CombinationLock
string GetMainPartNameNoTool()
void RefreshPartsToBuild(string main_part_name, ItemBase tool, bool use_tool=true)
void OnUpdateActions(Object item, Object target, int component_index)
ConstructionPart GetBuildPartAtIndex(int idx)
ConstructionPart GetCurrentBuildPart()
void SetNextAttachmentIndex()
void SetTarget(Object target)
protected ActionVariantManager m_ActionVariantManager
string m_MainPartNameNoTool
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
proto native void Clear()
remove all calls from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
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'.
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.
string Get(int index)
Gets n-th character from string.
proto native int Length()
Returns length of string.