Quantcast

Add some dry-coded support for ctrl-shift click to add to mini-map/world map. I hate you stanzilla.

ackis [02-27-09 - 18:23]
Add some dry-coded support for ctrl-shift click to add to mini-map/world map.  I hate you stanzilla.
Filename
ARLFrame.lua
AckisRecipeList.toc
Locals/ARLLocals-enUS.lua
diff --git a/ARLFrame.lua b/ARLFrame.lua
index 450c0cf..6e49db1 100644
--- a/ARLFrame.lua
+++ b/ARLFrame.lua
@@ -349,7 +349,7 @@ do
 	-- Input:
 	-- Output:

-	function addon:SetupMap()
+	function addon:SetupMap(singlerecipe)

 		if (not TomTom) then
 			--@debug@
@@ -375,17 +375,28 @@ do

 			local maplist = {}

-			-- Scan through all recipes to display, and add the vendors to a list to get their acquire info
-			for i = 1, #sortedRecipeIndex do
-				local recipeIndex = sortedRecipeIndex[i]
-
-				if ((recipeDB[recipeIndex]["Display"] == true) and (recipeDB[recipeIndex]["Search"] == true)) then
-					-- loop through acquire methods, display each
-					for k, v in pairs(recipeDB[recipeIndex]["Acquire"]) do
-						-- If it's a vendor check to see if we're displaying it
-						if (v["Type"] == 2) then
-							local display = CheckDisplayFaction(addon.db.profile.filters, vendorDB[v["ID"]]["Faction"])
-							maplist[v["ID"]] = display
+			-- We're only getting a singl recipe, not a bunch
+			if (singlerecipe) then
+				-- loop through acquire methods, display each
+				for k, v in pairs(recipeDB[singlerecipe]["Acquire"]) do
+					-- If it's a vendor check to see if we're displaying it
+					if (v["Type"] == 2) then
+						local display = CheckDisplayFaction(addon.db.profile.filters, vendorDB[v["ID"]]["Faction"])
+						maplist[v["ID"]] = display
+					end
+				end
+			else
+				-- Scan through all recipes to display, and add the vendors to a list to get their acquire info
+				for i = 1, #sortedRecipeIndex do
+					local recipeIndex = sortedRecipeIndex[i]
+					if ((recipeDB[recipeIndex]["Display"] == true) and (recipeDB[recipeIndex]["Search"] == true)) then
+						-- loop through acquire methods, display each
+						for k, v in pairs(recipeDB[recipeIndex]["Acquire"]) do
+							-- If it's a vendor check to see if we're displaying it
+							if (v["Type"] == 2) then
+								local display = CheckDisplayFaction(addon.db.profile.filters, vendorDB[v["ID"]]["Faction"])
+								maplist[v["ID"]] = display
+							end
 						end
 					end
 				end
@@ -433,9 +444,6 @@ do
 				end

 				if ((zone) and (continent)) then
-					--@debug@
-					--addon:Print("Adding vendor ID: " .. k .. " to the world map at coords " .. vendorDB[k]["Coordx"] .. "," .. vendorDB[k]["Coordy"].. " with continent ID: " .. continent .. " and zone ID: " .. zone .. ".")
-					--@end-debug@
 					local iconuid = TomTom:AddZWaypoint(continent, zone, vendorDB[k]["Coordx"], vendorDB[k]["Coordy"], vendorDB[k]["Name"], false, minimap, worldmap)
 					tinsert(iconlist,iconuid)
 				end
@@ -948,6 +956,7 @@ local function GenerateTooltipContent(owner, rIndex, playerFaction, exclude)
 		gttAdd(0, -1, 0, 0, L["ALT_CLICK"], clr1)
 		gttAdd(0, -1, 0, 1, L["CTRL_CLICK"], clr1)
 		gttAdd(0, -1, 0, 1, L["SHIFT_CLICK"], clr1)
+		gttAdd(0, -1, 0, 1, L["CTRL_SHIFT_CLICK"], clr1)

 		arlTooltip:Show()

@@ -2620,39 +2629,35 @@ function addon.RecipeItem_OnClick(button)
 		local traverseIndex = 0

 		-- First, check if this is a "modified" click, and react appropriately
-		if (IsShiftKeyDown()) then
-
-			local itemID = recipeDB[clickedSpellIndex]["ItemID"]
-			local _, itemLink = GetItemInfo(itemID)
-
-			if (itemLink) then
-
-				ChatFrameEditBox:Insert(itemLink)
-
-			else
-
-				addon:Print(L["NoItemLink"])
-
+		if (IsModifierKeyDown()) then
+			-- CTRL-SHIFT
+			if (IsControlKeyDown() and IsShiftKeyDown()) then
+				addon:SetupMap(clickedSpellIndex)
+			-- SHIFT
+			elseif (IsShiftKeyDown()) then
+				local itemID = recipeDB[clickedSpellIndex]["ItemID"]
+				local _, itemLink = GetItemInfo(itemID)
+				if (itemLink) then
+					ChatFrameEditBox:Insert(itemLink)
+				else
+					addon:Print(L["NoItemLink"])
+				end
+			-- CTRL
+			elseif (IsControlKeyDown()) then
+				ChatFrameEditBox:Insert(recipeDB[clickedSpellIndex]["RecipeLink"])
+			-- ALT
+			elseif (IsAltKeyDown()) then
+				-- Code needed here to insert this item into the "Ignore List"
+				addon:ToggleExcludeRecipe(clickedSpellIndex)
+				ReDisplay()
 			end
-
-		elseif (IsControlKeyDown()) then
-
-			ChatFrameEditBox:Insert(recipeDB[clickedSpellIndex]["RecipeLink"])
-
-		elseif (IsAltKeyDown()) then
-
-			-- Code needed here to insert this item into the "Ignore List"
-			addon:ToggleExcludeRecipe(clickedSpellIndex)
-			ReDisplay()
-
+		-- No modifyer
 		else
-
 			-- three possibilities here
 			-- 1) We clicked on the recipe button on a closed recipe
 			-- 2) We clicked on the recipe button of an open recipe
 			-- 3) we clicked on the expanded text of an open recipe
 			if (isRecipe) then
-
 				if (isExpanded) then
 					-- get rid of our expanded lines
 					traverseIndex = clickedIndex + 1
diff --git a/AckisRecipeList.toc b/AckisRecipeList.toc
index 4159b97..ca17f80 100644
--- a/AckisRecipeList.toc
+++ b/AckisRecipeList.toc
@@ -1,6 +1,6 @@
-## Title: Ackis Recipe List (1.0 RC3)
-## Title-koKR: Ackis의 제조법 리스트 (1.0 RC3)
-## Title-deDE: Ackis Rezeptliste (1.0 RC3)
+## Title: Ackis Recipe List (1.0 RC4)
+## Title-koKR: Ackis의 제조법 리스트 (1.0 RC4)
+## Title-deDE: Ackis Rezeptliste (1.0 RC4)

 ## Notes: Scans your tradeskills and tells you which recipes you are missing, along with information on how to obtain them.
 ## Notes-frFR: Analyse vos métiers et vous indique les recettes qui vous manque, ainsi que des informations sur la façon de les obtenir.
@@ -15,7 +15,7 @@
 ## X-Donate: Donate a few bucks/hours at your local animal shelter, send me UDE Point codes, or a Murky Code.

 ## Interface: 30000
-## Version: 1.0 RC3 @project-revision@
+## Version: 1.0 RC4 @project-revision@
 ## X-Revision: @project-revision@
 ## X-Date: @file-date-iso@

diff --git a/Locals/ARLLocals-enUS.lua b/Locals/ARLLocals-enUS.lua
index c443c12..c57c1e6 100644
--- a/Locals/ARLLocals-enUS.lua
+++ b/Locals/ARLLocals-enUS.lua
@@ -309,9 +309,10 @@ L["WEAPON_NONE_DESC"]		= "Do NOT include any recipes that make weapon items in t
 L["NOT_YET_SCANNED"]		= "not yet scanned!"

 -- Common Tool tip Strings (where different from above)
-L["CTRL_CLICK"]			= "Ctrl-Click to add this recipe's link to your chat"
-L["ALT_CLICK"]			= "Alt-Click to add/remove this recipe to your ignore list"
-L["SHIFT_CLICK"]		= "Shift-Click to add the item crafted by this recipe's link to your chat"
+L["CTRL_CLICK"]			= "Ctrl-Click to add this recipe's link to your chat."
+L["ALT_CLICK"]			= "Alt-Click to add/remove this recipe to your ignore list."
+L["SHIFT_CLICK"]		= "Shift-Click to add the item crafted by this recipe's link to your chat."
+L["CTRL_SHIFT_CLICK"]	= "Ctrl-Shift-Click to add the item to the map and mini-map."
 L["Obtained From"]		= true
 L["RECIPE_EXCLUDED"]	= "Recipe is in Exclusion list"
 L["Required Skill"]		= true