10 [
Attribute(
desc:
"The value condition that is changed compaired to the attribute value")]
11 protected float m_fValueCondition;
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")]
14 protected bool m_bOnlyShowIfConditionChanged;
16 protected float m_fStartingValue;
21 super.InitDynamicDescription(attribute);
24 if (!m_bOnlyShowIfConditionChanged)
31 m_fStartingValue = var.GetFloat();
37 if (!super.IsValid(attribute, attributeUi))
44 float value = var.GetFloat();
46 switch (m_eDisplayIfValue)
50 if (!m_bOnlyShowIfConditionChanged)
51 return value < m_fValueCondition;
53 return m_fStartingValue >= m_fValueCondition && value < m_fValueCondition;
57 if (!m_bOnlyShowIfConditionChanged)
58 return value <= m_fValueCondition;
60 return m_fStartingValue > m_fValueCondition && value <= m_fValueCondition;
64 if (!m_bOnlyShowIfConditionChanged)
65 return value == m_fValueCondition;
67 return value != m_fStartingValue && value == m_fValueCondition;
71 if (!m_bOnlyShowIfConditionChanged)
72 return value > m_fValueCondition;
74 return m_fStartingValue <= m_fValueCondition && value > m_fValueCondition;
78 if (!m_bOnlyShowIfConditionChanged)
79 return value >= m_fValueCondition;
81 return m_fStartingValue < m_fValueCondition && value >= m_fValueCondition;
85 if (!m_bOnlyShowIfConditionChanged)
86 return value != m_fValueCondition;
88 return value != m_fStartingValue && value != m_fValueCondition;