Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CoreMenuHeaderComponent.c
Go to the documentation of this file.
1 /*
2 Component for menu headers, assumes the layout includes a text widget named "Title".
3 */
4 
5 //------------------------------------------------------------------------------------------------
7 {
8  [Attribute("Title", desc: "Title of the menu")]
9  protected string m_sTitle;
10 
11  protected TextWidget m_wTitle;
12 
13  //------------------------------------------------------------------------------------------------
14  override void HandlerAttached(Widget w)
15  {
16  super.HandlerAttached(w);
17 
18  m_wTitle = TextWidget.Cast(w.FindAnyWidget("Title"));
19  SetTitle(m_sTitle);
20  }
21 
22  //------------------------------------------------------------------------------------------------
23  void SetTitle(string text)
24  {
25  if (m_wTitle)
26  m_wTitle.SetText(text);
27  }
28 
29  //------------------------------------------------------------------------------------------------
30  static SCR_CoreMenuHeaderComponent FindComponentInHierarchy(notnull Widget root)
31  {
33 
34  ScriptedWidgetEventHandler handler = SCR_WidgetTools.FindHandlerInChildren(root, SCR_CoreMenuHeaderComponent);
35  if (handler)
36  comp = SCR_CoreMenuHeaderComponent.Cast(handler);
37 
38  return comp;
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  static SCR_CoreMenuHeaderComponent FindComponent(notnull Widget w)
43  {
44  return SCR_CoreMenuHeaderComponent.Cast(w.FindHandler(SCR_CoreMenuHeaderComponent));
45  }
46 }
SCR_WidgetTools
Definition: SCR_WidgetTools.c:1
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ScriptedWidgetComponent
Definition: SCR_ScriptedWidgetComponent.c:7
SCR_CoreMenuHeaderComponent
Definition: SCR_CoreMenuHeaderComponent.c:6