Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditablePreviewComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Editor (Editables)", description: "", icon: "WBData/ComponentEditorProps/componentEditor.png")]
3 {
4 }
5 
7 
9 class SCR_EditablePreviewComponent : SCR_EditableEntityComponent
10 {
14 
15  //------------------------------------------------------------------------------------------------
19  {
20  if (!from || !from.IsRegistered())
21  return;
22 
23  m_SourceEntity = from;
24  m_EntityTypeInternal = from.GetEntityType();
25  m_vIconPos = from.m_vIconPos;
26  m_iIconBoneIndex = from.m_iIconBoneIndex;
27  RestoreParentEntity();
28  }
29 
30  //------------------------------------------------------------------------------------------------
33  void InitFromSource(IEntityComponentSource from)
34  {
35  if (!from)
36  return;
37 
39  from.Get("m_EntityType", m_EntityTypeInternal);
40  from.Get("m_vIconPos", m_vIconPos);
41 
42  string iconBoneName;
43  from.Get("m_sIconBoneName", iconBoneName);
44  if (m_Owner.GetAnimation())
45  m_iIconBoneIndex = m_Owner.GetAnimation().GetBoneIndex(iconBoneName);
46  else
47  m_iIconBoneIndex = -1;
48 
49  RestoreParentEntity();
50  }
51 
52  //------------------------------------------------------------------------------------------------
53  override bool GetPos(out vector pos)
54  {
55  if (m_Owner && (m_Owner.GetFlags() & EntityFlags.VISIBLE))
56  return super.GetPos(pos);
57  else
58  return false;
59  }
60 
61  //------------------------------------------------------------------------------------------------
62  override void UpdateGameHierarchy(IEntity parent, IEntity child, bool toAdd)
63  {
64  //--- Game hierarchy is managed by SCR_BasePreviewEntity
65  }
66 
67  //------------------------------------------------------------------------------------------------
68  override EEditableEntityType GetEntityType(IEntity owner = null)
69  {
70  return m_EntityTypeInternal;
71  }
72 
73  //------------------------------------------------------------------------------------------------
74  override SCR_UIInfo GetInfo(IEntity owner = null)
75  {
76  if (m_UIInfoInternal)
77  return m_UIInfoInternal;
78 
79  SCR_UIInfo info;
80  if (m_SourceEntity)
81  info = m_SourceEntity.GetInfo(owner);
82  else
83  info = super.GetInfo(owner);
84 
85  return info;
86  }
87 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
m_UIInfoInternal
protected ref SCR_UIInfo m_UIInfoInternal
Definition: SCR_EditablePreviewComponent.c:13
GetPos
override bool GetPos(out vector pos)
Definition: SCR_EditablePreviewComponent.c:53
GetEntityType
override EEditableEntityType GetEntityType(IEntity owner=null)
Definition: SCR_EditablePreviewComponent.c:68
InitFromEntity
void InitFromEntity(SCR_EditableEntityComponent from)
Definition: SCR_EditablePreviewComponent.c:18
InitFromSource
void InitFromSource(IEntityComponentSource from)
Definition: SCR_EditablePreviewComponent.c:33
SCR_EditablePreviewComponentClass
Definition: SCR_EditablePreviewComponent.c:2
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
m_SourceEntity
SCR_EditablePreviewComponentClass m_SourceEntity
Special configuration to show icon of SCR_BasePreviewEntity ghost preview.
SCR_UIInfo
Definition: SCR_UIInfo.c:7
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
UpdateGameHierarchy
override void UpdateGameHierarchy(IEntity parent, IEntity child, bool toAdd)
Definition: SCR_EditablePreviewComponent.c:62
SCR_EditableEntityComponentClass
Definition: SCR_EditableEntityComponentClass.c:2
GetInfo
override SCR_UIInfo GetInfo(IEntity owner=null)
Definition: SCR_EditablePreviewComponent.c:74
m_EntityTypeInternal
protected EEditableEntityType m_EntityTypeInternal
Definition: SCR_EditablePreviewComponent.c:12
m_Owner
SCR_AIGroupUtilityComponentClass m_Owner
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180