Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AnalogGauge360.c
Go to the documentation of this file.
1 // Signal based analog gauge, used for 360 deg dials, supports up to 2 needles - standard size
3 {
4  [Attribute("", UIWidgets.EditBox, "Gauge custom needle texture. If not selected, default is used.")]
5  protected string m_sCustomNeedle2;
6 
7  protected ImageWidget m_wNeedle2;
8  protected ImageWidget m_wNeedle2Shadow;
9 
10  override void CreateGauge(IEntity owner, out bool bSuccess)
11  {
12  super.CreateGauge(owner, bSuccess);
13 
14  // Gauge 2nd needle
15  m_wNeedle2 = ImageWidget.Cast(m_wRoot.FindAnyWidget("Needle2"));
16  m_wNeedle2Shadow = ImageWidget.Cast(m_wRoot.FindAnyWidget("Needle2Shadow"));
17  bSuccess = CreateGaugeNeedle(owner, m_wNeedle2, m_wNeedle2Shadow, m_sCustomNeedle2);
18 
19  if (!bSuccess)
20  return;
21  }
22 
23  override void UpdateGauge(IEntity owner, float timeSlice, float value)
24  {
25  // Get unclamped percentage value of the gauge range
26  float fValuePerc = (value - m_fValueMin) / m_fValueRange;
27 
28  UpdateGaugeNeedle(owner, timeSlice, m_wNeedle, m_wNeedleShadow, fValuePerc, 1, false);
29  UpdateGaugeNeedle(owner, timeSlice, m_wNeedle2, m_wNeedle2Shadow, fValuePerc, 0.1, false);
30  }
31 };
SCR_AnalogGauge
Definition: SCR_AnalogGauge.c:2
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_AnalogGauge360
Definition: SCR_AnalogGauge360.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.