Hi,
I am trying to implement a simple command to put a icon on a map to specific coordinate.
Lua Code:
local ADDON = ...
-- some code
local hbd = LibStub:GetLibrary("HereBeDragons-2.0")
local hbdp = LibStub:GetLibrary("HereBeDragons-Pins-2.0")
-- some code
local point = CreateFrame("Frame", nil, UIParent)
point:SetWidth(12)
point:SetHeight(12)
point:SetBackdrop({bgFile = "Interface\\Addons\\"..ADDON.."\\icon.tga"})
SLASH_GMSPEED1 = "/gmpoint"
SlashCmdList["GMSPEED"] = function(args)
local x, y = strsplit(" ",SecureCmdOptionParse(args))
local mapid
if WorldMapFrame:IsShown() then
mapid = WorldMapFrame:GetMapID()
else
mapid = C_Map.GetBestMapForUnit("player")
end
-- x,y,mapid = hbd:GetPlayerZonePosition()
print("DEBUG:" .. mapid .. ":" .. x .. ":" .. y)
hbdp:RemoveAllMinimapIcons(ADDON)
hbdp:AddMinimapIconMap(ADDON, point, tonumber(mapid), tonumber(x)/100, tonumber(y)/100, true, true)
hbdp:RemoveAllWorldMapIcons(ADDON)
hbdp:AddWorldMapIconMap(ADDON, point, tonumber(mapid), tonumber(x)/100, tonumber(y)/100, HBD_PINS_WORLDMAP_SHOW_PARENT )
end
But it doesn't works as expected ...
Some iussue:
1) /gmpoint x y works (big word
and puts the icon --> "point" on worldmap and minimap .... but
a) it seems to me the icon disappears as soon as I move
b) it is unable to works after the first use
c) is there a nice pin icon I can use in wow texture ?
Thanks for any helps.