124 if (item && item.CanPutIntoHands(null))
143 Man player =
GetGame().GetPlayer();
145 if( focused_slot.
IsReserved() || focused_item != selected_item && !(selected_slot && selected_slot.
IsOutOfReach() ) )
149 if( selected_item.GetInventory().CanRemoveEntity() )
151 if(
m_Entity.GetInventory().CanAddAttachmentEx( selected_item, focused_slot.
GetSlotID() ) )
153 player.PredictiveTakeEntityToTargetAttachmentEx(
m_Entity, selected_item, focused_slot.
GetSlotID() );
158 else if(
m_Entity.GetInventory().CanAddAttachment( selected_item ) )
160 player.PredictiveTakeEntityToTargetAttachment(
m_Entity, selected_item);
170 EntityAI item_in_hands =
GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
172 focused_item.GetInventory().GetCurrentInventoryLocation( il );
174 if( reachable && focused_item.GetInventory().CanRemoveEntity() )
176 if( item_in_hands && item_in_hands.GetInventory().CanRemoveEntity() )
180 player.PredictiveSwapEntities( item_in_hands, focused_item );
186 if( player.GetHumanInventory().CanAddEntityInHands( focused_item ) )
188 player.PredictiveTakeEntityToHands( focused_item );
201 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin( PluginRecipesManager ) );
228 if( !entity || entity.IsInherited( Magazine ) )
241 if ( item_in_hands && ent && hands_icon )
254 if( entity.HasQuantity() )
256 entity.OnRightClick();
302 if (item.GetTargetQuantityMax() < item.GetQuantity())
303 item.SplitIntoStackMaxClient( null, -1 );
305 player.PhysicalPredictiveDropItem(item);
313 return m_Parent.GetMainWidget().FindAnyWidget(
"AttachmentsWrapper").GetAlpha() > 0;
330 if (
m_Entity.CanDisplayAttachmentSlot(slot_id))
339 icon.GetMainWidget().Show(
false );
365 icon.GetMainWidget().Show(
true );
369 bool draggable =
true;
386 bool in_hands_condition =
m_Entity.GetHierarchyRoot() && item.GetInventory().CanRemoveEntity();
388 if( in_hands_condition || in_vicinity_condition )
447 icon.
Init( item,
true );
474 for ( i = 0; i < number_of_rows; i++ )
516 path =
"CfgSlots" +
" Slot_" +
"magazine2";
519 string icon_name =
"";
520 if(
GetGame().ConfigGetText(
path +
" ghostIcon", icon_name ) && icon_name !=
"" )
535 if (
m_Entity.CanDisplayAttachmentSlot(slot_id))
537 icon.GetMainWidget().Show(
true );
541 icon.GetMainWidget().Show(
false );
547 int row_index = number_of_rows - 1;
553 row_last.
GetSlotIcon( k ).GetMainWidget().Show(
false );
555 row_last.GetRootWidget().Update();
556 row_last.GetRootWidget().GetParent().Update();
572 for (
int s = 0; s < searching_in.Count(); ++s )
574 string cfg_name = searching_in.Get( s );
575 string path = cfg_name +
" " + e.GetType();
579 GetGame().ConfigGetTextArray(
path +
" attachments", attachments_slots );
580 if ( e.IsWeapon() && (!e.ConfigIsExisting(
"DisplayMagazine") || e.ConfigGetBool(
"DisplayMagazine")) )
582 attachments_slots.Insert(
"magazine" );
585 return attachments_slots;
588 if ( e.IsWeapon() && (!e.ConfigIsExisting(
"DisplayMagazine") || e.ConfigGetBool(
"DisplayMagazine")) )
590 attachments_slots.Insert(
"magazine" );
593 return attachments_slots;
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
bool CanPerformActionFromInventory(ItemBase mainItem, ItemBase targetItem)
void SetFalseAttachmentsHeaderText(string text)
void AttachmentRemoved(EntityAI item, string slot, EntityAI parent)
ref array< string > m_AttachmentSlotDisplayable
ref array< string > m_AttachmentSlotNames
ref AttachmentsWrapper m_AttachmentsContainer
void SetDefaultFocus(bool while_micromanagment_mode=false)
void AttachmentAdded(EntityAI item, string slot, EntityAI parent)
void OnAttachmentReservationRelease(EntityAI item, int slot_id)
SlotsIcon GetFocusedSlotsIcon()
array< int > GetSlotsSorted()
array< string > GetItemSlots(EntityAI e)
bool TransferItemToVicinity()
int GetAttachmentSlotID()
int GetAttachmentHeight()
void SetAttachmentSlotID(int slotID)
ref array< int > m_AttachmentIDOrdered
void SetActive(bool active)
AttachmentsWrapper GetWrapper()
void Attachments(Container parent, EntityAI entity)
bool IsItemWithQuantityActive()
void OnAttachmentReservationSet(EntityAI item, int slot_id)
EntityAI GetFocusedItem()
ref map< int, SlotsIcon > m_AttachmentSlots
int GetRecipeCount(bool recipe_anywhere, EntityAI entity1, EntityAI entity2)
TextWidget GetFalseHeaderTextWidget()
void InitAttachmentGrid(int att_row_index)
void ShowFalseAttachmentsHeader(bool show)
static bool IsAttachmentReachable(EntityAI e, string att_slot_name="", int slot_id=-1, float range=1.5)
void SetFalseAttachmentsHeaderText(string text)
void ShowFalseAttachmentsHeader(bool show)
TextWidget GetFalseHeaderTextWidget()
void SetParent(Attachments atts)
Super root of all classes in Enforce script.
override void UpdateRadialIcon()
script counterpart to engine's class Inventory
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
bool CombineItems(EntityAI entity1, EntityAI entity2)
provides access to slot configuration
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
EntityAI GetDraggedItem()
void SetSelectedItemEx(EntityAI selected_item, Container selected_container, LayoutHolder selected_icon)
HandsPreview GetHandsPreview()
SlotsIcon GetSelectedIcon()
EntityAI GetSelectedItem()
static ItemManager GetInstance()
base for semi auto weapons @NOTE name copies config base class
SlotsIcon GetSlotIcon(int index)
void Init(EntityAI obj, bool reservation=false)
void SetSlotID(int slot_ID)
void SetSlotDisplayName(string text)
override void UpdateInterval()
Widget GetMountedWidget()
Widget GetOutOfReachWidget()
ImageWidget GetGhostSlot()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
array< string > TStringArray
FindInventoryLocationType
flags for searching locations in inventory
PluginBase GetPlugin(typename plugin_type)