Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_HintInfoDisplay.c
Go to the documentation of this file.
1 class SCR_HintInfoDisplay : SCR_InfoDisplayExtended
3 {
4  [Attribute(desc: "Name of the widget to which the SCR_HintUIComponent is attached")]
5  protected string m_sHintComponentWidget;
6 
7  protected SCR_HintUIComponent m_HintComponent;
8  protected SCR_InfoDisplaySlotHandler m_SlotHandler;
9  protected SCR_HUDSlotUIComponent m_HUDSlotComponent;
10 
11  //------------------------------------------------------------------------------------------------
12  override void DisplayStartDraw(IEntity owner)
13  {
14  if (!m_wRoot)
15  return;
16 
17  Widget hintWidget = m_wRoot.FindAnyWidget(m_sHintComponentWidget);
18 
19  if (!hintWidget)
20  return;
21 
22  m_HintComponent = SCR_HintUIComponent.Cast(hintWidget.FindHandler(SCR_HintUIComponent));
23  if (!m_HintComponent)
24  return;
25 
27  if (!m_SlotHandler)
28  return;
29 
31  Show(false);
32 
33  m_HUDSlotComponent = m_SlotHandler.GetSlotUIComponent();
34  if (!m_HUDSlotComponent)
35  return;
36 
37  m_HintComponent.GetOnHintShown().Insert(OnHintShown);
38  m_HUDSlotComponent.GetOnResize().Insert(OnSlotUIResize);
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  override void DisplayStopDraw(IEntity owner)
43  {
44  if (m_HUDSlotComponent)
45  m_HUDSlotComponent.GetOnResize().Remove(OnSlotUIResize);
46 
47  if (m_HintComponent)
48  m_HintComponent.GetOnHintShown().Remove(OnHintShown);
49  }
50 
51  //------------------------------------------------------------------------------------------------
52  override void DisplayUpdate(IEntity owner, float timeSlice)
53  {
54  //Check if the SlotUIComponent is still valid otherwise change to the new one
55  if (m_HUDSlotComponent != m_SlotHandler.GetSlotUIComponent())
56  {
57  if (m_HUDSlotComponent)
58  m_HUDSlotComponent.GetOnResize().Remove(OnSlotUIResize);
59 
60  m_HUDSlotComponent = m_SlotHandler.GetSlotUIComponent();
61  if (!m_HUDSlotComponent)
62  return;
63 
64  m_HUDSlotComponent.GetOnResize().Insert(OnSlotUIResize);
65  }
66  }
67 
68  //------------------------------------------------------------------------------------------------
70  protected void OnHintShown(bool isShown)
71  {
72  Show(isShown);
73  }
74 
75  //------------------------------------------------------------------------------------------------
77  protected void OnSlotUIResize()
78  {
79  Show(m_HintComponent && m_HintComponent.IsHintShown());
80  }
81 }
GetHandler
SCR_InfoDisplayHandler GetHandler(typename handlerType)
Definition: SCR_InfoDisplay.c:80
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_HintInfoDisplay
Handles SCR_HintUIComponent when using InfoDisplay and HudManager slotting.
Definition: SCR_HintInfoDisplay.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Show
override void Show(WorkspaceWidget pWorkspace, Widget pToolTipWidget, float desiredPosX, float desiredPosY)
Definition: SCR_ScriptedWidgetTooltip.c:55
SCR_HintUIComponent
Definition: SCR_HintUIComponent.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_InfoDisplaySlotHandler
Definition: SCR_InfoDisplaySlotHandler.c:2
m_HUDSlotComponent
protected SCR_HUDSlotUIComponent m_HUDSlotComponent
Definition: SCR_VonDisplay.c:103
m_SlotHandler
protected SCR_InfoDisplaySlotHandler m_SlotHandler
Definition: SCR_VonDisplay.c:102
SCR_HUDSlotUIComponent
Definition: SCR_HUDSlotUIComponent.c:5