Arma Reforger Script API
|
Manager of 'ghost' preview shown while transforming or placing. More...
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) |
![]() | |
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 () |
![]() | |
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 |
![]() | |
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 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). | |
Manager of 'ghost' preview shown while transforming or placing.
|
protected |
bool SCR_PreviewEntityEditorComponent.CanMoveInRoot | ( | ) |
bool SCR_PreviewEntityEditorComponent.CanUnsnap | ( | float | verticalDelta | ) |
Checked if preview entity is snapped and can be unsnapped.
verticalDelta | Intended vertical change |
SCR_BasePreviewEntity SCR_PreviewEntityEditorComponent.CreatePreview | ( | ResourceName | prefab, |
notnull array< vector > | offsets, | ||
vector | initTransform[4] = {} ) |
Create preview from prefab.
prefab | IEntity prefab |
offsets | Offsets when multiple instances of the preview entity are to be spawned |
initTransform | Transformation matrix on which the preview entity will be created (optional) |
SCR_BasePreviewEntity SCR_PreviewEntityEditorComponent.CreatePreview | ( | SCR_EditableEntityComponent | pivot, |
set< SCR_EditableEntityComponent > | entities ) |
Create preview from existing entities.
pivot | Directly edited entity |
entities | List of edited entities |
SCR_BasePreviewEntity SCR_PreviewEntityEditorComponent.CreateWaitingPreview | ( | ) |
Duplicate the preview to indicate waiting.
void SCR_PreviewEntityEditorComponent.DeletePreview | ( | ) |
Delete current preview entity.
override void SCR_PreviewEntityEditorComponent.EOnEditorActivate | ( | ) |
When the component is activated.
Implements SCR_BaseEditorComponent.
override void SCR_PreviewEntityEditorComponent.EOnEditorDeactivate | ( | ) |
When the component is deactivated.
Implements SCR_BaseEditorComponent.
override void SCR_PreviewEntityEditorComponent.EOnEditorDebug | ( | array< string > | debugTexts | ) |
Every frame while the editor is opened and debug menu is shown.
Implements SCR_BaseEditorComponent.
override void SCR_PreviewEntityEditorComponent.EOnEditorInit | ( | ) |
When the entity is created.
Implements SCR_BaseEditorComponent.
override void SCR_PreviewEntityEditorComponent.EOnFrame | ( | IEntity | owner, |
float | timeSlice ) |
string SCR_PreviewEntityEditorComponent.GetActionContext | ( | ) |
Get action context activated every frame.
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.
vector SCR_PreviewEntityEditorComponent.GetLocalOffset | ( | ) |
ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnPreviewChange | ( | ) |
Get event called every time preview transformation is updated.
ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnPreviewCreate | ( | ) |
Get event called when a preview is created (e.g., transforming or placing starts).
ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnPreviewDelete | ( | ) |
Get event called when a preview is deleted (e.g., transforming or placing ends).
ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnTargetChange | ( | ) |
Get event called every time preview is snapped or unsapped from a target.
ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnVerticalModeChange | ( | ) |
Get event called when vertical mode changes.
ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnVerticalSnapChange | ( | ) |
Get event called when vertical snapping changes.
ScriptInvoker SCR_PreviewEntityEditorComponent.GetOnWaitingPreviewCreate | ( | ) |
Get event called when waiting preview is created (e.g., after placing entity on client, while waiting for server callback).
SCR_EditablePreviewEntity SCR_PreviewEntityEditorComponent.GetPreviewEntity | ( | ) |
Get preview entity.
float SCR_PreviewEntityEditorComponent.GetPreviewHeightAboveSea | ( | ) |
Get preview's height above sea.
float SCR_PreviewEntityEditorComponent.GetPreviewHeightAboveTerrain | ( | ) |
Get preview's height above terrain.
bool SCR_PreviewEntityEditorComponent.GetPreviewTransform | ( | out vector | transform[4] | ) |
Get transformation of the preview entity.
transform | Preview transformation |
bool SCR_PreviewEntityEditorComponent.GetPreviewTransformOrigin | ( | out vector | transform[4] | ) |
Get transformation of the preview entity from when transformation started.
transform | Origin preview transformation |
ResourceName SCR_PreviewEntityEditorComponent.GetSlotPrefab | ( | ) |
Create slot prfab to which the preview can fit to.
|
protected |
SCR_EditableEntityComponent SCR_PreviewEntityEditorComponent.GetTarget | ( | ) |
Get target to which the preview is currently snapped to.
EEditableEntityInteraction SCR_PreviewEntityEditorComponent.GetTargetInteraction | ( | ) |
Get target interaction type.
EEditorTransformVertical SCR_PreviewEntityEditorComponent.GetVerticalMode | ( | ) |
Get mode which defines which height the preview maintains.
EEditorTransformVertical SCR_PreviewEntityEditorComponent.GetVerticalModeReal | ( | ) |
Get actually used vertical mode (in certain circumstances, the mode defaults to SEA instead of using what user chose)
void SCR_PreviewEntityEditorComponent.InitTransform | ( | vector | transform[4] | ) |
bool SCR_PreviewEntityEditorComponent.IsChange | ( | ) |
Check if the preview changed while editing.
bool SCR_PreviewEntityEditorComponent.IsEditing | ( | ) |
Check if editing is currently on.
bool SCR_PreviewEntityEditorComponent.IsFixedPosition | ( | ) |
Is the entity fixed to specific position?
bool SCR_PreviewEntityEditorComponent.IsMovingVertically | ( | ) |
Is the entity being moved vertically in this frame?
bool SCR_PreviewEntityEditorComponent.IsRotating | ( | ) |
Is the entity being rotated in this frame?
bool SCR_PreviewEntityEditorComponent.IsSnappedToTarget | ( | ) |
Check if snapped to taregt.
bool SCR_PreviewEntityEditorComponent.IsSnappedVertically | ( | ) |
Checked if preview entity is snapped according to currently active snapping rules.
bool SCR_PreviewEntityEditorComponent.IsUnderwater | ( | ) |
Is editing underwater?
bool SCR_PreviewEntityEditorComponent.IsVerticalSnap | ( | ) |
Get vertical snapping rules.
|
protected |
|
protected |
override void SCR_PreviewEntityEditorComponent.OnDelete | ( | IEntity | owner | ) |
|
protected |
void SCR_PreviewEntityEditorComponent.ResetPreviewHeight | ( | ) |
Reset entity height back to 0.
void SCR_PreviewEntityEditorComponent.ResetPreviewTransform | ( | ) |
Reset changes of the preveiw entity and hide it.
void SCR_PreviewEntityEditorComponent.SetIsMovingVertically | ( | bool | isMovingVertically | ) |
Set if the entity is being moved vertically this frame.
isRotating | True if being moved vertically |
void SCR_PreviewEntityEditorComponent.SetIsRotating | ( | bool | isRotating | ) |
Set if the entity is being rotated this frame.
isRotating | True if being rotated |
void SCR_PreviewEntityEditorComponent.SetLastPreviewState | ( | SCR_EPreviewState | state | ) |
Set the last preview state out of this method.
If it's needs restart.
SCR_EPreviewState | state - intended state |
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).
pos |
void SCR_PreviewEntityEditorComponent.SetPreviewState | ( | SCR_EPreviewState | state | ) |
Set preview material based on the requested status.
state | - desired state. |
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.
transform | Preview transformation |
bool SCR_PreviewEntityEditorComponent.SetTarget | ( | SCR_EditableEntityComponent | target, |
bool | isDelegate = false ) |
Attach preview entity to a target.
target | Target |
void SCR_PreviewEntityEditorComponent.SetVerticalMode | ( | EEditorTransformVertical | mode | ) |
Set mode which defines which height the preview maintains.
Mode |
void SCR_PreviewEntityEditorComponent.SetVerticalSnap | ( | bool | enabled | ) |
Set vertical snapping rules.
Mode |
void SCR_PreviewEntityEditorComponent.ShowAsDisabled | ( | bool | disable = true | ) |
Show preview entity as disabled.
disable | True to show as disabled, false to show in normal state |
vector SCR_PreviewEntityEditorComponent.SnapVertically | ( | vector | pos | ) |
Snap position according to currently active snapping rules.
pos | Unmodified position |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |