ESO Lua File v100011

ingame/playerattributebars/playerattributebars.lua

[◄ back to folders ]
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
--Attribute Bar
-------------------
local DELAY_BEFORE_FADING = 1500
local ZO_PlayerAttributeBar = ZO_Object:Subclass()
function ZO_PlayerAttributeBar:New(control, barControls, powerType, unitOverride, secondPriorityUnitTag)
    local bar = ZO_Object.New(self)
    bar.control = control
    bar.barControls = barControls
    bar.powerType = powerType
    bar.unitTag = unitOverride or "player"
    bar.secondPriorityUnitTag = secondPriorityUnitTag
    bar.current = 0
    bar.max = 0
    bar.effectiveMax = 0
    bar.timeline = ANIMATION_MANAGER:CreateTimelineFromVirtual("PlayerAttributeBarAnimation", control)
    bar.fadeOutDelay = 0
    bar.textEnabled = false
    bar.forcedVisibleReferences = 0
    bar:SetTextEnabled(ZO_PlayerAttributeBar.IsTextEnabled())
    bar:RefreshColor()   
    bar:UpdateStatusBar()
    control.playerAttributeBarObject = bar
    control:RegisterForEvent(EVENT_INTERFACE_SETTING_CHANGED, function(_, settingType, settingId) bar:OnInterfaceSettingChanged(settingType, settingId) end)
    control:RegisterForEvent(EVENT_PLAYER_ACTIVATED, function() bar:OnPlayerActivated() end)
    
    control:RegisterForEvent(EVENT_POWER_UPDATE, function(_, unitTag, powerPoolIndex, powerType, current, max, effectiveMax) bar:OnPowerUpdate(unitTag, powerPoolIndex, powerType, current, max, effectiveMax) end)
    if unitOverride or secondPriorityUnitTag then
        control:RegisterForEvent(EVENT_UNIT_CREATED, function(_, unitTag) if self:IsUnitTag(unitTag) then self:UpdateStatusBar() end end)
    end
    EVENT_MANAGER:RegisterForUpdate(control:GetName() .. "FadeUpdate", DELAY_BEFORE_FADING, function() bar:UpdateContextualFading() end)
    return bar
end
function ZO_PlayerAttributeBar:GetEffectiveUnitTag()
    if self.secondPriorityUnitTag then
        if not DoesUnitExist(self.unitTag) and DoesUnitExist(self.secondPriorityUnitTag) then
            return self.secondPriorityUnitTag
        end
    end
    return self.unitTag
end
function ZO_PlayerAttributeBar:IsUnitTag(unitTag)
    return self:GetEffectiveUnitTag() == unitTag
end
function ZO_PlayerAttributeBar:RefreshColor()
    local powerType = self.powerType
    local gradient = ZO_POWER_BAR_GRADIENT_COLORS[powerType]
    for i, control in ipairs(self.barControls) do
        ZO_StatusBar_SetGradientColor(control, gradient)
        control:SetFadeOutLossColor(GetInterfaceColor(INTERFACE_COLOR_TYPE_POWER_FADE_OUT, powerType))
        control:SetFadeOutGainColor(GetInterfaceColor(INTERFACE_COLOR_TYPE_POWER_FADE_IN, powerType))
    end
end
function ZO_PlayerAttributeBar:UpdateStatusBar(current, max, effectiveMax)
        return false
    end
    local forceInit = false
    if(current == nil or max == nil or effectiveMax == nil) then        
        current, max, effectiveMax = GetUnitPower(self:GetEffectiveUnitTag(), self.powerType)
        forceInit = true
    end
    if self.current == current and self.max == max and self.effectiveMax == effectiveMax then
        return
    end
    self.current = current
    self.max = max
    self.effectiveMax = effectiveMax
    local barMax = max
    local barCurrent = current
    if #self.barControls > 1 then
        barMax = barMax / 2
        barCurrent = barCurrent / 2
    end
    for _, control in pairs(self.barControls) do
        ZO_StatusBar_SmoothTransition(control, barCurrent, barMax, forceInit)
    end
    if not forceInit then
        self:ResetFadeOutDelay()
    end
    if(self.textEnabled) then
        self.label:SetText(zo_strformat(SI_UNIT_FRAME_BARVALUE, current, max))
    end
end
function ZO_PlayerAttributeBar:ResetFadeOutDelay()
    self.fadeOutDelay = GetFrameTimeMilliseconds() + DELAY_BEFORE_FADING
end
local EXCLUDE_LINK_CHECK = true
function ZO_PlayerAttributeBar:ShouldContextuallyShow(excludeLinkCheck)
        return false
    end
    if self.max == 0 then
        return false
    end
    if self.forceVisible then
        return true
    end
    if ((self.current < self.effectiveMax) and (self.current ~= 0)) then
        return true
    end
    if not self.IsPlayerFrameFadingEnabled() then
        return true
    end
    if self.fadeOutDelay > GetFrameTimeMilliseconds() then
        return true
    end
    if self.linkedVisibility and not excludeLinkCheck then
        return self.linkedVisibility:ShouldContextuallyShow(EXCLUDE_LINK_CHECK)
    end
    return false
end
function ZO_PlayerAttributeBar:LinkVisibility(otherAttributeBar)
    otherAttributeBar.linkedVisibility = self
    self.linkedVisibility = otherAttributeBar
    otherAttributeBar:UpdateContextualFading()
end
end
function ZO_PlayerAttributeBar.IsTextEnabled()
    return GetSetting_Bool(SETTING_TYPE_UI, UI_SETTING_ALWAYS_SHOW_STATUS_TEXT)
end
function ZO_PlayerAttributeBar.IsPlayerFrameFadingEnabled()
    return GetSetting_Bool(SETTING_TYPE_UI, UI_SETTING_FADE_PLAYER_BARS)
end
function ZO_PlayerAttributeBar:UpdateContextualFading()
    local shouldContextuallyShow = self:ShouldContextuallyShow()
    if shouldContextuallyShow ~= self.isContextuallyShown then
        if shouldContextuallyShow then
            self.timeline:PlayForward()
        else
            self.timeline:PlayBackward()
        end
        self.isContextuallyShown = shouldContextuallyShow
        if self.linkedVisibility then
            self.linkedVisibility:UpdateContextualFading()
        end
    end
end
function ZO_PlayerAttributeBar:AddForcedVisibleReference()
    self.forcedVisibleReferences = self.forcedVisibleReferences + 1
    self:SetForceVisible(self.forcedVisibleReferences ~= 0)
end
function ZO_PlayerAttributeBar:RemoveForcedVisibleReference()
    self.forcedVisibleReferences = self.forcedVisibleReferences - 1
    self:SetForceVisible(self.forcedVisibleReferences ~= 0)
end
function ZO_PlayerAttributeBar:SetForceVisible(forceVisible)
    if self.forceVisible ~= forceVisible then
        self.forceVisible = forceVisible
        self:UpdateContextualFading()
    end
end
function ZO_PlayerAttributeBar:SetTextEnabled(enabled)
    if(self.textEnabled ~= enabled) then
        self.textEnabled = enabled
        if(enabled) then
            if(not self.label) then
                self.label = CreateControlFromVirtual("$(parent)Label", self.control, "ZO_PlayerAttributeBarText")
            end
            self.label:SetHidden(false)
            self:UpdateStatusBar()
        else
            if(self.label) then
                self.label:SetHidden(true)
            end
        end
    end
end
--Events
function ZO_PlayerAttributeBar:OnPowerUpdate(unitTag, powerPoolIndex, powerType, current, max, effectiveMax)
    if(self:IsUnitTag(unitTag) and self.powerType == powerType and (current ~= self.current or max ~= self.max or effectiveMax ~= self.effectiveMax)) then
        self:UpdateStatusBar(current, max, effectiveMax)
    end
end
function ZO_PlayerAttributeBar:OnPlayerActivated()
end
function ZO_PlayerAttributeBar:OnInterfaceSettingChanged(settingType, settingId)
    if settingType == SETTING_TYPE_UI then
        if settingId == UI_SETTING_FADE_PLAYER_BARS then
            self:UpdateContextualFading()
        elseif settingId == UI_SETTING_ALWAYS_SHOW_STATUS_TEXT then
            self:SetTextEnabled(self.IsTextEnabled())
        end
    end
end
--Attribute Bar Group
-----------------------
local NUM_BARS = 3
local NORMAL_WIDTH = 237
local EXPANDED_WIDTH = 323
local SHRUNK_WIDTH = 141
local BAR_OFFSET_FROM_SCREEN_EDGE = 502
local MIN_BAR_AREA_WIDTH = (EXPANDED_WIDTH + 15) * NUM_BARS
local MAX_BAR_AREA_WIDTH = 1600
local ZO_PlayerAttributeBars = ZO_Object:Subclass()
local PLAYER_ATTRIBUTE_VISUALIZER_SOUNDS = 
{
    [STAT_HEALTH_MAX] = 
    {
        [ATTRIBUTE_BAR_STATE_NORMAL]    = SOUNDS.UAV_MAX_HEALTH_NORMAL,
        [ATTRIBUTE_BAR_STATE_EXPANDED]  = SOUNDS.UAV_MAX_HEALTH_INCREASED,
        [ATTRIBUTE_BAR_STATE_SHRUNK]    = SOUNDS.UAV_MAX_HEALTH_DECREASED,
    },
    [STAT_MAGICKA_MAX] = 
    {
        [ATTRIBUTE_BAR_STATE_NORMAL]    = SOUNDS.UAV_MAX_MAGICKA_NORMAL,
        [ATTRIBUTE_BAR_STATE_EXPANDED]  = SOUNDS.UAV_MAX_MAGICKA_INCREASED,
        [ATTRIBUTE_BAR_STATE_SHRUNK]    = SOUNDS.UAV_MAX_MAGICKA_DECREASED,
    },
    [STAT_STAMINA_MAX] = 
    {
        [ATTRIBUTE_BAR_STATE_NORMAL]    = SOUNDS.UAV_MAX_STAMINA_NORMAL,
        [ATTRIBUTE_BAR_STATE_EXPANDED]  = SOUNDS.UAV_MAX_STAMINA_INCREASED,
        [ATTRIBUTE_BAR_STATE_SHRUNK]    = SOUNDS.UAV_MAX_STAMINA_DECREASED,
    },
    [STAT_HEALTH_REGEN_COMBAT] = 
    {
        [STAT_STATE_INCREASE_GAINED]    = SOUNDS.UAV_INCREASED_HEALTH_REGEN_ADDED,
        [STAT_STATE_INCREASE_LOST]      = SOUNDS.UAV_INCREASED_HEALTH_REGEN_LOST,
        [STAT_STATE_DECREASE_GAINED]    = SOUNDS.UAV_DECREASED_HEALTH_REGEN_ADDED,
        [STAT_STATE_DECREASE_LOST]      = SOUNDS.UAV_DECREASED_HEALTH_REGEN_LOST,
    },
    [STAT_MAGICKA_REGEN_COMBAT] = 
    {
        [STAT_STATE_INCREASE_GAINED]    = SOUNDS.UAV_INCREASED_MAGICKA_REGEN_ADDED,
        [STAT_STATE_INCREASE_LOST]      = SOUNDS.UAV_INCREASED_MAGICKA_REGEN_LOST,
        [STAT_STATE_DECREASE_GAINED]    = SOUNDS.UAV_DECREASED_MAGICKA_REGEN_ADDED,
        [STAT_STATE_DECREASE_LOST]      = SOUNDS.UAV_DECREASED_MAGICKA_REGEN_LOST,
    },
    [STAT_STAMINA_REGEN_COMBAT] = 
    {
        [STAT_STATE_INCREASE_GAINED]    = SOUNDS.UAV_INCREASED_STAMINA_REGEN_ADDED,
        [STAT_STATE_INCREASE_LOST]      = SOUNDS.UAV_INCREASED_STAMINA_REGEN_LOST,
        [STAT_STATE_DECREASE_GAINED]    = SOUNDS.UAV_DECREASED_STAMINA_REGEN_ADDED,
        [STAT_STATE_DECREASE_LOST]      = SOUNDS.UAV_DECREASED_STAMINA_REGEN_LOST,
    },
    [STAT_ARMOR_RATING] = 
    {
        [STAT_STATE_INCREASE_GAINED]    = SOUNDS.UAV_INCREASED_ARMOR_ADDED,
        [STAT_STATE_INCREASE_LOST]      = SOUNDS.UAV_INCREASED_ARMOR_LOST,
        [STAT_STATE_DECREASE_GAINED]    = SOUNDS.UAV_DECREASED_ARMOR_ADDED,
        [STAT_STATE_DECREASE_LOST]      = SOUNDS.UAV_DECREASED_ARMOR_LOST,
    },
    [STAT_POWER] = 
    {
        [STAT_STATE_INCREASE_GAINED]    = SOUNDS.UAV_INCREASED_POWER_ADDED,
        [STAT_STATE_INCREASE_LOST]      = SOUNDS.UAV_INCREASED_POWER_LOST,
        [STAT_STATE_DECREASE_GAINED]    = SOUNDS.UAV_DECREASED_POWER_ADDED,
        [STAT_STATE_DECREASE_LOST]      = SOUNDS.UAV_DECREASED_POWER_LOST,
    },
    [STAT_MITIGATION] =
    {
        [STAT_STATE_IMMUNITY_GAINED]    = SOUNDS.UAV_IMMUNITY_ADDED,
        [STAT_STATE_IMMUNITY_LOST]      = SOUNDS.UAV_IMMUNITY_LOST,
        [STAT_STATE_SHIELD_GAINED]      = SOUNDS.UAV_DAMAGE_SHIELD_ADDED,
        [STAT_STATE_SHIELD_LOST]        = SOUNDS.UAV_DAMAGE_SHIELD_LOST,
        [STAT_STATE_POSSESSION_APPLIED] = SOUNDS.UAV_POSSESSION_APPLIED,
        [STAT_STATE_POSSESSION_REMOVED] = SOUNDS.UAV_POSSESSION_REMOVED,
    },
}
function ZO_PlayerAttributeBars:New(control)
    local barGroup = ZO_Object.New(self)
    barGroup.control = control
    barGroup.forceVisible = false
    
    local bars = {}
    local healthControl = GetControl(control, "Health")
    local healthBarControls = {GetControl(healthControl, "BarLeft"), GetControl(healthControl, "BarRight")}
    healthControl.barControls = healthBarControls
    local healthAttributeBar = ZO_PlayerAttributeBar:New(healthControl, healthBarControls, POWERTYPE_HEALTH)
    table.insert(bars, healthAttributeBar)
    healthControl.warner = ZO_HealthWarner:New(healthControl)
    local siegeHealthControl = GetControl(control, "SiegeHealth")
    local siegeHealthBarControls = {GetControl(siegeHealthControl, "BarLeft"), GetControl(siegeHealthControl, "BarRight")}
    siegeHealthControl.barControls = siegeHealthBarControls
    local siegeHealthAttributeBar = ZO_PlayerAttributeBar:New(siegeHealthControl, siegeHealthBarControls, POWERTYPE_HEALTH, "controlledsiege", "escortedram")
    table.insert(bars, siegeHealthAttributeBar)
    local function UpdateSiegeHealthBar() 
        siegeHealthAttributeBar:UpdateStatusBar() 
    end
    control:RegisterForEvent(EVENT_BEGIN_SIEGE_CONTROL, UpdateSiegeHealthBar)
    control:RegisterForEvent(EVENT_END_SIEGE_CONTROL, UpdateSiegeHealthBar)
    control:RegisterForEvent(EVENT_LEAVE_RAM_ESCORT, UpdateSiegeHealthBar)
    siegeHealthAttributeBar:SetExternalVisibilityRequirement(function() return IsGameCameraSiegeControlled() or IsPlayerEscortingRam() end)
    healthAttributeBar:LinkVisibility(siegeHealthAttributeBar)
    local magickaControl = GetControl(control, "Magicka")
    local magickaBarControls = {GetControl(magickaControl, "Bar")}
    magickaControl.barControls = magickaBarControls
    local magickaAttributeBar = ZO_PlayerAttributeBar:New(magickaControl, magickaBarControls, POWERTYPE_MAGICKA)
    table.insert(bars, magickaAttributeBar)
    magickaControl.warner = ZO_ResourceWarner:New(magickaControl, POWERTYPE_MAGICKA)
    local werewolfControl = GetControl(control, "Werewolf")
    local werewolfBarControls = {GetControl(werewolfControl, "Bar")}
    werewolfControl.barControls = werewolfBarControls
    local werewolfAttributeBar = ZO_PlayerAttributeBar:New(werewolfControl, werewolfBarControls, POWERTYPE_WEREWOLF)
    table.insert(bars, werewolfAttributeBar)
    control:RegisterForEvent(EVENT_WEREWOLF_STATE_CHANGED, function() werewolfAttributeBar:UpdateContextualFading() end)
    werewolfAttributeBar:SetExternalVisibilityRequirement(IsWerewolf)
    magickaAttributeBar:LinkVisibility(werewolfAttributeBar)
    local staminaControl = GetControl(control, "Stamina")
    local staminaBarControls = {GetControl(staminaControl, "Bar")}
    staminaControl.barControls = staminaBarControls
    local staminaAttributeBar = ZO_PlayerAttributeBar:New(staminaControl, staminaBarControls, POWERTYPE_STAMINA)
    table.insert(bars, staminaAttributeBar)
    staminaControl.warner = ZO_ResourceWarner:New(staminaControl, POWERTYPE_STAMINA)
    local mountStaminaControl = GetControl(control, "MountStamina")
    local mountStaminaBarControls = {GetControl(mountStaminaControl, "Bar")}
    mountStaminaControl.barControls = mountStaminaBarControls
    local mountStaminaAttributeBar = ZO_PlayerAttributeBar:New(mountStaminaControl, mountStaminaBarControls, POWERTYPE_MOUNT_STAMINA)
    table.insert(bars, mountStaminaAttributeBar)
    mountStaminaAttributeBar:SetExternalVisibilityRequirement(IsMounted)
    control:RegisterForEvent(EVENT_MOUNTED_STATE_CHANGED, function() mountStaminaAttributeBar:UpdateContextualFading() end)
    staminaAttributeBar:LinkVisibility(mountStaminaAttributeBar)
    barGroup.bars = bars
    control:RegisterForEvent(EVENT_SCREEN_RESIZED, function() barGroup:OnScreenResized() end)
    local function OnExternalControlCountChanged(bar, change, count)
        if change > 0 then
            bar.playerAttributeBarObject:AddForcedVisibleReference()
        else
            bar.playerAttributeBarObject:RemoveForcedVisibleReference()
        end
    end
    barGroup.forceShow = false
    barGroup.attributeVisualizer = ZO_UnitAttributeVisualizer:New("player", PLAYER_ATTRIBUTE_VISUALIZER_SOUNDS, healthControl, magickaControl, staminaControl, OnExternalControlCountChanged)
    barGroup.attributeVisualizer:AddModule(ZO_UnitVisualizer_ArrowRegenerationModule:New())
    barGroup.attributeVisualizer:AddModule(ZO_UnitVisualizer_ShrinkExpandModule:New(NORMAL_WIDTH, EXPANDED_WIDTH, SHRUNK_WIDTH))
    local armorDamageLayoutInfo =
    {
        type = "Arrow",
        increasedArmorBgContainerTemplate = "ZO_IncreasedArmorBgContainerArrow",
        increasedArmorFrameContainerTemplate = "ZO_IncreasedArmorFrameContainerArrow",
        increasedArmorBgLeftOffset = -8,
        increasedArmorBgTopOffset = -7,
        increasedArmorBgRightOffset = 8,
        increasedArmorBgBottomOffset = 6,
        decreasedArmorOverlayContainerTemplate = "ZO_DecreasedArmorOverlayContainerArrow",
        increasedPowerGlowTemplate = "ZO_IncreasedPowerGlowArrow",
    }
    barGroup.attributeVisualizer:AddModule(ZO_UnitVisualizer_ArmorDamage:New(armorDamageLayoutInfo))
    local unwaveringLayoutInfo =
    {
        overlayContainerTemplate = "ZO_UnwaveringOverlayContainerArrow",
        overlayLeftOffset = 3,
        overlayTopOffset = 3,
        overlayRightOffset = -3,
        overlayBottomOffset = -3,
    }
    barGroup.attributeVisualizer:AddModule(ZO_UnitVisualizer_UnwaveringModule:New(unwaveringLayoutInfo))
     local possessionLayoutInfo =
    {
        type = "Arrow",
        overlayContainerTemplate = "ZO_PossessionOverlayContainerArrow",
        overlayLeftOffset = 3,
        overlayTopOffset = 3,
        overlayRightOffset = -3,
        overlayBottomOffset = -3,
        possessionHaloGlowTemplate = "ZO_PossessionHaloGlowArrow",
    }
    barGroup.attributeVisualizer:AddModule(ZO_UnitVisualizer_PossessionModule:New(possessionLayoutInfo))
    local powerShieldLayoutInfo =
    {
        barLeftOverlayTemplate = "ZO_PowerShieldBarLeftOverlayArrow",
        barRightOverlayTemplate = "ZO_PowerShieldBarRightOverlayArrow",
    }
    barGroup.attributeVisualizer:AddModule(ZO_UnitVisualizer_PowerShieldModule:New(powerShieldLayoutInfo))
    
    barGroup:ResizeToFitScreen()
    PLAYER_ATTRIBUTE_BARS_FRAGMENT = ZO_HUDFadeSceneFragment:New(control)
    barGroup:ApplyStyle() -- Setup initial visual style based on current mode.
    control:RegisterForEvent(EVENT_GAMEPAD_PREFERRED_MODE_CHANGED, function() barGroup:OnGamepadPreferredModeChanged() end)
    return barGroup
end
function ZO_PlayerAttributeBars:ApplyStyle()
    ApplyTemplateToControl(self.control, ZO_GetPlatformTemplate("ZO_PlayerAttribute"))
end
function ZO_PlayerAttributeBars:OnGamepadPreferredModeChanged()
    self:ApplyStyle()
end
function ZO_PlayerAttributeBars:ForceShow(forceShow)
    if self.forceShow ~= forceShow then
        self.forceShow = forceShow
        for i = 1, #self.bars do
            if forceShow then
                self.bars[i]:AddForcedVisibleReference()
            else
                self.bars[i]:RemoveForcedVisibleReference()
            end
        end
    end
end
function ZO_PlayerAttributeBars:ResizeToFitScreen()
    local screenWidth, screenHeight = GuiRoot:GetDimensions()
    local barAreaWidth = screenWidth - BAR_OFFSET_FROM_SCREEN_EDGE * 2
    barAreaWidth = zo_clamp(barAreaWidth, MIN_BAR_AREA_WIDTH, MAX_BAR_AREA_WIDTH)
    self.control:SetWidth(barAreaWidth)
end
--Events
function ZO_PlayerAttributeBars:OnScreenResized()
end
--XML
    PLAYER_ATTRIBUTE_BARS = ZO_PlayerAttributeBars:New(self)
end