Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_MapUITask.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
//[Obsolete("Replaced with SCR_TaskMapUIComponent")]
3
//class SCR_MapUITask : SCR_MapUIElement
4
//{
5
// protected bool m_bIsEnabled; // task is hovered over & and is clickable
6
// protected SCR_BaseTask m_Task;
7
// protected TextWidget m_wTaskTitle;
8
// protected Widget m_wAssignees;
9
// protected Widget m_wMapTask;
10
// Widget m_wHorizLayout;
11
//
12
// //------------------------------------------------------------------------------
13
// SCR_MapUITask InitTask(notnull SCR_BaseTask task)
14
// {
15
// SCR_MapDescriptorComponent descr = SCR_MapDescriptorComponent.Cast(task.FindComponent(SCR_MapDescriptorComponent));
16
// if (descr)
17
// m_MapItem = descr.Item();
18
//
19
// MapDescriptorProps props = m_MapItem.GetProps();
20
// props.SetIconVisible(false);
21
// props.SetTextVisible(false);
22
// props.Activate(true);
23
//
24
// SCR_Faction targetFaction = SCR_Faction.Cast(task.GetTargetFaction());
25
//
26
// ImageWidget image = ImageWidget.Cast(m_wMapTask.FindAnyWidget("TaskIconBackground"));
27
// if (image)
28
// task.SetTaskIconWidget(image);
29
//
30
// image = ImageWidget.Cast(m_wMapTask.FindAnyWidget("TaskIconSymbol"));
31
// if (image)
32
// {
33
// if (targetFaction)
34
// image.SetColor(targetFaction.GetOutlineFactionColor());
35
//
36
// task.SetWidgetIcon(image);
37
// }
38
//
39
// Widget widget = m_wMapTask.FindAnyWidget("TaskIconOutline");
40
// if (widget)
41
// {
42
// if (targetFaction)
43
// widget.SetColor(targetFaction.GetOutlineFactionColor());
44
// }
45
//
46
// if (!m_wMapTask)
47
// return null;
48
//
49
// SCR_MapUITask handler = SCR_MapUITask.Cast(m_wMapTask.FindHandler(SCR_MapUITask));
50
// if (!handler)
51
// return null;
52
//
53
// SetTask(task);
54
// SetEvents();
55
//
56
// return handler;
57
// }
58
//
59
// //------------------------------------------------------------------------------
60
// void SetTask(notnull SCR_BaseTask task)
61
// {
62
// m_Task = task;
63
// SetImage(task.GetFullTaskIconName());
64
//
65
// if (m_wTaskTitle)
66
// m_Task.SetTitleWidgetText(m_wTaskTitle, m_Task.GetTaskListTaskTitle());
67
//
68
// SetMapMarkerAssigneeCount();
69
// }
70
//
71
// //------------------------------------------------------------------------------
72
// SCR_BaseTask GetTask()
73
// {
74
// return m_Task;
75
// }
76
//
77
// //------------------------------------------------------------------------------
78
// Widget GetMapWidget()
79
// {
80
// return m_wMapTask;
81
// }
82
//
83
// //------------------------------------------------------------------------------
84
// override bool OnMouseEnter(Widget w, int x, int y)
85
// {
86
// super.OnMouseEnter(w, x, y);
87
//
88
// if (m_wMapTask)
89
// m_wMapTask.SetZOrder(2);
90
//
91
// if (w.Type() == SizeLayoutWidget)
92
// PlayHoverSound(m_sSoundHover);
93
//
94
// return false;
95
// }
96
//
97
// //------------------------------------------------------------------------------
98
// override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
99
// {
100
// super.OnMouseLeave(w, enterW, x, y);
101
//
102
// if (m_wMapTask)
103
// m_wMapTask.SetZOrder(0);
104
//
105
// return false;
106
// }
107
//
108
// //------------------------------------------------------------------------------
109
// override void HandlerAttached(Widget w)
110
// {
111
// super.HandlerAttached(w);
112
//
113
// m_eIconType = SCR_EIconType.TASK;
114
// m_wTaskTitle = TextWidget.Cast(w.FindAnyWidget("Title"));
115
// m_wImage = ImageWidget.Cast(w.FindAnyWidget("TaskIcon"));
116
// m_wAssignees = w.FindAnyWidget("Assignee");
117
// m_wHorizLayout = w.FindAnyWidget("HorizLayout");
118
// m_wMapTask = w;
119
//
120
// ButtonWidget taskIconButton;
121
// Widget overlayWidget;
122
// ButtonWidget taskAssignButton
123
//
124
// Widget widget = w.FindAnyWidget("TaskIconHover");
125
// if (widget)
126
// {
127
// widget.SetEnabled(false);
128
// widget.SetOpacity(0);
129
// }
130
//
131
// widget = w.FindAnyWidget("Border");
132
// if (widget)
133
// {
134
// widget.SetEnabled(false);
135
// widget.SetOpacity(0);
136
// }
137
//
138
// widget = w.FindAnyWidget("TaskTitleButton");
139
// if (widget)
140
// {
141
// widget.SetVisible(false);
142
// }
143
//
144
// widget = w.FindAnyWidget("Assignee");
145
// if (widget)
146
// {
147
// widget.SetEnabled(false);
148
// widget.SetOpacity(0);
149
// }
150
//
151
// SCR_TaskSelectButton iconButtonHandler;
152
// SCR_TaskOverlayButton overlayButtonHandler;
153
// SCR_TaskAssignButton assignButtonHandler;
154
//
155
// taskIconButton = ButtonWidget.Cast(w.FindAnyWidget("TaskIconButton"));
156
// if (taskIconButton)
157
// {
158
// iconButtonHandler = SCR_TaskSelectButton.Cast(taskIconButton.FindHandler(SCR_TaskSelectButton));
159
// if (iconButtonHandler)
160
// iconButtonHandler.SetRootWidgetHandler(this);
161
// }
162
//
163
// overlayWidget = w.FindAnyWidget("OverlayWidget");
164
// if (overlayWidget)
165
// {
166
// overlayButtonHandler = SCR_TaskOverlayButton.Cast(overlayWidget.FindHandler(SCR_TaskOverlayButton));
167
// if (overlayButtonHandler)
168
// overlayButtonHandler.SetRootWidgetHandler(this);
169
// }
170
//
171
// taskAssignButton = ButtonWidget.Cast(w.FindAnyWidget("TaskTitleButton"));
172
// if (taskAssignButton)
173
// {
174
// assignButtonHandler = SCR_TaskAssignButton.Cast(taskAssignButton.FindHandler(SCR_TaskAssignButton));
175
// if (assignButtonHandler)
176
// assignButtonHandler.SetRootWidgetHandler(this);
177
// }
178
//
179
// if (GetTaskManager())
180
// {
181
// SCR_BaseTaskManager.s_OnTaskAssigned.Insert(GetAssignedPlayers);
182
// SCR_BaseTaskManager.s_OnTaskUnassigned.Insert(GetAssignedPlayers);
183
// }
184
// }
185
//
186
// //------------------------------------------------------------------------------
187
// override void HandlerDeattached(Widget w)
188
// {
189
// if (GetTaskManager())
190
// {
191
// SCR_BaseTaskManager.s_OnTaskAssigned.Remove(GetAssignedPlayers);
192
// SCR_BaseTaskManager.s_OnTaskUnassigned.Remove(GetAssignedPlayers);
193
// }
194
// }
195
//
196
// //------------------------------------------------------------------------------
197
// void AssignTask()
198
// {
199
// if (!m_Task)
200
// return;
201
//
202
// SCR_TaskNetworkComponent taskNetworkComp = SCR_TaskNetworkComponent.Cast(GetGame().GetPlayerController().FindComponent(SCR_TaskNetworkComponent));
203
// if (!taskNetworkComp)
204
// return;
205
//
206
// int taskId;
207
// SCR_BaseTask curTask = SCR_BaseTaskExecutor.GetLocalExecutor().GetAssignedTask();
208
// if (curTask)
209
// {
210
// taskId = curTask.GetTaskID();
211
// taskNetworkComp.AbandonTask(taskId);
212
// if (curTask != m_Task)
213
// {
214
// taskId = m_Task.GetTaskID();
215
// taskNetworkComp.RequestAssignment(taskId);
216
// SCR_UISoundEntity.SoundEvent(SCR_SoundEvent.TASK_ACCEPT);
217
// }
218
// else
219
// {
220
// SCR_UISoundEntity.SoundEvent(SCR_SoundEvent.TASK_CANCELED);
221
// }
222
// }
223
// else
224
// {
225
// taskId = m_Task.GetTaskID();
226
// taskNetworkComp.RequestAssignment(taskId);
227
// SCR_UISoundEntity.SoundEvent(SCR_SoundEvent.TASK_ACCEPT);
228
// }
229
// }
230
//
231
// //------------------------------------------------------------------------------
232
// void GetAssignedPlayers(SCR_BaseTask task = null)
233
// {
234
// if (!task || task != m_Task)
235
// return;
236
//
237
// task.UpdateMapTaskIcon();
238
//
239
// array<SCR_BaseTaskExecutor> assignees = {};
240
// m_Task.GetAssignees(assignees);
241
// if (assignees.IsEmpty())
242
// {
243
// m_wAssignees.SetEnabled(false);
244
// m_wAssignees.SetOpacity(0);
245
// return;
246
// }
247
//
248
// m_wAssignees.SetEnabled(true);
249
// m_wAssignees.SetOpacity(1);
250
//
251
// SetMapMarkerAssigneeCount();
252
// }
253
//
254
// //------------------------------------------------------------------------------
255
// void SetMapMarkerAssigneeCount()
256
// {
257
// TextWidget assigneesCount = TextWidget.Cast(m_wAssignees.FindAnyWidget("AssigneesCount"));
258
// if (assigneesCount)
259
// assigneesCount.SetText(m_Task.GetAssigneeCount().ToString());
260
// }
261
//
262
// //------------------------------------------------------------------------------
263
// void UpdateFocusedTask()
264
// {
265
// SCR_UITaskManagerComponent utm = SCR_UITaskManagerComponent.GetInstance();
266
// if (utm)
267
// utm.Action_SelectTask(m_Task);
268
// }
269
//
270
// //------------------------------------------------------------------------------
271
// void SetEvents()
272
// {
273
// ButtonWidget assignButton = ButtonWidget.Cast(m_wMapTask.FindAnyWidget("TaskTitleButton"));
274
// if (assignButton)
275
// {
276
// SCR_TaskAssignButton handler = SCR_TaskAssignButton.Cast(assignButton.FindHandler(SCR_TaskAssignButton));
277
// if (handler)
278
// handler.GetOnMapIconClick().Insert(AssignTask);
279
// }
280
//
281
// ButtonWidget selectButton = ButtonWidget.Cast(m_wMapTask.FindAnyWidget("TaskIconButton"));
282
// if (selectButton)
283
// {
284
// SCR_TaskSelectButton handler = SCR_TaskSelectButton.Cast(selectButton.FindHandler(SCR_TaskSelectButton));
285
// if (handler)
286
// handler.GetOnMapIconClick().Insert(UpdateFocusedTask);
287
// }
288
// }
289
//
290
// //------------------------------------------------------------------------------
291
// override vector GetPos()
292
// {
293
// if (!m_Task)
294
// return vector.Zero;
295
//
296
// return m_Task.GetOrigin();
297
// }
298
//}
scripts
Game
Tasks
UI
SCR_MapUITask.c
Generated by
1.17.0