Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ButtonEffectImage.c
Go to the documentation of this file.
1 [BaseContainerProps(configRoot : true), SCR_ButtonEffectTitleAttribute("Image", "m_sWidgetName")]
3 class SCR_ButtonEffectImage : SCR_ButtonEffectWidgetBase
4 {
5  [Attribute("", UIWidgets.ResourceNamePicker, "Common image set", "imageset")]
6  ResourceName m_ImageSet;
7 
8  [Attribute()]
9  ref SCR_ButtonEffectImage_ImageOrImageSet m_Default;
10 
11  [Attribute()]
12  ref SCR_ButtonEffectImage_ImageOrImageSet m_Hovered;
13 
14  [Attribute()]
15  ref SCR_ButtonEffectImage_ImageOrImageSet m_Activated;
16 
17  [Attribute()]
18  ref SCR_ButtonEffectImage_ImageOrImageSet m_ActivatedHovered;
19 
20  [Attribute()]
21  ref SCR_ButtonEffectImage_ImageOrImageSet m_Disabled;
22 
23  [Attribute()]
24  ref SCR_ButtonEffectImage_ImageOrImageSet m_DisabledActivated;
25 
26  [Attribute()]
27  ref SCR_ButtonEffectImage_ImageOrImageSet m_FocusGained;
28 
29  [Attribute()]
30  ref SCR_ButtonEffectImage_ImageOrImageSet m_FocusLost;
31 
32  [Attribute()]
33  ref SCR_ButtonEffectImage_ImageOrImageSet m_ToggledOn;
34 
35  [Attribute()]
36  ref SCR_ButtonEffectImage_ImageOrImageSet m_ToggledOff;
37 
38  //-------------------------------------------------------------------------------------------
39  override void OnStateDefault(bool instant)
40  {
41  Apply(m_Default);
42  }
43 
44  //-------------------------------------------------------------------------------------------
45  override void OnStateHovered(bool instant)
46  {
47  Apply(m_Hovered);
48  }
49 
50  //-------------------------------------------------------------------------------------------
51  override void OnStateActivated(bool instant)
52  {
53  Apply(m_Activated);
54  }
55 
56  //-------------------------------------------------------------------------------------------
57  override void OnStateActivatedHovered(bool instant)
58  {
59  Apply(m_ActivatedHovered);
60  }
61 
62  //-------------------------------------------------------------------------------------------
63  override void OnStateDisabled(bool instant)
64  {
65  Apply(m_Disabled);
66  }
67 
68  //-------------------------------------------------------------------------------------------
69  override void OnStateDisabledActivated(bool instant)
70  {
71  Apply(m_DisabledActivated);
72  }
73 
74  //-------------------------------------------------------------------------------------------
75  override void OnFocusGained(bool instant)
76  {
77  Apply(m_FocusGained);
78  }
79 
80  //-------------------------------------------------------------------------------------------
81  override void OnFocusLost(bool instant)
82  {
83  Apply(m_FocusLost);
84  }
85 
86  //-------------------------------------------------------------------------------------------
87  override void OnToggledOn(bool instant)
88  {
89  Apply(m_ToggledOn);
90  }
91 
92  //-------------------------------------------------------------------------------------------
93  override void OnToggledOff(bool instant)
94  {
95  Apply(m_ToggledOff);
96  }
97 
98  //-------------------------------------------------------------------------------------------
99  protected void Apply(SCR_ButtonEffectImage_ImageOrImageSet imgSpec)
100  {
101  ImageWidget w = ImageWidget.Cast(m_wTarget);
102 
103  if (!w || !imgSpec)
104  return;
105 
106  if (!imgSpec.m_ImageName.IsEmpty() && !imgSpec.m_ImageOrImageSet.IsEmpty())
107  w.LoadImageFromSet(0, imgSpec.m_ImageOrImageSet, imgSpec.m_ImageName);
108  else if (!imgSpec.m_ImageName.IsEmpty() && !m_ImageSet.IsEmpty())
109  w.LoadImageFromSet(0, m_ImageSet, imgSpec.m_ImageName);
110  else if (!imgSpec.m_ImageName.IsEmpty())
111  w.LoadImageTexture(0, imgSpec.m_ImageOrImageSet);
112  }
113 }
114 
116 class SCR_ButtonEffectImage_ImageOrImageSet
117 {
118  [Attribute()]
119  ResourceName m_ImageOrImageSet;
120 
121  [Attribute()]
122  string m_ImageName;
123 
124  //------------------------------------------------------------------------------------------------
125  // constructor
128  void SCR_ButtonEffectImage_ImageOrImageSet(ResourceName resource = string.Empty, string imageName = string.Empty)
129  {
130  if (!resource.IsEmpty())
131  m_ImageOrImageSet = resource;
132 
133  if (!imageName.IsEmpty())
134  m_ImageName = imageName;
135  }
136 }
m_DisabledActivated
ref SCR_ButtonEffectImage_ImageOrImageSet m_DisabledActivated
Definition: SCR_ButtonEffectImage.c:21
m_ImageSet
ResourceName m_ImageSet
Definition: SCR_ButtonEffectImage.c:3
m_Disabled
ref SCR_ButtonEffectImage_ImageOrImageSet m_Disabled
Definition: SCR_ButtonEffectImage.c:18
m_ActivatedHovered
ref SCR_ButtonEffectImage_ImageOrImageSet m_ActivatedHovered
Definition: SCR_ButtonEffectImage.c:15
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_ToggledOff
ref SCR_ButtonEffectImage_ImageOrImageSet m_ToggledOff
Definition: SCR_ButtonEffectImage.c:33
m_FocusLost
ref SCR_ButtonEffectImage_ImageOrImageSet m_FocusLost
Definition: SCR_ButtonEffectImage.c:27
m_FocusGained
ref SCR_ButtonEffectImage_ImageOrImageSet m_FocusGained
Definition: SCR_ButtonEffectImage.c:24
BaseContainerProps
SCR_ButtonEffectImage SCR_ButtonEffectWidgetBase BaseContainerProps()] class SCR_ButtonEffectImage_ImageOrImageSet
Definition: SCR_ButtonEffectImage.c:115
m_Activated
ref SCR_ButtonEffectImage_ImageOrImageSet m_Activated
Definition: SCR_ButtonEffectImage.c:12
m_Default
ref SCR_ButtonEffectImage_ImageOrImageSet m_Default
Definition: SCR_ButtonEffectImage.c:6
SCR_ButtonEffectImage
This effect modifies texture of an image.
Definition: SCR_ButtonEffectImage.c:3
m_Hovered
ref SCR_ButtonEffectImage_ImageOrImageSet m_Hovered
Definition: SCR_ButtonEffectImage.c:9
m_ToggledOn
ref SCR_ButtonEffectImage_ImageOrImageSet m_ToggledOn
Definition: SCR_ButtonEffectImage.c:30