Quantcast

Impossible! After 2 years we managed to discover the secret of click through option for backgrounds!

Darthpred [04-11-15 - 19:31]
Impossible! After 2 years we managed to discover the secret of click through option for backgrounds!
Filename
ElvUI_SLE/modules/backgrounds.lua
ElvUI_SLE/options/backgrounds_c.lua
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',