Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_NotificationsLogDisplay.c
Go to the documentation of this file.
1/*
2Handles the SCR_NotificationsLogComponent when Player is initialized.
3*/
4class SCR_NotificationsLogDisplay : SCR_InfoDisplayExtended
5{
6 [Attribute(desc: "Should the Notifications go from top to bottom instead of bottom to top?")]
7 protected bool m_bInsertFromTop;
8
12 /*
13 Sets the height of 1 notification to the available spac in the slot can be set correctly.
14 !CANNOT BE 0!
15 */
16 protected const int HEIGHT_DIVIDER = 50;
17
18 //------------------------------------------------------------------------------------------------
19 override void DisplayStartDraw(IEntity owner)
20 {
21 if (!m_wRoot)
22 return;
23
25
27 if (!m_slotHandler)
28 return;
29
30 m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
32 return;
33
34 m_HUDSlotComponent.GetOnResize().Insert(OnSlotUIResize);
35 }
36
37 //------------------------------------------------------------------------------------------------
38 override void DisplayStopDraw(IEntity owner)
39 {
40 // Assign it again in case the SlotUIComponent has changed
41 m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
43 return;
44
45 m_HUDSlotComponent.GetOnResize().Remove(OnSlotUIResize);
46 }
47
48 //------------------------------------------------------------------------------------------------
49 override void DisplayUpdate(IEntity owner, float timeSlice)
50 {
51 if (m_HUDSlotComponent != m_slotHandler.GetSlotUIComponent())
52 {
54 m_HUDSlotComponent.GetOnResize().Remove(OnSlotUIResize);
55
56 m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
58 return;
59
60 m_HUDSlotComponent.GetOnResize().Insert(OnSlotUIResize);
61 }
62 }
63
64 //------------------------------------------------------------------------------------------------
67 {
68 // Assign it again in case the SlotUIComponent has changed
69 m_HUDSlotComponent = m_slotHandler.GetSlotUIComponent();
71 return;
72
73 int maxNotifications = (int)m_HUDSlotComponent.GetHeight() / HEIGHT_DIVIDER;
74 if (maxNotifications < 1)
75 maxNotifications = 1;
76
77 m_NotificationsHud.OnSlotResize(maxNotifications);
78 m_NotificationsHud.ChangeInsertOrder(m_bInsertFromTop);
79 }
80}
Widget m_wRoot
SCR_InfoDisplayHandler GetHandler(typename handlerType)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_InfoDisplaySlotHandler m_slotHandler
SCR_NotificationsLogComponent m_NotificationsHud
override void DisplayUpdate(IEntity owner, float timeSlice)
void OnSlotUIResize()
Calculate the amount of lines that can be displayed dependent on how much space the Layout has.
override void DisplayStartDraw(IEntity owner)
override void DisplayStopDraw(IEntity owner)
Definition int.c:13
SCR_FieldOfViewSettings Attribute