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 |
local SMOOTH_ANIMATE_BAR = true
local SET_BAR = false
return bar
end
self . bossHealthValues = { }
for i = 1 , # self . bars do
local gradient = ZO_POWER_BAR_GRADIENT_COLORS [ POWERTYPE_HEALTH ]
end
self . bossUnitTags = { }
for i = 1 , MAX_BOSSES do
self . bossUnitTags [ "boss" .. i ] = true
end
control : RegisterForEvent ( EVENT_POWER_UPDATE , function ( _ , unitTag , powerPoolIndex , powerType ) self : OnPowerUpdate ( unitTag , powerType ) end )
control : RegisterForEvent ( EVENT_INTERFACE_SETTING_CHANGED , function ( _ , settingSystem , settingId ) self : OnInterfaceSettingChanged ( settingSystem , settingId ) end )
control : RegisterForEvent ( EVENT_GAMEPAD_PREFERRED_MODE_CHANGED , function ( ) self : OnGamepadPreferredModeChanged ( ) end )
end
end
end
self . bossHealthValues [ unitTag ] = { }
end
self . bossHealthValues [ unitTag ] = nil
end
local bossEntry = self . bossHealthValues [ unitTag ]
if bossEntry ~= nil then
bossEntry . health = health
bossEntry . maxHealth = maxHealth
end
end
local totalHealth = 0
local totalMaxHealth = 0
totalHealth = totalHealth + bossEntry . health
totalMaxHealth = totalMaxHealth + bossEntry . maxHealth
end
for i = 1 , # self . bars do
end
end
--if there are multiple bosses and one of them dies and despawns in the middle of the fight we
--still want to show them as part of the boss bar (otherwise it will reset to 100%).
local currentBossCount = 0
currentBossCount = currentBossCount + 1
end
end
--if there are no bosses left it's safe to reset everything
self . bossHealthValues = { }
end
end
--Events
if ( self . bossUnitTags [ unitTag ] ) then
end
end
end
if settingSystem == SETTING_TYPE_UI and settingId == UI_SETTING_RESOURCE_NUMBERS then
end
end
--Global XML
end |