For complete information I have tried also a more minimalist approach.
The relevant part of the code is this one:
Lua Code:
local UnitAffectingCombat, InCombatLockdown = UnitAffectingCombat, InCombatLockdown
local function hide(self)
self:Hide()
end
local function show(self)
self:Show()
end
local f = CreateFrame("Frame")
f:SetScript("OnEvent", function ()
if (UnitAffectingCombat("player") or UnitAffectingCombat("pet") or InCombatLockdown()) then
hooksecurefunc(GameTooltip, "SetAction", hide)
else
hooksecurefunc(GameTooltip, "SetAction", show);
end
end)
f:RegisterEvent("ACTIONBAR_UPDATE_STATE")
but it correctly remove tooltips when I enter in combat but never put them back :-) when I exit from it :-)
Thanks again :-)