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 |
STAT_STATE_INCREASE_GAINED = 1
STAT_STATE_INCREASE_LOST = 2
STAT_STATE_DECREASE_GAINED = 3
STAT_STATE_DECREASE_LOST = 4
STAT_STATE_IMMUNITY_GAINED = 1
STAT_STATE_IMMUNITY_LOST = 2
STAT_STATE_SHIELD_GAINED = 3
STAT_STATE_SHIELD_LOST = 4
STAT_STATE_POSSESSION_APPLIED = 5
STAT_STATE_POSSESSION_REMOVED = 6
STAT_STATE_TRAUMA_GAINED = 7
STAT_STATE_TRAUMA_LOST = 8
ATTRIBUTE_BAR_STATE_NORMAL = 1
ATTRIBUTE_BAR_STATE_EXPANDED = 2
ATTRIBUTE_BAR_STATE_SHRUNK = 3
return unitAttributeVisualizer
end
function ZO_UnitAttributeVisualizer : Initialize ( unitTag , soundTable , healthBarControl , magickaBarControl , staminaBarControl , externalControlCallback )
self . unitTag = unitTag
self . soundTable = soundTable
self . visualModules = { }
self . healthBarControl = healthBarControl
self . magickaBarControl = magickaBarControl
self . staminaBarControl = staminaBarControl
self . moduleControlledCounts = { }
if healthBarControl then
self . moduleControlledCounts [ healthBarControl ] = 0
end
if magickaBarControl then
self . moduleControlledCounts [ magickaBarControl ] = 0
end
if staminaBarControl then
self . moduleControlledCounts [ staminaBarControl ] = 0
end
end
local eventNamespace = "ZO_UnitAttributeVisualizer" .. unitTag
EVENT_MANAGER : RegisterForEvent ( eventNamespace , EVENT_UNIT_ATTRIBUTE_VISUAL_ADDED , function ( eventCode , ... ) self : OnUnitAttributeVisualAdded ( ... ) end )
EVENT_MANAGER : AddFilterForEvent ( eventNamespace , EVENT_UNIT_ATTRIBUTE_VISUAL_ADDED , REGISTER_FILTER_UNIT_TAG , self . unitTag )
EVENT_MANAGER : RegisterForEvent ( eventNamespace , EVENT_UNIT_ATTRIBUTE_VISUAL_UPDATED , function ( eventCode , ... ) self : OnUnitAttributeVisualUpdated ( ... ) end )
EVENT_MANAGER : AddFilterForEvent ( eventNamespace , EVENT_UNIT_ATTRIBUTE_VISUAL_UPDATED , REGISTER_FILTER_UNIT_TAG , self . unitTag )
EVENT_MANAGER : RegisterForEvent ( eventNamespace , EVENT_UNIT_ATTRIBUTE_VISUAL_REMOVED , function ( eventCode , ... ) self : OnUnitAttributeVisualRemoved ( ... ) end )
EVENT_MANAGER : AddFilterForEvent ( eventNamespace , EVENT_UNIT_ATTRIBUTE_VISUAL_REMOVED , REGISTER_FILTER_UNIT_TAG , self . unitTag )
if unitTag == "reticleover" then
end
EVENT_MANAGER : RegisterForEvent ( eventNamespace , EVENT_RETICLE_TARGET_CHANGED , OnReticleTargetChanged )
elseif unitTag == "target" then
end
EVENT_MANAGER : AddFilterForEvent ( eventNamespace , EVENT_TARGET_CHANGED , REGISTER_FILTER_UNIT_TAG , "player" )
end
end
end
end
end
if not self . visualModules [ module ] then
self . visualModules [ module ] = module
end
end
end
end
end
end
return self . unitTag
end
function ZO_UnitAttributeVisualizer : OnUnitAttributeVisualAdded ( unitTag , visualType , stat , attribute , powerType , value , maxValue , sequenceId )
--if we have no UAV info for this type then we can add it
if mostRecentUpdate == nil then
end
end
end
end
function ZO_UnitAttributeVisualizer : OnUnitAttributeVisualUpdated ( unitTag , visualType , stat , attribute , powerType , oldValue , newValue , oldMaxValue , newMaxValue , sequenceId )
--make sure that we haven't already got the new state info that comes with this event as part of the UAV initializing on EVENT_PLAYER_ACTIVATED
if mostRecentUpdate ~= nil and sequenceId > mostRecentUpdate then
module : OnUnitAttributeVisualUpdated ( visualType , stat , attribute , powerType , oldValue , newValue , oldMaxValue , newMaxValue )
end
end
end
end
function ZO_UnitAttributeVisualizer : OnUnitAttributeVisualRemoved ( unitTag , visualType , stat , attribute , powerType , value , maxValue , sequenceId )
--make sure that we haven't already got the new state info that comes with this event as part of the UAV initializing on EVENT_PLAYER_ACTIVATED
if mostRecentUpdate ~= nil and sequenceId > mostRecentUpdate then
end
end
end
end
if self . soundTable and self . soundTable [ stat ] and self . soundTable [ stat ] [ state ] then
end
end
end
end |