--[[============================================================================ This file is a part of ChampionBar Copyright (C) 2015 Scott Yeskie (Sasky) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ============================================================================]] --- --- Create new type for Enlightenment Pool --- ChampionBar = ChampionBar or {} local EPBarType = ZO_Object:Subclass() ChampionBar.EPBarType = EPBarType function EPBarType:New(barTypeClass, barTypeId) local obj = ZO_Object.New(self) obj.barTypeClass = barTypeClass obj.barTypeId = barTypeId obj:Initialize() obj:InitializeLastValues() return obj end function EPBarType:Initialize() self.barGradient = { ZO_ColorDef:New("EEFF66"), ZO_ColorDef:New("EEFF00") } self.levelTypeText = "Enlightenment Pool" self.tooltipCurrentMaxFormat = 120000 self.icon = "EsoUI/Art/Champion/champion_points_health_icon-HUD-32.dds" end function EPBarType:InitializeLastValues() self.lastLevel = self:GetLevel() self.lastCurrent = self:GetCurrent() end function EPBarType:Equals(barTypeClass, ...) if(self.barTypeClass == barTypeClass) then for i = 1, select("#", ...) do local param = select(i, ...) if(param ~= self.params[i]) then return false end end return true end return false end function EPBarType:GetEnlightenedPool() if IsEnlightenedAvailableForCharacter() then return 1 else return 0 end end function EPBarType:GetEnlightenedTooltip() return "Enlightenment: " .. self:GetCurrent() .. "/" ..self:GetLevelSize() end function EPBarType:GetSecondaryBarType() return nil end function EPBarType:GetLevelSize(rank) return 1200000 end function EPBarType:GetLevel() return GetPlayerChampionPointsEarned() end function EPBarType:GetCurrent() return GetEnlightenedPool() end function EPBarType:GetBarGradient() return self.barGradient end function EPBarType:GetShownAttribute() local level = self:GetLevel() if self:GetLevelSize(level) ~= nil then level = level + 1 end return GetChampionPointAttributeForRank(level) end function EPBarType:GetIcon() return "/esoui/art/champion/champion_star_burst.dds" end