1 [
ComponentEditorProps(
category:
"GameScripted/Editor", description:
"Entity transformation (moving and rotating). Works only with SCR_EditorBaseEntity!", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
36 SCR_CampaignBuildingCompositionComponent compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(pivot.GetOwner().FindComponent(SCR_CampaignBuildingCompositionComponent));
37 if (!compositionComponent)
40 if (compositionComponent.IsInteractionLocked())
42 SCR_NotificationsComponent.SendLocal(
ENotification.EDITOR_COMPOSITION_UNDER_CONSTRUCTION);
52 super.StartEditing(pivot, entities, transform);
56 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
59 super.StartEditingServer(pivotId, entityIds, dummyVector, transform, isUnderwater, verticalMode);
61 IEntity child = m_EditedPivot.GetOwner().GetChildren();
62 SCR_CampaignBuildingLayoutComponent layoutComponent;
64 while (child && !layoutComponent)
66 layoutComponent = SCR_CampaignBuildingLayoutComponent.Cast(child.FindComponent(SCR_CampaignBuildingLayoutComponent));
69 child = child.GetSibling();
74 layoutComponent.LockCompositionInteraction();
75 layoutComponent.DeletePreview();
81 [
RplRpc(RplChannel.Reliable, RplRcver.Owner)]
94 IEntity owner = m_EditedPivot.GetOwner();
99 owner.GetWorldTransform(transform);
101 array<vector> offsets = {};
102 ResourceName resName = owner.GetPrefabData().GetPrefabName();
106 Event_OnTransformationStart.Invoke(m_aEditedEntities);
110 SCR_BaseEditorEffect.Activate(prefabData.GetEffectsTransforationStart(),
this, entities: m_aEditedEntities);
116 super.EOnEditorActivate();
121 m_ObstructionComponent = SCR_CampaignBuildingPlacingObstructionEditorComponent.Cast(FindEditorComponent(SCR_CampaignBuildingPlacingObstructionEditorComponent,
true,
true));
127 super.EOnEditorDeactivate();
134 if (editedEntities.IsEmpty())
144 SCR_CampaignBuildingEditorComponent editorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent,
true));
145 if (!editorComponent)
148 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(editorComponent.GetProviderComponent());
149 if (!providerComponent)
152 if (vector.Distance(previewOrigin, providerComponent.GetOwner().GetOrigin()) > providerComponent.GetBuildingRadius())
169 super.ConfirmEditing();
182 [
RplRpc(RplChannel.Reliable, RplRcver.Owner)]
185 IEntity composition = m_EditedPivot.GetOwner();
187 super.ConfirmEditingServer(
params);
189 SCR_CampaignBuildingCompositionComponent compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(composition.FindComponent(SCR_CampaignBuildingCompositionComponent));
190 if (!compositionComponent)
198 compositionComponent.SpawnCompositionLayout(compositionComponent.GetPrefabId(), editableEntity);
199 compositionComponent.SetInteractionLockServer(
false);
203 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
206 SCR_CampaignBuildingLayoutComponent layoutComponent;
210 IEntity composition = m_EditedPivot.GetOwner();
211 SCR_CampaignBuildingCompositionComponent compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(composition.FindComponent(SCR_CampaignBuildingCompositionComponent));
212 if (!compositionComponent)
215 compositionComponent.SpawnCompositionLayout(compositionComponent.GetPrefabId(), m_EditedPivot);
216 compositionComponent.SetInteractionLockServer(
false);
219 super.CancelEditingServer();