Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SnapToTerrainContextAction.c
Go to the documentation of this file.
3 {
4  override bool CanBeShown(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
5  {
6  vector pos;
7  return selectedEntity.GetPos(pos)
8  && selectedEntity.GetEntityType() != EEditableEntityType.CHARACTER //--- ToDo: Don't compare to specific types
9  && !selectedEntity.HasEntityFlag(EEditableEntityFlag.NON_INTERACTIVE); //--- No applicable for slots or location labels
10  }
11 
12  override bool CanBePerformed(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
13  {
14  //--- ToDo: Only when not currently snapped?
15  return true;
16  }
17 
18  override void Perform(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition)
19  {
20  GenericEntity owner = selectedEntity.GetOwner();
21  if (!owner) return;
22 
23  vector transform[4];
24  selectedEntity.GetTransform(transform);
25 
26  if (!SCR_TerrainHelper.SnapToTerrain(transform, owner.GetWorld())) return;
27 
28  selectedEntity.SetTransformWithChildren(transform);
29  }
30 };
SCR_TerrainHelper
Definition: SCR_TerrainHelper.c:1
EEditableEntityFlag
EEditableEntityFlag
Unique flags of the entity.
Definition: EEditableEntityFlag.c:5
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_SnapToTerrainContextAction
Definition: SCR_SnapToTerrainContextAction.c:2
SCR_SelectedEntitiesContextAction
Definition: SCR_SelectedEntitiesContextAction.c:10
SCR_BaseContainerCustomTitleUIInfo
void SCR_BaseContainerCustomTitleUIInfo(string propertyName, string format="%1")
Definition: Attributes.c:788
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