diff Libs/DF/pictureedit.lua @ 22:dbd417f413a8

- framework update.
author Tercio
date Tue, 08 Sep 2015 13:16:49 -0300
parents dc1c77254f80
children 7d5934415ad0
line wrap: on
line diff
--- a/Libs/DF/pictureedit.lua	Tue Aug 25 14:09:54 2015 -0300
+++ b/Libs/DF/pictureedit.lua	Tue Sep 08 13:16:49 2015 -0300
@@ -12,7 +12,6 @@
 	window:SetMovable (true)
 	tinsert (UISpecialFrames, "DetailsFrameworkImageEdit")
 	window:SetFrameStrata ("TOOLTIP")
-	
 	window:SetMaxResize (266, 226)
 	
 	window.hooks = {}
@@ -39,9 +38,9 @@
 		window:StopMovingOrSizing()
 	end)
 	
-	local background_frame_image = background_frame:CreateTexture (nil, "background")
-	background_frame_image:SetAllPoints (background_frame)
-	background_frame_image:SetTexture ([[Interface\AddOns\Details\images\welcome]])
+	background_frame:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
+	background_frame:SetBackdropColor (0, 0, 0, 0.9)
+	background_frame:SetBackdropBorderColor (0, 0, 0, 1)
 	
 	local haveHFlip = false
 	local haveVFlip = false
@@ -72,7 +71,7 @@
 		topSlider:SetHook ("OnValueChange", function (_, _, value)
 			topCoordTexture.image:SetHeight (window.frame:GetHeight()/100*value)
 			if (window.callback_func) then
-				window.accept (true)
+				window.accept (nil, nil, true)
 			end
 		end)
 		
@@ -105,7 +104,7 @@
 			value = math.abs (value-100)
 			bottomCoordTexture.image:SetHeight (math.max (window.frame:GetHeight()/100*value, 1))
 			if (window.callback_func) then
-				window.accept (true)
+				window.accept (nil, nil, true)
 			end
 		end)
 		
@@ -136,7 +135,7 @@
 		leftSlider:SetHook ("OnValueChange", function (_, _, value)
 			leftCoordTexture.image:SetWidth (window.frame:GetWidth()/100*value)
 			if (window.callback_func) then
-				window.accept (true)
+				window.accept (nil, nil, true)
 			end
 		end)
 		
@@ -168,7 +167,7 @@
 			value = math.abs (value-100)
 			rightCoordTexture.image:SetWidth (math.max (window.frame:GetWidth()/100*value, 1))
 			if (window.callback_func) then
-				window.accept (true)
+				window.accept (nil, nil, true)
 			end
 		end)
 		
@@ -191,7 +190,7 @@
 		local alphaFrame
 		local originalColor = {0.9999, 0.8196, 0}
 		
-		local enableTexEdit = function (side, _, button)
+		local enableTexEdit = function (button, b, side)
 			
 			if (alphaFrameShown) then
 				alphaFrame:Hide()
@@ -245,12 +244,12 @@
 			if (default) then
 				edit_texture:SetVertexColor (unpack (default))
 				if (window.callback_func) then
-					window.accept (true)
+					window.accept (nil, nil, true)
 				end
 			else
 				edit_texture:SetVertexColor (ColorPickerFrame:GetColorRGB())
 				if (window.callback_func) then
-					window.accept (true)
+					window.accept (nil, nil, true)
 				end
 			end
 		end
@@ -301,7 +300,7 @@
 		--leftSlider.backdrop = nil
 		--leftSlider.fractional = true
 		
-		local alpha = function(_, _, button)
+		local alpha = function (button)
 		
 			if (ColorPickerFrame:IsShown()) then
 				ColorPickerFrame:Hide()
@@ -331,7 +330,7 @@
 		alphaSlider:SetHook ("OnValueChange", function (_, _, value)
 			edit_texture:SetAlpha (value/100)
 			if (window.callback_func) then
-				window.accept (true)
+				window.accept (nil, nil, true)
 			end
 		end)
 
@@ -375,23 +374,23 @@
 			topCoordTexture:SetHeight (window.frame:GetHeight()/100*topSlider:GetValue())
 			
 			if (window.callback_func) then
-				window.accept (true)
+				window.accept (nil, nil, true)
 			end
 		end)
 		
 
 		
 	--> flip
-		local flip = function (side)
+		local flip = function (button, b, side)
 			if (side == 1) then
 				haveHFlip = not haveHFlip
 				if (window.callback_func) then
-					window.accept (true)
+					window.accept (nil, nil, true)
 				end
 			elseif (side == 2) then
 				haveVFlip = not haveVFlip
 				if (window.callback_func) then
-					window.accept (true)
+					window.accept (nil, nil, true)
 				end
 			end
 		end
@@ -405,7 +404,7 @@
 		flipButtonV:InstallCustomTexture()
 		
 	--> accept
-		window.accept = function (keep_editing)
+		window.accept = function (self, b, keep_editing)
 		
 			if (not keep_editing) then
 				buttonsBackground:Hide()
@@ -470,6 +469,7 @@
 			window.callback_func = callback
 			window.extra_param = extraParam
 			buttonsBackground:Show()
+			buttonsBackground.widget:SetBackdrop (nil)
 			
 			table.wipe (window.hooks)
 		end
@@ -505,7 +505,7 @@
 			end
 
 			if (window.callback_func) then
-				window.accept (true)
+				window.accept (nil, nil, true)
 			end
 
 		end