Quantcast
WoWInterface - View Single Post - Help on calling a switch function
View Single Post
04-03-15, 08:29 AM   #4
gmarco
A Frostmaul Preserver
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 290
Hi myrroddin,

Thanks very much for your kind reply.

I have tried to implement your suggestion and to rewrite the code in this way:

Lua Code:
  1. local ADDON = ...
  2.  
  3. local prgname = "|cffffd200ToolTipDisable|r"
  4.  
  5. local function hide(self)
  6.         print ("DEBUG: Hide")
  7.         self:Hide()
  8. end
  9.  
  10. local function show(self)
  11.         print ("DEBUG: Show")
  12.         self:Show()
  13. end
  14.  
  15.  
  16. local f = CreateFrame("Frame")
  17. f:SetScript("OnEvent", function(self, event, ...)
  18.    
  19.     if event == "PLAYER_REGEN_DISABLED" then
  20.                 hooksecurefunc(GameTooltip, "SetAction", hide)
  21.     end
  22.    
  23.     if event == "PLAYER_REGEN_ENABLED" then    
  24.                 hooksecurefunc(GameTooltip, "SetAction", show);
  25.     end
  26.  
  27. end)
  28. f:RegisterEvent("PLAYER_REGEN_DISABLED")
  29. f:RegisterEvent("PLAYER_REGEN_ENABLED")

It HIDE the tooltips when I go in combat but it doesn't show again when I exit from it .
Mah.

I am investigating a little bit more.


EDIT:

It continues to print a sequence of
DEBUG: Hide
DEBUG: Show
DEBUG: Hide
DEBUG: Show

Like the 2 events fire each others one by one very fast after exiting from combat.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.

Last edited by gmarco : 04-03-15 at 08:40 AM.
  Reply With Quote