Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ArsenalItemListConfig.c
Go to the documentation of this file.
1[BaseContainerProps(configRoot:true)]
3{
4 [Attribute("", UIWidgets.Object)]
5 protected ref array<ref SCR_ArsenalItemStandalone> m_aArsenalItems;
6
8
9 //------------------------------------------------------------------------------------------------
12 bool GetArsenalItems(out array<ref SCR_ArsenalItemStandalone> arsenalItems)
13 {
14 arsenalItems = m_aArsenalItems;
15 return arsenalItems != null && !arsenalItems.IsEmpty();
16 }
17
18 //------------------------------------------------------------------------------------------------
24 {
26 return false;
27
28 for (int i = 0, count = m_aArsenalItems.Count(); i < count; i++)
29 {
31 if (item.GetItemResourceName() == prefab)
32 {
33 itemType = item.GetItemType();
34 itemMode = item.GetItemMode();
35 return true;
36 }
37 }
38 return false;
39 }
40
41 //------------------------------------------------------------------------------------------------
49 array<SCR_ArsenalItem> GetFilteredArsenalItems(SCR_EArsenalItemType typeFilter, SCR_EArsenalItemMode modeFilter, EArsenalItemDisplayType requiresDisplayType = -1, SCR_Faction checkFaction = null)
50 {
51 array<SCR_ArsenalItem> filteredItems = new array<SCR_ArsenalItem>();
52
53 array<SCR_ArsenalItem> itemsByType = m_mArsenalItemsByType.Get(typeFilter);
54 if (!itemsByType)
55 {
56 itemsByType = new array<SCR_ArsenalItem>();
57 array<ref SCR_ArsenalItemStandalone> availableArsenalItems;
58 if (GetArsenalItems(availableArsenalItems))
59 {
60 for (int i = 0, count = availableArsenalItems.Count(); i < count; i++)
61 {
62 //~ Ignore if no required display data
63 if (requiresDisplayType != -1 && !availableArsenalItems[i].GetDisplayDataOfType(requiresDisplayType))
64 continue;
65
66 if (availableArsenalItems[i].GetItemType() & typeFilter)
67 {
68 itemsByType.Insert(availableArsenalItems[i]);
69 }
70 }
71
72 m_mArsenalItemsByType.Insert(typeFilter, itemsByType);
73 }
74 }
75
76 //~ Get the catalog if a faction is given
77 SCR_EntityCatalog catalog;
78 if (checkFaction)
79 catalog = checkFaction.GetFactionEntityCatalogOfType(EEntityCatalogType.ITEM, false);
80
81 foreach (SCR_ArsenalItem item : itemsByType)
82 {
83 if (item.GetItemMode() & modeFilter)
84 {
85 //~ Check if item is part of faction
86 if (catalog && !catalog.GetEntryWithPrefab(item.GetItemResourceName()))
87 continue;
88
89 filteredItems.Insert(item);
90 }
91 }
92
93 return filteredItems;
94 }
95
96 //------------------------------------------------------------------------------------------------
101 {
102 for (int i = 0, count = m_aArsenalItems.Count(); i < count; i++)
103 {
105 if (item.GetItemResourceName() == prefab)
106 {
107 itemMode = item.GetItemMode();
108 return true;
109 }
110 }
111 return false;
112 }
113
114 //------------------------------------------------------------------------------------------------
118 bool GetUseMilitarySupplyAllocationForPrefab(ResourceName prefab, out SCR_EArsenalItemType itemUseMilitarySupplyAllocation)
119 {
120 for (int i = 0, count = m_aArsenalItems.Count(); i < count; i++)
121 {
123 if (item.GetItemResourceName() == prefab)
124 {
125 itemUseMilitarySupplyAllocation = item.GetUseMilitarySupplyAllocation();
126 return true;
127 }
128 }
129
130 return false;
131 }
132}
EEntityCatalogType
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_ArsenalItemDisplayData GetDisplayDataOfType(EArsenalItemDisplayType displayType)
SCR_EArsenalItemType GetItemType()
SCR_EArsenalItemMode
SCR_EArsenalItemType
SCR_EArsenalItemType GetItemType()
bool GetUseMilitarySupplyAllocation()
ResourceName GetItemResourceName()
SCR_EArsenalItemMode GetItemMode()
bool GetArsenalItems(out array< ref SCR_ArsenalItemStandalone > arsenalItems)
array< SCR_ArsenalItem > GetFilteredArsenalItems(SCR_EArsenalItemType typeFilter, SCR_EArsenalItemMode modeFilter, EArsenalItemDisplayType requiresDisplayType=-1, SCR_Faction checkFaction=null)
bool GetUseMilitarySupplyAllocationForPrefab(ResourceName prefab, out SCR_EArsenalItemType itemUseMilitarySupplyAllocation)
bool GetItemModeForPrefab(ResourceName prefab, out SCR_EArsenalItemType itemMode)
bool GetItemTypeAndModeForPrefab(ResourceName prefab, out SCR_EArsenalItemType itemType, out SCR_EArsenalItemMode itemMode)
ref array< ref SCR_ArsenalItemStandalone > m_aArsenalItems
ref map< SCR_EArsenalItemType, ref array< SCR_ArsenalItem > > m_mArsenalItemsByType
SCR_EntityCatalogEntry GetEntryWithPrefab(ResourceName prefabToFind)
static bool IsEmptyOrWhiteSpace(string input)
Definition Types.c:486
SCR_FieldOfViewSettings Attribute