Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PlayerTeleportedFeedbackComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Misc", description: "")]
2 class SCR_PlayerTeleportedFeedbackComponentClass : ScriptComponentClass
3 {
4 }
5 
6 class SCR_PlayerTeleportedFeedbackComponent : ScriptComponent
7 {
8  protected ref ScriptInvoker m_OnPlayerTeleported = new ScriptInvoker(); //param int GM that teleported the player
10 
11  //------------------------------------------------------------------------------------------------
13  ScriptInvoker GetOnPlayerTeleported()
14  {
15  return m_OnPlayerTeleported;
16  }
17 
18  //------------------------------------------------------------------------------------------------
20  void PlayerTeleported(IEntity character, bool isLongFade, SCR_EPlayerTeleportedReason teleportReason)
21  {
22  //~ Do not show teleport feedback if no character
23  if (!character)
24  return;
25 
26  //~ Do not show teleport feedback if dead
27  SCR_DamageManagerComponent damageManager = SCR_DamageManagerComponent.GetDamageManager(character);
28  if (damageManager && damageManager.GetState() == EDamageState.DESTROYED)
29  return;
30 
31  bool editorIsOpen = SCR_EditorManagerEntity.IsOpenedInstance();
32 
33  m_OnPlayerTeleported.Invoke(editorIsOpen, isLongFade, teleportReason);
34 
35  //~ Player teleported by GM
36  if (teleportReason == SCR_EPlayerTeleportedReason.EDITOR)
37  {
38  //~ Only show notification if editor is closed
39  if (!editorIsOpen)
40  SCR_NotificationsComponent.SendLocal(ENotification.EDITOR_GM_TELEPORTED_PLAYER);
41  }
42  //~ Player teleported as blocking spawner
43  else if (teleportReason == SCR_EPlayerTeleportedReason.BLOCKING_SPAWNER)
44  {
45  SCR_NotificationsComponent.SendLocal(ENotification.TELEPORTED_PLAYER_BLOCKING_SPAWNER);
46  }
47  }
48 }
49 
51 {
56 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
SCR_EPlayerTeleportedReason
SCR_EPlayerTeleportedReason
Definition: SCR_PlayerTeleportedFeedbackComponent.c:50
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
FAST_TRAVEL
@ FAST_TRAVEL
Definition: SCR_PlayerTeleportedFeedbackComponent.c:55
EDamageState
EDamageState
Definition: EDamageState.c:12
EDITOR
@ EDITOR
Definition: SCR_PlayerTeleportedFeedbackComponent.c:53
SCR_PlayerTeleportedFeedbackComponentClass
Definition: SCR_PlayerTeleportedFeedbackComponent.c:2
ENotification
ENotification
Definition: ENotification.c:4
BLOCKING_SPAWNER
@ BLOCKING_SPAWNER
Definition: SCR_PlayerTeleportedFeedbackComponent.c:54
DEFAULT
@ DEFAULT
Definition: SCR_PlayerTeleportedFeedbackComponent.c:52
m_PlayerManager
protected PlayerManager m_PlayerManager
Definition: SCR_PlayerTeleportedFeedbackComponent.c:9
PlayerTeleported
void PlayerTeleported(IEntity character, bool isLongFade, SCR_EPlayerTeleportedReason teleportReason)
On player teleported send a notification and event that the local player character is teleported.
Definition: SCR_PlayerTeleportedFeedbackComponent.c:20
m_OnPlayerTeleported
SCR_PlayerTeleportedFeedbackComponentClass m_OnPlayerTeleported
GetOnPlayerTeleported
ScriptInvoker GetOnPlayerTeleported()
Get on player Teleported script invoker.
Definition: SCR_PlayerTeleportedFeedbackComponent.c:13
PlayerManager
Definition: PlayerManager.c:12
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26