5 private ref array<ref SCR_BaseEditorEffect> m_EffectsActivate;
8 private ref array<ref SCR_BaseEditorEffect> m_EffectsDeactivate;
12 array<ref SCR_BaseEditorEffect> GetEffectsActivate()
14 return m_EffectsActivate;
19 array<ref SCR_BaseEditorEffect> GetEffectsDeactivate()
21 return m_EffectsDeactivate;
124 protected RplComponent m_RplComponent;
125 private bool m_bOpen;
127 private ref ScriptInvoker m_OnEffect;
136 protected void EOnEditorInit();
140 protected void EOnEditorDelete();
144 protected void EOnEditorRequest(
bool isOpen);
148 protected void EOnEditorOpen();
152 protected void EOnEditorClose();
158 protected void EOnEditorPreActivate();
164 protected void EOnEditorActivate();
170 protected bool EOnEditorActivateAsync(
int attempt)
177 protected void EOnEditorPostActivate();
183 protected void EOnEditorDeactivate();
189 protected bool EOnEditorDeactivateAsync(
int attempt)
196 protected void EOnEditorPostDeactivate();
200 protected void EOnEditorDebug(array<string> debugTexts);
214 protected void EOnEditorInitServer();
218 protected void EOnEditorDeleteServer();
222 protected void EOnEditorOpenServer();
226 protected void EOnEditorOpenServerCallback();
230 protected void EOnEditorCloseServer();
234 protected void EOnEditorCloseServerCallback();
240 protected void EOnEditorActivateServer();
246 protected void EOnEditorDeactivateServer();
254 sealed
void OnInitBase()
260 sealed
void OnDeleteBase()
267 sealed
void OnRequestBase(
bool isOpen)
269 EOnEditorRequest(isOpen);
273 sealed
void OnOpenedBase()
280 sealed
void OnClosedBase()
288 sealed
void OnPreActivateBase()
290 EOnEditorPreActivate();
294 sealed
void OnActivateBase()
304 sealed
bool OnActivateAsyncBase(
int attempt)
306 return EOnEditorActivateAsync(attempt);
310 sealed
void OnPostActivateBase()
312 EOnEditorPostActivate();
320 sealed
void OnDeactivateBase()
337 sealed
void OnPostDeactivateBase()
339 EOnEditorPostDeactivate();
345 sealed
bool OnDeactivateAsyncBase(
int attempt)
347 return EOnEditorDeactivateAsync(attempt);
368 static Managed GetInstance(
typename type,
bool showError =
false,
bool modeFirst =
false)
375 Print(
string.Format(
"Cannot find editor component '%1', local instance of editor manager not found!",
type), LogLevel.ERROR);
379 Managed component = editorManager.FindComponent(
type);
380 if (component && !modeFirst)
387 Managed componentMode = editorMode.FindComponent(
type);
390 return componentMode;
394 Print(
string.Format(
"Cannot find editor component '%1' on local instance of editor manager or on the curent editor mode!",
type), LogLevel.ERROR);
399 Print(
string.Format(
"Cannot find editor component '%1' on local instance of editor manager, and no current editor mode exists!",
type), LogLevel.ERROR);
413 Managed component = editorManager.FindComponent(
type);
421 editorManager = editorMode.GetManager();
425 return editorManager.FindComponent(
type);
433 static int GetAllInstances(
typename type, out notnull array<Managed> outComponents)
435 outComponents.Clear();
441 Managed component = editorManager.FindComponent(
type);
443 outComponents.Insert(component);
445 array<SCR_EditorModeEntity> modeEntities = {};
446 int modesCount = editorManager.GetModeEntities(modeEntities);
447 for (
int i = 0; i < modesCount; i++)
449 component = modeEntities[i].FindComponent(
type);
451 outComponents.Insert(component);
453 return outComponents.Count();
466 manager =
m_Owner.GetManager();
484 Print(
string.Format(
"Cannot find editor component '%1', local instance of editor manager not found!",
type), LogLevel.ERROR);
489 if (component && !modeFirst)
499 component = componentMode;
501 else if (showError && !component)
503 Print(
string.Format(
"Cannot find editor component '%1' on local instance of editor manager or on the curent editor mode!",
type), LogLevel.ERROR);
506 else if (showError && !component)
508 Print(
string.Format(
"Cannot find editor component '%1' on local instance of editor manager, and no current editor mode exists!",
type), LogLevel.ERROR);
516 EntityComponentPrefabData GetEditorComponentData()
519 return GetComponentData(
m_Owner);
537 void ResetEditorComponent();
542 ScriptInvoker GetOnEffect()
545 m_OnEffect =
new ScriptInvoker();
551 protected bool IsOnEditorManager()
557 protected bool IsOwner()
563 protected bool IsProxy()
569 protected bool IsMaster()
575 protected bool IsAdmin()
598 protected void SendNotification(
ENotification notificationID,
int selfID = 0,
int targetID = 0, vector
position = vector.Zero)
601 SCR_NotificationsComponent.SendLocal(notificationID,
position, selfID, targetID);
611 if (
m_Owner.GetOnOpenedServer())
614 if (
m_Owner.GetOnOpenedServerCallback())
615 m_Owner.GetOnOpenedServerCallback().Insert(EOnEditorOpenServerCallback);
617 if (
m_Owner.GetOnActivateServer())
620 if (
m_Owner.GetOnDeactivateServer())
623 if (
m_Owner.GetOnClosedServer())
626 if (
m_Owner.GetOnClosedServerCallback())
627 m_Owner.GetOnClosedServerCallback().Insert(EOnEditorCloseServerCallback);
652 m_Manager =
m_Owner.GetManager();
666 override void OnPostInit(IEntity owner)
687 Print(
"SCR_BaseEditorComponent must be attached to SCR_EditorBaseEntity!", LogLevel.ERROR);
698 if (Replication.IsServer())
699 EOnEditorDeleteServer();