Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FuelTooltipDetail.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "If any of these are set and none of the Ignore are then it is used to display the fuel tooltip. (Leave empty to get all and none SCR_FuelNodes are always displayed)", uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(SCR_EFuelNodeTypeFlag))]
5 protected SCR_EFuelNodeTypeFlag m_eFuelNodeTypes;
6
7 [Attribute(desc: "If any of these are present then the fuel node is ignored (Leave empty to ignore none and none SCR_FuelNodes are always displayed) ", uiwidget: UIWidgets.Flags, enums: ParamEnumArray.FromEnum(SCR_EFuelNodeTypeFlag))]
8 protected SCR_EFuelNodeTypeFlag m_eIgnoreFuelNodeTypes;
9
10 [Attribute("#AR-ValueUnit_Percentage")]
11 protected string m_sPercentageText;
12
15
16 protected ref array<SCR_FuelManagerComponent> m_aFuelManagers = {};
17
18 //------------------------------------------------------------------------------------------------
19 override bool NeedUpdate()
20 {
21 return true;
22 }
23
24 //------------------------------------------------------------------------------------------------
26 {
27 float totalFuel, totalMaxFuel, percentage;
28
29 SCR_FuelManagerComponent.GetTotalValuesOfFuelNodesOfFuelManagers(m_aFuelManagers, totalFuel, totalMaxFuel, percentage, m_eFuelNodeTypes, m_eIgnoreFuelNodeTypes);
30
31 if (m_wBar)
32 m_wBar.SetValue(percentage);
33
34 if (m_Value)
35 m_Value.SetTextFormat(m_sPercentageText, Math.Round(percentage * 100));
36 }
37
38 //------------------------------------------------------------------------------------------------
39 override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
40 {
41 m_Value = TextWidget.Cast(m_Widget.FindAnyWidget("Value"));
42
43 Widget barWidget = m_Widget.FindAnyWidget("ProgressBar");
44 if (barWidget)
46
47 if (!m_Value && !m_wBar)
48 return false;
49
50 DamageManagerComponent damageManager = DamageManagerComponent.Cast(entity.GetOwner().FindComponent(DamageManagerComponent));
51 if (damageManager && damageManager.GetState() == EDamageState.DESTROYED)
52 return false;
53
54 SCR_FuelManagerComponent.GetAllFuelManagers(entity.GetOwner(), m_aFuelManagers);
55 if (m_aFuelManagers.IsEmpty())
56 return false;
57
58 float totalFuel, totalMaxFuel, percentage;
59 SCR_FuelManagerComponent.GetTotalValuesOfFuelNodesOfFuelManagers(m_aFuelManagers, totalFuel, totalMaxFuel, percentage, m_eFuelNodeTypes, m_eIgnoreFuelNodeTypes);
60
61 return totalMaxFuel > 0;
62 }
63}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_FuelManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Math.c:13
SCR_EFuelNodeTypeFlag m_eIgnoreFuelNodeTypes
SCR_WLibProgressBarComponent m_wBar
ref array< SCR_FuelManagerComponent > m_aFuelManagers
override void UpdateDetail(SCR_EditableEntityComponent entity)
override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
SCR_EFuelNodeTypeFlag m_eFuelNodeTypes
Minimalist progress bar.
SCR_FieldOfViewSettings Attribute
EDamageState