*Edit* I updated my code above with the changes below. You can copy paste it instead if you like.
Great feedback.
The hook updates quite often when I tested, but probably not if there are no blips on the minimap to show.
For that I suggest changing:
Code:
hooksecurefunc(Minimap, "UpdateBlips", function()
to this:
Code:
local elapsed = 0
WorldMapFrame:HookScript("OnUpdate", function(self, e)
elapsed = elapsed + e
if elapsed < .5 then return end -- update frequency
elapsed = 0
I thought about it and it's probably best to add a OnUpdate after all, since the blips even if not moving or updating, need to flash. :P
The "if frame.unit then" will update units that aren't visible as well. On the other hand perhaps instead of "IsVisible" maybe "IsShown" is better. Try using "if frame.unit and frame:IsShown() then" and see if it works. This will help avoid updating the hidden frames, we don't need to update those anyway.