Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_NotificationSenderComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/GameMode/Components", description: "Base for gamemode scripted component.")]
3 {
4 }
5 
6 class SCR_NotificationSenderComponent : SCR_BaseGameModeComponent
7 {
8  [Attribute("1", desc: "Show player left notification if player left.")]
9  protected bool m_bShowPlayerLeftNotification;
10 
11  [Attribute("10", desc: "Is killfeed enabled and what info will be displayed (Full killfeed is always displayed in open unlimited Editor)", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EKillFeedType))]
12  protected EKillFeedType m_iKillFeedType;
13 
14  [Attribute("40", desc: "If killfeed is enabled, what is the relationship between the player that died and the local player. (Full killfeed is always displayed in open unlimited Editor)", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EKillFeedReceiveType))]
15  protected EKillFeedReceiveType m_iReceiveKillFeedType;
16 
17  [Attribute("0", desc: "Array of Killfeed names")]
18  protected ref array<ref SCR_NotificationKillfeedTypeName> m_aKillfeedTypeNames;
19 
20  [Attribute("0", desc: "Array of Killfeed receive names")]
21  protected ref array<ref SCR_NotificationKillfeedreceiveTypeName> m_aKillfeedReceiveTypeNames;
22 
23  [Attribute("{D3BFEE28E7D5B6A1}Configs/ServerBrowser/KickDialogs.conf", desc: "If disconnect reason has a preset set to it then it will send a kick/ban notification", params: "conf")]
24  protected ref SCR_ConfigurableDialogUiPresets m_PlayerKickReasonsConfig;
25 
27 
29 
30  //States
32 
33  //------------------------------------------------------------------------------------------------
34  override void OnControllableDestroyed(IEntity entity, IEntity killerEntity, notnull Instigator killer)
35  {
36  //~ hot fix for On Controllable Destroyed issues \/
37  if (Replication.IsClient())
38  return;
39 
40  if (!entity)
41  return;
42 
43  RplComponent entityRpl = RplComponent.Cast(entity.FindComponent(RplComponent));
44  RplComponent instigatorRpl;
45 
46  if (killerEntity)
47  instigatorRpl = RplComponent.Cast(killerEntity.FindComponent(RplComponent));
48 
49  RplId entityRplId = RplId.Invalid();
50  RplId instigatorRplId = RplId.Invalid();
51 
52  if (entityRpl)
53  entityRplId = entityRpl.Id();
54 
55  if (instigatorRpl)
56  instigatorRplId = instigatorRpl.Id();
57 
58  OnControllableDestroyedBroadCast(entityRplId, instigatorRplId);
59  Rpc(OnControllableDestroyedBroadCast, entityRplId,instigatorRplId);
60 
61  //~ hot fix for On Controllable Destroyed issues /\
62  }
63 
64  //------------------------------------------------------------------------------------------------
65  //~ Todo: This is a hot a hotfix for On Controllable Destroyed issues \/
66  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
67  protected void OnControllableDestroyedBroadCast(RplId entityRplId, RplId instigatorRplId)
68  {
69  IEntity entity;
70  IEntity instigator;
71 
72  RplComponent entityRpl = RplComponent.Cast(Replication.FindItem(entityRplId));
73  RplComponent instigatorRpl = RplComponent.Cast(Replication.FindItem(instigatorRplId));
74 
75  if (entityRpl)
76  entity = entityRpl.GetEntity();
77 
78  if (instigatorRpl)
79  instigator = instigatorRpl.GetEntity();
80 
81  OnControllableDestroyedHotfix(entity, instigator);
82  }
83  //~ hot fix for On Controllable Destroyed issues /\
84 
85  //------------------------------------------------------------------------------------------------
86  //~ Todo: hot fix for On Controllable Destroyed issues - Move logic to OnControllableDestroyed if fixed
87  protected void OnControllableDestroyedHotfix(IEntity entity, IEntity instigator)
88  {
89  //~ No entity destroyed
90  if (!entity)
91  return;
92 
93  bool isUnlimitedEditorOpened = false;
94 
95  //~ Check if player has unlimited editor and if the editor is open
96  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
97  if (editorManager)
98  isUnlimitedEditorOpened = !editorManager.IsLimited() && editorManager.IsOpened();
99 
100  //~ Killfeed is disabled and unlimited editor is not open
101  if (!isUnlimitedEditorOpened && m_iKillFeedType == EKillFeedType.DISABLED)
102  return;
103 
104  int playerId = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(entity);
105  if (playerId <= 0)
106  return;
107 
108  //~ Check if killed player message can be seen if Limited editor (or editor not open)
109  if (!isUnlimitedEditorOpened && m_iReceiveKillFeedType != EKillFeedReceiveType.ALL)
110  {
111  //~ No faction manager so don't show killfeed?
112  if (!m_FactionManager)
113  return;
114 
115  Faction localPlayerFaction = m_FactionManager.GetLocalPlayerFaction();
116 
117  //~ No local faction so don't show killfeed
118  if (!localPlayerFaction)
119  return;
120 
121  int localPlayerID = SCR_PlayerController.GetLocalPlayerId();
122  Faction killedPlayerFaction = m_FactionManager.GetPlayerFaction(playerId);
123 
124  switch (m_iReceiveKillFeedType)
125  {
126  //~ check if in group
127  case EKillFeedReceiveType.GROUP_ONLY :
128  {
129  //~ Check if local player is not the same as killed otherwise they are always in the same group
130  if (localPlayerID != playerId)
131  {
132  //~ Factions not friendly so don't show killfeed
133  if (!localPlayerFaction.IsFactionFriendly(killedPlayerFaction))
134  return;
135 
136  //~ No group manager so don't send
137  SCR_GroupsManagerComponent groupManager = SCR_GroupsManagerComponent.GetInstance();
138  if (!groupManager)
139  return;
140 
141  SCR_AIGroup localPlayerGroup = groupManager.GetPlayerGroup(localPlayerID);
142 
143  //~ If not in group or not in the same group do not send
144  if (!localPlayerGroup || !localPlayerGroup.IsPlayerInGroup(playerId))
145  return;
146  }
147 
148  break;
149  }
150 
151  //~ Check if the same faction
152  case EKillFeedReceiveType.SAME_FACTION_ONLY :
153  {
154  //~ Check if local player is not the same as killed otherwise they are always the same faction
155  if (localPlayerID != playerId)
156  {
157  //~ If no local faction or if not the same faction do not show killfeed
158  if (!localPlayerFaction || localPlayerFaction != killedPlayerFaction)
159  return;
160 
161  //~ If Faction is hostile towards itself still do not show killfeed (DM)
162  if (!localPlayerFaction.IsFactionFriendly(localPlayerFaction))
163  return;
164  }
165 
166  break;
167  }
168 
169  //~ Check if allies
170  case EKillFeedReceiveType.ALLIES_ONLY :
171  {
172  //~ Check if local player is not the same as killed otherwise they are always allied
173  if (localPlayerID != playerId)
174  {
175  //~ Factions not friendly so don't show killfeed
176  if (!localPlayerFaction || !localPlayerFaction.IsFactionFriendly(killedPlayerFaction))
177  return;
178  }
179 
180  break;
181  }
182 
183  //~ Check if enemies
184  case EKillFeedReceiveType.ENEMIES_ONLY :
185  {
186  //~ If local player killed it is never an enemy
187  if (localPlayerID == playerId)
188  return;
189 
190  //~ Factions friendly so don't show killfeed
191  if (localPlayerFaction.IsFactionFriendly(killedPlayerFaction))
192  return;
193 
194  break;
195  }
196  }
197  }
198 
199  //~ Never show killer so simply show player died if limited editor
200  if (!isUnlimitedEditorOpened && m_iKillFeedType == EKillFeedType.UNKNOWN_KILLER)
201  {
202  SCR_NotificationsComponent.SendLocal(ENotification.PLAYER_DIED, playerId);
203  return;
204  }
205 
206  int killerId;
207  if (entity == instigator)
208  killerId = playerId;
209  else
210  killerId = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(instigator);
211 
212  SCR_EditableCharacterComponent killerEditableCharacterComponent;
213  //~ If there is a killer and the killer is not the player itself
214  if (instigator && killerId <= 0)
215  {
216  killerEditableCharacterComponent = SCR_EditableCharacterComponent.Cast(instigator.FindComponent(SCR_EditableCharacterComponent));
217 
218  //~ Killer was not character so get killer in vehicle
219  if (!killerEditableCharacterComponent)
220  killerEditableCharacterComponent = GetKillerFromVehicle(instigator, instigator.IsInherited(Vehicle));
221 
222  if (killerEditableCharacterComponent)
223  killerId = SCR_PossessingManagerComponent.GetPlayerIdFromControlledEntity(killerEditableCharacterComponent.GetOwner());
224  }
225 
226  bool playerIsPossessed = false;
227  bool killerIsPossessed = false;
228 
229  //~ Check if player or killer where possessed
230  SCR_PossessingManagerComponent possesionManager = SCR_PossessingManagerComponent.GetInstance();
231  if (possesionManager)
232  {
233  playerIsPossessed = possesionManager.IsPossessing(playerId);
234 
235  if (killerId > 0)
236  killerIsPossessed = possesionManager.IsPossessing(killerId);
237  }
238 
239  //Death notification
240  //Suicide
241  if (playerId == killerId || !instigator)
242  {
243  //Player Suicide
244  if (!playerIsPossessed)
245  SCR_NotificationsComponent.SendLocal(ENotification.PLAYER_DIED, playerId);
246  //Possessed Suicide
247  else
248  SCR_NotificationsComponent.SendLocalUnlimitedEditor(ENotification.POSSESSED_AI_DIED, playerId);
249  }
250  //If killed by other player
251  else if (killerId > 0)
252  {
253  //Player killed player
254  if (!playerIsPossessed && !killerIsPossessed)
255  {
256  SCR_NotificationsComponent.SendLocal(ENotification.PLAYER_KILLED_PLAYER, killerId, playerId);
257  }
258  //Possesed player killed by other player (Show player killed by NPC and for GM: possesed GM killed player)
259  else if (!playerIsPossessed && killerIsPossessed)
260  {
261  SCR_NotificationsComponent.SendLocalUnlimitedEditor(ENotification.POSSESSED_AI_KILLED_PLAYER, killerId, playerId);
262  SCR_NotificationsComponent.SendLocalLimitedEditor(ENotification.AI_KILLED_PLAYER, killerId, playerId);
263  }
264  //Player killed possessed player (Show to GM only)
265  else if (playerIsPossessed && !killerIsPossessed)
266  {
267  SCR_NotificationsComponent.SendLocalUnlimitedEditor(ENotification.PLAYER_KILLED_POSSESSED_AI, killerId, playerId);
268  }
269  //Possessed AI Killed Possessed AI (GM Only)
270  else
271  {
272  SCR_NotificationsComponent.SendLocalUnlimitedEditor(ENotification.POSSESSED_AI_KILLED_POSSESSED_AI, killerId, playerId);
273  }
274  }
275  //Killed by NPC
276  else if (killerEditableCharacterComponent)
277  {
278  int killerRplId = Replication.FindId(killerEditableCharacterComponent);
279 
280  if (!playerIsPossessed)
281  SCR_NotificationsComponent.SendLocal(ENotification.AI_KILLED_PLAYER, killerRplId, playerId);
282  else
283  SCR_NotificationsComponent.SendLocalUnlimitedEditor(ENotification.AI_KILLED_POSSESSED_AI, killerRplId, playerId);
284  }
285  //Unknown killer
286  else
287  {
288  if (!playerIsPossessed)
289  SCR_NotificationsComponent.SendLocal(ENotification.PLAYER_DIED, playerId);
290  else
291  SCR_NotificationsComponent.SendLocalUnlimitedEditor(ENotification.POSSESSED_AI_DIED, playerId);
292  }
293  }
294 
295  //------------------------------------------------------------------------------------------------
296  protected SCR_EditableCharacterComponent GetKillerFromVehicle(IEntity veh, bool pilot)
297  {
298  BaseCompartmentManagerComponent compartmentManager = BaseCompartmentManagerComponent.Cast(veh.FindComponent(BaseCompartmentManagerComponent));
299 
300  if (!compartmentManager)
301  return null;
302 
303  array<BaseCompartmentSlot> compartments = {};
304 
305  for (int i = 0, compart = compartmentManager.GetCompartments(compartments); i < compart; i++)
306  {
307  BaseCompartmentSlot slot = compartments[i];
308 
309  if (pilot && slot.Type() == PilotCompartmentSlot)
310  {
311  if (slot.GetOccupant())
312  return SCR_EditableCharacterComponent.Cast(slot.GetOccupant().FindComponent(SCR_EditableCharacterComponent));
313  }
314  else if (!pilot && slot.Type() == TurretCompartmentSlot)
315  {
316  if (slot.GetOccupant())
317  return SCR_EditableCharacterComponent.Cast(slot.GetOccupant().FindComponent(SCR_EditableCharacterComponent));
318  }
319  }
320 
321  return null;
322  }
323 
324  //------------------------------------------------------------------------------------------------
325  protected void OnEditorLimitedChanged(bool isLimited)
326  {
327  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
328  if (!editorManager)
329  return;
330 
331  int playerID = editorManager.GetPlayerID();
332 
333  //Became Player
334  if (isLimited)
335  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_PLAYER_NO_LONGER_GM, playerID);
336  //Became GM
337  else
338  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_PLAYER_BECAME_GM, playerID);
339  }
340 
341  //------------------------------------------------------------------------------------------------
342  override void OnPlayerRegistered(int playerId)
343  {
344  //Join notification
345  SCR_NotificationsComponent.SendLocal(ENotification.PLAYER_JOINED, playerId);
346  }
347 
348  //------------------------------------------------------------------------------------------------
349  override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
350  {
351  //~ Should never be called for clients but just in case
352  if (!GetGameMode().IsMaster())
353  return;
354 
355  SCR_EditorManagerEntity editorManager;
356 
357  //~ Get editorManager if has any
359  if (core)
360  editorManager = core.GetEditorManager(playerId);
361 
362  bool hasUnlimitedEditor = editorManager && !editorManager.IsLimited();
363 
364  //~ Is GM, Always show GM left notification even if kicked/banned to notify players that the GM has left
365  if (hasUnlimitedEditor)
366  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_GM_LEFT, playerId);
367 
368  bool isKickedOrBanned = false;
369 
370  //~ Check if disconnect cause has message attached to it. If true: show kick/ban reason. If false: only show gm/player left
371  if (m_PlayerKickReasonsConfig)
372  {
373  string groupId, reasonId;
374  KickCauseGroup2 groupInt;
375  int reasonInt;
376 
377  //~ Get disconnect message preset
378  GetGame().GetFullKickReason(cause, groupInt, reasonInt, groupId, reasonId);
379  SCR_ConfigurableDialogUiPreset preset = m_PlayerKickReasonsConfig.FindPreset(groupId + "_" + reasonId);
380 
381  //~ If has kick/Ban message it will send out a notification
382  isKickedOrBanned = preset != null && !preset.m_sMessage.IsEmpty();
383  }
384  //~ No config
385  else
386  {
387  Print("'SCR_NotificationSenderComponent' has no 'm_PlayerKickReasonsConfig'! Make sure it is added else it will never know if a player was kicked!", LogLevel.ERROR);
388  }
389 
390  //~ Is kicked/banned. Will also send ban notification if for some reason there is a timeout attached even if there is no specific kick message
391  if (isKickedOrBanned || timeout != 0)
392  {
393  SCR_DataCollectorComponent dataCollector = GetGame().GetDataCollector();
394  if (dataCollector)
395  {
396  SCR_PlayerData playerData = dataCollector.GetPlayerData(playerId);
397 
398  if (playerData)
399  {
400  float banTimeOut = playerData.GetTimeOut();
401 
402  //~ If playerData has ban timeout which is greater then timeout use that instead. This is because Heavy ban kicks the player and bans it via backend. So the timeout is set somewhere else
403  if (banTimeOut > 0 && banTimeOut > timeout)
404  timeout = banTimeOut;
405  }
406  }
407 
408  //~ Player kicked
409  if (timeout == 0)
410  SCR_NotificationsComponent.SendToEveryone(ENotification.PLAYER_KICKED, playerId, cause, timeout);
411  //~ Player perminent ban
412  else if (timeout < 0)
413  SCR_NotificationsComponent.SendToEveryone(ENotification.PLAYER_BANNED_NO_DURATION, playerId, cause, timeout);
414  //~ Player temp ban
415  else
416  SCR_NotificationsComponent.SendToEveryone(ENotification.PLAYER_BANNED, playerId, cause, timeout);
417  }
418  //~ Is Not kicked/banned, is player and should send on leave notification.
419  else if (m_bShowPlayerLeftNotification && !hasUnlimitedEditor)
420  {
421  SCR_NotificationsComponent.SendToEveryone(ENotification.PLAYER_LEFT, playerId);
422  }
423  }
424 
425  //------------------------------------------------------------------------------------------------
426  override void OnPlayerSpawned(int playerId, IEntity controlledEntity)
427  {
428  //Check if faction changed and send notification if diffrent
429  if (m_FactionManager)
430  {
431  //Get factions using ID
432  Faction playerFaction = m_FactionManager.GetPlayerFaction(playerId);
433 
434  //Faction is diffrent
435  if (m_FactionOnSpawn != playerFaction)
436  {
437  //Send player joined faction notification
438  SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(ENotification.PLAYER_JOINED_FACTION, playerId);
439  m_FactionOnSpawn = playerFaction;
440  }
441  }
442  }
443 
444  //======================================== WEATHER SET TO LOOPING ========================================\\
445 
446  //------------------------------------------------------------------------------------------------
450  void OnWeatherChangedNotification(int playerID)
451  {
452  if (Replication.IsClient())
453  return;
454 
456  {
458  GetGame().GetCallqueue().CallLater(OnWeatherChangedNotificationDelay, 0 , false, playerID);
459  }
460  }
461 
462  //------------------------------------------------------------------------------------------------
463  protected void OnWeatherChangedNotificationDelay(int playerID)
464  {
466 
467  ChimeraWorld world = ChimeraWorld.CastFrom(GetGame().GetWorld());
468  if (!world)
469  return;
470 
471  TimeAndWeatherManagerEntity weatherManager = world.GetTimeAndWeatherManager();
472  if (!weatherManager)
473  return;
474 
475  WeatherState currentState = weatherManager.GetCurrentWeatherState();
476 
477  if (!currentState)
478  return;
479 
480  SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(ENotification.EDITOR_ATTRIBUTES_WEATHER_CHANGED, playerID, currentState.GetStateID());
481  }
482 
483  //======================================== KILLFEED ========================================\\
484 
485  //------------------------------------------------------------------------------------------------
489  int GetKillFeedTypeNames(notnull array<ref SCR_NotificationKillfeedTypeName> killFeedTypeNames)
490  {
491  killFeedTypeNames.Clear();
492  foreach (SCR_NotificationKillfeedTypeName killfeedTypeName: m_aKillfeedTypeNames)
493  {
494  killFeedTypeNames.Insert(killfeedTypeName);
495  }
496 
497  return killFeedTypeNames.Count();
498  }
499 
500  //------------------------------------------------------------------------------------------------
504  int GetKillFeedReceiveTypeNames(notnull array<ref SCR_NotificationKillfeedreceiveTypeName> killFeedReceiveTypeNames)
505  {
506  killFeedReceiveTypeNames.Clear();
507  foreach (SCR_NotificationKillfeedreceiveTypeName killfeedReceiveTypeName: m_aKillfeedReceiveTypeNames)
508  {
509  killFeedReceiveTypeNames.Insert(killfeedReceiveTypeName);
510  }
511 
512  return killFeedReceiveTypeNames.Count();
513  }
514 
515  //------------------------------------------------------------------------------------------------
517  EKillFeedType GetKillFeedType()
518  {
519  return m_iKillFeedType;
520  }
521 
522  //------------------------------------------------------------------------------------------------
526  void SetKillFeedType(EKillFeedType killFeedType, int playerNotificationId = -1)
527  {
528  if (!GetGameMode().IsMaster() || killFeedType == m_iKillFeedType)
529  return;
530 
531  SetKillFeedTypeBroadcast(killFeedType);
532  Rpc(SetKillFeedTypeBroadcast, killFeedType);
533 
534  if (playerNotificationId > 0)
535  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_CHANGED_KILLFEED_TYPE, playerNotificationId, killFeedType, false);
536  }
537 
538  //------------------------------------------------------------------------------------------------
540  EKillFeedReceiveType GetReceiveKillFeedType()
541  {
542  return m_iReceiveKillFeedType;
543  }
544 
545  //------------------------------------------------------------------------------------------------
549  void SetReceiveKillFeedType(EKillFeedReceiveType receiveKillFeedType, int playerNotificationId = -1)
550  {
551  if (receiveKillFeedType == m_iReceiveKillFeedType || !GetGameMode().IsMaster())
552  return;
553 
554  SetReceiveKillFeedTypeBroadcast(receiveKillFeedType);
555  Rpc(SetReceiveKillFeedTypeBroadcast, receiveKillFeedType);
556 
557  if (playerNotificationId > 0)
558  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_CHANGED_KILLFEED_RECEIVE_TYPE, playerNotificationId, receiveKillFeedType, true);
559  }
560 
561  //------------------------------------------------------------------------------------------------
562  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
563  protected void SetKillFeedTypeBroadcast(EKillFeedType killFeedType)
564  {
565  m_iKillFeedType = killFeedType;
566  }
567 
568  //------------------------------------------------------------------------------------------------
569  [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
570  protected void SetReceiveKillFeedTypeBroadcast(EKillFeedReceiveType receiveKillFeedType)
571  {
572  m_iReceiveKillFeedType = receiveKillFeedType;
573  }
574 
575  //======================================== RPL ========================================\\
576 
577  //------------------------------------------------------------------------------------------------
578  override bool RplSave(ScriptBitWriter writer)
579  {
580  writer.WriteInt(m_iKillFeedType);
581  writer.WriteInt(m_iReceiveKillFeedType);
582 
583  return true;
584  }
585 
586  //------------------------------------------------------------------------------------------------
587  override bool RplLoad(ScriptBitReader reader)
588  {
589  EKillFeedType killFeedType;
590  EKillFeedReceiveType receiveKillFeedType;
591 
592  reader.ReadInt(killFeedType);
593  reader.ReadInt(receiveKillFeedType);
594 
595  SetKillFeedTypeBroadcast(killFeedType);
596  SetReceiveKillFeedTypeBroadcast(receiveKillFeedType);
597 
598  return true;
599  }
600 
601  //======================================== INIT ========================================\\
602 
603  //------------------------------------------------------------------------------------------------
604  override void EOnInit(IEntity owner)
605  {
606  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
607  if (editorManager)
608  editorManager.GetOnLimitedChange().Insert(OnEditorLimitedChanged);
609 
610  m_FactionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
611 
612  super.EOnInit(owner);
613  }
614 
615  //------------------------------------------------------------------------------------------------
616  override void OnPostInit(IEntity owner)
617  {
618  SetEventMask(owner, EntityEvent.INIT);
619 
620  super.OnPostInit(owner);
621  }
622 
623  //======================================== DELETE ========================================\\
624 
625  //------------------------------------------------------------------------------------------------
626  protected override void OnDelete(IEntity owner)
627  {
628  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
629  if (editorManager)
630  editorManager.GetOnLimitedChange().Remove(OnEditorLimitedChanged);
631 
632  super.OnDelete(owner);
633  }
634 }
635 
639 {
640  //~ If changes are made in this enum make sure to change m_aKillfeedTypeNames
641  DISABLED = 0,
642  UNKNOWN_KILLER = 10,
643  FULL = 20,
644 }
645 
648 enum EKillFeedReceiveType
649 {
650  //~ If changes are made in this enum make sure to change m_aKillfeedReceiveTypeNames
651  ALL = 0,
652  ENEMIES_ONLY = 10,
653  ALLIES_ONLY = 20,
654  SAME_FACTION_ONLY = 30,
655  GROUP_ONLY = 40,
656 }
657 
660 class SCR_NotificationKillfeedTypeName
661 {
662  [Attribute(desc: "Killfeed type", uiwidget : UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EKillFeedType))]
663  protected EKillFeedType m_iKillfeedType;
664 
665  [Attribute(desc: "Name displayed in Notification", uiwidget: UIWidgets.LocaleEditBox)]
666  protected LocalizedString m_sKillfeedTypeName;
667 
668  //------------------------------------------------------------------------------------------------
670  EKillFeedType GetKillfeedType()
671  {
672  return m_iKillfeedType;
673  }
674 
675  //------------------------------------------------------------------------------------------------
677  string GetName()
678  {
679  return m_sKillfeedTypeName;
680  }
681 }
682 
684 [BaseContainerProps(), SCR_BaseContainerCustomTitleEnum(EKillFeedReceiveType, "m_iKillfeedreceiveType")]
686 {
687  [Attribute(desc: "Killfeed receive type", uiwidget : UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EKillFeedReceiveType))]
688  protected EKillFeedReceiveType m_iKillfeedreceiveType;
689 
690  [Attribute(desc: "Name displayed in Notification", uiwidget: UIWidgets.LocaleEditBox)]
691  protected LocalizedString m_sKillfeedReceiveTypeName;
692 
693  //------------------------------------------------------------------------------------------------
695  EKillFeedType GetKillfeedReceiveType()
696  {
697  return m_iKillfeedreceiveType;
698  }
699 
700  //------------------------------------------------------------------------------------------------
702  string GetName()
703  {
704  return m_sKillfeedReceiveTypeName;
705  }
706 }
UNKNOWN_KILLER
UNKNOWN_KILLER
Will see killfeed messages but will never know who the killer is.
Definition: SCR_NotificationSenderComponent.c:37
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
ChimeraWorld
Definition: ChimeraWorld.c:12
GROUP_ONLY
enum EKillFeedType GROUP_ONLY
Will see killfeed from group members only.
SCR_BaseContainerCustomTitleEnum
enum EKillFeedType SCR_BaseContainerCustomTitleEnum(EKillFeedType, "m_iKillfeedType")
Definition: SCR_NotificationSenderComponent.c:659
IsMaster
protected bool IsMaster()
Definition: SCR_DataCollectorComponent.c:190
SCR_PlayerController
Definition: SCR_PlayerController.c:31
desc
Configs ServerBrowser KickDialogs desc
Definition: SCR_NotificationSenderComponent.c:23
m_bListeningToWeatherChanged
protected bool m_bListeningToWeatherChanged
Definition: SCR_NotificationSenderComponent.c:31
GetName
string GetName()
Definition: SCR_ScenarioFrameworkLayerBase.c:85
KickCauseGroup2
KickCauseGroup2
Extends KickCauseGroup by adding game-specific groups.
Definition: KickCauseGroup2.c:13
BaseContainerProps
enum EKillFeedType BaseContainerProps()
Class to get Killfeed type name.
ALLIES_ONLY
enum EKillFeedType ALLIES_ONLY
Will see killfeed from allies only.
FULL
FULL
Will see every player (except possessed pawns) killed messages. Including killer.
Definition: SCR_NotificationSenderComponent.c:38
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
OnDelete
override void OnDelete(IEntity owner)
Definition: SCR_CampaignBuildingCompositionComponent.c:538
PilotCompartmentSlot
Definition: PilotCompartmentSlot.c:12
SCR_PlayerData
Definition: SCR_PlayerData.c:2
RplRpc
SCR_AchievementsHandlerClass ScriptComponentClass RplRpc(RplChannel.Reliable, RplRcver.Owner)] void UnlockOnClient(AchievementId achievement)
Definition: SCR_AchievementsHandler.c:11
RplLoad
override bool RplLoad(ScriptBitReader reader)
Definition: SCR_AIGroupInfoComponent.c:106
KickCauseCode
KickCauseCode
Definition: KickCauseCode.c:19
Instigator
Definition: Instigator.c:6
SAME_FACTION_ONLY
enum EKillFeedType SAME_FACTION_ONLY
Will see killfeed from same faction only.
EKillFeedType
EKillFeedType
Definition: SCR_NotificationSenderComponent.c:638
RplSave
override bool RplSave(ScriptBitWriter writer)
Definition: SCR_CampaignBuildingCompositionComponent.c:490
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
SCR_ConfigurableDialogUiPresets
Class for a .conf file with multiple presets.
Definition: SCR_ConfigurableDialogUI.c:849
SCR_NotificationSenderComponentClass
Definition: SCR_NotificationSenderComponent.c:2
OnEditorLimitedChanged
protected void OnEditorLimitedChanged(bool isLimited)
Definition: SCR_NightModeGameModeComponent.c:266
ENotification
ENotification
Definition: ENotification.c:4
m_FactionManager
protected SCR_FactionManager m_FactionManager
Definition: SCR_NotificationSenderComponent.c:28
OnPlayerRegistered
override void OnPlayerRegistered(int playerId)
Register provided client's respawn timer.
Definition: SCR_RespawnTimerComponent.c:207
SCR_EditorManagerCore
Core component to manage SCR_EditorManagerEntity.
Definition: SCR_EditorManagerCore.c:5
TurretCompartmentSlot
Definition: TurretCompartmentSlot.c:12
OnControllableDestroyed
override void OnControllableDestroyed(IEntity entity, IEntity killerEntity, notnull Instigator killer)
Award additional XP for enemies killed in friendly bases.
Definition: SCR_NotificationSenderComponent.c:34
OnPostInit
override void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_AIConfigComponent.c:72
ENEMIES_ONLY
enum EKillFeedType ENEMIES_ONLY
Will see killfeed from enemies only.
SCR_ConfigurableDialogUiPreset
Configuration for a dialog.
Definition: SCR_ConfigurableDialogUI.c:809
DISABLED
DISABLED
Killfeed is disabled.
Definition: SCR_NotificationSenderComponent.c:36
SCR_NotificationKillfeedreceiveTypeName
Class to get Killfeed receive type name.
Definition: SCR_NotificationSenderComponent.c:685
OnPlayerSpawned
override void OnPlayerSpawned(int playerId, IEntity controlledEntity)
Definition: SCR_XPHandlerComponent.c:32
EOnInit
override void EOnInit(IEntity owner)
Definition: SCR_AIConfigComponent.c:79
Faction
Definition: Faction.c:12
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_GroupsManagerComponent.c:1320
m_FactionOnSpawn
protected Faction m_FactionOnSpawn
Definition: SCR_NotificationSenderComponent.c:26
Attribute
SCR_NotificationSenderComponentClass SCR_BaseGameModeComponentClass Attribute("1", desc:"Show player left notification if player left.")
Definition: SCR_NotificationSenderComponent.c:8
SCR_AIGroup
Definition: SCR_AIGroup.c:68
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition: SCR_FactionManager.c:461
LocalizedString
Definition: LocalizedString.c:21
OnPlayerDisconnected
override void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
Definition: SCR_PlayerProfileManagerComponent.c:119
SCR_BaseGameModeComponentClass
Definition: SCR_BaseGameModeComponent.c:2
ALL
enum EKillFeedType ALL
Will see killfeed from allies and enemies alike.
Definition: SCR_ScenarioFrameworkLayerBase.c:13
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
SCR_BaseGameModeComponent
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_BaseGameModeComponent.c:199
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26