changeset 18:680465749fc7

- framework update.
author Tercio
date Fri, 26 Jun 2015 14:03:10 -0300
parents 0c160948ac5e
children 215f0dd37a6c
files Libs/DF/addon.lua Libs/DF/dropdown.xml Libs/DF/fw.lua Libs/DF/panel.lua
diffstat 4 files changed, 27 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Libs/DF/addon.lua	Tue Jun 23 14:16:13 2015 -0300
+++ b/Libs/DF/addon.lua	Fri Jun 26 14:03:10 2015 -0300
@@ -1,9 +1,11 @@
-
-
 
 local DF = _G ["DetailsFramework"]
 local _
 
+if (not DF) then -- or not DetailsFrameWorkLoadValid
+	return 
+end
+
 function DF:CreateAddOn (name, global_saved, global_table, options_table, broker)
 	
 	local addon = LibStub ("AceAddon-3.0"):NewAddon (name, "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0", "DetailsFramework-1.0", "AceComm-3.0")
--- a/Libs/DF/dropdown.xml	Tue Jun 23 14:16:13 2015 -0300
+++ b/Libs/DF/dropdown.xml	Fri Jun 26 14:03:10 2015 -0300
@@ -93,7 +93,7 @@
 				
 				<Scripts>
 					<OnHide>
-						DetailsDropDownOptionsFrameOnHide (self);
+						DetailsFrameworkDropDownOptionsFrameOnHide (self);
 					</OnHide>
 					<OnLoad>
 						self:SetBackdropColor (0, 0, 0, 0.95);
--- a/Libs/DF/fw.lua	Tue Jun 23 14:16:13 2015 -0300
+++ b/Libs/DF/fw.lua	Fri Jun 26 14:03:10 2015 -0300
@@ -1,12 +1,14 @@
 
-local major, minor = "DetailsFramework-1.0", 2
+local major, minor = "DetailsFramework-1.0", 3
 local DF, oldminor = LibStub:NewLibrary (major, minor)
 
-
-if (not DF) then 
+if (not DF) then
+	DetailsFrameWorkLoadValid = false
 	return 
 end
 
+DetailsFrameWorkLoadValid = true
+
 local _type = type
 local _unpack = unpack
 local _
@@ -737,7 +739,7 @@
 			options_frame:SetPoint ("center", UIParent, "center")
 			
 			options_frame:SetBackdrop ({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
-			edgeFile = [[Interface\AddOns\Details\images\border_2]], edgeSize = 32,
+			edgeFile = DF.folder ..  "border_2", edgeSize = 32,
 			insets = {left = 1, right = 1, top = 1, bottom = 1}})
 			options_frame:SetBackdropColor (0, 0, 0, .7)
 
--- a/Libs/DF/panel.lua	Tue Jun 23 14:16:13 2015 -0300
+++ b/Libs/DF/panel.lua	Fri Jun 26 14:03:10 2015 -0300
@@ -1,9 +1,11 @@
-
-
 
 local DF = _G ["DetailsFramework"]
 local _
 
+if (not DF) then -- or not DetailsFrameWorkLoadValid
+	return 
+end
+
 --> lua locals
 local _rawset = rawset --> lua local
 local _rawget = rawget --> lua local
@@ -1335,6 +1337,7 @@
 function DF:SavePositionOnScreen (frame)
 	if (frame.db and frame.db.position) then
 		local x, y = DF:GetPositionOnScreen (frame)
+		--print ("saving...", x, y, frame:GetName())
 		frame.db.position.x, frame.db.position.y = x, y
 	end
 end
@@ -1359,6 +1362,15 @@
 	end
 end
 
+local Panel1PxHasPosition = function (self)
+	local db = self.db
+	if (db) then
+		if (db.position and db.position.x and (db.position.x ~= 0 or db.position.y ~= 0)) then
+			return true
+		end
+	end
+end
+
 function DF:Create1PxPanel (parent, w, h, title, name, config, title_anchor, no_special_frame)
 	local f = CreateFrame ("frame", name, parent or UIParent)
 	f:SetSize (w or 100, h or 75)
@@ -1380,6 +1392,7 @@
 	f:SetUserPlaced (true)
 	
 	f.db = config
+	--print (config.position.x, config.position.x)
 	Panel1PxReadConfig (f)
 	
 	local close = CreateFrame ("button", name and name .. "CloseButton", f)
@@ -1426,6 +1439,7 @@
 	f.Title = title_string
 	f.Lock = lock
 	f.Close = close
+	f.HasPosition = Panel1PxHasPosition
 	
 	f.IsLocked = not f.IsLocked
 	Panel1PxOnToggleLock (f)