Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DeployableHintUIInfo.c
Go to the documentation of this file.
1[BaseContainerProps(configRoot: true)]
2class SCR_DeployableHintUIInfo : SCR_InventoryItemHintUIInfo
3{
4 [Attribute(defvalue: "0", desc: "Id of a variant for which this hint should fetch the list of required items", params: "0 inf")]
5 protected int m_iVariantId;
6
7 [Attribute(defvalue: "0", desc: "Never show this hint")]
8 protected bool m_bHide;
9
10 //------------------------------------------------------------------------------------------------
11 override bool CanBeShown(InventoryItemComponent item, SCR_InventorySlotUI focusedSlot)
12 {
13 return !m_bHide && super.CanBeShown(item, focusedSlot);
14 }
15
16 //------------------------------------------------------------------------------------------------
17 override bool SetItemHintNameTo(InventoryItemComponent item, TextWidget textWidget)
18 {
19 if (!textWidget)
20 return false;
21
22 textWidget.SetTextWrapping(false);
23 return super.SetItemHintNameTo(item, textWidget);
24 }
25
26 //------------------------------------------------------------------------------------------------
28 {
29 IEntity owner = item.GetOwner();
30 SCR_MultiPartDeployableItemComponent deployableComp = SCR_MultiPartDeployableItemComponent.Cast(owner.FindComponent(SCR_MultiPartDeployableItemComponent));
31 if (!deployableComp)
32 return string.Empty;
33
35 if (!data)
36 return string.Empty;
37
38 SCR_DeployableVariantContainer container = data.GetVariantContainer(m_iVariantId);
39 if (!container)
40 string.Empty;
41
42 array<ref SCR_RequiredDeployablePart> requirements = container.GetRequiredElementsRaw();
43 if (!requirements || requirements.IsEmpty())
44 return string.Empty;
45
46 int numberOfParts;
47 string element;
48 foreach(int i, SCR_RequiredDeployablePart partReq : requirements)
49 {
50 element += UIConstants.RICH_TEXT_LINE_BREAK + UIConstants.RICH_TEXT_LIST_POINT + " " + partReq.GetPartName();
51 numberOfParts = partReq.GetNumberOfRequiredPrefabs();
52 if (numberOfParts > 1)
53 element += WidgetManager.Translate(" " + UIConstants.VALUE_MUTLIPLIER_SHORT, numberOfParts.ToString());
54 }
55
56 return WidgetManager.Translate(GetName(), GetDescription(), element);
57 }
58}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
override bool SetItemHintNameTo(InventoryItemComponent item, TextWidget textWidget)
override string GetItemHintName(InventoryItemComponent item)
override bool CanBeShown(InventoryItemComponent item, SCR_InventorySlotUI focusedSlot)
array< ref SCR_RequiredDeployablePart > GetRequiredElementsRaw()
Returns pointer to a shared array of requirements.
SCR_FieldOfViewSettings Attribute