Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ValueAttributeDynamicDescription.c
Go to the documentation of this file.
1
6{
7 [Attribute(desc: "If the current value is x to value given condition than display the description", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EAttributeValueDynamicDescription))]
9
10 [Attribute(desc: "The value condition that is changed compaired to the attribute value")]
11 protected float m_fValueCondition;
12
13 [Attribute("0", desc: "If true it will only show the description if the condition was false before and is now true (meaning if you save the attributes and open it again it will not show the warning), else it will always set the warning if the condition is true wether it was changed or not")]
15
16 protected float m_fStartingValue;
17
18 //------------------------------------------------------------------------------------------------
19 override void InitDynamicDescription(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
20 {
21 super.InitDynamicDescription(attribute);
22
23 //~ No need to set starting value if always checks if condition true
25 return;
26
27 SCR_BaseEditorAttributeVar var = attribute.GetVariableOrCopy();
28 if (!var)
29 return;
30
32 }
33
34 //------------------------------------------------------------------------------------------------
35 override bool IsValid(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
36 {
37 if (!super.IsValid(attribute, attributeUi))
38 return false;
39
40 SCR_BaseEditorAttributeVar var = attribute.GetVariableOrCopy();
41 if (!var)
42 return false;
43
44 float value = var.GetFloat();
45
46 switch (m_eDisplayIfValue)
47 {
49 {
51 return value < m_fValueCondition;
52
54 }
55 case EAttributeValueDynamicDescription.LESS_OR_EQUAL_THAN :
56 {
58 return value <= m_fValueCondition;
59
61 }
63 {
65 return value == m_fValueCondition;
66
67 return value != m_fStartingValue && value == m_fValueCondition;
68 }
69 case EAttributeValueDynamicDescription.GREATER_THAN :
70 {
72 return value > m_fValueCondition;
73
75 }
76 case EAttributeValueDynamicDescription.GREATER_OR_EQUAL_THAN :
77 {
79 return value >= m_fValueCondition;
80
82 }
83 case EAttributeValueDynamicDescription.NOT_EQUAL_TO :
84 {
86 return value != m_fValueCondition;
87
88 return value != m_fStartingValue && value != m_fValueCondition;
89 }
90 }
91
92 return false;
93 }
94};
95
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
override void InitDynamicDescription(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
override bool IsValid(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
SCR_FieldOfViewSettings Attribute