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

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

void Attachments (Container parent, EntityAI entity)
 
void ~Attachments ()
 
AttachmentsWrapper GetWrapper ()
 
bool IsEmpty ()
 
bool IsItemActive ()
 
bool IsItemWithQuantityActive ()
 
void UnfocusAll ()
 
void SetDefaultFocus (bool while_micromanagment_mode=false)
 
void SetLastActive ()
 
void SetActive (bool active)
 
void SelFirstActive ()
 
SlotsIcon GetFocusedSlotsIcon ()
 
EntityAI GetFocusedItem ()
 
int GetFocusedSlot ()
 
bool SelectItem ()
 
bool Select ()
 
int GetRecipeCount (bool recipe_anywhere, EntityAI entity1, EntityAI entity2)
 
bool CanCombine ()
 
bool CanCombineAmmo ()
 
bool CanEquip ()
 
bool Combine ()
 
bool SplitItem ()
 
bool EquipItem ()
 
bool TransferItem ()
 
bool InspectItem ()
 
bool TransferItemToVicinity ()
 
bool IsActive ()
 
int GetAttachmentHeight ()
 
void UpdateInterval ()
 
array< intGetSlotsSorted ()
 
void AttachmentAdded (EntityAI item, string slot, EntityAI parent)
 
void AttachmentRemoved (EntityAI item, string slot, EntityAI parent)
 
void OnAttachmentReservationSet (EntityAI item, int slot_id)
 
void OnAttachmentReservationRelease (EntityAI item, int slot_id)
 
void InitAttachmentGrid (int att_row_index)
 
array< stringGetItemSlots (EntityAI e)
 
void ShowFalseAttachmentsHeader (bool show)
 
void SetFalseAttachmentsHeaderText (string text)
 
TextWidget GetFalseHeaderTextWidget ()
 
void SetAttachmentSlotID (int slotID)
 
int GetAttachmentSlotID ()
 

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

Container m_Parent
 
EntityAI m_Entity
 
ref AttachmentsWrapper m_AttachmentsContainer
 
ref array< stringm_AttachmentSlotNames
 
ref array< stringm_AttachmentSlotDisplayable
 
ref map< int, SlotsIconm_AttachmentSlots
 
ref array< intm_AttachmentIDOrdered
 
int m_RowIndex
 
int m_AttachmentSlotID = -1
 

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

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

◆ Attachments()

void Attachments ( Container parent,
EntityAI entity )
inlineprotected
17 {
18 m_Parent = parent;
24 m_Entity.GetOnItemAttached().Insert( AttachmentAdded );
25 m_Entity.GetOnItemDetached().Insert( AttachmentRemoved );
26 m_Entity.GetOnAttachmentSetLock().Insert( OnAttachmentReservationSet );
27 m_Entity.GetOnAttachmentReleaseLock().Insert( OnAttachmentReservationRelease );
28
29 }
ref array< int > m_AttachmentIDOrdered
Definition Attachments.c:11
void AttachmentAdded(EntityAI item, string slot, EntityAI parent)
Definition Attachments.c:416
array< string > GetItemSlots(EntityAI e)
Definition Attachments.c:563
ref array< string > m_AttachmentSlotNames
Definition Attachments.c:8
void AttachmentRemoved(EntityAI item, string slot, EntityAI parent)
Definition Attachments.c:431
void OnAttachmentReservationSet(EntityAI item, int slot_id)
Definition Attachments.c:441
EntityAI m_Entity
Definition Attachments.c:6
ref array< string > m_AttachmentSlotDisplayable
Definition Attachments.c:9
ref map< int, SlotsIcon > m_AttachmentSlots
Definition Attachments.c:10
void OnAttachmentReservationRelease(EntityAI item, int slot_id)
Definition Attachments.c:451
Container m_Parent
Definition Attachments.c:5
Definition EntityAI.c:95

Перекрестные ссылки AttachmentAdded(), AttachmentRemoved(), GetItemSlots(), m_AttachmentIDOrdered, m_AttachmentSlotDisplayable, m_AttachmentSlotNames, m_AttachmentSlots, m_Entity, m_Parent, OnAttachmentReservationRelease() и OnAttachmentReservationSet().

◆ ~Attachments()

void ~Attachments ( )
inlineprotected
32 {
33 if( m_Entity )
34 {
35 m_Entity.GetOnItemAttached().Remove( AttachmentAdded );
36 m_Entity.GetOnItemDetached().Remove( AttachmentRemoved );
37 m_Entity.GetOnAttachmentSetLock().Remove( OnAttachmentReservationSet );
38 m_Entity.GetOnAttachmentReleaseLock().Remove( OnAttachmentReservationRelease );
39 }
40
42 }
ref AttachmentsWrapper m_AttachmentsContainer
Definition Attachments.c:7

Перекрестные ссылки AttachmentAdded(), AttachmentRemoved(), m_AttachmentsContainer, m_Entity, OnAttachmentReservationRelease() и OnAttachmentReservationSet().

Методы

◆ AttachmentAdded()

void AttachmentAdded ( EntityAI item,
string slot,
EntityAI parent )
inlineprotected
417 {
420 if (icon)
421 {
422 icon.SetSlotID(slot_id);
423 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
424 if (item)
425 {
426 icon.Init(item);
427 }
428 }
429 }
provides access to slot configuration
Definition InventorySlots.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static proto native owned string GetSlotDisplayName(int id)
converts slot_id to string
Definition SlotsIcon.c:2

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

Используется в Attachments(), InitAttachmentGrid() и ~Attachments().

◆ AttachmentRemoved()

void AttachmentRemoved ( EntityAI item,
string slot,
EntityAI parent )
inlineprotected
432 {
435 if (icon)
436 {
437 icon.Clear();
438 }
439 }

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

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

◆ CanCombine()

bool CanCombine ( )
inlineprotected
206 {
208 ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
209
211 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51
EntityAI GetFocusedItem()
Definition Attachments.c:104
Definition InventoryItem.c:731
Definition ItemManager.c:2
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
Definition ItemManager.c:793
proto native CGame GetGame()

Перекрестные ссылки ItemManager::GetCombinationFlags(), GetFocusedItem(), GetGame() и GetPlayer().

Используется в AttachmentsWrapper::CanCombine().

◆ CanCombineAmmo()

bool CanCombineAmmo ( )
inlineprotected
214 {
217 ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
219 Class.CastTo(amc, m_player.GetActionManager());
220
221 return ( amc.CanPerformActionFromInventory( item_in_hands, ent ) );
222 }
DayZPlayer m_player
Definition RandomGeneratorSyncManager.c:16
Definition ActionManagerClient.c:5
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition PlayerBaseClient.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), GetFocusedItem(), GetGame(), GetPlayer() и m_player.

Используется в AttachmentsWrapper::CanCombineAmmo().

◆ CanEquip()

bool CanEquip ( )
inlineprotected
225 {
228 if( !entity || entity.IsInherited( Magazine ) )
229 {
230 return false;
231 }
232 return GetGame().GetPlayer().GetInventory().FindFreeLocationFor( entity, FindInventoryLocationType.ATTACHMENT, il );
233 }
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:17
Definition Building.c:6
InventoryLocation.
Definition InventoryLocation.c:29

Перекрестные ссылки GetFocusedItem() и GetGame().

Используется в AttachmentsWrapper::CanEquip().

◆ Combine()

bool Combine ( )
inlineprotected
236 {
238 ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
239 Icon hands_icon = ItemManager.GetInstance().GetHandsPreview().GetIcon();
240
241 if ( item_in_hands && ent && hands_icon )
242 {
243 return hands_icon.CombineItems( item_in_hands, ent );
244 }
245
246 return false;
247 }
Definition Icon.c:2
static ItemManager GetInstance()
Definition ItemManager.c:283

Перекрестные ссылки GetFocusedItem(), GetGame(), ItemManager::GetInstance() и GetPlayer().

Используется в AttachmentsWrapper::Combine().

◆ EquipItem()

bool EquipItem ( )
inlineprotected
264 {
266 if( entity && !entity.IsInherited( Magazine ) && !GetFocusedSlotsIcon().IsOutOfReach() )
267 {
268 GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.ATTACHMENT, entity );
269 return true;
270 }
271 return false;
272 }
SlotsIcon GetFocusedSlotsIcon()
Definition Attachments.c:99

Перекрестные ссылки GetFocusedItem(), GetFocusedSlotsIcon() и GetGame().

Используется в AttachmentsWrapper::EquipItem().

◆ GetAttachmentHeight()

int GetAttachmentHeight ( )
inlineprotected
317 {
318 return m_AttachmentsContainer.Count();
319 }

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

◆ GetAttachmentSlotID()

int GetAttachmentSlotID ( )
inlineprotected
617 {
618 return m_AttachmentSlotID;
619 }
int m_AttachmentSlotID
Definition Attachments.c:14

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

◆ GetFalseHeaderTextWidget()

TextWidget GetFalseHeaderTextWidget ( )
inlineprotected
607 {
608 return m_AttachmentsContainer.GetFalseHeaderTextWidget();
609 }

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

◆ GetFocusedItem()

EntityAI GetFocusedItem ( )
inlineprotected

◆ GetFocusedSlot()

int GetFocusedSlot ( )
inlineprotected
110 {
111 SlotsIcon icon = m_AttachmentsContainer.GetFocusedSlotsIcon();
112 if (icon)
113 return icon.GetSlotID();
114 return -1;
115 }

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

Используется в AttachmentsWrapper::GetFocusedSlot().

◆ GetFocusedSlotsIcon()

SlotsIcon GetFocusedSlotsIcon ( )
inlineprotected
100 {
101 return m_AttachmentsContainer.GetFocusedSlotsIcon();
102 }

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

Используется в EquipItem(), Select(), SelectItem(), SplitItem(), TransferItem(), TransferItemToVicinity() и UpdateInterval().

◆ GetItemSlots()

array< string > GetItemSlots ( EntityAI e)
inlineprotected
564 {
569
571 int i = 0;
572 for ( int s = 0; s < searching_in.Count(); ++s )
573 {
574 string cfg_name = searching_in.Get( s );
575 string path = cfg_name + " " + e.GetType();
576
577 if ( GetGame().ConfigIsExisting( path ) )
578 {
579 GetGame().ConfigGetTextArray( path + " attachments", attachments_slots );
580 if ( e.IsWeapon() && (!e.ConfigIsExisting("DisplayMagazine") || e.ConfigGetBool("DisplayMagazine")) )
581 {
582 attachments_slots.Insert( "magazine" );
583 }
584
585 return attachments_slots;
586 }
587 }
588 if ( e.IsWeapon() && (!e.ConfigIsExisting("DisplayMagazine") || e.ConfigGetBool("DisplayMagazine")) )
589 {
590 attachments_slots.Insert( "magazine" );
591 }
592
593 return attachments_slots;
594 }
string path
Definition OptionSelectorMultistate.c:142
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition IsBoxCollidingGeometryProxyClasses.c:28
array< string > TStringArray
Definition EnScript.c:685
const string CFG_VEHICLESPATH
Definition constants.c:217
const string CFG_WEAPONSPATH
Definition constants.c:218
const string CFG_MAGAZINESPATH
Definition constants.c:219

Перекрестные ссылки CFG_MAGAZINESPATH, CFG_VEHICLESPATH, CFG_WEAPONSPATH, GetGame() и path.

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

◆ GetRecipeCount()

int GetRecipeCount ( bool recipe_anywhere,
EntityAI entity1,
EntityAI entity2 )
inlineprotected
200 {
201 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast( GetPlugin( PluginRecipesManager ) );
202 return plugin_recipes_manager.GetValidRecipes( ItemBase.Cast( entity1 ), ItemBase.Cast( entity2 ), null, PlayerBase.Cast( GetGame().GetPlayer() ) );
203 }
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316

Перекрестные ссылки GetGame(), GetPlayer() и GetPlugin().

◆ GetSlotsSorted()

array< int > GetSlotsSorted ( )
inlineprotected
412 {
414 }

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

◆ GetWrapper()

AttachmentsWrapper GetWrapper ( )
inlineprotected
45 {
47 }

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

◆ InitAttachmentGrid()

void InitAttachmentGrid ( int att_row_index)
inlineprotected
459 {
461 int i;
463
465 string name = m_Entity.GetDisplayName();
466 name.ToUpper();
467
469 m_AttachmentsContainer.SetParent( this );
470 m_AttachmentsContainer.SetFalseAttachmentsHeaderText(name);
471 m_AttachmentsContainer.GetRootWidget().SetSort( att_row_index );
473
474 for ( i = 0; i < number_of_rows; i++ )
475 {
477 m_AttachmentsContainer.Insert( ic );
478
479 if( i == ( number_of_rows - 1 ) && m_AttachmentSlotNames.Count() % ITEMS_IN_ROW != 0 )
480 {
481 ic.SetColumnCount( m_AttachmentSlotNames.Count() % ITEMS_IN_ROW );
482 }
483 else
484 {
485 ic.SetColumnCount( ITEMS_IN_ROW );
486 }
487
488 for( int j = 0; j < ITEMS_IN_ROW; j++ )
489 {
490 icon = ic.GetSlotIcon( j );
491 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetMainWidget(), m_Parent, "OnDropReceivedFromHeader2" );
492 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetGhostSlot(), m_Parent, "OnDropReceivedFromHeader2" );
493 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetPanelWidget(), m_Parent, "OnDropReceivedFromHeader2" );
494
495 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetMainWidget(), m_Parent, "DraggingOverHeader" );
496 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetGhostSlot(), m_Parent, "DraggingOverHeader" );
497 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetPanelWidget(), m_Parent, "DraggingOverHeader" );
498
499 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetMainWidget(), m_Parent, "MouseClick2" );
500 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetGhostSlot(), m_Parent, "MouseClick2" );
501 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetPanelWidget(), m_Parent, "MouseClick2" );
502 }
503 }
504
505 for ( i = 0; i < m_AttachmentSlotNames.Count(); i++ )
506 {
508 WidgetEventHandler.GetInstance().RegisterOnDoubleClick( icon.GetPanelWidget(), m_Parent, "DoubleClick" );
509
510 string path = "CfgSlots" + " Slot_" + m_AttachmentSlotNames[i];
511
512 //Show different magazine icon for firearms and pistols
513 if ( m_AttachmentSlotNames[i] == "magazine" )
514 {
515 if ( !m_Entity.IsInherited( Pistol_Base ) )
516 path = "CfgSlots" + " Slot_" + "magazine2";
517 }
518
519 string icon_name = ""; //icon_name must be in format "set:<setname> image:<imagename>"
520 if( GetGame().ConfigGetText( path + " ghostIcon", icon_name ) && icon_name != "" )
523 m_AttachmentSlots.Insert( slot_id, icon );
525
526 icon.SetSlotID(slot_id);
527 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
528
529 EntityAI item = m_Entity.GetInventory().FindAttachment( slot_id );
530 if( item )
532 else
533 icon.Clear();
534
535 if (m_Entity.CanDisplayAttachmentSlot(slot_id))
536 {
537 icon.GetMainWidget().Show( true );
538 }
539 else
540 {
541 icon.GetMainWidget().Show( false );
542 }
543 }
544
545 if( m_AttachmentSlotNames.Count() > 0 )
546 {
547 int row_index = number_of_rows - 1;
549 if( row_last )
550 {
551 for( int k = ((m_AttachmentSlotNames.Count() - 1) % ITEMS_IN_ROW) + 1; k < ITEMS_IN_ROW; k++ )
552 {
553 row_last.GetSlotIcon( k ).GetMainWidget().Show( false );
554 }
555 row_last.GetRootWidget().Update();
556 row_last.GetRootWidget().GetParent().Update();
557 }
558 }
559
560 m_AttachmentsContainer.RecomputeOpenedContainers();
561 }
const int ITEMS_IN_ROW
Definition Attachments.c:1
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
int m_RowIndex
Definition Attachments.c:13
Definition AttachmentsWrapper.c:2
Definition EnMath.c:7
base for semi auto weapons @NOTE name copies config base class
Definition PistolAlt_Base.c:2
Definition SlotsContainer.c:2
SlotsIcon GetSlotIcon(int index)
Definition SlotsContainer.c:207
Definition StaticGUIUtils.c:2
static const int IMAGESETGROUP_INVENTORY
Definition StaticGUIUtils.c:3
static string VerifyIconImageString(int imageset_group=IMAGESETGROUP_INVENTORY, string icon_name="")
Checks for improperly formated, legacy image names and corrects them to default format.
Definition StaticGUIUtils.c:7
Definition WidgetEventHandler.c:2
static WidgetEventHandler GetInstance()
Definition WidgetEventHandler.c:22
static proto float Ceil(float f)
Returns ceil of value.

Перекрестные ссылки AttachmentAdded(), Math::Ceil(), GetGame(), WidgetEventHandler::GetInstance(), InventorySlots::GetSlotDisplayName(), SlotsContainer::GetSlotIcon(), InventorySlots::GetSlotIdFromString(), StaticGUIUtils::IMAGESETGROUP_INVENTORY, ITEMS_IN_ROW, m_AttachmentIDOrdered, m_AttachmentsContainer, m_AttachmentSlotNames, m_AttachmentSlots, m_Entity, m_Parent, m_RowIndex, name, path и StaticGUIUtils::VerifyIconImageString().

◆ InspectItem()

bool InspectItem ( )
inlineprotected
286 {
288 if( entity )
289 {
290 m_Parent.InspectItem( entity );
291 return true;
292 }
293 return false;
294 }

Перекрестные ссылки GetFocusedItem() и m_Parent.

Используется в AttachmentsWrapper::InspectItem().

◆ IsActive()

bool IsActive ( )
inlineprotected
312 {
313 return m_Parent.GetMainWidget().FindAnyWidget("AttachmentsWrapper").GetAlpha() > 0;
314 }

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

◆ IsEmpty()

bool IsEmpty ( )
inlineprotected
50 {
51 return m_AttachmentsContainer.IsEmpty();
52 }

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

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

◆ IsItemActive()

bool IsItemActive ( )
inlineprotected
55 {
57 if( !item )
58 {
59 return false;
60 }
61 return !IsEmpty() && ( !QuantityConversions.HasItemQuantity( item ) || ( QuantityConversions.HasItemQuantity( item ) && !item.CanBeSplit() ) );
62 }
bool IsEmpty()
Definition Attachments.c:49
Definition QuantityConversions.c:2
static int HasItemQuantity(notnull EntityAI item)
Definition QuantityConversions.c:143

Перекрестные ссылки GetFocusedItem(), QuantityConversions::HasItemQuantity() и IsEmpty().

Используется в AttachmentsWrapper::IsItemActive().

◆ IsItemWithQuantityActive()

bool IsItemWithQuantityActive ( )
inlineprotected
65 {
67 if( !item )
68 {
69 return false;
70 }
71 return !IsEmpty() && QuantityConversions.HasItemQuantity( item ) && item.CanBeSplit();
72 }

Перекрестные ссылки GetFocusedItem(), QuantityConversions::HasItemQuantity() и IsEmpty().

Используется в AttachmentsWrapper::IsItemWithQuantityActive().

◆ OnAttachmentReservationRelease()

void OnAttachmentReservationRelease ( EntityAI item,
int slot_id )
inlineprotected
452 {
454 icon.Clear();
455 }

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

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

◆ OnAttachmentReservationSet()

void OnAttachmentReservationSet ( EntityAI item,
int slot_id )
inlineprotected
442 {
444
445 if (item)
446 {
447 icon.Init( item, true );
448 }
449 }

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

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

◆ Select()

bool Select ( )
inlineprotected
138 {
139 SlotsIcon selected_slot = ItemManager.GetInstance().GetSelectedIcon();
140 EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
143 Man player = GetGame().GetPlayer();
144
145 if( focused_slot.IsReserved() || focused_item != selected_item && !(selected_slot && selected_slot.IsOutOfReach() ) )
146 {
147 if( selected_item )
148 {
149 if( selected_item.GetInventory().CanRemoveEntity() )
150 {
151 if( m_Entity.GetInventory().CanAddAttachmentEx( selected_item, focused_slot.GetSlotID() ) )
152 {
153 player.PredictiveTakeEntityToTargetAttachmentEx( m_Entity, selected_item, focused_slot.GetSlotID() );
154 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
155 return true;
156
157 }
158 else if( m_Entity.GetInventory().CanAddAttachment( selected_item ) )
159 {
160 player.PredictiveTakeEntityToTargetAttachment(m_Entity, selected_item);
161 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
162 return true;
163 }
164 }
165 }
166 else
167 {
168 if ( focused_item && !focused_slot.IsOutOfReach() )
169 {
170 EntityAI item_in_hands = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
172 focused_item.GetInventory().GetCurrentInventoryLocation( il );
174 if( reachable && focused_item.GetInventory().CanRemoveEntity() )
175 {
176 if( item_in_hands && item_in_hands.GetInventory().CanRemoveEntity() )
177 {
179 {
180 player.PredictiveSwapEntities( item_in_hands, focused_item );
181 return true;
182 }
183 }
184 else
185 {
186 if( player.GetHumanInventory().CanAddEntityInHands( focused_item ) )
187 {
188 player.PredictiveTakeEntityToHands( focused_item );
189 return true;
190 }
191 }
192 }
193 }
194 }
195 }
196 return false;
197 }
Definition AttachmentsOutOfReach.c:2
static bool IsAttachmentReachable(EntityAI e, string att_slot_name="", int slot_id=-1, float range=1.5)
Definition AttachmentsOutOfReach.c:5
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:628

Перекрестные ссылки GameInventory::CanSwapEntitiesEx(), GetFocusedItem(), GetFocusedSlotsIcon(), GetGame(), ItemManager::GetInstance(), AttachmentsOutOfReach::IsAttachmentReachable() и m_Entity.

Используется в AttachmentsWrapper::Select().

◆ SelectItem()

bool SelectItem ( )
inlineprotected
118 {
121
122 if (icon && !icon.IsOutOfReach())
123 {
124 if (item && item.CanPutIntoHands(null))
125 {
126 ItemManager.GetInstance().SetSelectedItemEx(item, null, icon);
127 }
128 else
129 {
130 ItemManager.GetInstance().SetSelectedItemEx(null, null, icon);
131 }
132 return true;
133 }
134 return false;
135 }

Перекрестные ссылки GetFocusedItem(), GetFocusedSlotsIcon() и ItemManager::GetInstance().

Используется в AttachmentsWrapper::SelectItem().

◆ SelFirstActive()

void SelFirstActive ( )
inlineprotected
95 {
96 m_AttachmentsContainer.SetFirstActive();
97 }

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

◆ SetActive()

void SetActive ( bool active)
inlineprotected
90 {
92 }

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

◆ SetAttachmentSlotID()

void SetAttachmentSlotID ( int slotID)
inlineprotected
612 {
614 }

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

◆ SetDefaultFocus()

void SetDefaultFocus ( bool while_micromanagment_mode = false)
inlineprotected
80 {
82 }

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

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

◆ SetFalseAttachmentsHeaderText()

void SetFalseAttachmentsHeaderText ( string text)
inlineprotected
602 {
603 m_AttachmentsContainer.SetFalseAttachmentsHeaderText(text);
604 }

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

◆ SetLastActive()

void SetLastActive ( )
inlineprotected
85 {
86 m_AttachmentsContainer.SetLastActive();
87 }

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

◆ ShowFalseAttachmentsHeader()

void ShowFalseAttachmentsHeader ( bool show)
inlineprotected
597 {
598 m_AttachmentsContainer.ShowFalseAttachmentsHeader(show);
599 }

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

◆ SplitItem()

bool SplitItem ( )
inlineprotected
250 {
252 if( entity && !entity.IsInherited( Magazine ) && !GetFocusedSlotsIcon().IsOutOfReach() )
253 {
254 if( entity.HasQuantity() )
255 {
256 entity.OnRightClick();
257 return true;
258 }
259 }
260 return false;
261 }

Перекрестные ссылки GetFocusedItem() и GetFocusedSlotsIcon().

Используется в AttachmentsWrapper::SplitItem().

◆ TransferItem()

bool TransferItem ( )
inlineprotected
275 {
277 if( entity && !GetFocusedSlotsIcon().IsOutOfReach() )
278 {
279 GetGame().GetPlayer().PredictiveTakeEntityToInventory( FindInventoryLocationType.CARGO, entity );
280 return true;
281 }
282 return false;
283 }

Перекрестные ссылки GetFocusedItem(), GetFocusedSlotsIcon() и GetGame().

Используется в AttachmentsWrapper::TransferItem().

◆ TransferItemToVicinity()

bool TransferItemToVicinity ( )
inlineprotected
297 {
300 if (item && !GetFocusedSlotsIcon().IsOutOfReach() )
301 {
302 if (item.GetTargetQuantityMax() < item.GetQuantity())
303 item.SplitIntoStackMaxClient( null, -1 );
304 else
305 player.PhysicalPredictiveDropItem(item);
306 return true;
307 }
308 return false;
309 }

Перекрестные ссылки GetFocusedItem(), GetFocusedSlotsIcon(), GetGame() и GetPlayer().

Используется в AttachmentsWrapper::TransferItemToVicinity().

◆ UnfocusAll()

void UnfocusAll ( )
inlineprotected
75 {
76 m_AttachmentsContainer.UnfocusAll();
77 }

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

◆ UpdateInterval()

void UpdateInterval ( )
inlineprotected
322 {
324 int slot_id;
326 int i = 0;
327 for (i = m_AttachmentSlotNames.Count() - 1; i >=0; --i)
328 {
330 if (m_Entity.CanDisplayAttachmentSlot(slot_id))
331 {
333 }
334 else
335 {
337 if (icon)
338 {
339 icon.GetMainWidget().Show( false );
340 if( GetFocusedSlotsIcon() == icon )
341 {
343 }
344 // radial icon (collabsable icon handling)
345 icon.UpdateInterval();
346 }
347 }
348
349 }
350
351 if ( m_AttachmentSlotDisplayable.Count() == 0 )
352 {
353 if (m_Parent)
354 {
356 //m_Parent.Close();
357 }
358 }
359
360 for (i = 0; i < m_AttachmentSlotDisplayable.Count(); ++i)
361 {
364 EntityAI item = icon.GetEntity();
365 icon.GetMainWidget().Show( true );
366 icon.UpdateInterval();
367 if ( item )
368 {
369 bool draggable = true;
370 if(icon.IsReserved())
371 {
372 draggable = false;
373 }
374
375 if( m_Entity.GetInventory().GetSlotLock( slot_id ) && ItemManager.GetInstance().GetDraggedItem() != item )
376 {
377 icon.GetMountedWidget().Show( true );
378 draggable = false;
379 }
380 else
381 {
382 icon.GetMountedWidget().Show( false );
383 }
384
386 bool in_hands_condition = m_Entity.GetHierarchyRoot() && item.GetInventory().CanRemoveEntity();
389 {
390 icon.GetOutOfReachWidget().Show( false );
391 }
392 else
393 {
394 icon.GetOutOfReachWidget().Show( true );
395 draggable = false;
396 }
397
398 if( draggable )
399 {
400 icon.GetPanelWidget().SetFlags( WidgetFlags.DRAGGABLE );
401 }
402 else
403 {
404 icon.GetPanelWidget().ClearFlags( WidgetFlags.DRAGGABLE );
405 }
406 }
407 }
408 m_AttachmentsContainer.GetRootWidget().Update();
409 }
void SetDefaultFocus(bool while_micromanagment_mode=false)
Definition Attachments.c:79
override void UpdateRadialIcon()
Definition ClosableContainer.c:28
WidgetFlags
Definition EnWidgets.c:58

Перекрестные ссылки GetFocusedSlotsIcon(), GetGame(), ItemManager::GetInstance(), GetPlayer(), InventorySlots::GetSlotIdFromString(), AttachmentsOutOfReach::IsAttachmentReachable(), m_AttachmentsContainer, m_AttachmentSlotDisplayable, m_AttachmentSlotNames, m_AttachmentSlots, m_Entity, m_Parent, SetDefaultFocus() и Container::UpdateRadialIcon().

Используется в AttachmentsWrapper::UpdateInterval().

Поля

◆ m_AttachmentIDOrdered

ref array<int> m_AttachmentIDOrdered
protected

Используется в Attachments(), GetSlotsSorted() и InitAttachmentGrid().

◆ m_AttachmentsContainer

◆ m_AttachmentSlotDisplayable

ref array<string> m_AttachmentSlotDisplayable
protected

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

◆ m_AttachmentSlotID

int m_AttachmentSlotID = -1
protected

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

◆ m_AttachmentSlotNames

ref array<string> m_AttachmentSlotNames
protected

Используется в Attachments(), InitAttachmentGrid() и UpdateInterval().

◆ m_AttachmentSlots

◆ m_Entity

EntityAI m_Entity
protected

◆ m_Parent

Container m_Parent
protected

◆ m_RowIndex

int m_RowIndex
protected

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


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