Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AnalogGaugeUni.c
Go to the documentation of this file.
1 // Signal based analog gauge, used for re-fuel mechanic prototype - shows delta between initial state (when displayed) and current state
3 {
4  [Attribute("0", UIWidgets.CheckBox, "Show difference of value")]
5  protected bool m_bShowValueDiff;
6 
7  private TextWidget m_wInfoText2;
8 
9  private IEntity m_Owner;
10  private bool m_bGaugeShown;
11  private float m_fLastValue = 0.0;
12 
13  bool IsGaugeShown()
14  {
15  return m_bGaugeShown;
16  };
17 
18  void EnableHUD( bool enable )
19  {
20  if( enable )
21  {
23  m_bGaugeShown = true;
24  }
25  else
26  {
28  m_bGaugeShown = false;
29  }
30  }
31 
32  //------------------------------------------------------------------------------------------------
33  override void CreateGauge(IEntity owner, out bool bSuccess)
34  {
35  super.CreateGauge( owner, bSuccess);
36 
37  m_wInfoText2 = TextWidget.Cast(m_wRoot.FindAnyWidget("InfoText2"));
38  m_wInfoText2.SetVisible(true);
39  m_wInfoText2.SetText("0");
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  override void UpdateGauge(IEntity owner, float timeSlice, float value)
44  {
45  super.UpdateGauge(owner, timeSlice, value);
46 
47  if (m_fLastValue == 0)
48  m_fLastValue = value;
49 
50  value = Math.Round(m_fLastValue - value);
51  m_wInfoText2.SetText(value.ToString());
52  }
53 };
SCR_AnalogGauge
Definition: SCR_AnalogGauge.c:2
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
DisplayStartDraw
protected void DisplayStartDraw(IEntity owner)
Definition: SCR_VonDisplay.c:730
SCR_AnalogGaugeUni
Definition: SCR_AnalogGaugeUni.c:2
DisplayStopDraw
protected void DisplayStopDraw(IEntity owner)
Definition: SCR_VonDisplay.c:752
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_Owner
SCR_AIGroupUtilityComponentClass m_Owner