From 6c73ed5c5e0d80ef32ea503d46d46be1b921df2b Mon Sep 17 00:00:00 2001 From: Darthpred Date: Sat, 11 Apr 2015 23:31:51 +0400 Subject: [PATCH] Impossible! After 2 years we managed to discover the secret of click through option for backgrounds! --- ElvUI_SLE/modules/backgrounds.lua | 12 +++++++++--- ElvUI_SLE/options/backgrounds_c.lua | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ElvUI_SLE/modules/backgrounds.lua b/ElvUI_SLE/modules/backgrounds.lua index 39db70c..714d794 100644 --- a/ElvUI_SLE/modules/backgrounds.lua +++ b/ElvUI_SLE/modules/backgrounds.lua @@ -24,9 +24,6 @@ local function CreateFrames() v[1]:Hide() end - --Make EnableMouse and option b/c of drunk russian - BGb:EnableMouse(true) --Maybe add an option to actually allow change this click catching? - BGa:EnableMouse(true) BGb.tex:SetAlpha(0.5) --Also the problem. As long as bottom bg can be transparent it's no good in keeping fixed transparency for the texture. @@ -78,6 +75,14 @@ function BG:FramesVisibility() end end +function BG:MouseCatching() + if not BGb then return end + local db = E.db.sle.backgrounds + for _,v in pairs(Fr) do + v[1]:EnableMouse(not(db[v[2]].clickthrough)) + end +end + function BG:UpdateFrames() if not BGb then return end local db = E.db.sle.backgrounds @@ -87,6 +92,7 @@ function BG:UpdateFrames() end BG:FramesSize() BG:FramesVisibility() + BG:MouseCatching() UpdateTex() end diff --git a/ElvUI_SLE/options/backgrounds_c.lua b/ElvUI_SLE/options/backgrounds_c.lua index 66fb9a9..76238da 100644 --- a/ElvUI_SLE/options/backgrounds_c.lua +++ b/ElvUI_SLE/options/backgrounds_c.lua @@ -152,6 +152,12 @@ local function configTable() desc = L["Show/Hide this frame during Pet Battles."], set = function(info, value) E.db.sle.backgrounds[v[1]].pethide = value; BG:RegisterHide() end }, + clickthrough = { + order = 9, + type = "toggle", + name = L["Click Through"], + set = function(info, value) E.db.sle.backgrounds[v[1]].clickthrough = value; BG:MouseCatching() end + }, alpha = { order = 12, type = 'range', -- 1.7.9.5