From 106c8ffc97dfad1f6bcb318d3adf88ce69d668cf Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Sun, 4 Jul 2010 18:29:35 -0400 Subject: [PATCH] Added support for possible TomTom-API addition to change a waypoint's icon to that of the recipe's profession. --- Waypoint.lua | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Waypoint.lua b/Waypoint.lua index 0c8c491..b187c48 100644 --- a/Waypoint.lua +++ b/Waypoint.lua @@ -390,15 +390,6 @@ function addon:AddWaypoint(recipe_id, acquire_id, location_id, npc_id) if not worldmap and not minimap then return end - local icontext = "Interface\\AddOns\\AckisRecipeList\\img\\enchant_up" - - -- Get the proper icon to put on the mini-map - -- for i, k in pairs(ORDERED_PROFESSIONS) do - -- if (i == MainPanel.profession) then - -- icontext = "Interface\\AddOns\\AckisRecipeList\\img\\" .. k["texture"] .. "_up" - -- break - -- end - -- end table.wipe(maplist) local recipe_list = private.recipe_list @@ -527,7 +518,21 @@ function addon:AddWaypoint(recipe_id, acquire_id, location_id, npc_id) end if _G.TomTom then - table.insert(iconlist, _G.TomTom:AddZWaypoint(continent, zone, x, y, name, false, minimap, worldmap)) + local uid = _G.TomTom:AddZWaypoint(continent, zone, x, y, name, false, minimap, worldmap) + table.insert(iconlist, uid) + + if _G.TomTom.ChangeWaypointIcon then + local icon_tex + + -- Get the proper icon to put on the mini-map + for index, profession in pairs(private.ordered_professions) do + if index == self.Frame.profession then + icon_tex = "Interface\\AddOns\\AckisRecipeList\\img\\" .. private.profession_textures[index] .. "_up" + break + end + end + _G.TomTom:ChangeWaypointIcon(uid, minimap, worldmap, icon_tex) + end elseif _G.Cartographer_Waypoints then local pt = _G.NotePoint:new(zone, x/100, y/100, desc) _G.Cartographer_Waypoints:AddWaypoint(pt) -- 1.7.9.5