Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TeleportPlayerHereContextAction.c
Go to the documentation of this file.
3{
4 //------------------------------------------------------------------------------------------------
5 override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
6 {
7 if (cursorWorldPosition == vector.Zero || SCR_Enum.HasFlag(flags, EEditorContextActionFlags.LIMITED))
8 return false;
9
10 if (!SCR_Global.IsPositionWithinTerrainBounds(cursorWorldPosition))
11 return false;
12
14 if (!controlledEntity)
15 return false;
16
17 // Check faction entity
18 if (SCR_EditableFactionComponent.Cast(hoveredEntity))
19 return false;
20
22 if (!damageManager)
23 return true;
24
25 return damageManager.GetState() != EDamageState.DESTROYED;
26 }
27
28 //------------------------------------------------------------------------------------------------
29 override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
30 {
31 //~ Do not teleport if hovering over own player as this will cotnrol the player and teleporting player to the same location as it is doesn't really do anything
32 if (hoveredEntity && hoveredEntity.GetPlayerID() == SCR_PlayerController.GetLocalPlayerId())
33 return false;
34
35 return CanBeShown(hoveredEntity, selectedEntities, cursorWorldPosition, flags);
36 }
37
38 //------------------------------------------------------------------------------------------------
39 override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
40 {
42 playersManager.TeleportPlayerToPosition(cursorWorldPosition);
43 }
44}
SCR_EAIThreatSectorFlags flags
EEditorContextActionFlags
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_ArsenalGameModeUIDataHolder SCR_BaseContainerCustomTitleUIInfo("m_UIInfo")
proto external Managed FindComponent(typename typeName)
static bool IsPositionWithinTerrainBounds(vector pos)
Definition Functions.c:1981
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
static IEntity GetLocalControlledEntity()
EDamageState