I don't use HandyNotes so I don't know all the ins-n-outs.
The iterator is cycling through your
points table for the current map id. (23 [EPL] in the table in your code).
for each successful
state will be the coord id. (number eg. 27592144 or 15606640) and
value will be the corresponding sub-table in
points[uiMapId]
To work the function would look more like:
Lua Code:
local get_the_best_icon = function(point) -- point is the coord sub-table
if not point then return end -- should never happen but...
local relevant_icon = point["icon_type"]
local completed_icon = "complete.tga"
local folder_dir = "Interface/AddOns/HandyNotes_EfficientSee/Icons/"
if task_id == "skipme" then -- task_id not really usable here as it stands so a re-think needed.
local show_icon = folder_dir..completed_icon
return show_icon
else
local show_icon = folder_dir..relevant_icon -- This will prolbably be the only icon returned
return show_icon
end
return show_icon -- will never get here because of the if/else nature of the stgatement above.
end
If the function is being used elsewhere you would use something like
Lua Code:
if points[whatevertheMapIdis] and points[whatevertheMapIdis][whatevertheCoordIdis] then
local icon = get_the_best_icon = get_the_best_icon(points[whatevertheMapIdis][whatevertheCoordIdis])
-- do whatever with the icon
end