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;
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;
11 protected string m_sPercentageText;
13 protected TextWidget m_Value;
16 protected ref array<SCR_FuelManagerComponent> m_aFuelManagers = {};
19 override bool NeedUpdate()
27 float totalFuel, totalMaxFuel, percentage;
29 SCR_FuelManagerComponent.GetTotalValuesOfFuelNodesOfFuelManagers(m_aFuelManagers, totalFuel, totalMaxFuel, percentage, m_eFuelNodeTypes, m_eIgnoreFuelNodeTypes);
32 m_wBar.SetValue(percentage);
35 m_Value.SetTextFormat(m_sPercentageText, Math.Round(percentage * 100));
41 m_Value = TextWidget.Cast(m_Widget.FindAnyWidget(
"Value"));
43 Widget barWidget = m_Widget.FindAnyWidget(
"ProgressBar");
51 if (damageManager && damageManager.GetState() ==
EDamageState.DESTROYED)
55 if (m_aFuelManagers.IsEmpty())
58 float totalFuel, totalMaxFuel, percentage;
59 SCR_FuelManagerComponent.GetTotalValuesOfFuelNodesOfFuelManagers(m_aFuelManagers, totalFuel, totalMaxFuel, percentage, m_eFuelNodeTypes, m_eIgnoreFuelNodeTypes);
61 return totalMaxFuel > 0;