Dayz 1.25
Dayz Code 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 ()
 

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

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
 

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

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

◆ Attachments()

void Attachments ( Container parent,
EntityAI entity )
inlineprotected
16 {
17 m_Parent = parent;
23 m_Entity.GetOnItemAttached().Insert( AttachmentAdded );
24 m_Entity.GetOnItemDetached().Insert( AttachmentRemoved );
25 m_Entity.GetOnAttachmentSetLock().Insert( OnAttachmentReservationSet );
26 m_Entity.GetOnAttachmentReleaseLock().Insert( OnAttachmentReservationRelease );
27
28 }
ref array< int > m_AttachmentIDOrdered
Definition Attachments.c:11
void AttachmentAdded(EntityAI item, string slot, EntityAI parent)
Definition Attachments.c:415
array< string > GetItemSlots(EntityAI e)
Definition Attachments.c:562
ref array< string > m_AttachmentSlotNames
Definition Attachments.c:8
void AttachmentRemoved(EntityAI item, string slot, EntityAI parent)
Definition Attachments.c:430
void OnAttachmentReservationSet(EntityAI item, int slot_id)
Definition Attachments.c:440
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:450
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
31 {
32 if( m_Entity )
33 {
34 m_Entity.GetOnItemAttached().Remove( AttachmentAdded );
35 m_Entity.GetOnItemDetached().Remove( AttachmentRemoved );
36 m_Entity.GetOnAttachmentSetLock().Remove( OnAttachmentReservationSet );
37 m_Entity.GetOnAttachmentReleaseLock().Remove( OnAttachmentReservationRelease );
38 }
39
41 }
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
416 {
419 if (icon)
420 {
421 icon.SetSlotID(slot_id);
422 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
423 if (item)
424 {
425 icon.Init(item);
426 }
427 }
428 }
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
431 {
434 if (icon)
435 {
436 icon.Clear();
437 }
438 }

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

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

◆ CanCombine()

bool CanCombine ( )
inlineprotected
205 {
207 ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
208
210 }
PlayerBase GetPlayer()
Definition ModifierBase.c:47
EntityAI GetFocusedItem()
Definition Attachments.c:103
Definition InventoryItem.c:731
Definition ItemManager.c:2
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)
Definition ItemManager.c:804
proto native CGame GetGame()

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

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

◆ CanCombineAmmo()

bool CanCombineAmmo ( )
inlineprotected
213 {
216 ItemBase item_in_hands = ItemBase.Cast( GetGame().GetPlayer().GetHumanInventory().GetEntityInHands() );
218 Class.CastTo(amc, m_player.GetActionManager());
219
220 return ( amc.CanPerformActionFromInventory( item_in_hands, ent ) );
221 }
DayZPlayer m_player
Definition RandomGeneratorSyncManager.c:15
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
224 {
227 if( !entity || entity.IsInherited( Magazine ) )
228 {
229 return false;
230 }
231 return GetGame().GetPlayer().GetInventory().FindFreeLocationFor( entity, FindInventoryLocationType.ATTACHMENT, il );
232 }
FindInventoryLocationType
flags for searching locations in inventory
Definition InventoryLocation.c:16
Definition Building.c:6
InventoryLocation.
Definition InventoryLocation.c:28

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

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

◆ Combine()

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

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

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

◆ EquipItem()

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

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

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

◆ GetAttachmentHeight()

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

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

◆ GetFalseHeaderTextWidget()

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

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

◆ GetFocusedItem()

EntityAI GetFocusedItem ( )
inlineprotected

◆ GetFocusedSlot()

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

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

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

◆ GetFocusedSlotsIcon()

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

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

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

◆ GetItemSlots()

array< string > GetItemSlots ( EntityAI e)
inlineprotected
563 {
568
570 int i = 0;
571 for ( int s = 0; s < searching_in.Count(); ++s )
572 {
573 string cfg_name = searching_in.Get( s );
574 string path = cfg_name + " " + e.GetType();
575
576 if ( GetGame().ConfigIsExisting( path ) )
577 {
578 GetGame().ConfigGetTextArray( path + " attachments", attachments_slots );
579 if ( e.IsWeapon() && (!e.ConfigIsExisting("DisplayMagazine") || e.ConfigGetBool("DisplayMagazine")) )
580 {
581 attachments_slots.Insert( "magazine" );
582 }
583
584 return attachments_slots;
585 }
586 }
587 if ( e.IsWeapon() && (!e.ConfigIsExisting("DisplayMagazine") || e.ConfigGetBool("DisplayMagazine")) )
588 {
589 attachments_slots.Insert( "magazine" );
590 }
591
592 return attachments_slots;
593 }
string path
Definition OptionSelectorMultistate.c:135
array< string > TStringArray
Definition EnScript.c:685
const string CFG_VEHICLESPATH
Definition constants.c:209
const string CFG_WEAPONSPATH
Definition constants.c:210
const string CFG_MAGAZINESPATH
Definition constants.c:211

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

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

◆ GetRecipeCount()

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

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

◆ GetSlotsSorted()

array< int > GetSlotsSorted ( )
inlineprotected
411 {
413 }

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

◆ GetWrapper()

AttachmentsWrapper GetWrapper ( )
inlineprotected
44 {
46 }

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

◆ InitAttachmentGrid()

void InitAttachmentGrid ( int att_row_index)
inlineprotected
458 {
460 int i;
462
464 string name = m_Entity.GetDisplayName();
465 name.ToUpper();
466
468 m_AttachmentsContainer.SetParent( this );
469 m_AttachmentsContainer.SetFalseAttachmentsHeaderText(name);
470 m_AttachmentsContainer.GetRootWidget().SetSort( att_row_index );
472
473 for ( i = 0; i < number_of_rows; i++ )
474 {
476 m_AttachmentsContainer.Insert( ic );
477
478 if( i == ( number_of_rows - 1 ) && m_AttachmentSlotNames.Count() % ITEMS_IN_ROW != 0 )
479 {
480 ic.SetColumnCount( m_AttachmentSlotNames.Count() % ITEMS_IN_ROW );
481 }
482 else
483 {
484 ic.SetColumnCount( ITEMS_IN_ROW );
485 }
486
487 for( int j = 0; j < ITEMS_IN_ROW; j++ )
488 {
489 icon = ic.GetSlotIcon( j );
490 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetMainWidget(), m_Parent, "OnDropReceivedFromHeader2" );
491 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetGhostSlot(), m_Parent, "OnDropReceivedFromHeader2" );
492 WidgetEventHandler.GetInstance().RegisterOnDropReceived( icon.GetPanelWidget(), m_Parent, "OnDropReceivedFromHeader2" );
493
494 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetMainWidget(), m_Parent, "DraggingOverHeader" );
495 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetGhostSlot(), m_Parent, "DraggingOverHeader" );
496 WidgetEventHandler.GetInstance().RegisterOnDraggingOver( icon.GetPanelWidget(), m_Parent, "DraggingOverHeader" );
497
498 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetMainWidget(), m_Parent, "MouseClick2" );
499 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetGhostSlot(), m_Parent, "MouseClick2" );
500 WidgetEventHandler.GetInstance().RegisterOnMouseButtonDown( icon.GetPanelWidget(), m_Parent, "MouseClick2" );
501 }
502 }
503
504 for ( i = 0; i < m_AttachmentSlotNames.Count(); i++ )
505 {
507 WidgetEventHandler.GetInstance().RegisterOnDoubleClick( icon.GetPanelWidget(), m_Parent, "DoubleClick" );
508
509 string path = "CfgSlots" + " Slot_" + m_AttachmentSlotNames[i];
510
511 //Show different magazine icon for firearms and pistols
512 if ( m_AttachmentSlotNames[i] == "magazine" )
513 {
514 if ( !m_Entity.IsInherited( Pistol_Base ) )
515 path = "CfgSlots" + " Slot_" + "magazine2";
516 }
517
518 string icon_name = ""; //icon_name must be in format "set:<setname> image:<imagename>"
519 if( GetGame().ConfigGetText( path + " ghostIcon", icon_name ) && icon_name != "" )
522 m_AttachmentSlots.Insert( slot_id, icon );
524
525 icon.SetSlotID(slot_id);
526 icon.SetSlotDisplayName(InventorySlots.GetSlotDisplayName(slot_id));
527
528 EntityAI item = m_Entity.GetInventory().FindAttachment( slot_id );
529 if( item )
531 else
532 icon.Clear();
533
534 if (m_Entity.CanDisplayAttachmentSlot(slot_id))
535 {
536 icon.GetMainWidget().Show( true );
537 }
538 else
539 {
540 icon.GetMainWidget().Show( false );
541 }
542 }
543
544 if( m_AttachmentSlotNames.Count() > 0 )
545 {
546 int row_index = number_of_rows - 1;
548 if( row_last )
549 {
550 for( int k = ((m_AttachmentSlotNames.Count() - 1) % ITEMS_IN_ROW) + 1; k < ITEMS_IN_ROW; k++ )
551 {
552 row_last.GetSlotIcon( k ).GetMainWidget().Show( false );
553 }
554 row_last.GetRootWidget().Update();
555 row_last.GetRootWidget().GetParent().Update();
556 }
557 }
558
559 m_AttachmentsContainer.RecomputeOpenedContainers();
560 }
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
285 {
287 if( entity )
288 {
289 m_Parent.InspectItem( entity );
290 return true;
291 }
292 return false;
293 }

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

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

◆ IsActive()

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

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

◆ IsEmpty()

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

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

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

◆ IsItemActive()

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

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

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

◆ IsItemWithQuantityActive()

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

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

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

◆ OnAttachmentReservationRelease()

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

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

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

◆ OnAttachmentReservationSet()

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

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

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

◆ Select()

bool Select ( )
inlineprotected
137 {
138 SlotsIcon selected_slot = ItemManager.GetInstance().GetSelectedIcon();
139 EntityAI selected_item = ItemManager.GetInstance().GetSelectedItem();
142 Man player = GetGame().GetPlayer();
143
144 if( focused_slot.IsReserved() || focused_item != selected_item && !(selected_slot && selected_slot.IsOutOfReach() ) )
145 {
146 if( selected_item )
147 {
148 if( selected_item.GetInventory().CanRemoveEntity() )
149 {
150 if( m_Entity.GetInventory().CanAddAttachmentEx( selected_item, focused_slot.GetSlotID() ) )
151 {
152 player.PredictiveTakeEntityToTargetAttachmentEx( m_Entity, selected_item, focused_slot.GetSlotID() );
153 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
154 return true;
155
156 }
157 else if( m_Entity.GetInventory().CanAddAttachment( selected_item ) )
158 {
159 player.PredictiveTakeEntityToTargetAttachment(m_Entity, selected_item);
160 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
161 return true;
162 }
163 }
164 }
165 else
166 {
167 if ( focused_item && !focused_slot.IsOutOfReach() )
168 {
169 EntityAI item_in_hands = GetGame().GetPlayer().GetHumanInventory().GetEntityInHands();
171 focused_item.GetInventory().GetCurrentInventoryLocation( il );
173 if( reachable && focused_item.GetInventory().CanRemoveEntity() )
174 {
175 if( item_in_hands && item_in_hands.GetInventory().CanRemoveEntity() )
176 {
178 {
179 player.PredictiveSwapEntities( item_in_hands, focused_item );
180 return true;
181 }
182 }
183 else
184 {
185 if( player.GetHumanInventory().CanAddEntityInHands( focused_item ) )
186 {
187 player.PredictiveTakeEntityToHands( focused_item );
188 return true;
189 }
190 }
191 }
192 }
193 }
194 }
195 return false;
196 }
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
117 {
120
121 if (icon && !icon.IsOutOfReach())
122 {
123 if (item && item.CanPutIntoHands(null))
124 {
125 ItemManager.GetInstance().SetSelectedItemEx(item, null, icon);
126 }
127 else
128 {
129 ItemManager.GetInstance().SetSelectedItemEx(null, null, icon);
130 }
131 return true;
132 }
133 return false;
134 }

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

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

◆ SelFirstActive()

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

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

◆ SetActive()

void SetActive ( bool active)
inlineprotected
89 {
91 }

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

◆ SetDefaultFocus()

void SetDefaultFocus ( bool while_micromanagment_mode = false)
inlineprotected
79 {
81 }

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

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

◆ SetFalseAttachmentsHeaderText()

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

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

◆ SetLastActive()

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

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

◆ ShowFalseAttachmentsHeader()

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

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

◆ SplitItem()

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

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

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

◆ TransferItem()

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

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

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

◆ TransferItemToVicinity()

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

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

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

◆ UnfocusAll()

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

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

◆ UpdateInterval()

void UpdateInterval ( )
inlineprotected
321 {
323 int slot_id;
325 int i = 0;
326 for (i = m_AttachmentSlotNames.Count() - 1; i >=0; --i)
327 {
329 if (m_Entity.CanDisplayAttachmentSlot(slot_id))
330 {
332 }
333 else
334 {
336 if (icon)
337 {
338 icon.GetMainWidget().Show( false );
339 if( GetFocusedSlotsIcon() == icon )
340 {
342 }
343 // radial icon (collabsable icon handling)
344 icon.UpdateInterval();
345 }
346 }
347
348 }
349
350 if ( m_AttachmentSlotDisplayable.Count() == 0 )
351 {
352 if (m_Parent)
353 {
355 //m_Parent.Close();
356 }
357 }
358
359 for (i = 0; i < m_AttachmentSlotDisplayable.Count(); ++i)
360 {
363 EntityAI item = icon.GetEntity();
364 icon.GetMainWidget().Show( true );
365 icon.UpdateInterval();
366 if ( item )
367 {
368 bool draggable = true;
369 if(icon.IsReserved())
370 {
371 draggable = false;
372 }
373
374 if( m_Entity.GetInventory().GetSlotLock( slot_id ) && ItemManager.GetInstance().GetDraggedItem() != item )
375 {
376 icon.GetMountedWidget().Show( true );
377 draggable = false;
378 }
379 else
380 {
381 icon.GetMountedWidget().Show( false );
382 }
383
385 bool in_hands_condition = m_Entity.GetHierarchyRoot() && item.GetInventory().CanRemoveEntity();
388 {
389 icon.GetOutOfReachWidget().Show( false );
390 }
391 else
392 {
393 icon.GetOutOfReachWidget().Show( true );
394 draggable = false;
395 }
396
397 if( draggable )
398 {
399 icon.GetPanelWidget().SetFlags( WidgetFlags.DRAGGABLE );
400 }
401 else
402 {
403 icon.GetPanelWidget().ClearFlags( WidgetFlags.DRAGGABLE );
404 }
405 }
406 }
407 m_AttachmentsContainer.GetRootWidget().Update();
408 }
void SetDefaultFocus(bool while_micromanagment_mode=false)
Definition Attachments.c:78
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_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().


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