Skip to content

Commit

Permalink
map: add api call to receive nodes by name
Browse files Browse the repository at this point in the history
  • Loading branch information
shagu committed Jan 4, 2024
1 parent fa6d5dc commit 6ff70d5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,22 @@ function pfMap:AddNode(meta)
pfMap.queue_update = GetTime()
end

function pfMap:GetNodes(addon, title)
local nodes = {}

if title and pfMap.nodes[addon] then
for map, foo in pairs(pfMap.nodes[addon]) do
for coords, node in pairs(pfMap.nodes[addon][map]) do
if pfMap.nodes[addon][map][coords][title] then
table.insert(nodes, pfMap.nodes[addon][map][coords][title])
end
end
end
end

return nodes
end

function pfMap:DeleteNode(addon, title)
-- remove tooltips
if not addon then
Expand Down

0 comments on commit 6ff70d5

Please sign in to comment.