Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TaskNotificationManagerComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Tasks/Notifications", description: "Component that takes care of playing task notifications")]
5
7{
8 [Attribute(desc:"Task notifications root config")]
9 protected ref SCR_TaskNotificationsRootConfig m_TaskNotificationsConfig;
10
15 protected SCR_CallsignManagerComponent m_CallsignManager;
17
18 protected static SCR_TaskNotificationManagerComponent s_Instance;
19
20 protected const int POPUP_DURATION = 6;
21 protected const bool SHOW_ENEMY_MAJOR_TEXT_NOTIFICATION = false;
22 protected const bool SHOW_ENEMY_MINOR_TEXT_NOTIFICATION = false;
23 protected const string GRID_FORMAT = "%1 %2";
24
25 //------------------------------------------------------------------------------------------------
29 SCR_BaseTaskNotificationData GetTaskNotificationData(SCR_ETaskNotification taskNotification, SCR_ETaskNotificationMsg taskNotificationMsg)
30 {
31 SCR_TaskNotificationConfig config = GetTaskNotificationConfig(taskNotification);
32 if (!config)
33 return null;
34
35 foreach (SCR_BaseTaskNotificationData data : config.m_aTaskNotificationDataList)
36 {
37 if (data && data.m_eTaskNotificationMsg == taskNotificationMsg)
38 return data;
39 }
40
41 return null;
42 }
43
44 //------------------------------------------------------------------------------------------------
47 SCR_TaskNotificationConfig GetTaskNotificationConfig(SCR_ETaskNotification taskNotification)
48 {
49 if (!m_TaskNotificationsConfig || !m_TaskNotificationsConfig.m_aTaskNotificationList)
50 return null;
51
52 foreach (SCR_TaskNotificationConfig config : m_TaskNotificationsConfig.m_aTaskNotificationList)
53 {
54 if (config && config.m_eTaskNotification == taskNotification)
55 return config;
56 }
57
58 return null;
59 }
60
61 //------------------------------------------------------------------------------------------------
66 string GetTaskNameWithBase(string taskName, notnull Faction faction, notnull SCR_CampaignMilitaryBaseComponent base)
67 {
68 return WidgetManager.Translate(taskName, base.GetFormattedBaseNameWithCallsign(faction));
69 }
70
71 //------------------------------------------------------------------------------------------------
75 string GetTaskNameWithGrid(LocalizedString taskKey, int grid)
76 {
77 int gridX = Math.Floor(grid * 0.001);
78 int gridY = grid - (gridX * 1000);
79
80 return WidgetManager.Translate(taskKey, string.Format(GRID_FORMAT, gridX, gridY));
81 }
82
83 //------------------------------------------------------------------------------------------------
93 void PlayTaskNotificationMsg(SCR_ETaskNotification taskNotification, SCR_ETaskNotificationMsg msg, int factionId, int baseCallsign, int callerGroupId, int calledGroupId, int grid, float quality)
94 {
95 if (!m_Campaign || m_Campaign.IsTutorial() || !m_GroupsManager || !m_FactionManager)
96 return;
97
98 SCR_TaskNotificationConfig config = GetTaskNotificationConfig(taskNotification);
99 if (!config)
100 return;
101
102 string taskName = config.m_sTaskName;
103
104 SCR_BaseTaskNotificationData data = GetTaskNotificationData(taskNotification, msg);
105 if (!data)
106 return;
107
108 // can skip notifications if using an interval
109 if (config.m_bAllowedNotificationInterval)
110 {
111 ChimeraWorld world = GetOwner().GetWorld();
112 WorldTimestamp lastSavedTimestamp;
113 if (m_mNotificationIntervalMap.Find(taskNotification, lastSavedTimestamp))
114 {
115 if (world.GetServerTimestamp().LessEqual(lastSavedTimestamp))
116 return;
117 }
118
119 m_mNotificationIntervalMap.Set(taskNotification, world.GetServerTimestamp().PlusSeconds(config.m_fNotificationInterval));
120 }
121
122 SCR_CampaignFaction faction = SCR_CampaignFaction.Cast(m_FactionManager.GetFactionByIndex(factionId));
123 SCR_CampaignMilitaryBaseComponent base = m_Campaign.GetBaseManager().FindBaseByCallsign(baseCallsign);
124 SCR_AIGroup callerGroup = m_GroupsManager.FindGroup(callerGroupId);
125
126 bool isFriendly = faction == m_FactionManager.GetLocalPlayerFaction();
127
128 #ifdef TASK_NOTIFICATION_DEBUG
129 Print("[SCR_CampaignFeedbackComponent.PlayTaskNotificationMsg] message:"+SCR_Enum.GetEnumName(SCR_ETaskNotificationMsg, msg)+" received", LogLevel.DEBUG);
130 #endif
131
133 if (majorBaseData && base)
134 {
135 switch (msg)
136 {
137 case SCR_ETaskNotificationMsg.MAJOR_CREATION:
138 PopupMsg(majorBaseData.GetCreationText(faction, base), prio: SCR_EGroupTaskPopUpPriority.CREATED, sound: SCR_SoundEvent.TASK_CREATED, isFriendly: isFriendly);
139 PlayVONotification(majorBaseData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
140 break;
141
142 case SCR_ETaskNotificationMsg.MAJOR_GROUP_ASSIGNED_TO_TASK:
143 case SCR_ETaskNotificationMsg.MAJOR_ASSIGNED_BY_SL_TO_SM:
144 {
145 PopupMsg(majorBaseData.m_sText, param1: GetTaskNameWithBase(taskName, faction, base), prio: SCR_EGroupTaskPopUpPriority.ASSIGNED, sound: SCR_SoundEvent.TASK_ACCEPT, isFriendly: isFriendly);
146 PlayVONotification(majorBaseData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
147 break;
148 }
149
150 case SCR_ETaskNotificationMsg.MAJOR_ASSIGNED_BY_SL_TO_COMMANDER:
151 {
152 if (callerGroup)
153 {
154 PopupMsg(majorBaseData.m_sText, param1: SCR_GroupHelperUI.GetTranslatedGroupName(callerGroup), param2: GetTaskNameWithBase(taskName, faction, base), prio: SCR_EGroupTaskPopUpPriority.ASSIGNED, sound: SCR_SoundEvent.TASK_ACCEPT, isFriendly: isFriendly);
155 PlayVONotification(majorBaseData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
156 }
157
158 break;
159 }
160
161 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_COMPLETED:
162 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_FAILED:
163 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_CANCELED:
164 {
165 PopupMsg(majorBaseData.m_sText, param1: GetTaskNameWithBase(taskName, faction, base), prio: SCR_EGroupTaskPopUpPriority.COMPLETED, sound: SCR_SoundEvent.TASK_SUCCEED, isFriendly: isFriendly);
166 PlayVONotification(majorBaseData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
167 break;
168 }
169
170 case SCR_ETaskNotificationMsg.MAJOR_TASK_FOR_COMMANDER_COMPLETED:
171 {
172 if (callerGroup)
173 {
174 PopupMsg(majorBaseData.m_sText, param1: SCR_GroupHelperUI.GetTranslatedGroupName(callerGroup), param2: GetTaskNameWithBase(taskName, faction, base), prio: SCR_EGroupTaskPopUpPriority.COMPLETED, sound: SCR_SoundEvent.TASK_SUCCEED, isFriendly:isFriendly);
175 PlayVONotification(majorBaseData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
176 }
177
178 break;
179 }
180
181 default:
182 Print("[SCR_MajorTaskNotificationData.PlayTaskNotificationMsg] message type not found", LogLevel.WARNING);
183 break;
184 }
185
186 return;
187 }
188
189 SCR_MajorRequestedTaskNotificationData majorRequestedData = SCR_MajorRequestedTaskNotificationData.Cast(data);
190 if (majorRequestedData)
191 {
192 switch (msg)
193 {
194 case SCR_ETaskNotificationMsg.MAJOR_CREATION:
195 case SCR_ETaskNotificationMsg.MAJOR_CREATION_BY_SL:
196 {
197 PopupMsg(majorRequestedData.GetCreationText(callerGroupId), param1: taskName, prio: SCR_EGroupTaskPopUpPriority.CREATED, sound: SCR_SoundEvent.TASK_CREATED, isFriendly: isFriendly);
198 PlayVONotification(majorRequestedData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
199 break;
200 }
201
202 case SCR_ETaskNotificationMsg.MAJOR_GROUP_ASSIGNED_TO_TASK:
203 case SCR_ETaskNotificationMsg.MAJOR_ASSIGNED_BY_SL_TO_SM:
204 {
205 PopupMsg(majorRequestedData.m_sText, param1: GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.ASSIGNED, sound: SCR_SoundEvent.TASK_ACCEPT, isFriendly: isFriendly);
206 PlayVONotification(majorRequestedData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
207 break;
208 }
209
210 case SCR_ETaskNotificationMsg.MAJOR_ASSIGNED_BY_SL_TO_COMMANDER:
211 {
212 if (callerGroup)
213 {
214 PopupMsg(majorRequestedData.m_sText, param1: SCR_GroupHelperUI.GetTranslatedGroupName(callerGroup), param2: GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.ASSIGNED, sound: SCR_SoundEvent.TASK_ACCEPT, isFriendly: isFriendly);
215 PlayVONotification(majorRequestedData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
216 }
217
218 break;
219 }
220
221 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_COMPLETED:
222 {
223 PopupMsg(majorRequestedData.m_sText, param1: GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.COMPLETED, sound: SCR_SoundEvent.TASK_SUCCEED, isFriendly: isFriendly);
224 PlayVONotification(majorRequestedData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
225 break;
226 }
227
228 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_FAILED:
229 {
230 PopupMsg(majorRequestedData.m_sText, param1: GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.FAILED, sound: SCR_SoundEvent.TASK_FAILED, isFriendly: isFriendly);
231 PlayVONotification(majorRequestedData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
232 break;
233 }
234
235 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_CANCELED:
236 {
237 PopupMsg(majorRequestedData.m_sText, param1: GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.CANCELED, sound: SCR_SoundEvent.TASK_CANCELED, isFriendly: isFriendly);
238 PlayVONotification(majorRequestedData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
239 break;
240 }
241
242 default:
243 Print("[SCR_MajorTaskNotificationData.PlayTaskNotificationMsg] message type not found", LogLevel.WARNING);
244 break;
245 }
246
247 return;
248 }
249
250 SCR_MajorTaskNotificationData majorData = SCR_MajorTaskNotificationData.Cast(data);
251 if (majorData)
252 {
253 switch (msg)
254 {
255 case SCR_ETaskNotificationMsg.MAJOR_CREATION:
256 PopupMsg(majorData.GetCreationText(), prio: SCR_EGroupTaskPopUpPriority.CREATED, sound: SCR_SoundEvent.TASK_CREATED, isFriendly: isFriendly);
257 PlayVONotification(majorData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
258 break;
259
260 case SCR_ETaskNotificationMsg.MAJOR_GROUP_ASSIGNED_TO_TASK:
261 case SCR_ETaskNotificationMsg.MAJOR_ASSIGNED_BY_SL_TO_SM:
262 {
263 PopupMsg(majorData.m_sText, param1: GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.ASSIGNED, sound: SCR_SoundEvent.TASK_ACCEPT, isFriendly: isFriendly);
264 PlayVONotification(majorData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
265 break;
266 }
267
268 case SCR_ETaskNotificationMsg.MAJOR_ASSIGNED_BY_SL_TO_COMMANDER:
269 {
270 if (callerGroup)
271 {
272 PopupMsg(majorData.m_sText, param1: SCR_GroupHelperUI.GetTranslatedGroupName(callerGroup), param2:GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.ASSIGNED, sound: SCR_SoundEvent.TASK_ACCEPT, isFriendly: isFriendly);
273 PlayVONotification(majorData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
274 }
275
276 break;
277 }
278
279 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_COMPLETED:
280 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_FAILED:
281 case SCR_ETaskNotificationMsg.MAJOR_TASK_ASSIGNED_TO_YOUR_GROUP_CANCELED:
282 {
283 PopupMsg(majorData.m_sText, param1: GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.COMPLETED, sound: SCR_SoundEvent.TASK_SUCCEED, isFriendly: isFriendly);
284 PlayVONotification(majorData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
285 break;
286 }
287
288 case SCR_ETaskNotificationMsg.MAJOR_TASK_FOR_COMMANDER_COMPLETED:
289 {
290 if (callerGroup)
291 {
292 PopupMsg(majorData.m_sText, param1: SCR_GroupHelperUI.GetTranslatedGroupName(callerGroup), param2: GetTaskNameWithGrid(taskName, grid), prio: SCR_EGroupTaskPopUpPriority.COMPLETED, sound: SCR_SoundEvent.TASK_SUCCEED, isFriendly: isFriendly);
293 PlayVONotification(majorData.m_sSoundEventName, factionId, baseCallsign, callerGroupId, calledGroupId, grid, quality);
294 }
295
296 break;
297 }
298
299 default:
300 Print("[SCR_MajorTaskNotificationData.PlayTaskNotificationMsg] message type not found", LogLevel.WARNING);
301 break;
302 }
303
304 return;
305 }
306
308 if (minorData)
309 {
310 if (!isFriendly && !SHOW_ENEMY_MINOR_TEXT_NOTIFICATION)
311 return;
312
313 switch (msg)
314 {
315 case SCR_ETaskNotificationMsg.MINOR_CREATION:
316 SCR_NotificationsComponent.SendLocal(minorData.m_eNotification, taskNotification, factionId, baseCallsign, callerGroupId);
317 break;
318
319 case SCR_ETaskNotificationMsg.MINOR_GROUP_ASSIGNED_TO_SAME_TASK:
320 SCR_NotificationsComponent.SendLocal(minorData.m_eNotification, callerGroupId);
321 break;
322
323 case SCR_ETaskNotificationMsg.MINOR_TASK_COMPLETED:
324 case SCR_ETaskNotificationMsg.MINOR_TASK_COMPLETED_TO_COMMANDER:
325 case SCR_ETaskNotificationMsg.MINOR_TASK_FAILED:
326 case SCR_ETaskNotificationMsg.MINOR_TASK_FAILED_TO_COMMANDER:
327 case SCR_ETaskNotificationMsg.MINOR_TASK_CANCELED:
328 case SCR_ETaskNotificationMsg.MINOR_TASK_CANCELED_TO_COMMANDER:
329 case SCR_ETaskNotificationMsg.MINOR_YOUR_REQUEST_COMPLETED:
330 case SCR_ETaskNotificationMsg.MINOR_YOUR_REQUEST_FAILED:
331 case SCR_ETaskNotificationMsg.MINOR_YOUR_REQUEST_CANCELED:
332 SCR_NotificationsComponent.SendLocal(minorData.m_eNotification, taskNotification, msg, factionId, baseCallsign, grid); // SCR_NotificationTaskName
333 break;
334
335 default:
336 Print("[SCR_MajorTaskNotificationData.PlayTaskNotificationMsg] message type not found", LogLevel.WARNING);
337 break;
338 }
339 }
340 }
341
342 //------------------------------------------------------------------------------------------------
343 protected void PopupMsg(string text, int prio = -1, string param1 = "", string param2 = "", string sound = "", bool isFriendly = true)
344 {
345 if (!isFriendly && !SHOW_ENEMY_MAJOR_TEXT_NOTIFICATION)
346 return;
347
348 SCR_PopUpNotification.GetInstance().PopupMsg(text, param1: param1, param2: param2, duration: POPUP_DURATION, prio: prio, sound: sound);
349 }
350
351 //------------------------------------------------------------------------------------------------
352 protected void PlayVONotification(string soundEventName, int factionId, int baseCallsign = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN, int callerGroupId = -1, int calledGroupId = -1, int grid = -1, float quality = 0.5)
353 {
355 if (!playerController)
356 return;
357
358 IEntity player = playerController.GetMainEntity();
359 if (!player)
360 return;
361
362 BaseContainer settings = GetGame().GetGameUserSettings().GetModule("SCR_AudioSettings");
363 bool announcerEnabled = true; // enabled so everything is in the default state if we don't find settings
364 if (settings)
365 settings.Get("m_bHQAnnouncer", announcerEnabled);
366
367 if (!announcerEnabled)
368 return;
369
370 int gridX = Math.Floor(grid * 0.001);
371 int gridY = grid - (gridX * 1000);
372
373 PlayVOTaskNotification(soundEventName.Trim(), factionId, baseCallsign, callerGroupId, calledGroupId, gridX, gridY, quality);
374 }
375
376 //------------------------------------------------------------------------------------------------
386 void PlayVOTaskNotification(string soundEventName, int factionId, int baseCallsign, int callerGroupId, int calledGroupId, int gridX, int gridY, float quality)
387 {
388 // Don't show UI on headless
389 if (System.IsConsoleApp())
390 return;
391
392 if (!m_GroupsManager)
394
395 SCR_HQRadioSoundEntity radioSoundEntity = SCR_HQRadioSoundEntity.GetInstance();
396 if (!radioSoundEntity)
397 return;
398
400 m_SimpleSoundComponent = radioSoundEntity.GetSimpleSoundComponent();
401
402 if (!m_FactionManager)
403 m_FactionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
404
405 if (!m_Campaign)
406 m_Campaign = SCR_GameModeCampaign.GetInstance();
407
408 if (!m_CallsignManager)
409 m_CallsignManager = SCR_CallsignManagerComponent.Cast(m_Campaign.FindComponent(SCR_CallsignManagerComponent));
410
411 if (!m_GroupsManager || !m_FactionManager || !m_CallsignManager || !m_SimpleSoundComponent || !m_Campaign)
412 return;
413
414 SCR_AIGroup callerGroup = m_GroupsManager.FindGroup(callerGroupId);
415
416 int companyCallsignIndexCaller, platoonCallsignIndexCaller, squadCallsignIndexCaller, characterCallsignIndexCaller;
417
418 if (callerGroup)
419 m_CallsignManager.GetEntityCallsignIndexes(callerGroup, companyCallsignIndexCaller, platoonCallsignIndexCaller, squadCallsignIndexCaller, characterCallsignIndexCaller);
420
421 int localPlayerId = SCR_PlayerController.GetLocalPlayerId();
422 if (localPlayerId == 0)
423 return;
424
425 SCR_AIGroup calledGroup = m_GroupsManager.FindGroup(calledGroupId);
426
427 int companyCallsignIndexCalled, platoonCallsignIndexCalled, squadCallsignIndexCalled, characterCallsignIndexCalled;
428
429 if (calledGroup)
430 m_CallsignManager.GetEntityCallsignIndexes(calledGroup, companyCallsignIndexCalled, platoonCallsignIndexCalled, squadCallsignIndexCalled, characterCallsignIndexCalled);
431
432 SCR_CampaignFaction faction = SCR_CampaignFaction.Cast(m_FactionManager.GetFactionByIndex(factionId));
433 SCR_CampaignMilitaryBaseComponent base = m_Campaign.GetBaseManager().FindBaseByCallsign(baseCallsign);
434
435 if (base)
436 {
437 SCR_MilitaryBaseCallsign callsignInfo;
438
439 if (faction == m_Campaign.GetFactionByEnum(SCR_ECampaignFaction.BLUFOR))
440 callsignInfo = faction.GetBaseCallsignByIndex(base.GetCallsign());
441 else
442 callsignInfo = faction.GetBaseCallsignByIndex(base.GetCallsign(), m_Campaign.GetCallsignOffset());
443
444 if (callsignInfo)
445 {
446 int signalBase = m_SimpleSoundComponent.GetSignalIndex("Base");
447 m_SimpleSoundComponent.SetSignalValue(signalBase, callsignInfo.GetSignalIndex());
448 }
449 }
450
451 if (companyCallsignIndexCaller != SCR_CampaignMilitaryBaseComponent.INVALID_PLAYER_INDEX)
452 {
453 int signalCompanyCaller = m_SimpleSoundComponent.GetSignalIndex("CompanyCaller");
454 int signalPlatoonCaller = m_SimpleSoundComponent.GetSignalIndex("PlatoonCaller");
455 int signalSquadCaller = m_SimpleSoundComponent.GetSignalIndex("SquadCaller");
456 m_SimpleSoundComponent.SetSignalValue(signalCompanyCaller, companyCallsignIndexCaller);
457 m_SimpleSoundComponent.SetSignalValue(signalPlatoonCaller, platoonCallsignIndexCaller);
458 m_SimpleSoundComponent.SetSignalValue(signalSquadCaller, squadCallsignIndexCaller);
459 }
460
461 if (companyCallsignIndexCalled != SCR_CampaignMilitaryBaseComponent.INVALID_PLAYER_INDEX)
462 {
463 int signalCompanyCalled = m_SimpleSoundComponent.GetSignalIndex("CompanyCalled");
464 int signalPlatoonCalled = m_SimpleSoundComponent.GetSignalIndex("PlatoonCalled");
465 int signalSquadCalled = m_SimpleSoundComponent.GetSignalIndex("SquadCalled");
466 m_SimpleSoundComponent.SetSignalValue(signalCompanyCalled, companyCallsignIndexCalled);
467 m_SimpleSoundComponent.SetSignalValue(signalPlatoonCalled, platoonCallsignIndexCalled);
468 m_SimpleSoundComponent.SetSignalValue(signalSquadCalled, squadCallsignIndexCalled);
469 }
470
471 if (gridX >= 0 && gridY >= 0)
472 {
473 float gridValue = (gridX * 1000) + gridY;
474 int signalGrid = m_SimpleSoundComponent.GetSignalIndex("Grid");
475 m_SimpleSoundComponent.SetSignalValue(signalGrid, gridValue);
476 }
477
478 int signalIdentityVoice = m_SimpleSoundComponent.GetSignalIndex("IdentityVoice");
479 m_SimpleSoundComponent.SetSignalValue(signalIdentityVoice, faction.GetIndentityVoiceSignal());
480
481 int signalQuality = m_SimpleSoundComponent.GetSignalIndex("TransmissionQuality");
482 m_SimpleSoundComponent.SetSignalValue(signalQuality, quality);
483
484 radioSoundEntity.PlayRadioSound(soundEventName);
485 }
486
487 //------------------------------------------------------------------------------------------------
489 static SCR_TaskNotificationManagerComponent GetInstance()
490 {
491 return s_Instance;
492 }
493
494 //------------------------------------------------------------------------------------------------
495 override void EOnInit(IEntity owner)
496 {
497 m_Campaign = SCR_GameModeCampaign.GetInstance();
498 if (!m_Campaign)
499 return;
500
502 m_FactionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
503 m_CallsignManager = SCR_CallsignManagerComponent.Cast(m_Campaign.FindComponent(SCR_CallsignManagerComponent));
504 }
505
506 //------------------------------------------------------------------------------------------------
507 override void OnPostInit(IEntity owner)
508 {
509 // remove if unused
510 SetEventMask(owner, EntityEvent.INIT);
511 }
512
513 //------------------------------------------------------------------------------------------------
518 {
519 if (!s_Instance)
520 s_Instance = this;
521 else
522 Print("[SCR_TaskNotificationManagerComponent instance is missing", LogLevel.WARNING);
523 }
524}
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_GameModeCampaign m_Campaign
SCR_EGroupTaskPopUpPriority
Group task popup message priorities sorted from lowest to highest.
SCR_ETaskNotification
Objective and request notifications types.
SCR_ETaskNotificationMsg
Various types of task notifications for different events and states.
Get all prefabs that have the spawner data
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_HQRadioSoundEntityClass m_SimpleSoundComponent
SCR_FactionManager m_FactionManager
SCR_GroupsManagerComponent m_GroupsManager
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_SpawnerSlotManagerClass s_Instance
Class used for managing changes and removals of slots present in world.
void PlayVOTaskNotification(string soundEventName, int factionId, int baseCallsign, int callerGroupId, int calledGroupId, int gridX, int gridY, float quality)
string GetTaskNameWithBase(string taskName, notnull Faction faction, notnull SCR_CampaignMilitaryBaseComponent base)
void SCR_TaskNotificationManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_TaskNotificationConfig GetTaskNotificationConfig(SCR_ETaskNotification taskNotification)
void PlayTaskNotificationMsg(SCR_ETaskNotification taskNotification, SCR_ETaskNotificationMsg msg, int factionId, int baseCallsign, int callerGroupId, int calledGroupId, int grid, float quality)
void PlayVONotification(string soundEventName, int factionId, int baseCallsign=SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN, int callerGroupId=-1, int calledGroupId=-1, int grid=-1, float quality=0.5)
void PopupMsg(string text, int prio=-1, string param1="", string param2="", string sound="", bool isFriendly=true)
string GetTaskNameWithGrid(LocalizedString taskKey, int grid)
proto external BaseWorld GetWorld()
Definition Math.c:13
bool GetEntityCallsignIndexes(IEntity entity, out int companyCallsignIndex, out int platoonCallsignIndex, out int squadCallsignIndex, out int characterCallsignIndex)
static string GetTranslatedGroupName(notnull SCR_AIGroup group)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
Takes care of dynamic and static onscreen popups.
void PopupMsg(string text, float duration=DEFAULT_DURATION, string text2="", int prio=-1, string param1="", string param2="", string param3="", string param4="", string text2param1="", string text2param2="", string text2param3="", string text2param4="", string sound="", SCR_EPopupMsgFilter category=SCR_EPopupMsgFilter.ALL, WorldTimestamp progressStart=null, WorldTimestamp progressEnd=null)
static SCR_PopUpNotification GetInstance()
Definition Types.c:486
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnInit(IEntity owner)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14
proto external PlayerController GetPlayerController()
T2 param2
Definition tuple.c:92
Tuple param1