1 [
ComponentEditorProps(
category:
"GameScripted/Editor (Editables)", description:
"", icon:
"WBData/ComponentEditorProps/componentEditor.png")]
15 [
RplProp(onRplName:
"OnRplLimitedEditor")]
16 protected bool m_bHasLimitedEditor;
20 protected ref ScriptInvoker m_OnUIReset =
new ScriptInvoker();
21 protected ref ScriptInvoker m_OnLimitedEditorChanged =
new ScriptInvoker();
35 m_bHasLimitedEditor = editorManager.IsLimited();
54 return m_OnLimitedEditorChanged;
62 return m_bHasLimitedEditor;
76 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
88 return m_ControlledEntity;
100 if (editorManagerCore) editorManagerCore.Event_OnEditorManagerInitOwner.Insert(
OnRplPlayerID);
106 if (editorManagerCore) editorManagerCore.Event_OnEditorManagerInitOwner.Remove(
OnRplPlayerID);
111 delegateManager.RegisterDelegate(
this);
117 m_OnLimitedEditorChanged.Invoke(
m_iPlayerID, m_bHasLimitedEditor);
125 m_bHasLimitedEditor = isLimited;
127 Replication.BumpMe();
133 if (m_ControlledEntity)
134 return m_ControlledEntity.GetEntityType(owner);
136 return super.GetEntityType(owner);
142 if (m_ControlledEntity)
144 SCR_UIInfo info = m_ControlledEntity.GetInfo(owner);
149 return super.GetInfo();
162 if (m_ControlledEntity)
164 Faction faction = m_ControlledEntity.GetFaction();
176 if (m_ControlledEntity)
177 return m_ControlledEntity.GetAIGroup();
185 if (m_ControlledEntity)
186 return m_ControlledEntity.GetVehicle();
194 if (m_ControlledEntity)
195 return m_ControlledEntity.GetHealth();
201 override bool GetEntityBudgetCost(out notnull array<ref SCR_EntityBudgetValue> outBudgets, IEntity owner =
null)
210 if (m_ControlledEntity)
211 return m_ControlledEntity.GetPos(pos);
219 return super.GetLogText(prefix) +
string.Format(
", ctrl: %1", m_ControlledEntity);
227 if (!super.RplSave(writer))
230 RplId controlledEntityRplID = Replication.FindId(m_ControlledEntity);
231 writer.WriteRplId(controlledEntityRplID);
241 if (!super.RplLoad(reader))
244 RplId controlledEntityRplID;
245 reader.ReadRplId(controlledEntityRplID);
254 super.OnPostInit(owner);
256 owner.SetFlags(EntityFlags.NO_LINK,
true);
265 delegateManager.UnegisterDelegate(
this);