Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EditableEntityBaseChildComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Editor (Editables)", description: "", insertable: false)]
2 class SCR_EditableEntityBaseChildComponentClass : ScriptComponentClass
3 {
4 }
5 
7 
14 {
15  [Attribute("0", UIWidgets.Flags, "", enums: ParamEnumArray.FromEnum(EEditableEntityState))]
16  protected EEditableEntityState m_State;
17 
19 
20  //------------------------------------------------------------------------------------------------
25  void EOnStateChanged(EEditableEntityState states, EEditableEntityState changedState, bool toSet);
26 
27  //------------------------------------------------------------------------------------------------
30  {
31  //--- Call event on existing states
32  IEntity parentTemp = m_Owner;
34  while (parentTemp)
35  {
36  GenericEntity parentGeneric = GenericEntity.Cast(parentTemp);
37  if (parentGeneric)
38  {
39  entity = SCR_EditableEntityComponent.Cast(parentGeneric.FindComponent(SCR_EditableEntityComponent));
40  if (entity)
41  {
42  //--- Mark the entity as virtual
43  if (!entity.HasEntityFlag(EEditableEntityFlag.VIRTUAL))
44  entity.SetEntityFlag(EEditableEntityFlag.VIRTUAL, true);
45 
46  //--- Get all active states
47  EEditableEntityState states = entity.GetEntityStates();
48  EOnStateChanged(states, states, true);
49  break;
50  }
51  }
52  parentTemp = parentTemp.GetParent();
53  }
54  }
55 
56  //------------------------------------------------------------------------------------------------
60  bool CanApply(EEditableEntityState changedState)
61  {
62  return (m_State & changedState) && m_Owner;
63  }
64 
65  //------------------------------------------------------------------------------------------------
66  // constructor
70  void SCR_EditableEntityBaseChildComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
71  {
72  m_Owner = GenericEntity.Cast(ent);
73  }
74 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
EEditableEntityState
EEditableEntityState
Definition: EEditableEntityState.c:37
EEditableEntityFlag
EEditableEntityFlag
Unique flags of the entity.
Definition: EEditableEntityFlag.c:5
EOnStateChanged
void EOnStateChanged(EEditableEntityState states, EEditableEntityState changedState, bool toSet)
Show editable entity only when its state is RENDERED.
Definition: SCR_EditableEntityMaterialChildComponent.c:44
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
m_Owner
protected GenericEntity m_Owner
Definition: SCR_EditableEntityBaseChildComponent.c:18
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
UpdateFromCurrentState
void UpdateFromCurrentState()
Update based on current state of editable entity.
Definition: SCR_EditableEntityBaseChildComponent.c:29
SCR_EditableEntityBaseChildComponentClass
Definition: SCR_EditableEntityBaseChildComponent.c:2
Attribute
SCR_EditableEntityBaseChildComponentClass ScriptComponentClass Attribute("0", UIWidgets.Flags, "", enums:ParamEnumArray.FromEnum(EEditableEntityState))] protected EEditableEntityState m_State
SCR_EditableEntityBaseChildComponent
void SCR_EditableEntityBaseChildComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_EditableEntityBaseChildComponent.c:70
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
m_State
private EEditableEntityState m_State
Definition: SCR_BaseEntitiesEditorUIEffect.c:3
CanApply
bool CanApply(EEditableEntityState changedState)
Definition: SCR_EditableEntityBaseChildComponent.c:60
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180