Quantcast

Embed libqtipclick, add some tt generating functions, etc

ackis [05-15-09 - 21:06]
Embed libqtipclick, add some tt generating functions, etc
Filename
.pkgmeta
ARLFrame.lua
AckisRecipeList.toc
embeds.xml
diff --git a/.pkgmeta b/.pkgmeta
index abccaa6..aa86251 100644
--- a/.pkgmeta
+++ b/.pkgmeta
@@ -71,4 +71,7 @@ externals:
   tag: latest
  libs/LibQTip-1.0:
   url: svn://svn.wowace.com/wow/libqtip-1-0/mainline/trunk
-  tag: latest
\ No newline at end of file
+  tag: latest
+ libs/LibQTipClick-1.0:
+  url: svn://svn.wowace.com/wow/libqtipclick-1-0/mainline/trunk
+  tag: latest
diff --git a/ARLFrame.lua b/ARLFrame.lua
index 2f7b986..42d8470 100644
--- a/ARLFrame.lua
+++ b/ARLFrame.lua
@@ -22,6 +22,7 @@ local BFAC		= LibStub("LibBabble-Faction-3.0"):GetLookupTable()
 local BC		= LibStub("LibBabble-Class-3.0"):GetLookupTable()
 local L			= LibStub("AceLocale-3.0"):GetLocale(MODNAME)
 local QTip		= LibStub("LibQTip-1.0")
+local QTipClick	= LibStub("LibQTipClick-1.0")

 local string = string
 local ipairs = ipairs
@@ -3204,14 +3205,36 @@ end

 -- Description: Function called when tool tip is clicked for alt trade skills

-function addon:HandleTTClick(cell, event, button)
+local function HandleTTClick(cell, event, button)
+
+end
+
+-- Description: Creates a list of names/alts/etc in a tooltip which you can click on
+
+local function GenerateClickAbleTT()
+
+	--addon.db.profile.tradeskill[prealm][pname][tradename]
+	local tradeskilllist = addon.db.profile.tradeskill
+	local t = {}
+
+	-- Parse the realms
+	for realm in pairs(tradeskilllist) do
+		-- Parse hte names
+		for name in pairs(tradeskilllist[realm]) do
+			-- Parse the professions
+			for prof in pairs(tradeskilllist[realm][name]) do
+				tinsert(t, name .. " - " .. realm .. " : " .. prof)
+			end
+		end
+	end
+
+	return strcat(t,"\n")

 end

 -- Description: Creates the initial frame to display recipes into

 function addon:CreateFrame(
-
 	rDB,		-- RecipeList
 	sortedRI,	-- sortedindex
 	cPlayer,	-- playerdata
@@ -4451,10 +4474,9 @@ function addon:CreateFrame(
 				ARL_MiscAltBtn:RegisterForClicks("LeftButtonUp")
 				ARL_MiscAltBtn:SetScript("OnClick",
 					function(this,button)
-					--open tooltip (qtipclick?) with all alts
-					--tooltip:SetCallback("OnMouseDown", addon.HandleTTClick)
+					--tooltip:SetCallback("OnMouseDown", HandleTTClick)
 					--GameTooltip_SetDefaultAnchor(GameTooltip, this)
-					--GameTooltip:SetText()
+					--GameTooltip:SetText(GenerateClickAbleTT())
 					--GameTooltip:Show()
 					end)

diff --git a/AckisRecipeList.toc b/AckisRecipeList.toc
index 4d924e4..e6fbd6b 100644
--- a/AckisRecipeList.toc
+++ b/AckisRecipeList.toc
@@ -25,7 +25,7 @@
 ## X-Website: http://www.wowwiki.com/AckisRecipeList/
 ## X-Feedback: http://wow.curse.com/downloads/wow-addons/details/arl.aspx

-## OptionalDeps: Ace3, LibAboutPanel, LibBetterBlizzOptions-1.0, LibBabble-Zone-3.0, LibBabble-Faction-3.0, LibBabble-Boss-3.0, LibBabble-Class-3.0, LibSharedMedia-3.0, LibQTip-1.0, Skillet, ATSW, Manufac, Cauldron, TomTom, TipTac
+## OptionalDeps: Ace3, LibAboutPanel, LibBetterBlizzOptions-1.0, LibBabble-Zone-3.0, LibBabble-Faction-3.0, LibBabble-Boss-3.0, LibBabble-Class-3.0, LibSharedMedia-3.0, LibQTip-1.0, LibQTipClick-1.0,Skillet, ATSW, Manufac, Cauldron, TomTom, TipTac
 ## DefaultState: Enabled

 ## SavedVariables: ARLDB2
diff --git a/embeds.xml b/embeds.xml
index d763009..5bbff30 100644
--- a/embeds.xml
+++ b/embeds.xml
@@ -24,5 +24,6 @@
 <Include file="libs\LibSharedMedia-3.0\lib.xml"/>
 <Include file="libs\LibBetterBlizzOptions\LibBetterBlizzOptions-1.0\lib.xml"/>
 <Include file="libs\LibQTip-1.0\lib.xml"/>
+<Include file="libs\LibQTipClick-1.0\lib.xml"/>

 </Ui>
\ No newline at end of file