LibGetFrame

LibGetFrame

716k Downloads

[enhancement] Scanning on demand

clicketz opened this issue ยท 1 comments

commented

There are edge cases where the frame cache isn't updated but new frames are added to the UI. As an example, after someone makes visible their previously hidden raid/party frames but before they join a group for GROUP_ROSTER_UPDATE to fire. This matters for testing, mostly.

Is it reasonable to implement something like

function lib.ForceScan(delay)
    ScanForUnitFrames(delay)
end

for authors to have a bit more control over expected frames with regards to edge cases?

commented

Indeed, good suggestion, i added lib.ScanForUnitFrames so you can trigger a scan when you want, but it's important to be aware that the cache won't be updated on the same frame this function is called.

You need to register a callback to "GETFRAME_REFRESH", "FRAME_UNIT_UPDATE", or "FRAME_UNIT_REMOVED" that will trigger when scan is finished, if a scan is already in progress when you call ScanForUnitFrames an other one will be done after.

I need to update the README with recent changes to make the lib use coroutine done