Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SetSuppliesBaseEditorAttribute.c
Go to the documentation of this file.
3 {
4  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5  {
7  if (!editableEntity)
8  return null;
9 
10  if (!CanDisplay(editableEntity))
11  return null;
12 
13  /*SCR_CampaignSuppliesComponent supplyComponent = SCR_CampaignSuppliesComponent.GetSuppliesComponent(editableEntity.GetOwner());
14  if (!supplyComponent)
15  return null;*/
16 
18 
19  if (!base)
20  return null;
21 
22  if (base.GetSuppliesMax() <= 0)
23  return null;
24 
25  //~ Send over current and max value as max value is used in UI to set slider max
26  return SCR_BaseEditorAttributeVar.CreateVector(Vector(base.GetSupplies(), base.GetSuppliesMax(), 0));
27  }
28 
29  protected bool CanDisplay(SCR_EditableEntityComponent editableEntity)
30  {
31  //~ Ignore if vehicle
32  return editableEntity.GetEntityType() != EEditableEntityType.VEHICLE;
33  }
34 
35  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
36  {
37  if (!var)
38  return;
39 
40  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
41  if (!editableEntity)
42  return;
43 
44  /*SCR_CampaignSuppliesComponent supplyComponent = SCR_CampaignSuppliesComponent.GetSuppliesComponent(editableEntity.GetOwner());
45  if (!supplyComponent)
46  return;*/
47 
49 
50  if (!base)
51  return;
52 
53  vector currentAndMaxSupplies = var.GetVector();
54  base.SetSupplies(currentAndMaxSupplies[0]);
55  }
56 };
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseValueListEditorAttribute
Definition: SCR_BaseValueListEditorAttribute.c:5
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
SCR_SetSuppliesBaseEditorAttribute
Definition: SCR_SetSuppliesBaseEditorAttribute.c:2
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
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
SCR_CampaignMilitaryBaseComponent
Definition: SCR_CampaignMilitaryBaseComponent.c:38