Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseSupportStationEnableEditorAttribute.c
Go to the documentation of this file.
3 {
4  //------------------------------------------------------------------------------------------------
5  //~ Overwrite this
6  protected SCR_ESupportStationResupplyType GetSupportStationType()
7  {
8  Print("SCR_BaseSupportStationEnableEditorAttribute should never be used. Inherit instead!", LogLevel.ERROR);
9  return SCR_ESupportStationResupplyType.NONE;
10  }
11 
12  //------------------------------------------------------------------------------------------------
13  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
14  {
15  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
16  if (!editableEntity || !editableEntity.GetOwner())
17  return null;
18 
19  SCR_BaseSupportStationComponent supportStation = SCR_BaseSupportStationComponent.FindSupportStation(editableEntity.GetOwner(), GetSupportStationType());
20  if (!supportStation)
21  return null;
22 
23  return SCR_BaseEditorAttributeVar.CreateBool(supportStation.IsEnabled());
24  }
25 
26  //------------------------------------------------------------------------------------------------
27  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
28  {
29  if (!var)
30  return;
31 
32  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
33  if (!editableEntity || !editableEntity.GetOwner())
34  return;
35 
36  SCR_BaseSupportStationComponent supportStation = SCR_BaseSupportStationComponent.FindSupportStation(editableEntity.GetOwner(), GetSupportStationType());
37  if (!supportStation)
38  return;
39 
40  supportStation.SetEnabled(var.GetBool());
41  }
42 };
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_BaseSupportStationEnableEditorAttribute
Definition: SCR_BaseSupportStationEnableEditorAttribute.c:2
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