Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SetEnableDamageEditorAttribute.c
Go to the documentation of this file.
3 {
4  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5  {
6  //Disabled for now
7  return null;
8 
10  if (!editableEntity)
11  return null;
12 
13  if (!IsValidEntityType(editableEntity.GetEntityType()))
14  return null;
15 
16  IEntity owner = editableEntity.GetOwner();
17  if (!owner)
18  return null;
19 
20  DamageManagerComponent damageComponent = DamageManagerComponent.Cast(owner.FindComponent(DamageManagerComponent));
21  if (!damageComponent)
22  return null;
23 
24 
25  if (damageComponent.GetState() == EDamageState.DESTROYED)
26  return null;
27 
28  return SCR_BaseEditorAttributeVar.CreateBool(damageComponent.IsDamageHandlingEnabled());
29  }
30 
31  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
32  {
33  if (!var)
34  return;
35  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
36 
37  IEntity owner = editableEntity.GetOwner();
38  if (!owner)
39  return;
40 
41  DamageManagerComponent damageComponent = DamageManagerComponent.Cast(owner.FindComponent(DamageManagerComponent));
42  if (!damageComponent)
43  return;
44 
45  if (damageComponent.GetState() == EDamageState.DESTROYED)
46  return;
47 
48  damageComponent.EnableDamageHandling(var.GetBool());
49  }
50 
51  override int GetEntries(notnull array<ref SCR_BaseEditorAttributeEntry> outEntries)
52  {
53  }
54 };
SCR_SetEnableDamageEditorAttribute
Definition: SCR_SetEnableDamageEditorAttribute.c:2
SCR_ValidTypeBaseValueListEditorAttribute
Definition: SCR_ValidTypeBaseValueListEditorAttribute.c:2
EDamageState
EDamageState
Definition: EDamageState.c:12
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
DamageManagerComponent
Definition: DamageManagerComponent.c:12
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468