Add event handler, cleanup debug override
Sasky [03-31-15 - 06:28]
Add event handler, cleanup debug override
diff --git a/ChampionBar.lua b/ChampionBar.lua
index fd924d3..324bf76 100644
--- a/ChampionBar.lua
+++ b/ChampionBar.lua
@@ -58,39 +58,21 @@ local function replaceHandlers()
end
self.secondaryBarControl:SetHidden(secondaryBarInfo == nil)
end
+end
- function PLAYER_PROGRESS_BAR:Show()
- self:SetBarState("showing")
-
- local barTypeInfo = self:GetBarTypeInfo()
- AAA = barTypeInfo
- ZO_StatusBar_SetGradientColor(self.barControl, barTypeInfo:GetBarGradient())
-
- self:RefreshSecondaryBar()
-
- for i = 1, self.glowContainer:GetNumChildren() do
- local glowTexture = self.glowContainer:GetChild(i)
- glowTexture:SetColor(barTypeInfo.barGlowColor:UnpackRGB())
- end
-
- self.levelTypeLabel:SetText(zo_strformat(SI_LEVEL_BAR_LABEL, barTypeInfo.levelTypeText))
-
- if(barTypeInfo:GetIcon() ~= nil) then
- self.levelTypeIcon:SetHidden(false)
- self.levelTypeIcon:SetTexture(barTypeInfo.icon)
- else
- self.levelTypeIcon:SetHidden(true)
- end
-
- self.control:SetHidden(false)
- self.fadeTimeline:PlayForward()
- end
+local function registerEvents()
+ EVENT_MANAGER:RegisterForEvent("ChampionBar", EVENT_CHAMPION_POINT_GAINED, function()
+ local vpbar = PLAYER_PROGRESS_BAR.barTypes[PPB_VP];
+ vpbar.icon = vpbar:GetIcon()
+ vpbar.barGradient = vpbar:GetBarGradient()
+ end)
end
local function onAddOnLoaded(_, addonName)
if addonName ~= "ChampionBar" then return end
replaceBars()
replaceHandlers()
+ registerEvents()
end
-EVENT_MANAGER:RegisterForEvent("ChampionBarReplace", EVENT_ADD_ON_LOADED, onAddOnLoaded)
\ No newline at end of file
+EVENT_MANAGER:RegisterForEvent("ChampionBar", EVENT_ADD_ON_LOADED, onAddOnLoaded)
\ No newline at end of file