3 const string TASK_LIST_FRAME =
"MapTaskList";
4 const string ICON_NAME =
"faction";
6 protected Widget m_wUI;
7 protected OverlayWidget m_wTaskListFrame;
13 protected bool m_bTaskListInvoked;
14 protected bool m_bOpened;
15 protected bool m_bOnMapClose;
16 protected bool m_bMapContextAllowed =
true;
18 [
Attribute(
"JournalFrame",
desc:
"Journal frame widget name")]
19 protected string m_sJournalFrameName;
21 [
Attribute(
"MapTaskList",
desc:
"Map task list root widget name")]
22 protected string m_sMapTaskListRootName;
24 [
Attribute(
"MapTaskListFrame",
desc:
"Map task list root frame widget name")]
25 protected string m_sMapTaskListRootFrameName;
27 [
Attribute(
"exclamationCircle",
desc:
"Journal Toolmenu imageset quad name")]
28 protected string m_sJournalToolMenuIconName;
31 override protected void OnMapOpen(MapConfiguration config)
33 m_bOnMapClose =
false;
37 override protected void OnMapClose(MapConfiguration config)
42 m_UITaskManager.Action_TasksClose();
43 m_UITaskManager.ClearWidget();
44 m_UITaskManager.CreateTaskList();
68 GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
71 m_wTaskListFrame = OverlayWidget.Cast(
m_RootWidget.FindAnyWidget(TASK_LIST_FRAME));
72 if (!m_wTaskListFrame)
75 m_wUI = m_UITaskManager.CreateTaskList(m_wTaskListFrame);
80 void SetMapContextAllowed(
bool val)
91 m_UITaskManager.ClearWidget();
92 if (!m_wTaskListFrame)
93 m_wTaskListFrame = OverlayWidget.Cast(
m_RootWidget.FindAnyWidget(TASK_LIST_FRAME));
95 m_wUI = m_UITaskManager.CreateTaskList(m_wTaskListFrame);
99 m_bTaskListInvoked =
true;
100 m_UITaskManager.Action_ShowTasks(
m_wUI, taskToFocus);
107 m_UITaskManager.Action_ShowTasks(
m_wUI, taskToFocus);
113 m_bTaskListInvoked =
true;
114 m_UITaskManager.Action_TasksClose();
118 m_bTaskListInvoked =
false;
123 void RefreshTaskList()
128 m_UITaskManager.ClearWidget();
129 if (!m_wTaskListFrame)
130 m_wTaskListFrame = OverlayWidget.Cast(
m_RootWidget.FindAnyWidget(TASK_LIST_FRAME));
132 m_wUI = m_UITaskManager.CreateTaskList(m_wTaskListFrame);
137 m_bTaskListInvoked =
true;
138 m_UITaskManager.Action_ShowTasks(
m_wUI);
151 void HandleTaskList(
bool isVisible =
true,
SCR_BaseTask taskToFocus =
null)
156 Widget taskListRoot =
m_RootWidget.FindAnyWidget(m_sMapTaskListRootName);
160 taskListRoot.SetVisible(isVisible);
161 Widget taskListRootFrame =
m_RootWidget.FindAnyWidget(m_sMapTaskListRootFrameName);
162 if (!taskListRootFrame)
164 ToggleTaskList(taskToFocus);
168 taskListRootFrame.SetVisible(isVisible);
171 if (toolEntry.GetImageSet() != m_sJournalToolMenuIconName)
174 Widget mapJournalFrame =
m_RootWidget.FindAnyWidget(m_sJournalFrameName);
175 if (mapJournalFrame && mapJournalFrame.IsVisible())
177 mapJournalFrame.SetVisible(
false);
178 toolEntry.SetActive(
false);
182 ToggleTaskList(taskToFocus);
186 protected void OnInputDeviceIsGamepad(
bool isGamepad)
188 if (isGamepad && m_bOpened)
198 override void HandlerDeattached(Widget w)
203 GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);