View Single Post
08-09-20, 08:44 AM   #12
ContactingWoWInterface
A Deviate Faerie Dragon
Join Date: Aug 2020
Posts: 12
I'm not sure that I went about this the best way, but here's what I've managed to get so far. I'm sure something will go wrong, but in the meantime this script seems to disable the frame at login, after combat has ended and after I change talents (frame only activates for holy spec).

Lua Code:
  1. local frameHandler = CreateFrame("FRAME")
  2. local frameHandler2 = CreateFrame("FRAME")
  3. local inCombat = false -- Need own variable becuase of event timings
  4.  
  5. frameHandler:SetScript("OnEvent", function(self, event, ...) -- Hides/shows frames when leaving/entering combat
  6.     if event =="PLAYER_REGEN_DISABLED" then
  7.         inCombat = true
  8.         PitBull4_Groups_Party:Show()
  9.     else
  10.         inCombat = false
  11.         PitBull4_Groups_Party:Hide()
  12.     end
  13.     if IsAddOnLoaded("PitBull4") then
  14.         C_Timer.After(0.1, function()
  15.         PitBull4_Groups_Party:Hide()
  16.         end)
  17.     end
  18. end)
  19.  
  20. frameHandler2:SetScript("OnEvent", function(self, event, ...) -- Hides/shows frames when changing talent specialization
  21.     if event =="ACTIVE_TALENT_GROUP_CHANGED" then
  22.         C_Timer.After(0.1, function()
  23.         PitBull4_Groups_Party:Hide()
  24.         end)
  25.     end
  26. end)
  27.  
  28. frameHandler:RegisterEvent("PLAYER_REGEN_ENABLED") -- Left combat
  29. frameHandler:RegisterEvent("PLAYER_REGEN_DISABLED") -- Entered combat
  30. frameHandler2:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") -- Changed talent specialization

Now I need to figure out how to make the frame fade before it goes away.

Last edited by ContactingWoWInterface : 08-09-20 at 08:53 AM.
  Reply With Quote