Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_NotificationDisplayData.c
Go to the documentation of this file.
1
8{
9 [Attribute("0", UIWidgets.SearchComboBox, "Notification", "", ParamEnumArray.FromEnum(ENotification) )]
10 ENotification m_NotificationKey;
11
12 [Attribute()]
13 bool m_bPriorityNotification;
14
15 [Attribute("0", desc: "If true will add the (Friendly) indicator to any entities named in the notification that are friendly towards the local player that recieved the notification")]
17
18 [Attribute(desc: "Holds the display information of the notification, Fill in Name and Color. Optional: Icon")]
20
21 //Max amount of Characters a username can be. (Xbox = 12, Playstation = 16, Steam = 32)
23
25 protected const LocalizedString FRIENDLY_INDICATOR = "#AR-Notification_FriendlyIndicator";
26
27 protected const LocalizedString LOCAL_PLAYER_INDICATOR = "#AR-Notification_LocalPlayerIndicator";
28
29 protected static const float PLATFORM_ICON_SIZE = 2;
30
31 //------------------------------------------------------------------------------------------------
37 {
38 //Save Initial positions
39 if (m_info.GetEditorSetPositionData() != ENotificationSetPositionData.NEVER_AUTO_SET_POSITION)
41
42 //Save faction related color. Is ignored if no faction related color type is assigned
44 }
45
46 //------------------------------------------------------------------------------------------------
54 {
55 info = m_info;
56
57 colorEnum = m_info.GetNotificationColor();
58
59 if (colorEnum >= ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
60 colorEnum = data.GetFactionRelatedColor();
61 }
62
63 //------------------------------------------------------------------------------------------------
70 {
72 if (!coloredTextInfo)
73 return ENotificationColor.NEUTRAL;
74
75 ENotificationColor colorEnum = coloredTextInfo.GetNotificationTextColor();
76
77 if (colorEnum >= ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
78 colorEnum = data.GetFactionRelatedTextColor();
79
80 return colorEnum;
81 }
82
83 //------------------------------------------------------------------------------------------------
91 {
93
94 if (!splitNotificationUIInfo)
95 return;
96
97 ENotificationColor leftFactionColor, rightFactionColor;
98 data.GetSplitFactionRelatedColor(leftFactionColor, rightFactionColor);
99
100 leftTextColorEnum = splitNotificationUIInfo.GetLeftTextColor();
101
102 if (leftTextColorEnum >= ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE || splitNotificationUIInfo.ShouldReplaceLeftColorWithRightColorIfAlly())
103 leftTextColorEnum = leftFactionColor;
104
105 rightTextColorEnum = splitNotificationUIInfo.GetRightTextColor();
106
107 if (rightTextColorEnum >= ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
108 rightTextColorEnum = rightFactionColor;
109 }
110
111 //------------------------------------------------------------------------------------------------
118 {
119 if (!m_info)
120 {
121 Print("(" + typename.EnumToString(ENotification, data.GetID()) + ") SCR_NotificationDisplayData has no UIInfo assigned!", LogLevel.WARNING);
122 return string.Empty;
123 }
124
125 return m_info.GetName();
126 }
127
128 //------------------------------------------------------------------------------------------------
135 {
136 return false;
137 }
138
139 //------------------------------------------------------------------------------------------------
145 {
146 return m_bPriorityNotification;
147 }
148
149 //------------------------------------------------------------------------------------------------
158
159 //------------------------------------------------------------------------------------------------
160 protected bool GetPlayerName(int playerID, out string playerName)
161 {
162 //~ Name already assigned
163 if (!playerName.IsEmpty())
164 return true;
165
166 PlayerManager playerManager = GetGame().GetPlayerManager();
167 if (!playerManager)
168 return false;
169
170 playerName = SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(playerID);
171
172 if (playerName.Length() > MAX_USERNAME_CHARACTERS)
173 {
174 string trimedName = playerName.Substring(0, MAX_USERNAME_CHARACTERS);
175 playerName = trimedName + "...";
176 }
177
178 PlatformKind playerPlatform = playerManager.GetPlatformKind(SCR_PlayerController.GetLocalPlayerId());
179
181 if (!playerName.IsEmpty() && playerPlatform == PlatformKind.PSN)
182 {
183 if (playerManager.GetPlatformKind(playerID) == PlatformKind.PSN)
184 playerName = string.Format("<color rgba=%1><image set='%2' name='%3' scale='%4'/></color>", UIColors.FormatColor(GUIColors.ENABLED), UIConstants.ICONS_IMAGE_SET, UIConstants.PLATFROM_PLAYSTATION_ICON_NAME, PLATFORM_ICON_SIZE) + playerName;
185 else
186 playerName = string.Format("<color rgba=%1><image set='%2' name='%3' scale='%4'/></color>", UIColors.FormatColor(GUIColors.ENABLED), UIConstants.ICONS_IMAGE_SET, UIConstants.PLATFROM_GENERIC_ICON_NAME, PLATFORM_ICON_SIZE) + playerName;
187 }
188
189 if (SCR_PlayerController.GetLocalPlayerId() == playerID)
190 playerName = WidgetManager.Translate(LOCAL_PLAYER_INDICATOR, playerName);
191 else if (!playerName.IsEmpty() && m_bAddFriendlyIndicator && IsPlayerFriendlyToLocalPlayer(playerID))
192 playerName = WidgetManager.Translate(FRIENDLY_INDICATOR, playerName);
193
194 return !playerName.IsEmpty();
195 }
196
197 //------------------------------------------------------------------------------------------------
198 protected bool GetEditableEntityName(int entityRplID, out string entityName, bool useCharacterName = false)
199 {
200 //~ Name already assigned
201 if (!entityName.IsEmpty())
202 return true;
203
204 //Get target Entity. Also works with non-editable entity iD
205 SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(Replication.FindItem(entityRplID));
206 if (!editableEntity)
207 {
208 IEntity entity = IEntity.Cast(Replication.FindItem(entityRplID));
209 if (!entity)
210 {
211 RplComponent rplComponent = RplComponent.Cast(Replication.FindItem(entityRplID));
212 if (rplComponent)
213 entity = rplComponent.GetEntity();
214 }
215 if (entity)
217 }
218
219 //~ Editable entity component
220 if (editableEntity)
221 {
222 if (editableEntity.GetEntityType() != EEditableEntityType.TASK)
223 {
224 //~ Entity is a player so use that name instead
225 if (editableEntity.GetPlayerID() > 0)
226 return GetPlayerName(editableEntity.GetPlayerID(), entityName);
227
228 if (useCharacterName)
229 {
230 if (SCR_EditableCharacterComponent.Cast(editableEntity))
231 {
232 string format, firstname, alias, surname;
233 if (GetCharacterName(entityRplID, format, firstname, alias, surname))
234 {
235 entityName = WidgetManager.Translate(format, firstname, alias, surname);
236 if (!entityName.IsEmpty())
237 {
238 if (m_bAddFriendlyIndicator && IsEntityFriendlyToLocalPlayer(editableEntity.GetOwner()))
239 entityName = WidgetManager.Translate(FRIENDLY_INDICATOR, entityName);
240
241 return true;
242 }
243 }
244 }
245 }
246
247 //~ Use entity name
248 entityName = editableEntity.GetDisplayName();
249 }
250 //~ Get objective type name
251 else
252 {
253 SCR_EditableTaskComponentClass taskPrefabData = SCR_EditableTaskComponentClass.Cast(editableEntity.GetComponentData(editableEntity.GetOwner()));
254 if (taskPrefabData)
255 entityName = taskPrefabData.GetObjectiveTypeName();
256 else
257 entityName = editableEntity.GetDisplayName();
258 }
259 }
260
261 if (!entityName.IsEmpty() && m_bAddFriendlyIndicator && IsEntityFriendlyToLocalPlayer(editableEntity.GetOwner()))
262 entityName = WidgetManager.Translate(FRIENDLY_INDICATOR, entityName);
263
264 return !entityName.IsEmpty();
265 }
266
267 //------------------------------------------------------------------------------------------------
268 protected bool IsPlayerFriendlyToLocalPlayer(int notificationPlayerID, bool friendlyIfNoFaction = false)
269 {
270 //~ Is player self no need to show friendly
271 if (SCR_PlayerController.GetLocalPlayerId() == notificationPlayerID)
272 return false;
273
274 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
275 if (!factionManager)
276 return false;
277
278 Faction notificationPlayerFaction = factionManager.GetPlayerFaction(notificationPlayerID);
279 if (!notificationPlayerFaction)
280 return friendlyIfNoFaction;
281
282 //Get local player faction
283 Faction playerSelfFaction = factionManager.GetLocalPlayerFaction();
284 if (!playerSelfFaction)
285 return friendlyIfNoFaction;
286
287 return playerSelfFaction.IsFactionFriendly(notificationPlayerFaction);
288 }
289
290 //------------------------------------------------------------------------------------------------
291 protected bool IsEntityFriendlyToLocalPlayer(IEntity notificationEntity, bool friendlyIfNoFaction = false)
292 {
293 //If no entity given or the entity is the same as local controlled entity return false
294 if (!notificationEntity || SCR_PlayerController.GetLocalControlledEntity() == notificationEntity)
295 return false;
296
297 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
298 if (!factionManager)
299 return false;
300
301 Faction notificationEntityFaction;
302
303 //Get notification entity ChimeraCharacter
304 SCR_ChimeraCharacter notificationEntityChimera = SCR_ChimeraCharacter.Cast(notificationEntity);
305 if (notificationEntityChimera)
306 {
307 notificationEntityFaction = notificationEntityChimera.GetFaction();
308 }
309 else
310 {
311 FactionAffiliationComponent factionAffiliationComponent = FactionAffiliationComponent.Cast(notificationEntity.FindComponent(FactionAffiliationComponent));
312 if (factionAffiliationComponent)
313 notificationEntityFaction = factionAffiliationComponent.GetAffiliatedFaction();
314 }
315
316 if (!notificationEntityFaction)
317 return friendlyIfNoFaction;
318
319 //Get local player faction
320 Faction playerSelfFaction = factionManager.GetLocalPlayerFaction();
321 if (!playerSelfFaction)
322 return friendlyIfNoFaction;
323
324 return playerSelfFaction.IsFactionFriendly(notificationEntityFaction);
325 }
326
327 //------------------------------------------------------------------------------------------------
328 //~ Returns faction name by index
329 protected bool GetFactionName(int factionIndex, out string factionName)
330 {
331 //~ Name already assigned
332 if (!factionName.IsEmpty())
333 return true;
334
335 FactionManager factionManager = GetGame().GetFactionManager();
336 if (!factionManager)
337 return false;
338
339 Faction faction = factionManager.GetFactionByIndex(factionIndex);
340 if (!faction)
341 return false;
342
343 factionName = faction.GetFactionName();
344 return !factionName.IsEmpty();
345 }
346
347 //------------------------------------------------------------------------------------------------
348 protected bool GetCharacterName(int entityRplID, out string format, out string firstname, out string alias, out string surname)
349 {
350 //Get target Entity. Also works with non-editable entity iD
351 SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(Replication.FindItem(entityRplID));
352 if (!editableEntity)
353 {
354 IEntity entity = IEntity.Cast(Replication.FindItem(entityRplID));
355 if (!entity)
356 {
357 RplComponent rplComponent = RplComponent.Cast(Replication.FindItem(entityRplID));
358 if (rplComponent)
359 entity = rplComponent.GetEntity();
360 }
361 if (entity)
363
364 if (!editableEntity)
365 return false;
366 }
367
368 SCR_CharacterIdentityComponent charIdentity = SCR_CharacterIdentityComponent.Cast(editableEntity.GetOwner().FindComponent(SCR_CharacterIdentityComponent));
369 if (!charIdentity)
370 return false;
371
372 charIdentity.GetFormattedFullName(format, firstname, alias, surname);
373 return true;
374 }
375
376 //------------------------------------------------------------------------------------------------
377 //~ Returns translated callsign in correct formatting
378 protected bool GetEntityCallsign(int rplID, out string callsign)
379 {
380 //~ Name already assigned
381 if (!callsign.IsEmpty())
382 return true;
383
384 Managed managed = Replication.FindItem(rplID);
385 if (!managed)
386 return false;
387
388 SCR_CallsignBaseComponent callsignComponent;
389 ScriptComponent scriptComp = ScriptComponent.Cast(managed);
390
391 //~ Get managed script
392 if (scriptComp)
393 {
394 callsignComponent = SCR_CallsignBaseComponent.Cast(scriptComp.GetOwner().FindComponent(SCR_CallsignBaseComponent));
395 }
396 //~ Get managed entity
397 else
398 {
399 IEntity entity = IEntity.Cast(managed);
400 if (!entity)
401 return false;
402
403 callsignComponent = SCR_CallsignBaseComponent.Cast(entity.FindComponent(SCR_CallsignBaseComponent));
404 }
405
406 if (!callsignComponent)
407 return false;
408
409 string company, platoon, squad, character, format;
410 if (!callsignComponent.GetCallsignNames(company, platoon, squad, character, format))
411 return false;
412
413 //~ Translate the callsign strings so it can be send as 1 string
414 callsign = WidgetManager.Translate(format, company, platoon, squad, character);
415 return true;
416 }
417
418 //------------------------------------------------------------------------------------------------
419 //~ Returns group name, or callsign if no name assigned
420 protected bool GetGroupNameFromGroupID(int playerGroupId, out string groupName)
421 {
422 SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
423 if (!groupsManager)
424 return false;
425
426 SCR_AIGroup aiGroup;
427 aiGroup = groupsManager.FindGroup(playerGroupId);
428
429 if (!aiGroup)
430 return false;
431
432 groupName = aiGroup.GetCustomName();
433
434 //~ No custom name set so get Callsign instead
436 return GetEntityCallsign(Replication.FindItemId(aiGroup), groupName);
437
438 return true;
439 }
440
441 //------------------------------------------------------------------------------------------------
442 //~ Get inventory item name
443 protected bool GetInventoryItemName(RplId rplId, out string itemName)
444 {
445 if (!itemName.IsEmpty())
446 return true;
447
448 RplComponent itemRplcComp = RplComponent.Cast(Replication.FindItem(rplId));
449 if (!itemRplcComp)
450 return false;
451
452 IEntity itemEntity = itemRplcComp.GetEntity();
453 if (!itemEntity)
454 return false;
455
457 if (!item)
458 return false;
459
460 ItemAttributeCollection attributeCollection = item.GetAttributes();
461 if (!attributeCollection)
462 return false;
463
464 UIInfo uiInfo = attributeCollection.GetUIInfo();
465 if (!uiInfo)
466 return false;
467
468 itemName = uiInfo.GetName();
469
470 return !itemName.IsEmpty();
471 }
472
473 //------------------------------------------------------------------------------------------------
483 {
484 if (m_info.GetEditorSetPositionData() == ENotificationSetPositionData.AUTO_SET_AND_UPDATE_POSITION)
486
487 data.GetPosition(position);
488
489 if (position == vector.Zero)
490 return false;
491
492 return true;
493 }
494
495 //------------------------------------------------------------------------------------------------
501 {
502
503 }
504
505 //------------------------------------------------------------------------------------------------
507 {
509 data.GetPosition(position);
510
511 return !((m_info.GetEditorSetPositionData() == ENotificationSetPositionData.AUTO_SET_POSITION_ONCE && position != vector.Zero) || m_info.GetEditorSetPositionData() == ENotificationSetPositionData.NEVER_AUTO_SET_POSITION);
512 }
513
514 //------------------------------------------------------------------------------------------------
515 //Set position data using Player ID
517 {
518 PlayerManager playerManager = GetGame().GetPlayerManager();
519 if (!playerManager)
520 return;
521
522 SCR_EditableEntityComponent playerEntity = SCR_EditableEntityComponent.GetEditableEntity(playerManager.GetPlayerControlledEntity(playerID));
523
524 if (!playerEntity)
525 return;
526
528
529 if (!playerEntity.GetPos(position))
530 return;
531
532 data.SetPosition(position);
533 }
534
535 //------------------------------------------------------------------------------------------------
536 //Set position data using Editable Entity ID
537 protected void SetPositionDataEditableEntity(int enditableEntityID, SCR_NotificationData data)
538 {
539 SCR_EditableEntityComponent targetEntity = SCR_EditableEntityComponent.Cast(Replication.FindItem(enditableEntityID));
540
541 if (!targetEntity) return;
542
544 if (!targetEntity.GetPos(position)) return;
545
546 data.SetPosition(position);
547 }
548
549 //------------------------------------------------------------------------------------------------
558
559 //------------------------------------------------------------------------------------------------
560 //Get faction related color of player target
561 protected ENotificationColor GetFactionRelatedColorPlayer(int notificationPlayerID, ENotificationColor colorType)
562 {
563 //If not a faction set color keep current color
564 if (colorType < ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
565 return colorType;
566
567 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
568 if (!factionManager)
569 return ENotificationColor.NEUTRAL;
570
571 Faction notificationPlayerFaction = factionManager.GetPlayerFaction(notificationPlayerID);
572
573 //~ Notification color is equal to faction color
574 if (colorType == ENotificationColor.FACTION_COLOR)
575 {
576 if (!notificationPlayerFaction)
577 return ENotificationColor.NEUTRAL;
578
579 int factionIndex = factionManager.GetFactionIndex(notificationPlayerFaction);
580
581 //~ Return minus number to let system know to use it to get faction color
582 return (factionIndex +1) * -1;
583 }
584
586 return ENotificationColor.NEUTRAL;
587
588 //Get factions using ID
589 Faction playerSelfFaction = factionManager.GetLocalPlayerFaction();
590
591 if (!playerSelfFaction || !notificationPlayerFaction)
592 return ENotificationColor.NEUTRAL;
593
594 //Check if friendly
595 if (playerSelfFaction.IsFactionFriendly(notificationPlayerFaction))
596 {
597 if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
598 return ENotificationColor.NEGATIVE;
599 else if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_POSITIVE)
600 return ENotificationColor.POSITIVE;
601 else if (colorType == ENotificationColor.FACTION_ENEMY_IS_NEGATIVE_ONLY)
602 return ENotificationColor.NEUTRAL;
603 else if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_POSITIVE_ONLY)
604 return ENotificationColor.POSITIVE;
605 }
606 else
607 {
608 if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
609 return ENotificationColor.POSITIVE;
610 else if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_POSITIVE)
611 return ENotificationColor.NEGATIVE;
612 else if (colorType == ENotificationColor.FACTION_ENEMY_IS_NEGATIVE_ONLY)
613 return ENotificationColor.NEGATIVE;
614 else if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_POSITIVE_ONLY)
615 return ENotificationColor.NEUTRAL;
616 }
617
618 //No color set
619 return ENotificationColor.NEUTRAL;
620 }
621
622 //------------------------------------------------------------------------------------------------
623 //Get faction related color of entity target
624 protected ENotificationColor GetFactionRelatedColorEntity(int notificationEntityID, ENotificationColor colorType)
625 {
626 //If not a faction set color keep current color
627 if (colorType < ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
628 return colorType;
629
630 if (!GetGame().GetPlayerController()) return ENotificationColor.NEUTRAL;
631 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
632 if (!factionManager)
633 return ENotificationColor.NEUTRAL;
634
635 //Get notification entity
636 SCR_EditableEntityComponent notificationEntity = SCR_EditableEntityComponent.Cast(Replication.FindItem(notificationEntityID));
637 if (!notificationEntity)
638 return ENotificationColor.NEUTRAL;
639
640 //Get notification entity ChimeraCharacter
641 SCR_ChimeraCharacter notificationEntityChimera = SCR_ChimeraCharacter.Cast(notificationEntity.GetOwner());
642 if (!notificationEntityChimera)
643 return ENotificationColor.NEUTRAL;
644
645 Faction notificationEntityFaction = notificationEntityChimera.GetFaction();
646
647 //~ Notification color is equal to faction color
648 if (colorType == ENotificationColor.FACTION_COLOR)
649 {
650 if (!notificationEntityFaction)
651 return ENotificationColor.NEUTRAL;
652
653 int factionIndex = factionManager.GetFactionIndex(notificationEntityFaction);
654
655 //~ Return minus number to let system know to use it to get faction color
656 return (factionIndex +1) * -1;
657 }
658
659 //Get factions
660 Faction playerSelfFaction = factionManager.GetLocalPlayerFaction();
661
662 if (!playerSelfFaction || !notificationEntityFaction)
663 return ENotificationColor.NEUTRAL;
664
665 //Check if friendly
666 if (playerSelfFaction.IsFactionFriendly(notificationEntityFaction))
667 {
668 if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
669 return ENotificationColor.NEGATIVE;
670 else if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_POSITIVE)
671 return ENotificationColor.POSITIVE;
672 else if (colorType == ENotificationColor.FACTION_ENEMY_IS_NEGATIVE_ONLY)
673 return ENotificationColor.NEUTRAL;
674 else if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_POSITIVE_ONLY)
675 return ENotificationColor.POSITIVE;
676 }
677 else
678 {
679 if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_NEGATIVE)
680 return ENotificationColor.POSITIVE;
681 else if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_POSITIVE)
682 return ENotificationColor.NEGATIVE;
683 else if (colorType == ENotificationColor.FACTION_ENEMY_IS_NEGATIVE_ONLY)
684 return ENotificationColor.NEGATIVE;
685 else if (colorType == ENotificationColor.FACTION_FRIENDLY_IS_POSITIVE_ONLY)
686 return ENotificationColor.NEUTRAL;
687 }
688
689 //No color set
690 return ENotificationColor.NEUTRAL;
691 }
692
693 //------------------------------------------------------------------------------------------------
694 //Check if entities are friendly
695 protected bool AreEntitiesFriendly(int entity1ID, bool entity1IsPlayer, int entity2ID, bool entity2IsPlayer)
696 {
697 Faction faction1, faction2;
698
699 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
700
701 if (entity1IsPlayer || entity2IsPlayer)
702 {
703 if (!factionManager)
704 return false;
705 }
706
708 SCR_ChimeraCharacter entityChimera;
709
710 //Get notification entity
711
712 //Get entity 1 faction
713 if (entity1IsPlayer)
714 {
715 faction1 = factionManager.GetPlayerFaction(entity1ID);
716 }
717 else
718 {
719 entity = SCR_EditableEntityComponent.Cast(Replication.FindItem(entity1ID));
720 if (!entity)
721 return false;
722
723 //Get notification entity SCR_ChimeraCharacter
724 entityChimera = SCR_ChimeraCharacter.Cast(entity.GetOwner());
725 if (!entityChimera)
726 return false;
727
728 faction1 = entityChimera.GetFaction();
729 }
730
731 //Get entity 2 faction
732 if (entity2IsPlayer)
733 {
734 faction2 = factionManager.GetPlayerFaction(entity2ID);
735 }
736 else
737 {
738 entity = SCR_EditableEntityComponent.Cast(Replication.FindItem(entity2ID));
739 if (!entity)
740 return false;
741
742 //Get notification entity SCR_ChimeraCharacter
743 entityChimera = SCR_ChimeraCharacter.Cast(entity.GetOwner());
744 if (!entityChimera)
745 return false;
746
747 faction2 = entityChimera.GetFaction();
748 }
749
750 if (!faction1 || !faction2)
751 return false;
752
753 return faction1.IsFactionFriendly(faction2);
754 }
755};
ENotification
ENotificationColor
ArmaReforgerScripted GetGame()
Definition game.c:1398
PlatformKind
Definition PlatformKind.c:8
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
vector position
Get all prefabs that have the spawner data
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
Main replication API.
Definition Replication.c:14
Replication item identifier.
Definition RplId.c:14
string GetCustomName()
Component of assigning and storing squad names.
bool GetCallsignNames(out string company, out string platoon, out string squad, out string character, out string format)
static SCR_EditableEntityComponent GetEditableEntity(IEntity owner)
EEditableEntityType GetEntityType(IEntity owner=null)
SCR_UINotificationInfo GetNotificationUIInfo()
void SetPositionDataEditablePlayer(int playerID, SCR_NotificationData data)
bool GetPosition(SCR_NotificationData data, out vector position)
void SetPosition(SCR_NotificationData data)
ENotificationColor GetFactionRelatedColorEntity(int notificationEntityID, ENotificationColor colorType)
void GetSplitNotificationTextColors(SCR_NotificationData data, out ENotificationColor leftTextColorEnum=ENotificationColor.NEUTRAL, out ENotificationColor rightTextColorEnum=ENotificationColor.NEUTRAL)
bool IsEntityFriendlyToLocalPlayer(IEntity notificationEntity, bool friendlyIfNoFaction=false)
void GetDisplayVisualizationData(SCR_NotificationData data, out SCR_UINotificationInfo info=null, out ENotificationColor colorEnum=ENotificationColor.NEUTRAL)
void SetPositionDataEditableEntity(int enditableEntityID, SCR_NotificationData data)
string GetText(SCR_NotificationData data)
bool GetEntityCallsign(int rplID, out string callsign)
void SetFactionRelatedColor(SCR_NotificationData data)
const LocalizedString FRIENDLY_INDICATOR
String used to indicate friendly entities together with the name eg: (Friendly) [PlayerName]....
bool GetCharacterName(int entityRplID, out string format, out string firstname, out string alias, out string surname)
ENotificationColor GetTextColor(SCR_NotificationData data)
void SetInitialDisplayData(SCR_NotificationData data)
bool GetInventoryItemName(RplId rplId, out string itemName)
bool GetPlayerName(int playerID, out string playerName)
bool IsPlayerFriendlyToLocalPlayer(int notificationPlayerID, bool friendlyIfNoFaction=false)
bool GetFactionName(int factionIndex, out string factionName)
bool AreEntitiesFriendly(int entity1ID, bool entity1IsPlayer, int entity2ID, bool entity2IsPlayer)
bool GetGroupNameFromGroupID(int playerGroupId, out string groupName)
bool GetEditableEntityName(int entityRplID, out string entityName, bool useCharacterName=false)
bool CanSetPosition(SCR_NotificationData data)
ENotificationColor GetFactionRelatedColorPlayer(int notificationPlayerID, ENotificationColor colorType)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
static IEntity GetLocalControlledEntity()
static bool IsEmptyOrWhiteSpace(string input)
UIInfo used by the Notifications system.
proto external GenericEntity GetOwner()
Get owner entity.
UIInfo - allows to define UI elements.
Definition UIInfo.c:14
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
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()