mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update Misc skin dropdowns and buttons
This commit is contained in:
@@ -25,21 +25,36 @@ local function LoadSkin()
|
|||||||
"OptionsFrameMiscellaneous",
|
"OptionsFrameMiscellaneous",
|
||||||
"SoundOptionsFrame",
|
"SoundOptionsFrame",
|
||||||
"TicketStatusFrame",
|
"TicketStatusFrame",
|
||||||
"StackSplitFrame",
|
"StackSplitFrame"
|
||||||
"DropDownList1MenuBackdrop",
|
|
||||||
"DropDownList2MenuBackdrop",
|
|
||||||
"DropDownList1Backdrop",
|
|
||||||
"DropDownList2Backdrop",
|
|
||||||
"L_DropDownList1MenuBackdrop",
|
|
||||||
"L_DropDownList2MenuBackdrop",
|
|
||||||
"L_DropDownList1Backdrop",
|
|
||||||
"L_DropDownList2Backdrop",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for i = 1, getn(skins) do
|
for i = 1, getn(skins) do
|
||||||
E:SetTemplate(_G[skins[i]], "Transparent")
|
E:SetTemplate(_G[skins[i]], "Transparent")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local ChatMenus = {
|
||||||
|
"ChatMenu",
|
||||||
|
"EmoteMenu",
|
||||||
|
"LanguageMenu",
|
||||||
|
"VoiceMacroMenu",
|
||||||
|
}
|
||||||
|
|
||||||
|
for i = 1, getn(ChatMenus) do
|
||||||
|
if _G[ChatMenus[i]] == _G["ChatMenu"] then
|
||||||
|
HookScript(_G[ChatMenus[i]], "OnShow", function()
|
||||||
|
E:SetTemplate(this, "Transparent", true)
|
||||||
|
this:SetBackdropColor(unpack(E["media"].backdropfadecolor))
|
||||||
|
this:ClearAllPoints()
|
||||||
|
this:SetPoint("BOTTOMLEFT", ChatFrame1, "TOPLEFT", 0, 30)
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
HookScript(_G[ChatMenus[i]], "OnShow", function()
|
||||||
|
E:SetTemplate(this, "Transparent", true)
|
||||||
|
this:SetBackdropColor(unpack(E["media"].backdropfadecolor))
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
for i = 1, OptionsFrame:GetNumRegions() do
|
for i = 1, OptionsFrame:GetNumRegions() do
|
||||||
local region = select(i, OptionsFrame:GetRegions())
|
local region = select(i, OptionsFrame:GetRegions())
|
||||||
if region:GetObjectType() == "Texture" then
|
if region:GetObjectType() == "Texture" then
|
||||||
@@ -49,23 +64,29 @@ local function LoadSkin()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local r, g, b = 0.8, 0.8, 0.8
|
|
||||||
local function StyleButton(f)
|
local function StyleButton(f)
|
||||||
local width, height = (f:GetWidth() * .6), f:GetHeight()
|
local width, height = (f:GetWidth() * .54), f:GetHeight()
|
||||||
|
|
||||||
local leftGrad = f:CreateTexture(nil, "HIGHLIGHT")
|
local left = f:CreateTexture(nil, "HIGHLIGHT")
|
||||||
leftGrad:SetWidth(width)
|
left:SetWidth(width)
|
||||||
leftGrad:SetHeight(height)
|
left:SetHeight(height)
|
||||||
leftGrad:SetPoint("LEFT", f, "CENTER")
|
left:SetPoint("LEFT", f, "CENTER")
|
||||||
leftGrad:SetTexture(E.media.blankTex)
|
left:SetTexture(1, 1, 1, 0.3)
|
||||||
leftGrad:SetGradientAlpha("Horizontal", r, g, b, 0.35, r, g, b, 0)
|
left:SetHeight(16)
|
||||||
|
|
||||||
local rightGrad = f:CreateTexture(nil, "HIGHLIGHT")
|
local right = f:CreateTexture(nil, "HIGHLIGHT")
|
||||||
rightGrad:SetWidth(width)
|
right:SetWidth(width)
|
||||||
rightGrad:SetHeight(height)
|
right:SetHeight(height)
|
||||||
rightGrad:SetPoint("RIGHT", f, "CENTER")
|
right:SetPoint("RIGHT", f, "CENTER")
|
||||||
rightGrad:SetTexture(E.media.blankTex)
|
right:SetTexture(1, 1, 1, 0.3)
|
||||||
rightGrad:SetGradientAlpha("Horizontal", r, g, b, 0, r, g, b, 0.35)
|
right:SetHeight(16)
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = 1, 32 do
|
||||||
|
StyleButton(_G["ChatMenuButton"..i])
|
||||||
|
StyleButton(_G["EmoteMenuButton"..i])
|
||||||
|
StyleButton(_G["LanguageMenuButton"..i])
|
||||||
|
StyleButton(_G["VoiceMacroMenuButton"..i])
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Static Popups
|
-- Static Popups
|
||||||
@@ -298,6 +319,11 @@ local function LoadSkin()
|
|||||||
hooksecurefunc("UIDropDownMenu_Initialize", function()
|
hooksecurefunc("UIDropDownMenu_Initialize", function()
|
||||||
for i = 1, UIDROPDOWNMENU_MAXLEVELS do
|
for i = 1, UIDROPDOWNMENU_MAXLEVELS do
|
||||||
local buttonBackdrop = _G["DropDownList"..i.."Backdrop"]
|
local buttonBackdrop = _G["DropDownList"..i.."Backdrop"]
|
||||||
|
local buttonBackdropMenu = _G["DropDownList"..i.."MenuBackdrop"]
|
||||||
|
|
||||||
|
E:SetTemplate(buttonBackdrop, "Transparent")
|
||||||
|
E:SetTemplate(buttonBackdropMenu, "Transparent")
|
||||||
|
|
||||||
for j = 1, UIDROPDOWNMENU_MAXBUTTONS do
|
for j = 1, UIDROPDOWNMENU_MAXBUTTONS do
|
||||||
local button = _G["DropDownList"..i.."Button"..j]
|
local button = _G["DropDownList"..i.."Button"..j]
|
||||||
local buttonHighlight = _G["DropDownList"..i.."Button"..j.."Highlight"]
|
local buttonHighlight = _G["DropDownList"..i.."Button"..j.."Highlight"]
|
||||||
@@ -308,11 +334,39 @@ local function LoadSkin()
|
|||||||
buttonHighlight:SetHeight(16)
|
buttonHighlight:SetHeight(16)
|
||||||
|
|
||||||
if i == 1 then
|
if i == 1 then
|
||||||
buttonHighlight:SetPoint("TOPLEFT", button, "TOPLEFT", -10, 0)
|
buttonHighlight:SetPoint("TOPLEFT", button, "TOPLEFT", -8, 0)
|
||||||
buttonHighlight:SetPoint("TOPRIGHT", button, "TOPRIGHT", -5, 0)
|
buttonHighlight:SetPoint("TOPRIGHT", button, "TOPRIGHT", -8, 0)
|
||||||
else
|
else
|
||||||
buttonHighlight:SetPoint("TOPLEFT", button, "TOPLEFT", -5, 0)
|
buttonHighlight:SetPoint("TOPLEFT", button, "TOPLEFT", -4, 0)
|
||||||
buttonHighlight:SetPoint("TOPRIGHT", button, "TOPRIGHT", -3, 0)
|
buttonHighlight:SetPoint("TOPRIGHT", button, "TOPRIGHT", -4, 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
hooksecurefunc("L_UIDropDownMenu_Initialize", function()
|
||||||
|
for i = 1, 2 do
|
||||||
|
local buttonBackdrop = _G["L_DropDownList"..i.."Backdrop"]
|
||||||
|
local buttonBackdropMenu = _G["L_DropDownList"..i.."MenuBackdrop"]
|
||||||
|
|
||||||
|
E:SetTemplate(buttonBackdrop, "Transparent")
|
||||||
|
E:SetTemplate(buttonBackdropMenu, "Transparent")
|
||||||
|
|
||||||
|
for j = 1, UIDROPDOWNMENU_MAXBUTTONS do
|
||||||
|
local button = _G["L_DropDownList"..i.."Button"..j]
|
||||||
|
local buttonHighlight = _G["L_DropDownList"..i.."Button"..j.."Highlight"]
|
||||||
|
|
||||||
|
button:SetFrameLevel(buttonBackdrop:GetFrameLevel() + 1)
|
||||||
|
buttonHighlight:SetTexture(1, 1, 1, 0.3)
|
||||||
|
buttonHighlight:ClearAllPoints()
|
||||||
|
buttonHighlight:SetHeight(16)
|
||||||
|
|
||||||
|
if i == 1 then
|
||||||
|
buttonHighlight:SetPoint("TOPLEFT", button, "TOPLEFT", -4, 0)
|
||||||
|
buttonHighlight:SetPoint("TOPRIGHT", button, "TOPRIGHT", 4, 0)
|
||||||
|
else
|
||||||
|
buttonHighlight:SetPoint("TOPLEFT", button, "TOPLEFT", -4, 0)
|
||||||
|
buttonHighlight:SetPoint("TOPRIGHT", button, "TOPRIGHT", -4, 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||||
local S = E:NewModule("Skins", "AceHook-3.0", "AceEvent-3.0");
|
local S = E:NewModule("Skins", "AceHook-3.0", "AceEvent-3.0");
|
||||||
|
|
||||||
|
--Cache global variables
|
||||||
|
--Lua functions
|
||||||
local _G = _G
|
local _G = _G
|
||||||
local unpack, assert, pairs, ipairs, select, type, pcall = unpack, assert, pairs, ipairs, select, type, pcall
|
local unpack, assert, pairs, ipairs, select, type, pcall = unpack, assert, pairs, ipairs, select, type, pcall
|
||||||
local tinsert, wipe = table.insert, table.wipe
|
local tinsert, wipe = table.insert, table.wipe
|
||||||
local lower = string.lower
|
local lower = string.lower
|
||||||
|
--WoW API / Variables
|
||||||
local CreateFrame = CreateFrame
|
local CreateFrame = CreateFrame
|
||||||
local SetDesaturation = SetDesaturation
|
local SetDesaturation = SetDesaturation
|
||||||
local hooksecurefunc = hooksecurefunc
|
local hooksecurefunc = hooksecurefunc
|
||||||
|
|||||||
Reference in New Issue
Block a user