Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditorAttributeHolderUIComponent.c
Go to the documentation of this file.
1 class SCR_EditorAttributeHolderUIComponent: ScriptedWidgetComponent
2 {
3  [Attribute("AttributeHolder")]
4  protected string m_sAttributeHolderName;
5 
6  [Attribute("TickboxHolder")]
7  protected string m_sTickBoxAttributeName;
8  [Attribute("GamePadLockedSelector")]
9  protected string m_sGamePadLockedSelectorName;
10 
11  [Attribute("HintWidget")]
12  protected string m_sAttributeHintName;
13  [Attribute("HintText")]
14  protected string m_sAttributeHintTextName;
15 
16  protected Widget m_wAttributeHolder;
17  protected SCR_AttributeTickboxUIComponent m_TickBoxAttribute;
18  protected Widget m_GamePadLockedSelector;
19  protected Widget m_wAttributeHint;
20  protected RichTextWidget m_wAttributeHintText;
21 
22  protected SCR_BaseEditorAttributeUIComponent m_AttributeComponent;
23 
24  //============================ GETTERS ============================\\
25  Widget GetAttributeHolder()
26  {
27  return m_wAttributeHolder;
28  }
29 
30  //============================ SETTERS ============================\\
31  void SetAttributeReference(SCR_BaseEditorAttributeUIComponent attribute)
32  {
33  m_AttributeComponent = attribute;
34  }
35 
36  void SetHintText(string hint)
37  {
38  m_wAttributeHintText.SetText(hint);
39  }
40 
41  void ShowHintText(bool show)
42  {
43  m_wAttributeHint.SetVisible(show);
44  }
45 
46  //============================ FOCUS ============================\\
47  //If Disabled attribute is focused or not with gamepad
48  protected void GamePadLockedSelectorFocusChanged(bool newFocus)
49  {
50  if (!m_AttributeComponent.GetAttribute().GetHasConflictingValues())
51  return;
52 
53  if (newFocus)
54  m_AttributeComponent.GetOnAttributeUIFocusChanged().Invoke(m_AttributeComponent);
55  else
56  m_AttributeComponent.GetOnAttributeUIFocusChanged().Invoke(null);
57  }
58 
59 
60  //============================ HANDLER ATTACHED ============================\\
61  override protected void HandlerAttached(Widget w)
62  {
63  m_wAttributeHolder = w.FindAnyWidget(m_sAttributeHolderName);
64 
65  Widget tickbox = w.FindAnyWidget(m_sTickBoxAttributeName);
66  m_TickBoxAttribute = SCR_AttributeTickboxUIComponent.Cast(tickbox.FindHandler(SCR_AttributeTickboxUIComponent));
67 
68  m_GamePadLockedSelector = w.FindAnyWidget(m_sGamePadLockedSelectorName);
69 
70  if (m_GamePadLockedSelector)
71  {
72  SCR_OnFocusUIComponent focusComponent = SCR_OnFocusUIComponent.Cast(m_GamePadLockedSelector.FindHandler(SCR_OnFocusUIComponent));
73 
74  if (focusComponent)
75  focusComponent.GetOnFocusChanged().Insert(GamePadLockedSelectorFocusChanged);
76  }
77 
78  m_wAttributeHint = w.FindAnyWidget(m_sAttributeHintName);
79  if (!m_wAttributeHint)
80  return;
81 
82  m_wAttributeHintText = RichTextWidget.Cast(m_wAttributeHint.FindAnyWidget(m_sAttributeHintTextName));
83  }
84 
85 
86 };
SCR_OnFocusUIComponent
Definition: SCR_OnFocusUIComponent.c:5
SCR_EditorAttributeHolderUIComponent
Definition: SCR_EditorAttributeHolderUIComponent.c:1
SCR_AttributeTickboxUIComponent
Using a controller will show/hide the Select button hint if the attribute with this script is focused...
Definition: SCR_AttributeTickboxUIComponent.c:4
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_BaseEditorAttributeUIComponent
Definition: SCR_BaseEditorAttributeUIComponent.c:3