22 int m_iActionInfo = -1;
30 snapshot.Serialize(packet, 88);
36 return snapshot.Serialize(packet, 88);
42 return lhs.CompareSnapshots(rhs, 88);
48 return snapshot.Compare(prop.m_vTransform, 48)
49 && snapshot.Compare(prop.m_ParentID, 4)
50 && snapshot.Compare(prop.m_bParentChanged, 4)
51 && snapshot.Compare(prop.m_VerticalMode, 4)
52 && snapshot.Compare(prop.m_bIsUnderwater, 4)
53 && snapshot.Compare(prop.m_TargetRplID, 4)
54 && snapshot.Compare(prop.m_TargetStaticID, 8)
55 && snapshot.Compare(prop.m_TargetInteraction, 4)
56 && snapshot.Compare(prop.m_PlacingFlags, 4)
57 && snapshot.Compare(prop.m_iActionInfo, 4);
63 snapshot.SerializeBytes(prop.m_vTransform, 48);
64 snapshot.SerializeBytes(prop.m_ParentID, 4);
65 snapshot.SerializeBytes(prop.m_bParentChanged, 4);
66 snapshot.SerializeBytes(prop.m_VerticalMode, 4);
67 snapshot.SerializeBytes(prop.m_bIsUnderwater, 4);
68 snapshot.SerializeBytes(prop.m_TargetRplID, 4);
69 snapshot.SerializeBytes(prop.m_TargetStaticID, 8);
70 snapshot.SerializeBytes(prop.m_TargetInteraction, 4);
71 snapshot.SerializeBytes(prop.m_PlacingFlags, 4);
72 snapshot.SerializeBytes(prop.m_iActionInfo, 4);
80 snapshot.SerializeBytes(prop.m_vTransform, 48);
81 snapshot.SerializeBytes(prop.m_ParentID, 4);
82 snapshot.SerializeBytes(prop.m_bParentChanged, 4);
83 snapshot.SerializeBytes(prop.m_VerticalMode, 4);
84 snapshot.SerializeBytes(prop.m_bIsUnderwater, 4);
85 snapshot.SerializeBytes(prop.m_TargetRplID, 4);
86 snapshot.SerializeBytes(prop.m_TargetStaticID, 8);
87 snapshot.SerializeBytes(prop.m_TargetInteraction, 4);
88 snapshot.SerializeBytes(prop.m_PlacingFlags, 4);
89 snapshot.SerializeBytes(prop.m_iActionInfo, 4);
99 if (m_Offset ==
vector.Zero)
103 Math3D.MatrixCopy(m_vTransform, outTransform);
108 vector coefMatrix[4] = {m_vTransform[0], m_vTransform[1], m_vTransform[2],
vector.Zero};
110 Math3D.MatrixMultiply4(coefMatrix, offsetMatrix, offsetMatrix);
111 outTransform = {m_vTransform[0], m_vTransform[1], m_vTransform[2], m_vTransform[3] + offsetMatrix[3]};
121 if (!m_Parent && m_ParentID.IsValid())
123 Print(
string.Format(
"Cannot deserialize entity, parent with RplId = %1 not found!", m_ParentID),
LogLevel.ERROR);
132 if (!m_Target && m_TargetRplID.IsValid())
134 Print(
string.Format(
"Cannot deserialize entity, target neither with RplId = %1 nor with EntityID = %2 found!", m_TargetRplID, m_TargetStaticID),
LogLevel.ERROR);
146 if (target && target.GetOwner())
149 if (!m_TargetRplID.IsValid())
150 m_TargetStaticID = target.GetOwner().GetID();
162 array<Managed> actionProviders = {};
163 actionCompOwner.FindComponents(SCR_BaseActionsEditorComponent, actionProviders);
164 SCR_BaseActionsEditorComponent actionProvider;
166 foreach (
int i, Managed comp : actionProviders)
168 actionProvider = SCR_BaseActionsEditorComponent.Cast(comp);
173 output =
data.FindAction(action);
179 Print(
"SCR_EditorPreviewParams.SetActionInfo: System supports only up to 999 actions per SCR_BaseActionsEditorComponent! Processing of action with ID = " + output +
" from " + comp +
" was aborted.",
LogLevel.ERROR);
199 array<Managed> actionProviders = {};
200 actionCompOwner.FindComponents(SCR_BaseActionsEditorComponent, actionProviders);
201 int componentId =
Math.Floor(m_iActionInfo * 0.001);
202 if (!actionProviders.IsIndexValid(componentId))
205 SCR_BaseActionsEditorComponent actionProvider = SCR_BaseActionsEditorComponent.Cast(actionProviders[componentId]);
224 bool isUnderwater =
false,
231 params.m_ParentID = parentID;
232 params.m_VerticalMode = verticalMode;
233 params.m_bIsUnderwater = isUnderwater;
234 params.m_TargetInteraction = targetInteraction;
251 SCR_NotificationsComponent.SendLocal(
ENotification.EDITOR_TRANSFORMING_INCORRECT_TARGET);
263 params.m_bParentChanged = parentChanged;
ArmaReforgerScripted GetGame()
Get all prefabs that have the spawner data
Replication item identifier.
static SCR_EditableEntityComponent GetEditableEntity(IEntity owner)
Network packet of variables for entity placing and transformation.
SCR_BaseEditorAction m_SourceAction
local cache of the action which was the reason for creation of this param
static void Encode(SSnapSerializerBase snapshot, ScriptCtx hint, ScriptBitSerializer packet)
static bool Extract(SCR_EditorPreviewParams prop, ScriptCtx hint, SSnapSerializerBase snapshot)
static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx hint)
static SCR_EditorPreviewParams CreateParamsFromPreview(SCR_PreviewEntityEditorComponent previewManager, SCR_EditableEntityComponent parent=null, bool parentChanged=false)
SCR_BaseEditorAction GetSourceAction(notnull IEntity actionCompOwner)
void SetTarget(SCR_EditableEntityComponent target)
static SCR_EditorPreviewParams CreateParams(vector transform[4], RplId parentID=Replication.INVALID_ID, EEditorTransformVertical verticalMode=EEditorTransformVertical.SEA, bool isUnderwater=false, SCR_EditableEntityComponent target=null, EEditableEntityInteraction targetInteraction=EEditableEntityInteraction.NONE)
static bool Inject(SSnapSerializerBase snapshot, ScriptCtx hint, SCR_EditorPreviewParams prop)
static bool PropCompare(SCR_EditorPreviewParams prop, SSnapSerializerBase snapshot, ScriptCtx hint)
void GetWorldTransform(out vector outTransform[4])
static bool Decode(ScriptBitSerializer packet, ScriptCtx hint, SSnapSerializerBase snapshot)
static int PackActionInfo(notnull SCR_BaseEditorAction action, notnull IEntity actionCompOwner)
SCR_EditableEntityComponent GetTarget()
bool GetPreviewTransform(out vector transform[4])
EEditorTransformVertical GetVerticalModeReal()
EEditableEntityInteraction GetTargetInteraction()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
EEditorTransformVertical
Vertical transformation mode.
EEditableEntityInteraction
Type of suggested interaction when hovering edited entity on top of another entity.