Compact Vendor Filter (This module is obsolete since Dragonflight)

Compact Vendor Filter (This module is obsolete since Dragonflight)

3.2k Downloads

GameTooltip Hooking Methodology

Talyrius opened this issue ยท 1 comments

commented

I don't know how closely you monitor the comments on Compact Vendor Filter's WoWInterface page, so I'm reposting this here.

Originally Posted by @brykrys @ WoWInterface:

Please could you look again at how you set hooks on GameTooltip-type objects?

I see you have hooked SetMerchantItem and SetMerchantCostItem (to set a flag called EnableHooks), and these hooks are applied to every GameTooltip-type object.

However the hooks are not calling back the correct old function in every case, they all call back the old function from GameTooltip itself.

This is a problem if any other AddOn has hooked these functions before you:

For example if an AddOn has hooked SetMerchantItem only on the GameTooltip, and expects the function to be called only from GameTooltip itself, it may cause unexpected errors when called from other tooltip objects.

Alternatively if an AddOn has applied a special version of SetMerchantItem to a particular tooltip other than GameTooltip itself, your hook will simply remove this special version.

For some background, I originally opened an issue for LibExtraTip about an error I was receiving regarding a GameTooltip_SetMerchantItem hook. I also happened to be using Compact Vendor Filter.

commented

Thank you for the heads up. I think I fixed the issue with this commit 2e3744e