Skip to content

Commit

Permalink
Error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
muleyo committed Dec 1, 2024
1 parent e42df9f commit 1463aac
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Modules/Misc/_ExpBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function expBar:OnEnable()
-- Reposition Exp Bar
SUIExpBar:ClearAllPoints()
SUIExpBar:SetPoint("LEFT", SUIMainMenuBar, "LEFT", 1, -30)
SUIExpBar:SetWidth(SUIMainMenuBar:GetWidth()-5.5)
SUIExpBar:SetWidth(SUIMainMenuBar:GetWidth() - 5.5)

-- Status Text
SUIExpBarText:SetFont(STANDARD_TEXT_FONT, 11, 'OUTLINE')
Expand All @@ -29,22 +29,24 @@ function expBar:OnEnable()
-- Add Border to ExpBar
SUIExpBarBorder = CreateFrame("Frame", SUIExpBarBorder, SUIExpBar, "BackdropTemplate")
SUIExpBarBorder:SetPoint("LEFT", SUIExpBar, "LEFT", -1.5, 0)
SUIExpBarBorder:SetSize(SUIExpBar:GetWidth()+3, SUIExpBar:GetHeight()+2)
SUIExpBarBorder:SetSize(SUIExpBar:GetWidth() + 3, SUIExpBar:GetHeight() + 2)
SUIExpBarBorder:SetBackdrop({
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tileEdge = false,
edgeSize = 6.5,
insets = { left = 1, right = 1, top = 1, bottom = 1 },
})

SUIExpBarBorder:SetBackdropBorderColor(unpack(SUI:Color(.15)))
if SUI:Color() then
SUIExpBarBorder:SetBackdropBorderColor(unpack(SUI:Color(.15)))
end

-- Check Level
local expBar = CreateFrame("Frame")
expBar:RegisterEvent("PLAYER_ENTERING_WORLD")
expBar:RegisterEvent("PLAYER_LEVEL_UP")
expBar:HookScript("OnEvent", function()
local rLevel = GetMaxLevelForExpansionLevel(GetClampedCurrentExpansionLevel())
local rLevel = GetMaxLevelForExpansionLevel(GetClampedCurrentExpansionLevel())
if UnitLevel("player") >= rLevel then
SUIExpBar:Hide()
else
Expand All @@ -54,4 +56,4 @@ function expBar:OnEnable()
else
SUIExpBar:Hide()
end
end
end

0 comments on commit 1463aac

Please sign in to comment.