Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_PreviewEntityEditorComponent Interface Reference

Manager of 'ghost' preview shown while transforming or placing. More...

Inheritance diagram for SCR_PreviewEntityEditorComponent:
SCR_BaseEditorComponent

Public Member Functions

void SetPreviewTransform (vector transform[4], float timeSlice=1, bool instant=false, EEditorTransformVertical verticalMode=EEditorTransformVertical.TERRAIN)
 Set transformation of the preview entity.
 
void ResetPreviewTransform ()
 Reset changes of the preveiw entity and hide it.
 
bool GetPreviewTransform (out vector transform[4])
 Get transformation of the preview entity.
 
bool GetPreviewTransformOrigin (out vector transform[4])
 Get transformation of the preview entity from when transformation started.
 
void SetPreviewHeight (vector pos)
 Set height in which the preview entity is.
 
void ResetPreviewHeight ()
 Reset entity height back to 0.
 
float GetPreviewHeightAboveTerrain ()
 Get preview's height above terrain.
 
float GetPreviewHeightAboveSea ()
 Get preview's height above sea.
 
vector GetLocalOffset ()
 
void SetVerticalMode (EEditorTransformVertical mode)
 Set mode which defines which height the preview maintains.
 
EEditorTransformVertical GetVerticalMode ()
 Get mode which defines which height the preview maintains.
 
EEditorTransformVertical GetVerticalModeReal ()
 Get actually used vertical mode (in certain circumstances, the mode defaults to SEA instead of using what user chose)
 
void SetVerticalSnap (bool enabled)
 Set vertical snapping rules.
 
bool IsVerticalSnap ()
 Get vertical snapping rules.
 
vector SnapVertically (vector pos)
 Snap position according to currently active snapping rules.
 
bool IsSnappedVertically ()
 Checked if preview entity is snapped according to currently active snapping rules.
 
bool CanUnsnap (float verticalDelta)
 Checked if preview entity is snapped and can be unsnapped.
 
bool CanMoveInRoot ()
 
void ShowAsDisabled (bool disable=true)
 Show preview entity as disabled.
 
void SetPreviewState (SCR_EPreviewState state)
 Set preview material based on the requested status.
 
void SetLastPreviewState (SCR_EPreviewState state)
 Set the last preview state out of this method.
 
bool SetTarget (SCR_EditableEntityComponent target, bool isDelegate=false)
 Attach preview entity to a target.
 
SCR_EditableEntityComponent GetTarget ()
 Get target to which the preview is currently snapped to.
 
EEditableEntityInteraction GetTargetInteraction ()
 Get target interaction type.
 
bool IsSnappedToTarget ()
 Check if snapped to taregt.
 
SCR_EditablePreviewEntity GetPreviewEntity ()
 Get preview entity.
 
string GetActionContext ()
 Get action context activated every frame.
 
bool IsEditing ()
 Check if editing is currently on.
 
bool IsChange ()
 Check if the preview changed while editing.
 
bool IsRotating ()
 Is the entity being rotated in this frame?
 
bool IsFixedPosition ()
 Is the entity fixed to specific position?
 
ResourceName GetSlotPrefab ()
 Create slot prfab to which the preview can fit to.
 
void SetIsMovingVertically (bool isMovingVertically)
 Set if the entity is being moved vertically this frame.
 
bool IsMovingVertically ()
 Is the entity being moved vertically in this frame?
 
void SetIsRotating (bool isRotating)
 Set if the entity is being rotated this frame.
 
bool IsUnderwater ()
 Is editing underwater?
 
array< IEntity > GetExcludeArray ()
 Get array of entities to be excluded when checking for GEOMETRY intersection for the preview.
 
ScriptInvoker GetOnPreviewCreate ()
 Get event called when a preview is created (e.g., transforming or placing starts).
 
ScriptInvoker GetOnPreviewDelete ()
 Get event called when a preview is deleted (e.g., transforming or placing ends).
 
ScriptInvoker GetOnPreviewChange ()
 Get event called every time preview transformation is updated.
 
ScriptInvoker GetOnTargetChange ()
 Get event called every time preview is snapped or unsapped from a target.
 
ScriptInvoker GetOnWaitingPreviewCreate ()
 Get event called when waiting preview is created (e.g., after placing entity on client, while waiting for server callback).
 
ScriptInvoker GetOnVerticalModeChange ()
 Get event called when vertical mode changes.
 
ScriptInvoker GetOnVerticalSnapChange ()
 Get event called when vertical snapping changes.
 
void InitTransform (vector transform[4])
 
SCR_BasePreviewEntity CreatePreview (SCR_EditableEntityComponent pivot, set< SCR_EditableEntityComponent > entities)
 Create preview from existing entities.
 
SCR_BasePreviewEntity CreatePreview (ResourceName prefab, notnull array< vector > offsets, vector initTransform[4]={})
 Create preview from prefab.
 
void DeletePreview ()
 Delete current preview entity.
 
SCR_BasePreviewEntity CreateWaitingPreview ()
 Duplicate the preview to indicate waiting.
 
override void EOnEditorDebug (array< string > debugTexts)
 Every frame while the editor is opened and debug menu is shown.
 
override void EOnFrame (IEntity owner, float timeSlice)
 
override void EOnEditorActivate ()
 When the component is activated.
 
override void EOnEditorDeactivate ()
 When the component is deactivated.
 
override void EOnEditorInit ()
 When the entity is created.
 
override void OnDelete (IEntity owner)
 
- Public Member Functions inherited from SCR_BaseEditorComponent
void OnInitBase ()
 
void OnDeleteBase ()
 
void OnRequestBase (bool isOpen)
 
void OnOpenedBase ()
 
void OnClosedBase ()
 
void OnPreActivateBase ()
 
void OnActivateBase ()
 
bool OnActivateAsyncBase (int attempt)
 
void OnPostActivateBase ()
 
void OnDeactivateBase ()
 
void OnPostDeactivateBase ()
 
bool OnDeactivateAsyncBase (int attempt)
 
void OnEffectBase (SCR_BaseEditorEffect effect)
 
SCR_EditorManagerEntity GetManager ()
 Get editor manager this component belongs to.
 
SCR_BaseEditorComponent FindEditorComponent (TypeName type, bool showError=false, bool modeFirst=false)
 Get the editor manager to which this component belongs.
 
EntityComponentPrefabData GetEditorComponentData ()
 Get prefab data of this component.
 
bool IsRemoved ()
 Check if the component is being deleted.
 
void ResetEditorComponent ()
 Reset values controlled by the component.
 
ScriptInvoker GetOnEffect ()
 Get event called when an effect is activated.
 
void InitServer ()
 
void InitOwner ()
 
override void OnPostInit (IEntity owner)
 
void SCR_BaseEditorComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 
void ~SCR_BaseEditorComponent ()
 

Protected Member Functions

float GetSnapBaseHeight (vector pos, EEditorTransformVertical verticalMode)
 
bool CanInteractWith (SCR_EditableEntityComponent target, out bool snap, out EEditableEntityInteraction interaction, bool isDelegate)
 
vector LerpTranslation (vector currentPos, vector targetPos, float timeSlice)
 
void LerpAngles (vector currentAngles, out vector targetAngles, float timeSlice)
 
void OnUserSettingsChanged ()
 
- Protected Member Functions inherited from SCR_BaseEditorComponent
bool IsOnEditorManager ()
 
bool IsOwner ()
 
bool IsProxy ()
 
bool IsMaster ()
 
bool IsAdmin ()
 
SCR_BaseEditorComponent GetParentComponent ()
 
void SetParentComponent (SCR_BaseEditorComponent parent)
 
void SendNotification (ENotification notificationID, int selfID=0, int targetID=0, vector position=vector.Zero)
 
void EOnEditorDelete ()
 When the entity is destroyed.
 
void EOnEditorRequest (bool isOpen)
 When opening/closing request is sent to server.
 
void EOnEditorOpen ()
 When the editor is opened.
 
void EOnEditorClose ()
 When the editor is closed.
 
void EOnEditorPreActivate ()
 Before the component is activated.
 
bool EOnEditorActivateAsync (int attempt)
 When the component is activated.
 
void EOnEditorPostActivate ()
 When the component is activated, but after EOnEditorActivate() function was called in all components.
 
bool EOnEditorDeactivateAsync (int attempt)
 When the component is deactivated.
 
void EOnEditorPostDeactivate ()
 When the component is deactivated, but after the next mode is activated.
 
void EOnEffect (SCR_BaseEditorEffect effect)
 When an effect is created in reaction an an event.
 
void EOnEditorInitServer ()
 When the entity is created (called on server)
 
void EOnEditorDeleteServer ()
 When the entity is destroyed (called on server)
 
void EOnEditorOpenServer ()
 When the editor is opened (called on server)
 
void EOnEditorOpenServerCallback ()
 When the editor is opened (called on server after async loading finished on client)
 
void EOnEditorCloseServer ()
 When the editor is closed (called on server)
 
void EOnEditorCloseServerCallback ()
 When the editor is closed (called on server after async loading finished on client)
 
void EOnEditorActivateServer ()
 When the component is activated (called on server)
 
void EOnEditorDeactivateServer ()
 When the component is deactivated (called on server)
 

Protected Attributes

ref Color m_HeightIndicatorColor
 
string m_sActionContext
 
bool m_bCanMoveInRoot
 
SCR_LayersEditorComponent m_LayerManager
 
SCR_StatesEditorComponent m_StateManager
 
SCR_EditablePreviewEntity m_PreviewEntity
 
ref SCR_EditableEntityInteraction m_Interaction
 
- Protected Attributes inherited from SCR_BaseEditorComponent
SCR_EditorBaseEntity m_Owner
 
SCR_EditorManagerEntity m_Manager
 
SCR_BaseEditorComponent m_Parent
 
RplComponent m_RplComponent
 

Static Protected Attributes

const float VERTICAL_TRACE_OFFSET = 0.01
 

Additional Inherited Members

- Static Public Member Functions inherited from SCR_BaseEditorComponent
static Managed GetInstance (TypeName type, bool showError=false, bool modeFirst=false)
 Get the local instance of a component attached on editor manager (SCR_EditorManagerEntity).
 
static Managed GetInstance (SCR_EditorBaseEntity editorManager, TypeName type, bool showError=false)
 Get instance of a component attached on specific editor manager / mode (SCR_EditorBaseEntity).
 
static int GetAllInstances (TypeName type, out notnull array< Managed > outComponents)
 Get component instances on editor manager (SCR_EditorBaseEntity) and all its modes (SCR_EditorModeEntity).
 

Detailed Description

Manager of 'ghost' preview shown while transforming or placing.

Member Function Documentation

◆ CanInteractWith()

bool SCR_PreviewEntityEditorComponent.CanInteractWith ( SCR_EditableEntityComponent target,
out bool snap,
out EEditableEntityInteraction interaction,
bool isDelegate )
protected

◆ CanMoveInRoot()

bool SCR_PreviewEntityEditorComponent.CanMoveInRoot ( )
Returns
True if the preview entity can be moved to root

◆ CanUnsnap()

bool SCR_PreviewEntityEditorComponent.CanUnsnap ( float verticalDelta)

Checked if preview entity is snapped and can be unsnapped.

Parameters
verticalDeltaIntended vertical change
Returns
True if the entity is snapped and can be unsnapped

◆ CreatePreview() [1/2]

SCR_BasePreviewEntity SCR_PreviewEntityEditorComponent.CreatePreview ( ResourceName prefab,
notnull array< vector > offsets,
vector initTransform[4] = {} )

Create preview from prefab.

Parameters
prefabIEntity prefab
offsetsOffsets when multiple instances of the preview entity are to be spawned
initTransformTransformation matrix on which the preview entity will be created (optional)
Returns
Created preview entity

◆ CreatePreview() [2/2]

SCR_BasePreviewEntity SCR_PreviewEntityEditorComponent.CreatePreview ( SCR_EditableEntityComponent pivot,
set< SCR_EditableEntityComponent > entities )

Create preview from existing entities.

Parameters
pivotDirectly edited entity
entitiesList of edited entities
Returns
Created preview entity

◆ CreateWaitingPreview()

SCR_BasePreviewEntity SCR_PreviewEntityEditorComponent.CreateWaitingPreview ( )

Duplicate the preview to indicate waiting.

◆ DeletePreview()

void SCR_PreviewEntityEditorComponent.DeletePreview ( )

Delete current preview entity.

◆ EOnEditorActivate()

override void SCR_PreviewEntityEditorComponent.EOnEditorActivate ( )

When the component is activated.

Implements SCR_BaseEditorComponent.

◆ EOnEditorDeactivate()

override void SCR_PreviewEntityEditorComponent.EOnEditorDeactivate ( )

When the component is deactivated.

Implements SCR_BaseEditorComponent.

◆ EOnEditorDebug()

override void SCR_PreviewEntityEditorComponent.EOnEditorDebug ( array< string > debugTexts)

Every frame while the editor is opened and debug menu is shown.

Implements SCR_BaseEditorComponent.

◆ EOnEditorInit()

override void SCR_PreviewEntityEditorComponent.EOnEditorInit ( )

When the entity is created.

Implements SCR_BaseEditorComponent.

◆ EOnFrame()

override void SCR_PreviewEntityEditorComponent.EOnFrame ( IEntity owner,
float timeSlice )

◆ GetActionContext()

string SCR_PreviewEntityEditorComponent.GetActionContext ( )

Get action context activated every frame.

Returns
Action context name

◆ GetExcludeArray()

array< IEntity > SCR_PreviewEntityEditorComponent.GetExcludeArray ( )

Get array of entities to be excluded when checking for GEOMETRY intersection for the preview.

Filled only if the preview was created from existing entities and not from a prefab.

Returns
Array of entities

◆ GetLocalOffset()

vector SCR_PreviewEntityEditorComponent.GetLocalOffset ( )
Returns
Offset of pivot on which the preview is centered (e.g., when dragging entity by its mesh, not by icon)

◆ GetOnPreviewChange()

ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnPreviewChange ( )

Get event called every time preview transformation is updated.

Returns
Script invoker

◆ GetOnPreviewCreate()

ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnPreviewCreate ( )

Get event called when a preview is created (e.g., transforming or placing starts).

Returns
Script invoker

◆ GetOnPreviewDelete()

ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnPreviewDelete ( )

Get event called when a preview is deleted (e.g., transforming or placing ends).

Returns
Script invoker

◆ GetOnTargetChange()

ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnTargetChange ( )

Get event called every time preview is snapped or unsapped from a target.

Returns
Script invoker

◆ GetOnVerticalModeChange()

ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnVerticalModeChange ( )

Get event called when vertical mode changes.

Returns
Script invoker

◆ GetOnVerticalSnapChange()

ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnVerticalSnapChange ( )

Get event called when vertical snapping changes.

Returns
Script invoker

◆ GetOnWaitingPreviewCreate()

ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnWaitingPreviewCreate ( )

Get event called when waiting preview is created (e.g., after placing entity on client, while waiting for server callback).

Returns
Script invoker

◆ GetPreviewEntity()

SCR_EditablePreviewEntity SCR_PreviewEntityEditorComponent.GetPreviewEntity ( )

Get preview entity.

Returns
Preview entity

◆ GetPreviewHeightAboveSea()

float SCR_PreviewEntityEditorComponent.GetPreviewHeightAboveSea ( )

Get preview's height above sea.

Returns
Height

◆ GetPreviewHeightAboveTerrain()

float SCR_PreviewEntityEditorComponent.GetPreviewHeightAboveTerrain ( )

Get preview's height above terrain.

Returns
Height

◆ GetPreviewTransform()

bool SCR_PreviewEntityEditorComponent.GetPreviewTransform ( out vector transform[4])

Get transformation of the preview entity.

Parameters
transformPreview transformation

◆ GetPreviewTransformOrigin()

bool SCR_PreviewEntityEditorComponent.GetPreviewTransformOrigin ( out vector transform[4])

Get transformation of the preview entity from when transformation started.

Parameters
transformOrigin preview transformation

◆ GetSlotPrefab()

ResourceName SCR_PreviewEntityEditorComponent.GetSlotPrefab ( )

Create slot prfab to which the preview can fit to.

Returns
Prefab resource

◆ GetSnapBaseHeight()

float SCR_PreviewEntityEditorComponent.GetSnapBaseHeight ( vector pos,
EEditorTransformVertical verticalMode )
protected

◆ GetTarget()

SCR_EditableEntityComponent SCR_PreviewEntityEditorComponent.GetTarget ( )

Get target to which the preview is currently snapped to.

Returns
Target editable entity

◆ GetTargetInteraction()

EEditableEntityInteraction SCR_PreviewEntityEditorComponent.GetTargetInteraction ( )

Get target interaction type.

Returns
Interaction type

◆ GetVerticalMode()

EEditorTransformVertical SCR_PreviewEntityEditorComponent.GetVerticalMode ( )

Get mode which defines which height the preview maintains.

Returns
Mode

◆ GetVerticalModeReal()

EEditorTransformVertical SCR_PreviewEntityEditorComponent.GetVerticalModeReal ( )

Get actually used vertical mode (in certain circumstances, the mode defaults to SEA instead of using what user chose)

Returns
Mode

◆ InitTransform()

void SCR_PreviewEntityEditorComponent.InitTransform ( vector transform[4])

◆ IsChange()

bool SCR_PreviewEntityEditorComponent.IsChange ( )

Check if the preview changed while editing.

Returns
True if changed

◆ IsEditing()

bool SCR_PreviewEntityEditorComponent.IsEditing ( )

Check if editing is currently on.

Returns
True when editing

◆ IsFixedPosition()

bool SCR_PreviewEntityEditorComponent.IsFixedPosition ( )

Is the entity fixed to specific position?

Returns
True if the position is fixed

◆ IsMovingVertically()

bool SCR_PreviewEntityEditorComponent.IsMovingVertically ( )

Is the entity being moved vertically in this frame?

Returns
True if being moved vertically

◆ IsRotating()

bool SCR_PreviewEntityEditorComponent.IsRotating ( )

Is the entity being rotated in this frame?

Returns
True if being rotated

◆ IsSnappedToTarget()

bool SCR_PreviewEntityEditorComponent.IsSnappedToTarget ( )

Check if snapped to taregt.

Returns
True if snapped

◆ IsSnappedVertically()

bool SCR_PreviewEntityEditorComponent.IsSnappedVertically ( )

Checked if preview entity is snapped according to currently active snapping rules.

Returns
True when snapped

◆ IsUnderwater()

bool SCR_PreviewEntityEditorComponent.IsUnderwater ( )

Is editing underwater?

Returns
True when currently editing underwater

◆ IsVerticalSnap()

bool SCR_PreviewEntityEditorComponent.IsVerticalSnap ( )

Get vertical snapping rules.

Returns
Mode

◆ LerpAngles()

void SCR_PreviewEntityEditorComponent.LerpAngles ( vector currentAngles,
out vector targetAngles,
float timeSlice )
protected

◆ LerpTranslation()

vector SCR_PreviewEntityEditorComponent.LerpTranslation ( vector currentPos,
vector targetPos,
float timeSlice )
protected

◆ OnDelete()

override void SCR_PreviewEntityEditorComponent.OnDelete ( IEntity owner)

◆ OnUserSettingsChanged()

void SCR_PreviewEntityEditorComponent.OnUserSettingsChanged ( )
protected

◆ ResetPreviewHeight()

void SCR_PreviewEntityEditorComponent.ResetPreviewHeight ( )

Reset entity height back to 0.

◆ ResetPreviewTransform()

void SCR_PreviewEntityEditorComponent.ResetPreviewTransform ( )

Reset changes of the preveiw entity and hide it.

◆ SetIsMovingVertically()

void SCR_PreviewEntityEditorComponent.SetIsMovingVertically ( bool isMovingVertically)

Set if the entity is being moved vertically this frame.

Parameters
isRotatingTrue if being moved vertically

◆ SetIsRotating()

void SCR_PreviewEntityEditorComponent.SetIsRotating ( bool isRotating)

Set if the entity is being rotated this frame.

Parameters
isRotatingTrue if being rotated

◆ SetLastPreviewState()

void SCR_PreviewEntityEditorComponent.SetLastPreviewState ( SCR_EPreviewState state)

Set the last preview state out of this method.

If it's needs restart.

Parameters
SCR_EPreviewStatestate - intended state

◆ SetPreviewHeight()

void SCR_PreviewEntityEditorComponent.SetPreviewHeight ( vector pos)

Set height in which the preview entity is.

Height of the preview is maintained based on specific editing modes (e.g., above terrain or above sea).

Parameters
pos

◆ SetPreviewState()

void SCR_PreviewEntityEditorComponent.SetPreviewState ( SCR_EPreviewState state)

Set preview material based on the requested status.

Parameters
state- desired state.

◆ SetPreviewTransform()

void SCR_PreviewEntityEditorComponent.SetPreviewTransform ( vector transform[4],
float timeSlice = 1,
bool instant = false,
EEditorTransformVertical verticalMode = EEditorTransformVertical::TERRAIN )

Set transformation of the preview entity.

When editing is confirmed, real entities are moved to where the preview is.

Parameters
transformPreview transformation

◆ SetTarget()

bool SCR_PreviewEntityEditorComponent.SetTarget ( SCR_EditableEntityComponent target,
bool isDelegate = false )

Attach preview entity to a target.

Parameters
targetTarget
Returns
True if the entity was attached

◆ SetVerticalMode()

void SCR_PreviewEntityEditorComponent.SetVerticalMode ( EEditorTransformVertical mode)

Set mode which defines which height the preview maintains.

Parameters
Mode

◆ SetVerticalSnap()

void SCR_PreviewEntityEditorComponent.SetVerticalSnap ( bool enabled)

Set vertical snapping rules.

Parameters
Mode

◆ ShowAsDisabled()

void SCR_PreviewEntityEditorComponent.ShowAsDisabled ( bool disable = true)

Show preview entity as disabled.

Parameters
disableTrue to show as disabled, false to show in normal state

◆ SnapVertically()

vector SCR_PreviewEntityEditorComponent.SnapVertically ( vector pos)

Snap position according to currently active snapping rules.

Parameters
posUnmodified position
Returns
Modified position

Member Data Documentation

◆ m_bCanMoveInRoot

bool SCR_PreviewEntityEditorComponent.m_bCanMoveInRoot
protected

◆ m_HeightIndicatorColor

ref Color SCR_PreviewEntityEditorComponent.m_HeightIndicatorColor
protected

◆ m_Interaction

ref SCR_EditableEntityInteraction SCR_PreviewEntityEditorComponent.m_Interaction
protected

◆ m_LayerManager

SCR_LayersEditorComponent SCR_PreviewEntityEditorComponent.m_LayerManager
protected

◆ m_PreviewEntity

SCR_EditablePreviewEntity SCR_PreviewEntityEditorComponent.m_PreviewEntity
protected

◆ m_sActionContext

string SCR_PreviewEntityEditorComponent.m_sActionContext
protected

◆ m_StateManager

SCR_StatesEditorComponent SCR_PreviewEntityEditorComponent.m_StateManager
protected

◆ VERTICAL_TRACE_OFFSET

const float SCR_PreviewEntityEditorComponent.VERTICAL_TRACE_OFFSET = 0.01
staticprotected

The documentation for this interface was generated from the following file: