LibInspectLess-1.0
Notice before download
This addon is no longer needed in most cases in 4.0.3a, as Blizzard finally fix the inspect problem. It remains here only for my another addon RatingSummary. As described below, LibInspectLess guarantees that ALL iteminfos of inspected player being retrieved which is used by RatingSummary to calc the gear stats. Although this feature is provided as API lib for other addons, as far as I know, there is no one using it :(
In short, you no longer need to download this any more...
Instruction
This lib itself is a standalone addon. By simply putting it into "Interface\Addons", the inspecting will keep working in most cases.
The blue post (link) says : "Inspecting other players can cease to function until the client is restarted."
And after testing for a few days, we have found at least 4 reasons for the problem:
- Inspected too frequently. The safe interval is at least 2 seconds, but many old tooltip addons inspect mouseover units with no restriction.
- Addons call NotifyInspect() while player himself is dead. They didn't use CanInspect(unit) before inspecting.
- Inspect players from other realms in battlegrounds or dungeons.
- The inspected target teleports to be invisible before the INSPECT_READY event is returned. The time between NotifyInspect() being requested and the return of the response is up to 1 second, If during that time, the inspected player logged out / finished using Hearthstone / transmited to BG / entered a teleport door etc, inspecting will cease to function.
LibInspectLess-1.0 will resolve the 1st and 2nd of above perfectly. And for the 3rd, LibInspectLess just prevents any inspecting request across realms before a fix from Blizzard is carried out.
And for the 4th, there is no solution as far as I can imagine. The only suggestion is to remove the mouseover-inspecting addons (tooltip mods in the most cases) and increase the interval of LibInspectLess (using /libinspectless command, '/lil 8' for example).
And if Blizzard repairs all the bugs, LibInspectLess is also useful to guarantee that ALL iteminfos of inspected player being retrieved. The stream downloading machanic is introduced in 4.0. You will find the tooltip on the inspected player's item dosen't show item information immediately. It's very annoy if your clients WDB cache is fresh.
I use this lib to rewrite the RatingSummary and the GearScore module in it. You can have a look at the API usages from GearScore.lua It implements mouseover gearscore and never cause problems.
Main API
lib:GetUnit()
CHECKs and returns the current inspecting unitid. This is used to avoid handling a inspected unit that is already gone. For example, an inspect is trigger by mouseover, and you register a InspectReady callback. But when the callback function is called, you are no longer pointing on that player. In that case, you can call lib:GetUnit(), and skip the following process if it returns nil.
lib:GetGUID()
returns the current inspecting unit's guid. Do not check. This is used when there is defininite an available unit to deal with.
lib:IsDone()
Returns whether the iteminfos of current inspecting unit are all retrieved. This aims to reuse the last inspecting result, instead of triggering another NotifyInspect()
Provides 4 events:
InspectLess_InspectReady
- args = guid
Same as blizzard event INSPECT_READY
InspectLess_Next
- args = locked
Fires when a new inspect can be requested. This is used for tooltip update.
InspectLess_InspectItemReady
- args = unit, guid
Fires when all iteminfos of your inspected player is got, and GetInventoryItemLink(unit) is safe to use This is because the GetItemInfo api is now streaming when necessary. It returns nil unless the client has downloaded the item info. As a result, the gametooltip often shows "Waiting/Recovering Item Information".
InspectLess_InspectItemFail
- args = unit, guid
Fires when the unit is changed while InspectLess is retrieving iteminfos, for example you are inspecting 'mouseover' unit, but you points another player before all iteminfos are retrieved. In that case, there it no way to call GetInventoryItemLink(unit) with the old unitid.
Thanks to starlon, the API docs is corrected now...
What is the relationship of this addon to http://wow.curse.com/downloads/wow-addons/details/inspectfix.aspx ?
Should we use one or the other, or both?
On line 76, I think:
lib.events:Fire("InspectLess_Next", locked)
Is supposed to be:
lib.events:Fire("InspectLess_InspectNext", locked)
Or at least that follows your API docs.
Please provides some details about "un-throttled OnUpdate"
There are 2 timers, one starts counting after a NotifyInspect() is requested, it counts down for 2.5 seconds and then do the clean-up work.
The other one starts counting while a INSPECT_READY event is received, And it checks target's items every 0.2 seconds. Whether done or failed, it will stop counting totally. ( the OnUpdate script is set to nil)
Do you mean that the first timer should also set "OnUpdate" to nil instead of rounded by "if waiting > 0" ? But I see a lots of BLZ codes use this way in OnUpdate...
Thanks in advance.
Looks interesting but totally un-throttled OnUpdate can't be good for fps.