Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_NotificationPlayerAndLocation.c
Go to the documentation of this file.
1 
9 {
10  [Attribute(defvalue: "1", params: "1 1000", desc: "Notifications can only send int's thus if you want to send a float you will need to send all values the amount of values you want after the dot. eg: 23.05 = * 100 to get 2 values after the dot. You will need to make sure this attribute is the same amount as you multiplied it with")]
11  protected int m_iNumberDivider;
12 
13  override string GetText(SCR_NotificationData data)
14  {
15  int playerID, param2;
16  data.GetParams(playerID, param2);
17 
18  string playerName;
19  data.GetNotificationTextEntries(playerName);
20  if (!GetPlayerName(playerID, playerName))
21  return string.Empty;
22 
23  float distance = param2;
24  distance = param2 / m_iNumberDivider;
25 
26  vector position;
27  data.GetPosition(position);
28 
29  string location;
30 
31  //~ Get nearest location
32  SCR_EditableEntityComponent nearestLocation;
34  if (core)
35  nearestLocation = core.FindNearestEntity(position, EEditableEntityType.COMMENT, EEditableEntityFlag.LOCAL);
36 
37  //~ Set nearest location name or position as location name if no nearest found
38  if (nearestLocation)
39  location = nearestLocation.GetDisplayName();
40  else
41  location = SCR_MapEntity.GetGridLabel(position);
42 
43  data.SetNotificationTextEntries(playerName, distance.ToString(), location);
44  return super.GetText(data);
45  }
46 };
EEditableEntityFlag
EEditableEntityFlag
Unique flags of the entity.
Definition: EEditableEntityFlag.c:5
SCR_EditableEntityCore
Definition: SCR_EditableEntityCore.c:10
SCR_NotificationPlayer
Definition: SCR_NotificationPlayer.c:10
SCR_BaseContainerCustomTitleEnum
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
Definition: SCR_CampaignHintStorage.c:22
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
ENotification
ENotification
Definition: ENotification.c:4
Attribute
typedef Attribute
Post-process effect of scripted camera.
distance
float distance
Definition: SCR_DestructibleTreeV2.c:29
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_NotificationData
Definition: SCR_NotificationData.c:6
SCR_NotificationPlayerAndLocation
Definition: SCR_NotificationPlayerAndLocation.c:8
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
position
vector position
Definition: SCR_DestructibleTreeV2.c:30
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468