Quantcast WoWInterface - View Single Post - Hiding SexyCooldown when out of combat...
View Single Post
02-26-13, 04:47 PM   #7
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,616
Well, there is a typo in that code that I just noticed. I edited my previous post to fix it.

However, it looks like SexyCooldown re-shows its frames every time a cooldown starts, so that code won't work anyway. Rather than hiding and showing individual frames, it will probably work better to re-parent them all to the CombatHider frame and just hide and show that, so the hidden/shown state of the inidividual frames doesn't matter:

-- Add frames to hide in this table:
local FramesToHide = {

local CombatHider = CreateFrame("Frame", "MyCombatHider", UIParent, "SecureHandlerStateTemplate")
RegisterStateDriver(CombatHider, "visibility", "[nocombat] hide; show")

CombatHider:SetScript("OnEvent", function(self, event)
	for i = #FramesToHide, 1, -1 do
		local frame = _G[FramesToHide[i]]
		if frame then
			tremove(FramesToHide, i)
I chose the PLAYER_ENTERING_WORLD event because it happens *after* PLAYER_LOGIN so hopefully SexyCooldown has finished setting up its frames by then.
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote