changeset 31:22fa64c9b2de

Store spellLink instead of spellID
author contrebasse
date Thu, 28 Apr 2011 21:43:06 +0200
parents fd76c8951b7d
children 416c307fd00b
files ReagentMaker.lua SecureMenu.lua data.lua
diffstat 3 files changed, 44 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/ReagentMaker.lua	Thu Apr 28 20:31:25 2011 +0200
+++ b/ReagentMaker.lua	Thu Apr 28 21:43:06 2011 +0200
@@ -206,17 +206,9 @@
 	local link
 	if A.data[reagentID].spellLink then
 		link = A.data[reagentID].spellLink
-	elseif A.data[reagentID].spellID then
-		link = GetSpellLink(A.data[reagentID].spellID)
 	else
 		A.DEBUG("Recipe link not found for "..reagentID)
 		return
-		--[[
-		local reagentIndex = A.findSkillIndex(reagentID)
-		if reagentIndex then
-			link = GetTradeSkillRecipeLink(A.findSkillIndex(reagentID))
-		end
-		--]]
 	end
 
 	if link then
--- a/SecureMenu.lua	Thu Apr 28 20:31:25 2011 +0200
+++ b/SecureMenu.lua	Thu Apr 28 21:43:06 2011 +0200
@@ -93,15 +93,12 @@
 	GameTooltip:SetOwner(btn,"ANCHOR_LEFT")
 	GameTooltip:SetHyperlink(btn.reagentLink)
 	GameTooltip:Show()
-	if btn.spellID then
-		local link = GetSpellLink(btn.spellID)
-		if link then
-			A.tooltipRecipe:SetOwner(GameTooltip)
-			A.tooltipRecipe:SetHyperlink(link)
-			A.tooltipRecipe:Show()
-			A.tooltipRecipe:ClearAllPoints()
-			A.tooltipRecipe:SetPoint("TOPRIGHT",GameTooltip,"BOTTOMRIGHT")
-		end
+	if btn.spellLink then
+		A.tooltipRecipe:SetOwner(GameTooltip)
+		A.tooltipRecipe:SetHyperlink(btn.spellLink)
+		A.tooltipRecipe:Show()
+		A.tooltipRecipe:ClearAllPoints()
+		A.tooltipRecipe:SetPoint("TOPRIGHT",GameTooltip,"BOTTOMRIGHT")
 	end
 end
 local function btnLeft(btn)
@@ -206,7 +203,7 @@
 	end
 end
 
-local function menuAddItem(action,itemID,reagent,spellID)
+local function menuAddItem(action,itemID,reagent,spellLink)
 	local btn
 	-- Create a button only if necessary
 	if numActiveEntries >= #menuEntries then
@@ -247,7 +244,7 @@
 	btn.reagentID = reagent[1]
 	btn.reagentLink = link
 	btn.reagentsForOneRecipe = reagent[2]
-	btn.spellID = spellID
+	btn.spellLink = spellLink
 
 	-- Set action
 	if type(action)=="function" then
@@ -295,7 +292,7 @@
 	for _,reagent in ipairs(A.data[itemID]) do
 		if A.data[itemID].spell then
 			-- Special spell
-			menuAddItem(A.data[itemID].spell,itemID,reagent,A.data[itemID].spellID)
+			menuAddItem(A.data[itemID].spell,itemID,reagent,A.data[itemID].spellLink)
 		else
 			-- Standard tradeskill spell UNTESTED
 			menuAddItem(A.craft,itemID,reagent)
--- a/data.lua	Thu Apr 28 20:31:25 2011 +0200
+++ b/data.lua	Thu Apr 28 21:43:06 2011 +0200
@@ -2,20 +2,24 @@
 
 local MillID = 51005
 local macroMill = "/cast "..GetSpellInfo(MillID).."\n/use "
+local MillLink = GetSpellLink(MillID)
+MillID = nil
 local ProspectID = 31252
 local macroProspect = "/cast "..GetSpellInfo(ProspectID).."\n/use "
+local ProspectLink = GetSpellLink(ProspectID)
+ProspectID = nil
 A.data = {
 	-- Mill
 	-- Normal pigments
 	[39151] = { -- Alabaster Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{2447,5,2,3}, -- Peacebloom
 		{ 765,5,2,3},  -- Silverleaf
 		{2449,5,2,4}}, -- Earthroot
 	[39334] = { -- Dusky Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{ 785,5,2,3}, -- Mageroyal
 		{2450,5,2,3}, -- Briarthorn
 		{2452,5,2,3}, -- Swiftthistle
@@ -23,21 +27,21 @@
 		{3820,5,2,4}}, -- Stranglekelp
 	[39338] = { -- Golden Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{3369,5,2,3}, -- Grave Moss
 		{3355,5,2,3}, -- Wild Steelbloom
 		{3356,5,2,4}, -- Kingsblood
 		{3357,5,2,4}}, -- Liferoot
 	[39339] = { -- Emerald Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{3818,5,2,3}, -- Fadeleaf
 		{3821,5,2,3}, -- Goldthorn
 		{3358,5,3,4}, -- Khadgar's Whisker
 		{3819,5,3,4}}, -- Dragon's Teeth
 	[39340] = { -- Violet Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{4625,5,2,3}, -- Firebloom
 		{8831,5,2,3}, -- Purple Lotus
 		{8836,5,2,3}, -- Arthas' Tears
@@ -47,7 +51,7 @@
 		{8846,5,2,4}}, -- Gromsblood
 	[39341] = { -- Silvery Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{13464,5,2,3}, -- Golden Sansam
 		{13463,5,2,3}, -- Dreamfoil
 		{13465,5,2,4}, -- Mountain Silversage
@@ -55,7 +59,7 @@
 		{13467,5,2,4}}, -- Icecap
 	[39342] = { -- Nether Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{22786,5,2,3}, -- Dreaming Glory
 		{22785,5,2,3}, -- Felweed
 		{22789,5,2,3}, -- Terocone
@@ -65,7 +69,7 @@
 		{22791,5,2,4}, -- Netherbloom
 		{22792,5,2,4}}, -- Nightmare Vine
 	[39343] = { -- Azure Pigment
-		spellID = MillID,
+		spellLink = MillLink,
 		spell = macroMill,
 		{37921,5,2,3}, -- Deadnettle
 		{36901,5,2,3}, -- Goldclover
@@ -78,7 +82,7 @@
 		{36905,5,2,4}}, -- Lichbloom
 	[61979] = { -- Ashen Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{52983,5,2,3}, -- Cinderbloom
 		{52985,5,2,3}, -- Azshara's Veil
 		{52984,5,2,3}, -- Stormvine
@@ -88,7 +92,7 @@
 	-- Rare pigments
 	[43103] = { -- Verdant Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{785,5,0.25},  -- Mageroyal
 		{2450,5,0.25}, -- Briarthorn
 		{2452,5,0.25}, -- Swiftthistle
@@ -96,21 +100,21 @@
 		{3820,5,0.5}}, -- Stranglekelp
 	[43104] = { -- Burnt Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{3369,5,0.25}, -- Grave Moss
 		{3355,5,0.25}, -- Wild Steelbloom
 		{3356,5,0.5}, -- Kingsblood
 		{3357,5,0.5}}, -- Liferoot
 	[43105] = { -- Indigo Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{3818,5,0.25}, -- Fadeleaf
 		{3821,5,0.25}, -- Goldthorn
 		{3358,5,0.5}, -- Khadgar's Whisker
 		{3819,5,0.5}}, -- Dragon's Teeth
 	[43106] = { -- Ruby Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{4625,5,0.25}, -- Firebloom
 		{8831,5,0.25}, -- Purple Lotus
 		{8836,5,0.25}, -- Arthas' Tears
@@ -120,7 +124,7 @@
 		{8846,5,0.5}}, -- Gromsblood
 	[43107] = { -- Sapphire Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{13464,5,0.25}, -- Golden Sansam
 		{13463,5,0.25}, -- Dreamfoil
 		{13465,5,0.5}, -- Mountain Silversage
@@ -128,7 +132,7 @@
 		{13467,5,0.5}}, -- Icecap
 	[43108] = { -- Ebon Pigment
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{22786,5,0.25}, -- Dreaming Glory
 		{22785,5,0.25}, -- Felweed
 		{22789,5,0.25}, -- Terocone
@@ -138,7 +142,7 @@
 		{22791,5,0.5}, -- Netherbloom
 		{22792,5,0.5}}, -- Nightmare Vine
 	[43109] = { -- Icy Pigment
-		spellID = MillID,
+		spellLink = MillLink,
 		spell = macroMill,
 		{37921,5,0.25}, -- Deadnettle
 		{36901,5,0.25}, -- Goldclover
@@ -151,7 +155,7 @@
 		{36905,5,0.5}}, -- Lichbloom
 	[61980] = { -- Burning Embers
 		spell = macroMill,
-		spellID = MillID,
+		spellLink = MillLink,
 		{52983,5,0.25}, -- Cinderbloom
 		{52985,5,0.25}, -- Azshara's Veil
 		{52984,5,0.25}, -- Stormvine
@@ -162,72 +166,72 @@
 	-- Prospect
 	[774] = { -- Malachite
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{2770,5,0.5}}, -- Copper Ore
 	[818] = { -- Tigerseye
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{2770,5,0.5}}, -- Copper Ore
 	[1210] = { -- Shadowgem
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{2771,50,0.38}, -- Tin Ore
 		{2770,5,0.1}}, -- Copper Ore
 	[1705] = { -- Lesser Moonstone
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{2771,5,0.38}, -- Tin Ore
 		{2772,5,0.35}}, -- Iron Ore
 	[1206] = { -- Moss Agate
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{2771,5,0.37}}, -- Tin Ore
 	[1529] = { -- Jade
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{2772,5,0.35}, -- Iron Ore
 		{2771,5,0.03}}, -- Tin Ore
 	[7909] = { -- Aquamarine
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{3858,5,0.35}, -- Mithril Ore
 		{2772,5,0.05}, -- Iron Ore
 		{2771,5,0.03}}, -- Tin Ore
 	[3864] = { -- Citrine
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{2772,5,0.36}, -- Iron Ore
 		{3858,5,0.35}, -- Mithril Ore
 		{2771,5,0.03}}, -- Tin Ore
 	[7910] = { -- Star Ruby
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{3858,5,0.36}, -- Mithril Ore
 		{10620,5,0.15}, -- Thorium Ore
 		{2772,5,0.05}}, -- Iron Ore
 	[12799] = { -- Large Opal
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{10620,5,0.31}, -- Thorium Ore
 		{3858,5,0.03}}, -- Mithril Ore
 	[12361] = { -- Blue Sapphire
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{10620,5,0.31}, -- Thorium Ore
 		{3858,5,0.02}}, -- Mithril Ore
 	[12800] = { -- Azerothian Diamond
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{10620,5,0.31}, -- Thorium Ore
 		{3858,5,0.02}}, -- Mithril Ore
 	[12364] = { -- Huge Emerald
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{10620,5,0.31}, -- Thorium Ore
 		{3858,5,0.02}}, -- Mithril Ore
 	[23112] = { -- Golden Draenite
 		spell = macroProspect,
-		spellID = ProspectID,
+		spellLink = ProspectLink,
 		{23424,5,0.19}, -- Fel Iron Ore
 		{23425,5,0.18}}, -- Adamantite Ore
 	-- To be continued...