Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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
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_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
static SCR_BaseEditorAttributeVar CreateVector(vector value)
EEditableEntityType GetEntityType(IEntity owner=null)
bool CanDisplay(SCR_EditableEntityComponent editableEntity)
override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
proto native vector Vector(float x, float y, float z)