Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_SetSuppliesBaseEditorAttribute.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
2
class
SCR_SetSuppliesBaseEditorAttribute
:
SCR_BaseValueListEditorAttribute
3
{
4
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5
{
6
SCR_EditableEntityComponent
editableEntity =
SCR_EditableEntityComponent
.Cast(item);
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
17
SCR_CampaignMilitaryBaseComponent
base
=
SCR_CampaignMilitaryBaseComponent
.Cast(editableEntity.GetOwner().FindComponent(
SCR_CampaignMilitaryBaseComponent
));
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
48
SCR_CampaignMilitaryBaseComponent
base
=
SCR_CampaignMilitaryBaseComponent
.Cast(editableEntity.GetOwner().FindComponent(
SCR_CampaignMilitaryBaseComponent
));
49
50
if
(!
base
)
51
return
;
52
53
vector
currentAndMaxSupplies = var.
GetVector
();
54
base
.SetSupplies(currentAndMaxSupplies[0]);
55
}
56
};
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
base
around base
Definition
SCR_HoldCampaignMilitaryBaseTaskEntity.c:9
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::CreateVector
static SCR_BaseEditorAttributeVar CreateVector(vector value)
Definition
SCR_BaseEditorAttributeVar.c:125
SCR_BaseEditorAttributeVar::GetVector
vector GetVector()
Definition
SCR_BaseEditorAttributeVar.c:74
SCR_BaseValueListEditorAttribute
Definition
SCR_BaseValueListEditorAttribute.c:6
SCR_CampaignMilitaryBaseComponent
Definition
SCR_CampaignMilitaryBaseComponent.c:38
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_EditableEntityComponent::GetEntityType
EEditableEntityType GetEntityType(IEntity owner=null)
Definition
SCR_EditableEntityComponent.c:127
SCR_SetSuppliesBaseEditorAttribute
Definition
SCR_SetSuppliesBaseEditorAttribute.c:3
SCR_SetSuppliesBaseEditorAttribute::CanDisplay
bool CanDisplay(SCR_EditableEntityComponent editableEntity)
Definition
SCR_SetSuppliesBaseEditorAttribute.c:29
SCR_SetSuppliesBaseEditorAttribute::WriteVariable
override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
Definition
SCR_SetSuppliesBaseEditorAttribute.c:35
vector
Definition
vector.c:13
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition
EEditableEntityType.c:6
Vector
proto native vector Vector(float x, float y, float z)
scripts
Game
Editor
Containers
Attributes
SCR_SetSuppliesBaseEditorAttribute.c
Generated by
1.17.0