1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
end
end
local value , maxValue = GetUnitAttributeVisualizerEffectInfo ( unitTag , ATTRIBUTE_VISUAL_POWER_SHIELDING , stat , attribute , powerType )
end
function ZO_UnitVisualizer_PowerShieldModule : CreateInfoTable ( control , oldBarInfo , stat , attribute , power )
local oldInfo = oldBarInfo and oldBarInfo [ attribute ]
if oldInfo then
oldInfo . maxValue = maxValue
return oldInfo
end
end
return nil
end
function ZO_UnitVisualizer_PowerShieldModule : OnAdded ( healthBarControl , magickaBarControl , staminaBarControl )
{
[ ATTRIBUTE_HEALTH ] = healthBarControl ,
}
end
if bar == healthBarControl then
if info then
info . isResizing = resizing
end
end
end
local STARTING_RESIZE = true
local STOPPING_RESIZE = false
self : GetOwner ( ) : RegisterCallback ( "AttributeBarSizeChangingStart" , function ( ... ) OnSizeChanged ( STARTING_RESIZE , ... ) end )
self : GetOwner ( ) : RegisterCallback ( "AttributeBarSizeChangingStopped" , function ( ... ) OnSizeChanged ( STOPPING_RESIZE , ... ) end )
EVENT_MANAGER : RegisterForEvent ( "ZO_UnitVisualizer_PowerShieldModule" .. self : GetModuleId ( ) , EVENT_PLAYER_ACTIVATED , function ( ) self : InitializeBarValues ( ) end )
EVENT_MANAGER : RegisterForUpdate ( "ZO_UnitVisualizer_PowerShieldModule" .. self : GetModuleId ( ) , 0 , function ( ) self : OnUpdate ( ) end )
end
{
[ ATTRIBUTE_HEALTH ] = self : CreateInfoTable ( healthBarControl , oldBarInfo , STAT_MITIGATION , ATTRIBUTE_HEALTH , POWERTYPE_HEALTH ) ,
}
end
end
end
if info . isResizing then
end
end
end
end
function ZO_UnitVisualizer_PowerShieldModule : IsUnitVisualRelevant ( visualType , stat , attribute , powerType )
if visualType == ATTRIBUTE_VISUAL_POWER_SHIELDING then
end
return false
end
function ZO_UnitVisualizer_PowerShieldModule : OnUnitAttributeVisualAdded ( visualType , stat , attribute , powerType , value , maxValue )
info . maxValue = info . maxValue + maxValue
end
function ZO_UnitVisualizer_PowerShieldModule : OnUnitAttributeVisualUpdated ( visualType , stat , attribute , powerType , oldValue , newValue , oldMaxValue , newMaxValue )
info . maxValue = info . maxValue + ( newMaxValue - oldMaxValue )
end
function ZO_UnitVisualizer_PowerShieldModule : OnUnitAttributeVisualRemoved ( visualType , stat , attribute , powerType , value , maxValue )
info . maxValue = info . maxValue - maxValue
end
-- assumes a double health bar for now
if not info . shieldLeftOverlay then
local leftStatusBar = bar . barControls [ 1 ]
local rightStatusBar = bar . barControls [ 2 ]
local shieldLeftOverlay = CreateControlFromVirtual ( "$(parent)PowerShieldLeftOverlay" , bar , self . layoutData . barLeftOverlayTemplate )
ZO_StatusBar_SetGradientColor ( shieldLeftOverlay . chunk , ZO_POWER_BAR_GRADIENT_COLORS [ POWERTYPE_HEALTH ] )
info . shieldLeftOverlay = shieldLeftOverlay
local shieldRightOverlay = CreateControlFromVirtual ( "$(parent)PowerShieldRightOverlay" , bar , self . layoutData . barRightOverlayTemplate )
ZO_StatusBar_SetGradientColor ( shieldRightOverlay . chunk , ZO_POWER_BAR_GRADIENT_COLORS [ POWERTYPE_HEALTH ] )
info . shieldRightOverlay = shieldRightOverlay
end )
end )
end
end
local leftBar = bar . barControls [ 1 ]
local rightBar = bar . barControls [ 2 ]
local percentOfBarMissing = 1 - info . statusValue / info . statusMax
end
end
if info . shieldLeftOverlay or info . shieldRightOverlay then
end
end
local lastValue = info . lastValue
else
end
end |