Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TaskListDisplay.c
Go to the documentation of this file.
1class SCR_TaskListDisplay : SCR_InfoDisplayExtended
2{
3 [Attribute("m_wTaskListEntryDescription")]
5
6 protected bool m_bHasListener;
8
10 protected SCR_TaskListUIComponent m_TaskListComponent;
11
12 protected const string ACTION_OPEN_TASK_LIST = "TasksOpen";
13 protected const string CONTENT_TASK_LIST_MAP = "TaskListMapContext";
14 protected const string CONTENT_TASK_LIST = "TaskListContext";
15
16 //------------------------------------------------------------------------------------------------
17 override void DisplayStartDraw(IEntity owner)
18 {
19 if (!m_wRoot)
20 return;
21
23
24 //## Need to listen for "activated" from input button due to gamepad support so its possible to exit from view with "B" press, but it also triggers action on chimera inputs
25 m_TaskListComponent = SCR_TaskListUIComponent.Cast(m_wRoot.FindHandler(SCR_TaskListUIComponent));
27 m_TaskListComponent.GetOnButtonTaskListHide().Insert(CloseTaskList);
28
29 Widget taskDescriptionWidget = m_wRoot.FindAnyWidget(m_sTaskDescriptionWidgetName);
30 if (taskDescriptionWidget)
31 taskDescriptionWidget.SetVisible(false);
32
33 GetGame().GetInputManager().AddActionListener(ACTION_OPEN_TASK_LIST, EActionTrigger.DOWN, OpenTaskList);
34 m_bHasListener = true;
35
37 if (m_MapEntity)
38 m_MapEntity.GetOnMapOpen().Insert(OnMapOpen);
39 }
40
41 //------------------------------------------------------------------------------------------------
42 override void DisplayStopDraw(IEntity owner)
43 {
45 m_TaskListComponent.GetOnButtonTaskListHide().Remove(CloseTaskList);
46
47 if (m_MapEntity)
48 m_MapEntity.GetOnMapOpen().Remove(OnMapOpen);
49
50 GetGame().GetInputManager().RemoveActionListener(ACTION_OPEN_TASK_LIST, EActionTrigger.DOWN, OpenTaskList);
51 m_bHasListener = false;
52 }
53
54 //------------------------------------------------------------------------------------------------
55 override void DisplayUpdate(IEntity owner, float timeSlice)
56 {
57 // Activate input Context
58 if (m_bShown)
59 {
60 if (m_MapEntity && m_MapEntity.IsOpen())
61 GetGame().GetInputManager().ActivateContext(CONTENT_TASK_LIST_MAP);
62 else
63 GetGame().GetInputManager().ActivateContext(CONTENT_TASK_LIST);
64 }
65 }
66
67 //------------------------------------------------------------------------------------------------
69 protected void OpenTaskList()
70 {
71 if (m_bShown || m_MapEntity && m_MapEntity.IsOpen())
72 return;
73
74 Show(true);
75
77 {
78 m_TaskManagerUI.RegisterTaskList(m_TaskListComponent);
79 m_TaskListComponent.RefreshTaskList();
80 m_TaskManagerUI.TaskHUDVisibilityChanged(true);
81
82 if (!m_TaskManagerUI.GetSelectedTask())
83 m_TaskListComponent.CollapseTask();
84 }
85
86 m_TaskListComponent.FocusOnEntry();
87
88 GetGame().GetInputManager().RemoveActionListener(ACTION_OPEN_TASK_LIST, EActionTrigger.DOWN, OpenTaskList);
89 m_bHasListener = false;
90 }
91
92 //------------------------------------------------------------------------------------------------
94 protected void CloseTaskList()
95 {
96 Show(false);
98 m_TaskManagerUI.TaskHUDVisibilityChanged(false);
99
100 GetGame().GetCallqueue().Call(AddTaskListOpenListener);
101 }
102
103 //------------------------------------------------------------------------------------------------
104 protected void OnMapOpen(MapConfiguration config)
105 {
106 Show(false);
107 if (!m_bHasListener)
109 }
110
111 //------------------------------------------------------------------------------------------------
112 protected void AddTaskListOpenListener()
113 {
114 GetGame().GetInputManager().AddActionListener(ACTION_OPEN_TASK_LIST, EActionTrigger.DOWN, OpenTaskList);
115 m_bHasListener = true;
116 }
117}
ArmaReforgerScripted GetGame()
Definition game.c:1398
Widget m_wRoot
bool m_bShown
static SCR_MapEntity GetMapInstance()
Get map entity instance.
SCR_TaskListUIComponent m_TaskListComponent
override void DisplayUpdate(IEntity owner, float timeSlice)
void OnMapOpen(MapConfiguration config)
override void DisplayStopDraw(IEntity owner)
override void DisplayStartDraw(IEntity owner)
const string ACTION_OPEN_TASK_LIST
void OpenTaskList()
Shows task list on HUD.
const string CONTENT_TASK_LIST_MAP
void CloseTaskList()
Hides task list on HUD.
SCR_TaskManagerUIComponent m_TaskManagerUI
static SCR_TaskManagerUIComponent GetInstance()
override void Show()
Definition gameLib.c:262
SCR_FieldOfViewSettings Attribute
EActionTrigger