7 [
Attribute(
"1",
desc:
"If true will show the description if value is set to less or equal than unconcious level. If false will set the description if set greater than unconcious level")]
8 protected bool m_bLessOrEqualThan;
10 [
Attribute(
"1",
desc:
"If true it will only show this description if unconsciousness is enabled, else it will only show if disabled")]
11 protected bool m_bOnlyShowIfUnconsciousnessEnabled;
13 protected SCR_AttributesManagerEditorComponent m_AttributeManager;
15 protected bool m_bEntityUnconsciousnessPermitted =
false;
16 protected float m_fUnconsciousLevel;
17 protected float m_fStartingValue;
22 super.InitDynamicDescription(attribute);
28 Print(
"'SCR_CharacterBloodAttributeDynamicDescription' is not attached to an attribute with the 'SCR_SliderBloodAttributeComponent' ui!", LogLevel.ERROR);
32 if (!m_AttributeManager)
33 m_AttributeManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent));
39 m_fStartingValue = var.GetFloat();
40 m_fUnconsciousLevel = bloodSlider.GetUnconsciousLevel();
45 protected bool IsUnconsciousnessEnabled()
50 return unconciousVar.GetBool();
52 BaseGameMode gameMode =
GetGame().GetGameMode();
55 SCR_GameModeHealthSettings healthSettings = SCR_GameModeHealthSettings.Cast(gameMode.FindComponent(SCR_GameModeHealthSettings));
58 return healthSettings.IsUnconsciousnessPermitted();
68 if (!super.IsValid(attribute, attributeUi) || !m_AttributeManager || m_bOnlyShowIfUnconsciousnessEnabled != IsUnconsciousnessEnabled())
75 float value = var.GetFloat();
77 if (m_bLessOrEqualThan)
79 if (m_fStartingValue <= m_fUnconsciousLevel || value > m_fUnconsciousLevel)
86 if (m_fStartingValue > m_fUnconsciousLevel || value <= m_fUnconsciousLevel)