Revert "Show current quest XP on xp bar (#17)"

This reverts commit 824afa5d0b.
This commit is contained in:
Andrew6810
2022-12-14 10:31:26 -07:00
parent b208722561
commit b37859db92
4 changed files with 192 additions and 431 deletions
+21 -42
View File
@@ -1,10 +1,13 @@
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local mod = E:GetModule("DataBars")
function mod.OnLeave(self)
if (self == ElvUI_ExperienceBar and mod.db.experience.mouseover)
or (self == ElvUI_ReputationBar and mod.db.reputation.mouseover)
then
--Lua functions
--WoW API / Variables
local GetExpansionLevel = GetExpansionLevel
local MAX_PLAYER_LEVEL_TABLE = MAX_PLAYER_LEVEL_TABLE
function mod:OnLeave()
if (self == ElvUI_ExperienceBar and mod.db.experience.mouseover) or (self == ElvUI_ReputationBar and mod.db.reputation.mouseover) then
E:UIFrameFadeOut(self, 1, self:GetAlpha(), 0)
end
GameTooltip:Hide()
@@ -30,51 +33,27 @@ function mod:CreateBar(name, onEnter, onClick, ...)
return bar
end
function mod:CreateBarBubbles(bar)
local bubbles = CreateFrame("Frame", "$parent_Bubbles", bar)
bubbles:SetAllPoints()
bubbles.textures = {}
for i = 1, 19 do
bubbles.textures[i] = bubbles:CreateTexture(nil, "OVERLAY")
bubbles.textures[i]:SetTexture(0, 0, 0, 1)
end
bar.bubbles = bubbles
return bubbles
end
function mod:UpdateBarBubbles(bar, db)
if db.showBubbles then
local vertical = db.orientation ~= "HORIZONTAL"
local width = vertical and db.width or 1
local height = not vertical and db.height or 1
local offset = (vertical and db.height or db.width) / 20
for i, texture in ipairs(bar.bubbles.textures) do
texture:Size(width, height)
texture:Point("TOPLEFT", bar, "TOPLEFT", vertical and 0 or offset * i, vertical and -offset * i or 0)
texture:Show()
end
else
for _, texture in ipairs(bar.bubbles.textures) do
texture:Hide()
end
end
end
function mod:UpdateDataBarDimensions()
self:ExperienceBar_UpdateDimensions()
self:ReputationBar_UpdateDimensions()
self:UpdateExperienceDimensions()
self:UpdateReputationDimensions()
end
function mod:PLAYER_LEVEL_UP(level)
local maxLevel = MAX_PLAYER_LEVEL_TABLE[GetExpansionLevel()]
if (level ~= maxLevel or not self.db.experience.hideAtMaxLevel) and self.db.experience.enable then
self:UpdateExperience("PLAYER_LEVEL_UP", level)
else
self.expBar:Hide()
end
end
function mod:Initialize()
self.db = E.db.databars
self.maxExpansionLevel = MAX_PLAYER_LEVEL_TABLE[GetAccountExpansionLevel()]
self:ExperienceBar_Load()
self:ReputationBar_Load()
self:LoadExperienceBar()
self:LoadReputationBar()
self:RegisterEvent("PLAYER_LEVEL_UP")
end
local function InitializeCallback()