4 protected bool m_bIsEnabled;
6 protected TextWidget m_wTaskTitle;
7 protected Widget m_wAssignees;
8 protected Widget m_wMapTask;
14 SCR_MapDescriptorComponent descr = SCR_MapDescriptorComponent.Cast(task.FindComponent(SCR_MapDescriptorComponent));
19 props.SetIconVisible(
false);
20 props.SetTextVisible(
false);
25 ImageWidget image = ImageWidget.Cast(m_wMapTask.FindAnyWidget(
"TaskIconBackground"));
27 task.SetTaskIconWidget(image);
29 image = ImageWidget.Cast(m_wMapTask.FindAnyWidget(
"TaskIconSymbol"));
33 image.SetColor(targetFaction.GetOutlineFactionColor());
35 task.SetWidgetIcon(image);
38 Widget widget = Widget.Cast(m_wMapTask.FindAnyWidget(
"TaskIconOutline"));
42 widget.SetColor(targetFaction.GetOutlineFactionColor());
62 SetImage(task.GetTaskMapIconName() + task.GetIconSuffix());
65 m_Task.SetTitleWidgetText(m_wTaskTitle,
m_Task.GetTaskListTaskTitle());
67 SetMapMarkerAssigneeCount();
83 override bool OnMouseEnter(Widget w,
int x,
int y)
85 super.OnMouseEnter(w, x, y);
89 utm.EnableTaskContext(
true);
92 m_wMapTask.SetZOrder(2);
94 if (w.Type() == SizeLayoutWidget)
95 PlayHoverSound(m_sSoundHover);
101 override bool OnMouseLeave(Widget w, Widget enterW,
int x,
int y)
103 super.OnMouseLeave(w, enterW, x, y);
107 utm.EnableTaskContext(
false);
110 m_wMapTask.SetZOrder(0);
116 override void HandlerAttached(Widget w)
118 super.HandlerAttached(w);
121 m_wTaskTitle = TextWidget.Cast(w.FindAnyWidget(
"Title"));
122 m_wImage = ImageWidget.Cast(w.FindAnyWidget(
"TaskIcon"));
123 m_wAssignees = Widget.Cast(w.FindAnyWidget(
"Assignee"));
124 m_wHorizLayout = w.FindAnyWidget(
"HorizLayout");
127 ButtonWidget taskIconButton;
128 Widget overlayWidget;
129 ButtonWidget taskAssignButton
131 Widget widget = Widget.Cast(w.FindAnyWidget(
"TaskIconHover"));
134 widget.SetEnabled(
false);
135 widget.SetOpacity(0);
138 widget = Widget.Cast(w.FindAnyWidget(
"Border"));
141 widget.SetEnabled(
false);
142 widget.SetOpacity(0);
145 widget = Widget.Cast(w.FindAnyWidget(
"TaskTitleButton"));
148 widget.SetVisible(
false);
151 widget = Widget.Cast(w.FindAnyWidget(
"Assignee"));
154 widget.SetEnabled(
false);
155 widget.SetOpacity(0);
162 taskIconButton = ButtonWidget.Cast(w.FindAnyWidget(
"TaskIconButton"));
166 if (iconButtonHandler)
167 iconButtonHandler.SetRootWidgetHandler(
this);
170 overlayWidget = w.FindAnyWidget(
"OverlayWidget");
174 if (overlayButtonHandler)
175 overlayButtonHandler.SetRootWidgetHandler(
this);
178 taskAssignButton = ButtonWidget.Cast(w.FindAnyWidget(
"TaskTitleButton"));
179 if (taskAssignButton)
182 if (assignButtonHandler)
183 assignButtonHandler.SetRootWidgetHandler(
this);
194 override void HandlerDeattached(Widget w)
210 if (!taskNetworkComp)
217 taskId = curTask.GetTaskID();
218 taskNetworkComp.AbandonTask(taskId);
221 taskId =
m_Task.GetTaskID();
222 taskNetworkComp.RequestAssignment(taskId);
232 taskId =
m_Task.GetTaskID();
233 taskNetworkComp.RequestAssignment(taskId);
241 if (!task || task !=
m_Task)
244 task.UpdateMapTaskIcon();
246 array<SCR_BaseTaskExecutor> assignees = {};
247 m_Task.GetAssignees(assignees);
248 if (assignees.IsEmpty())
250 m_wAssignees.SetEnabled(
false);
251 m_wAssignees.SetOpacity(0);
255 m_wAssignees.SetEnabled(
true);
256 m_wAssignees.SetOpacity(1);
258 SetMapMarkerAssigneeCount();
262 void SetMapMarkerAssigneeCount()
264 TextWidget assigneesCount = TextWidget.Cast(m_wAssignees.FindAnyWidget(
"AssigneesCount"));
266 assigneesCount.SetText(
m_Task.GetAssigneeCount().ToString());
270 void UpdateFocusedTask()
274 utm.Action_SelectTask(
m_Task);
280 ButtonWidget assignButton = ButtonWidget.Cast(m_wMapTask.FindAnyWidget(
"TaskTitleButton"));
285 handler.GetOnMapIconClick().Insert(AssignTask);
288 ButtonWidget selectButton = ButtonWidget.Cast(m_wMapTask.FindAnyWidget(
"TaskIconButton"));
293 handler.GetOnMapIconClick().Insert(UpdateFocusedTask);
298 override vector GetPos()
303 return m_Task.GetOrigin();