Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DpsConditionBarBaseTooltipDetail.c
Go to the documentation of this file.
3{
4 [Attribute("#AR-ValueUnit_Percentage")]
5 private string m_sPercentageText;
6
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;
9
10 [Attribute()]
11 protected ref Color m_cHasDpsBarColor;
12
14
19
20 protected bool m_bBarIsColored;
21
22 //------------------------------------------------------------------------------------------------
23 override bool NeedUpdate()
24 {
25 return m_DamageManager != null;
26 }
27
28 //------------------------------------------------------------------------------------------------
30 {
31 if (m_aDamageOverTimeConditions.IsEmpty())
32 return;
33
34 bool damageOverTime = false;
36 {
37 if (m_DamageManager.IsDamagedOverTime(dpsType))
38 {
39 damageOverTime = true;
40 break;
41 }
42 }
43
44 SetBarColor(damageOverTime);
45 }
46
47 //------------------------------------------------------------------------------------------------
48 protected void SetBarColor(bool SetConditionColor)
49 {
50 if (!m_Bar || m_bBarIsColored == SetConditionColor)
51 return;
52
53 m_bBarIsColored = SetConditionColor;
54
56 m_Bar.SetSliderColor(m_cHasDpsBarColor);
57 else
58 m_Bar.SetSliderColor(m_cDefaultBarColor);
59
60 }
61
62 //------------------------------------------------------------------------------------------------
63 protected void SetBarAndPercentageValue(float newValue)
64 {
65 if (m_Bar)
66 m_Bar.SetValue(newValue);
67
68 if (m_Value)
69 m_Value.SetTextFormat(m_sPercentageText, Math.Round(newValue * 100));
70 }
71
72 //------------------------------------------------------------------------------------------------
73 override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
74 {
75 m_DamageManager = DamageManagerComponent.Cast(entity.GetOwner().FindComponent(DamageManagerComponent));
76 if (!m_DamageManager)
77 return false;
78
79 m_Value = TextWidget.Cast(m_Widget.FindAnyWidget("Value"));
80
81 Widget barWidget = m_Widget.FindAnyWidget("ProgressBar");
82 if (barWidget)
84
85 if (!m_Value && !m_Bar)
86 return false;
87
88 m_cDefaultBarColor = m_Bar.m_SliderColor;
89
90 return true;
91 }
92}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
Definition Color.c:13
Definition Math.c:13
override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
override void UpdateDetail(SCR_EditableEntityComponent entity)
Minimalist progress bar.
SCR_FieldOfViewSettings Attribute
EDamageType
Definition EDamageType.c:13