Skip to content

Commit

Permalink
test setting one if they don't have it
Browse files Browse the repository at this point in the history
  • Loading branch information
eltreum0 committed Dec 29, 2024
1 parent 21d4ca4 commit 5b4c06f
Showing 1 changed file with 124 additions and 0 deletions.
124 changes: 124 additions & 0 deletions ElvUI_EltreumUI/Modules/Skins/Ace3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,25 @@ local function CreateFader(frame,isTree)
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
Expand All @@ -81,6 +100,30 @@ local function CreateFader(frame,isTree)
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)
end
end)
end

if frame.OnEnable then
Expand All @@ -105,6 +148,28 @@ local function CreateFader(frame,isTree)
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)
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

if frame.OnClick then
Expand All @@ -129,6 +194,28 @@ local function CreateFader(frame,isTree)
end
end
end)
else
frame:SetScript("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)
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

if frame.OnDisable then
Expand All @@ -153,6 +240,28 @@ local function CreateFader(frame,isTree)
end
end
end)
else
frame:SetScript("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
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

if frame.OnLeave then
Expand All @@ -170,6 +279,21 @@ local function CreateFader(frame,isTree)
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)
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
end
Expand Down

0 comments on commit 5b4c06f

Please sign in to comment.