Skip to content

Commit

Permalink
Move debug to local level
Browse files Browse the repository at this point in the history
  • Loading branch information
Azilroka committed Aug 14, 2024
1 parent e513b1e commit 38d521a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions AddOnSkins/Core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ local function errorhandler(err)
end

function AS:CallSkin(addonName, func, event, ...)
if (AS:CheckOption('SkinDebug')) then
if AS.Debug then
local args = {...}
xpcall(function() func(self, event, unpack(args)) end, errorhandler)
else
Expand Down Expand Up @@ -222,7 +222,7 @@ function AS:StartUp(event, ...)
AS:SecureHook(_G.ElvUI[1], 'UpdateMedia')
end

if not AS:CheckOption('SkinDebug') then
if not AS.Debug then
for Version, SkinTable in pairs(_G.AddOnSkinsDS) do
if Version == AS.Version or Version < AS.Version then
if Version < AS.Version then
Expand Down Expand Up @@ -252,7 +252,7 @@ function AS:StartUp(event, ...)
AS:Print(format("Version: |cFF1784D1%s|r Loaded!", AS.Version))
end

if not AS:CheckOption('SkinDebug') and AS.FoundError then
if not AS.Debug and AS.FoundError then
AS:Print(format(L["%s: There was an error in the following skin(s): %s"], AS.Version, table.concat(AS.SkinErrors, ", ")))
AS:Print(format(L["Please report this to Azilroka immediately @ %s"], AS:PrintURL(AS.TicketTracker)))
end
Expand Down
2 changes: 0 additions & 2 deletions AddOnSkins/Core/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ AS.Options.args.general = ACH:Group(GENERAL, nil, 0, nil, function(info) return
AS.Options.args.general.args.general = ACH:Group(' ', nil, 1)
AS.Options.args.general.args.general.inline = true
AS.Options.args.general.args.general.args.LoginMsg = ACH:Toggle(L["Login Message"], nil, 1)
AS.Options.args.general.args.general.args.SkinDebug = ACH:Toggle(L["Enable Skin Debugging"], nil, 2)

AS.Options.args.general.args.Theme = ACH:Select(L["Themes"], nil, 2, { PixelPerfect = L["Thin Border"], TwoPixel = L["Two Pixel"], ThickBorder = L["Thick Border"] })
AS.Options.args.general.args.SkinTemplate = ACH:Select(L["Template"], nil, 3, function() local tbl = CopyTable(DefaultTemplates) if AS:CheckOption('ElvUIStyle', 'ElvUI') then tbl.Custom = nil end return tbl end)
Expand Down Expand Up @@ -227,7 +226,6 @@ function AS:BuildProfile()
Parchment = false,
SelectedColor = { 0, 0.44, .87 },
Shadows = true,
SkinDebug = false,
SkinTemplate = 'Transparent',
StatusBarColor = { .01, .39, .1 },
StatusBarTexture = 'Blizzard Raid Bar',
Expand Down
10 changes: 2 additions & 8 deletions AddOnSkins/Core/Skins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -562,13 +562,8 @@ do
S:Point(frame.leftGrad, 'LEFT', frame, 'CENTER')
S:Point(frame.rightGrad, 'RIGHT', frame, 'CENTER')

if S.Retail or S.Wrath then
frame.leftGrad:SetGradient("Horizontal", { r, g, b, 0.35 }, { r, g, b, 0 })
frame.rightGrad:SetGradient("Horizontal", { r, g, b, 0 }, { r, g, b, 0.35 })
else
frame.leftGrad:SetGradientAlpha("Horizontal", r, g, b, 0.35, r, g, b, 0)
frame.rightGrad:SetGradientAlpha("Horizontal", r, g, b, 0, r, g, b, 0.35)
end
frame.leftGrad:SetGradient("Horizontal", { r, g, b, 0.35 }, { r, g, b, 0 })
frame.rightGrad:SetGradient("Horizontal", { r, g, b, 0 }, { r, g, b, 0.35 })
end
end

Expand All @@ -578,7 +573,6 @@ function S:HandlePointXY(frame, x, y)
end

function S:HandleFrame(frame, setBackdrop, template, x1, y1, x2, y2)
if not frame then return end
local name = frame and frame.GetName and frame:GetName()
local insetFrame = frame.Inset or name and _G[name..'Inset']
local portraitFrame = frame.Portrait or frame.portrait or name and _G[name..'Portrait']
Expand Down
1 change: 1 addition & 0 deletions AddOnSkins/Init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ AS.MyRealm = GetRealmName()
AS.Noop = function() end
AS.TexCoords = { .075, .925, .075, .925 }
AS.Faction = UnitFactionGroup('player')
AS.Debug = false

AS.preload = {}
AS.skins = {}
Expand Down

0 comments on commit 38d521a

Please sign in to comment.