Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ToggleDamageEditorAttribute.c
Go to the documentation of this file.
1 // Script File SCR_ToggleDamageEditorAttribute
4 {
5  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
6  {
7  //WIP
8  #ifndef WORKBENCH
9  return null;
10  #endif
11 
12  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
13  if (!editableEntity) return null;
14 
15  IEntity owner = editableEntity.GetOwner();
16  if (!owner) return null;
17  DamageManagerComponent damageComponent = DamageManagerComponent.Cast(owner.FindComponent(DamageManagerComponent));
18 
19  if (!damageComponent) return null;
20 
21  return SCR_BaseEditorAttributeVar.CreateInt(1);
22  }
23  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
24  {
25  if (!var) return;
26  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
27 
28  IEntity owner = editableEntity.GetOwner();
29  if (!owner) return;
30  DamageManagerComponent damageComponent = DamageManagerComponent.Cast(owner.FindComponent(DamageManagerComponent));
31  if (!damageComponent) return;
32 
33  Print("Set Damage enabled: " + var.GetInt());
34  }
35 };
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition: SCR_BaseEditorAttribute.c:3
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_ToggleDamageEditorAttribute
Definition: SCR_ToggleDamageEditorAttribute.c:3
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