Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ImageGalleryButtonComponent.c
Go to the documentation of this file.
1 
3 {
4 
5  [Attribute(defvalue: "", uiwidget: UIWidgets.ResourcePickerThumbnail, desc: "Image for the gallery", "edds imageset")]
6  private ResourceName m_Texture;
7 
8  ref ScriptInvoker m_OnClicked = new ScriptInvoker();
9  Widget m_wSizeContent;
10  ImageWidget m_Picture;
11  ImageWidget m_SelectedBar;
12  string m_sPictureString = string.Empty;
13 
14  //------------------------------------------------------------------------------------------------
15  override void HandlerAttached(Widget w)
16  {
17  super.HandlerAttached(w);
18  m_Picture = ImageWidget.Cast(m_wRoot.FindAnyWidget("Picture"));
19  m_SelectedBar = ImageWidget.Cast(m_wRoot.FindAnyWidget("SelectedBar"));
20  m_wSizeContent = m_wRoot.FindAnyWidget("TileOverlay");
21  }
22 
23  //------------------------------------------------------------------------------------------------
24  override bool OnClick(Widget w, int x, int y, int button)
25  {
26  super.OnClick(w, x, y, button);
27  if (button != 0)
28  return false;
29 
30  m_OnClicked.Invoke(this);
31  return false;
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  void SetImage(ResourceName name)
36  {
37  m_Texture = name;
38  m_Picture.LoadImageTexture(0, m_Texture.GetPath());
39  //m_Picture.SetImageTexture()
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  string GetImage()
44  {
45 
46  return m_Texture;
47  }
48 
49  //------------------------------------------------------------------------------------------------
50  void Select()
51  {
52  //m_SelectedBar.SetVisible(true);
53  m_wRoot.SetColor(Color.FromInt(Color.WHITE));
54  float padding[4] = {4, 4, 4, 4};
55  AnimateWidget.Padding(m_wSizeContent, padding, 10);
56  //m_wRoot.SetZOrder(1000);
57  }
58 
59  //------------------------------------------------------------------------------------------------
60  void Deselect()
61  {
62  //m_SelectedBar.SetVisible(false);
63 
64  float padding[4] = {0, 0, 0, 0};
65  AnimateWidget.Padding(m_wSizeContent, padding, 10);
66  //m_wRoot.SetZOrder(1000);
67  }
68 };
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_WLibComponentBase
Base class for all final Reforger interactive elements.
Definition: SCR_WLibComponentBase.c:4
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_OnClicked
ref ScriptInvoker m_OnClicked
Definition: SCR_ModularButtonComponent.c:60