Quantcast WoWInterface - View Single Post - Hiding SexyCooldown when out of combat...
View Single Post
Unread 02-25-13, 09:56 PM   #2
No Life!
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,204
This should work for SexyCooldown, and any other frames you want to hide or show only in or out of combat. Type "/fstack" and move the cursor over the SexyCooldown bar to check its name; if it's not "SexyCooldown", change the code below accordingly. Type "/fstack" again to hide the frame stack tooltip.

-- Add frames to hide in this table:
local FramesToHide = {
	["SexyCooldown"] = "PLAYER_REGEN_ENABLED", -- Show out of combat
	["SomeOtherFrame"] = "PLAYER_REGEN_DISABLED", -- Show in combat

local CombatHider = CreateFrame("Frame")
CombatHider:SetScript("OnEvent", function(self, event)
	for frameName, showEvent in pairs(FramesToHide) do
		local frame = _G[frameName]
		if frame then
			frame:SetShown(event == showEvent)
If you need help turning the above code into an addon, paste it onto this page, enter a title, and click the green button: http://addon.ziuo.net/
Author/maintainer of Grid, PhanxChat, ShieldsUp, 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!

Last edited by Phanx : 02-26-13 at 04:47 PM.
Phanx is offline   Reply With Quote