This commit is contained in:
Bunny67
2018-01-08 13:21:43 +03:00
parent 8323ca6511
commit e6ec88bf5a
4 changed files with 44 additions and 30 deletions
@@ -10,14 +10,14 @@ local pairs = pairs
local CreateFrame = CreateFrame local CreateFrame = CreateFrame
local RegisterAsWidget, RegisterAsContainer local RegisterAsWidget, RegisterAsContainer
local function SetModifiedBackdrop(self) local function SetModifiedBackdrop()
if self.backdrop then self = self.backdrop end if this.backdrop then this = this.backdrop end
self:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor)) this:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor))
end end
local function SetOriginalBackdrop(self) local function SetOriginalBackdrop()
if self.backdrop then self = self.backdrop end if this.backdrop then this = this.backdrop end
self:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end end
local function SkinScrollBar(frame, thumbTrim) local function SkinScrollBar(frame, thumbTrim)
@@ -101,8 +101,8 @@ local function SkinButton(f, strip, noTemplate)
E:SetTemplate(f, "Default", true) E:SetTemplate(f, "Default", true)
end end
HookScript(f, "OnEnter", function() SetModifiedBackdrop(this) end) HookScript(f, "OnEnter", SetModifiedBackdrop)
HookScript(f, "OnLeave", function() SetOriginalBackdrop(this) end) HookScript(f, "OnLeave", SetOriginalBackdrop)
end end
function S:SkinAce3() function S:SkinAce3()
@@ -37,8 +37,8 @@ function LoadSkin()
tab.backdrop:SetPoint("TOPLEFT", 3, -7) tab.backdrop:SetPoint("TOPLEFT", 3, -7)
tab.backdrop:SetPoint("BOTTOMRIGHT", -2, -1) tab.backdrop:SetPoint("BOTTOMRIGHT", -2, -1)
tab:SetScript("OnEnter", function() S:SetModifiedBackdrop(this) end) tab:SetScript("OnEnter", S.SetModifiedBackdrop)
tab:SetScript("OnLeave", function() S:SetOriginalBackdrop(this) end) tab:SetScript("OnLeave", S.SetOriginalBackdrop)
end end
@@ -300,11 +300,10 @@ local function LoadSkin()
-- Interface Options -- Interface Options
UIOptionsFrame:SetParent(E.UIParent) UIOptionsFrame:SetParent(E.UIParent)
UIOptionsFrame:SetScale(E.UIParent:GetScale()) UIOptionsFrame:EnableMouse(false)
UIOptionsFrame:EnableMouse(0)
hooksecurefunc("UIOptionsFrame_Load", function() hooksecurefunc("UIOptionsFrame_Load", function()
E:StripTextures(UIOptionsFrame, true) E:StripTextures(UIOptionsFrame)
end) end)
local UIOptions = { local UIOptions = {
@@ -322,30 +321,45 @@ local function LoadSkin()
for i = 1, getn(UIOptions) do for i = 1, getn(UIOptions) do
local options = _G[UIOptions[i]] local options = _G[UIOptions[i]]
if options then E:SetTemplate(options, "Transparent")
E:SetTemplate(options, "Transparent")
end
end end
BasicOptions.backdrop = CreateFrame("Frame", nil, BasicOptions)
BasicOptions.backdrop:SetPoint("TOPLEFT", BasicOptionsGeneral, -20, 35)
BasicOptions.backdrop:SetPoint("BOTTOMRIGHT", BasicOptionsHelp, 20, -130)
E:SetTemplate(BasicOptions.backdrop, "Transparent")
for i = 1, 2 do for i = 1, 2 do
local tab = _G["UIOptionsFrameTab"..i] local tab = _G["UIOptionsFrameTab"..i]
E:StripTextures(tab, true) E:StripTextures(tab, true)
E:CreateBackdrop(tab, "Transparent") E:CreateBackdrop(tab, "Transparent")
tab:SetFrameLevel(tab:GetParent():GetFrameLevel() + 1) tab:SetFrameLevel(tab:GetParent():GetFrameLevel() + 2)
tab.backdrop:SetFrameLevel(tab:GetParent():GetFrameLevel() + 1) tab.backdrop:SetFrameLevel(tab:GetParent():GetFrameLevel() + 1)
tab.backdrop:SetPoint("TOPLEFT", 10, E.PixelMode and -4 or -6) tab.backdrop:SetPoint("TOPLEFT", 5, E.PixelMode and -14 or -16)
tab.backdrop:SetPoint("BOTTOMRIGHT", -10, E.PixelMode and -4 or -6) tab.backdrop:SetPoint("BOTTOMRIGHT", -5, E.PixelMode and -4 or -6)
tab:SetScript("OnEnter", function() S:SetModifiedBackdrop(this) end) tab:SetScript("OnClick", function()
tab:SetScript("OnLeave", function() S:SetOriginalBackdrop(this) end) PanelTemplates_Tab_OnClick(UIOptionsFrame)
if AdvancedOptions:IsShown() then
BasicOptions:Show()
AdvancedOptions:Hide()
else
BasicOptions:Hide()
AdvancedOptions:Show()
end
PlaySound("igCharacterInfoTab")
end)
HookScript(tab, "OnEnter", S.SetModifiedBackdrop)
HookScript(tab, "OnLeave", S.SetOriginalBackdrop)
end end
for i = 1, UIOptionsFrame:GetNumChildren() do for i = 1, UIOptionsFrame:GetNumChildren() do
local child = select(i, UIOptionsFrame:GetChildren()) local child = select(i, UIOptionsFrame:GetChildren())
if child.GetPushedTexture and child:GetPushedTexture() and not child:GetName() then if child.GetPushedTexture and child:GetPushedTexture() and not child:GetName() then
child:SetFrameLevel(child:GetParent():GetFrameLevel() + 2) child:SetFrameLevel(UIOptionsFrame:GetFrameLevel() + 2)
S:HandleCloseButton(child, UIOptionsFrame.backdrop) S:HandleCloseButton(child, UIOptionsFrame.backdrop)
end end
end end
+8 -8
View File
@@ -38,14 +38,14 @@ function S:SquareButton_SetIcon(self, name)
end end
end end
function S:SetModifiedBackdrop(self) function S:SetModifiedBackdrop()
if self.backdrop then self = self.backdrop end if this.backdrop then this = this.backdrop end
self:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor)) this:SetBackdropBorderColor(unpack(E["media"].rgbvaluecolor))
end end
function S:SetOriginalBackdrop(self) function S:SetOriginalBackdrop()
if self.backdrop then self = self.backdrop end if this.backdrop then this = this.backdrop end
self:SetBackdropBorderColor(unpack(E["media"].bordercolor)) this:SetBackdropBorderColor(unpack(E["media"].bordercolor))
end end
function S:HandleButton(f, strip) function S:HandleButton(f, strip)
@@ -72,8 +72,8 @@ function S:HandleButton(f, strip)
if strip then E:StripTextures(f) end if strip then E:StripTextures(f) end
E:SetTemplate(f, "Default", true) E:SetTemplate(f, "Default", true)
HookScript(f, "OnEnter", function() S:SetModifiedBackdrop(this) end) HookScript(f, "OnEnter", S.SetModifiedBackdrop)
HookScript(f, "OnLeave", function() S:SetOriginalBackdrop(this) end) HookScript(f, "OnLeave", S.SetOriginalBackdrop)
end end
function S:HandleScrollBar(frame, thumbTrim) function S:HandleScrollBar(frame, thumbTrim)