5 private string m_sPercentageText;
7 [
Attribute(
"0", uiwidget: UIWidgets.ComboBox,
"Colors the bar if damage over time condition is true", enums: ParamEnumArray.FromEnum(
EDamageType))]
8 protected ref array<EDamageType> m_aDamageOverTimeConditions;
11 protected ref Color m_cHasDpsBarColor;
13 protected ref Color m_cDefaultBarColor;
15 protected TextWidget m_TextWidget;
16 protected TextWidget m_Value;
20 protected bool m_bBarIsColored;
23 override bool NeedUpdate()
31 if (m_aDamageOverTimeConditions.IsEmpty())
34 bool damageOverTime =
false;
35 foreach (
EDamageType dpsType: m_aDamageOverTimeConditions)
39 damageOverTime =
true;
44 SetBarColor(damageOverTime);
48 protected void SetBarColor(
bool SetConditionColor)
50 if (!m_Bar || m_bBarIsColored == SetConditionColor)
53 m_bBarIsColored = SetConditionColor;
56 m_Bar.SetSliderColor(m_cHasDpsBarColor);
58 m_Bar.SetSliderColor(m_cDefaultBarColor);
63 protected void SetBarAndPercentageValue(
float newValue)
66 m_Bar.SetValue(newValue);
69 m_Value.SetTextFormat(m_sPercentageText, Math.Round(newValue * 100));
79 m_Value = TextWidget.Cast(m_Widget.FindAnyWidget(
"Value"));
81 Widget barWidget = m_Widget.FindAnyWidget(
"ProgressBar");
88 m_cDefaultBarColor = m_Bar.m_SliderColor;