Skip to content

Commit

Permalink
causes several buttons to no longer be skinned #178
Browse files Browse the repository at this point in the history
  • Loading branch information
eltreum0 committed Dec 29, 2024
1 parent 0e533f6 commit 0bfc3c5
Showing 1 changed file with 91 additions and 183 deletions.
274 changes: 91 additions & 183 deletions ElvUI_EltreumUI/Modules/Skins/Ace3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,101 +36,30 @@ local function CreateFader(frame,isTree)

local backupR,backupG,backupB = 1,1,1

if frame.OnEnter then
frame:HookScript("OnEnter", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
if not frame.highlight then
UIFrameFadeIn(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 0, 1)
end
if frame.SetBackdropBorderColor then
frame:SetBackdropBorderColor(0, 0, 0, 1)
end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText and not frame.disabled and not (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
backupR,backupG,backupB = frametext:GetTextColor()
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end
end)
else
frame:SetScript("OnEnter", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
if not frame.highlight then
UIFrameFadeIn(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 0, 1)
end
if frame.SetBackdropBorderColor then
frame:SetBackdropBorderColor(0, 0, 0, 1)
end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText and not frame.disabled and not (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
backupR,backupG,backupB = frametext:GetTextColor()
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end
end)
end

if frame.OnShow then
frame:HookScript("OnShow", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
E:Delay(0,function() --the disable is delayed so delay running to run after it
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
elseif frame.disabled or (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(0.5,0.5,0.5)
else
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end
end)
end
end)
else
frame:SetScript("OnShow", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
E:Delay(0,function() --the disable is delayed so delay running to run after it
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
elseif frame.disabled or (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(0.5,0.5,0.5)
else
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end
end)
frame:HookScript("OnEnter", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
if not frame.highlight then
UIFrameFadeIn(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 0, 1)
end
if frame.SetBackdropBorderColor then
frame:SetBackdropBorderColor(0, 0, 0, 1)
end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText and not frame.disabled and not (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
backupR,backupG,backupB = frametext:GetTextColor()
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end)
end
end
end)

if frame.OnEnable then
frame:HookScript("OnEnable", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
frame:HookScript("OnShow", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
E:Delay(0,function() --the disable is delayed so delay running to run after it
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
Expand All @@ -146,111 +75,90 @@ local function CreateFader(frame,isTree)
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end
end
end)
else
frame:SetScript("OnEnable", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
elseif frame.disabled or (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(0.5,0.5,0.5)
end)
end
end)

frame:HookScript("OnEnable", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end
end)
end

if frame.OnClick then
frame:HookScript("OnClick", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
elseif frame.disabled or (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(0.5,0.5,0.5)
elseif frame.disabled or (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(0.5,0.5,0.5)
else
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.b)
else
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end
end)
end
end
end)

if frame.OnDisable then
frame:HookScript("OnDisable", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
elseif frame.disabled or (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(0.5,0.5,0.5)
frame:HookScript("OnClick", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
elseif frame.disabled or (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(0.5,0.5,0.5)
else
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
end
end)
end
end
end)

if frame.OnLeave then
frame:HookScript("OnLeave", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
if isTree then
if not frame.selected then
UIFrameFadeOut(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 1, 0)
frame:HookScript("OnDisable", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText then
if frame.selected then
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextSelected.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
elseif frame.disabled or (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(0.5,0.5,0.5)
else
UIFrameFadeOut(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 1, 0)
end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText and not frame.disabled and not (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(backupR,backupG,backupB)
end
end)
else
frame:SetScript("OnLeave", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
if isTree then
if not frame.selected then
UIFrameFadeOut(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 1, 0)
if not E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.classcolor then
frametext:SetTextColor(E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.r, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.g, E.db.ElvUI_EltreumUI.skins.ace3.tab.TextEnabled.b)
else
frametext:SetTextColor(valuecolors.r, valuecolors.g, valuecolors.b)
end
else
UIFrameFadeOut(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 1, 0)
end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText and not frame.disabled and not (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(backupR,backupG,backupB)
end
end)

frame:HookScript("OnLeave", function()
if not E.db.ElvUI_EltreumUI.skins.ace3.enable then return end
if isTree then
if not frame.selected then
UIFrameFadeOut(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 1, 0)
end
end)
end
else
UIFrameFadeOut(frame.EltruismAnimation, E.db.ElvUI_EltreumUI.skins.ace3.fadetime, 1, 0)
end
local frametext = (frame.Text) or (frame.text) or (_G[frame:GetName()] and _G[frame:GetName() .. "Text"]) --using frame.Text.GetText would return the function instead
if frametext and frametext.GetText and not frame.disabled and not (frame.GetButtonState and frame:GetButtonState() == "DISABLED") then
frametext:SetTextColor(backupR,backupG,backupB)
end
end)
end
end

Expand Down

0 comments on commit 0bfc3c5

Please sign in to comment.