Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VONEntryComponent.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
2 // Attached to layout used for radial menu VON entries
4 {
5  protected ImageWidget m_wPowerIcon;
6  protected ImageWidget m_wActiveIcon;
7  protected TextWidget m_wTransceiverText;
8  protected TextWidget m_wFrequencyText;
9  protected TextWidget m_wChannelText;
10 
11  //------------------------------------------------------------------------------------------------
12  void SetPowerIcon(bool state)
13  {
14  if (state)
15  m_wPowerIcon.SetColor(Color.FromInt(Color.GREEN));
16  else
17  m_wPowerIcon.SetColor(Color.FromInt(Color.GRAY));
18  }
19 
20  //------------------------------------------------------------------------------------------------
21  void SetActiveIcon(bool state)
22  {
23  if (state)
24  m_wActiveIcon.SetOpacity(1);
25  else
26  m_wActiveIcon.SetOpacity(0);
27  }
28 
29  //------------------------------------------------------------------------------------------------
30  void SetTransceiverText(string text)
31  {
32  m_wTransceiverText.SetText(text);
33  }
34 
35  //------------------------------------------------------------------------------------------------
36  void SetTransceiverOpacity(float alpha)
37  {
38  m_wTransceiverText.SetOpacity(alpha);
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  void SetFrequencyText(string text)
43  {
44  m_wFrequencyText.SetText(text);
45  }
46 
47  //------------------------------------------------------------------------------------------------
48  void SetFrequencyColor(Color color)
49  {
50  m_wFrequencyText.SetColor(color);
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  void SetChannelText(string text)
55  {
56  if (text == string.Empty)
57  {
58  m_wChannelText.SetOpacity(0);
59  }
60  else
61  {
62  m_wChannelText.SetText(text);
63  m_wChannelText.SetOpacity(1);
64  }
65  }
66 
67  //------------------------------------------------------------------------------------------------
68  override void HandlerAttached(Widget w)
69  {
70  super.HandlerAttached(w);
71 
72  m_wPowerIcon = ImageWidget.Cast(m_wRoot.FindAnyWidget("PowerIcon"));
73  m_wActiveIcon = ImageWidget.Cast(m_wRoot.FindAnyWidget("ActiveIcon"));
74  m_wTransceiverText = TextWidget.Cast(m_wRoot.FindAnyWidget("TransceiverText"));
75  m_wFrequencyText = TextWidget.Cast(m_wRoot.FindAnyWidget("FrequencyText"));
76  m_wChannelText = TextWidget.Cast(m_wRoot.FindAnyWidget("ChannelText"));
77  }
78 };
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_VONEntryComponent
Definition: SCR_VONEntryComponent.c:3
SCR_SelectionMenuEntryComponent
Definition: SCR_SelectionMenuEntryComponent.c:6