Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SnapToTerrainToolbarAction.c
Go to the documentation of this file.
1 // Script File
4 {
5  override bool IsServer()
6  {
7  return false;
8  }
9  override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
10  {
11  return true;
12  }
13 
14  override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
15  {
16  return selectedEntities.Count() > 0;
17  }
18 
19  override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
20  {
21  foreach (SCR_EditableEntityComponent entity : selectedEntities)
22  {
23  GenericEntity owner = entity.GetOwner();
24  if (!owner) continue;
25 
26  vector transform[4];
27  entity.GetTransform(transform);
28 
29  if (!SCR_TerrainHelper.SnapToTerrain(transform, owner.GetWorld())) return;
30 
31  entity.SetTransform(transform);
32  }
33  }
34 };
SCR_TerrainHelper
Definition: SCR_TerrainHelper.c:1
SCR_SnapToTerrainToolbarAction
Definition: SCR_SnapToTerrainToolbarAction.c:3
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
SCR_EditorToolbarAction
Definition: SCR_EditorToolbarAction.c:3
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
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