Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_HintInfoDisplay.c
Go to the documentation of this file.
1
2class 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
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();
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 {
45 m_HUDSlotComponent.GetOnResize().Remove(OnSlotUIResize);
46
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 {
58 m_HUDSlotComponent.GetOnResize().Remove(OnSlotUIResize);
59
60 m_HUDSlotComponent = m_SlotHandler.GetSlotUIComponent();
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}
Widget m_wRoot
SCR_InfoDisplayHandler GetHandler(typename handlerType)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Handles SCR_HintUIComponent when using InfoDisplay and HudManager slotting.
void OnHintShown(bool isShown)
Make it visible / invisible to trigger rezising of the Group.
SCR_HintUIComponent m_HintComponent
override void DisplayUpdate(IEntity owner, float timeSlice)
SCR_HUDSlotUIComponent m_HUDSlotComponent
SCR_InfoDisplaySlotHandler m_SlotHandler
override void DisplayStopDraw(IEntity owner)
override void DisplayStartDraw(IEntity owner)
void OnSlotUIResize()
Make InfoDisplay in-/visible when menu is changed.
override void Show()
Definition gameLib.c:262
SCR_FieldOfViewSettings Attribute