View Single Post
Old 02-26-13, 05:48 AM   #4
Aryae21
A Deviate Faerie Dragon
Join Date: Jan 2013
Posts: 18
To be more specific I posted the code I edited according to your instructions, I simply copy and pasted the entire LUA file after using that website provided. On an additional note just to be as thorough as possible, I did check to see if the add-on created was actually loaded in wow multiple times. It is on, however the memory usage is 0. Not sure if that means anything, Id think it would use something no matter how small but that's just what i thought, doesn't necessarily mean anything.

Code:
-- This file is loaded from "SexyCooldownHideOOC.toc"

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

local CombatHider = CreateFrame("Frame")
CombatHider:RegisterEvent("PLAYER_REGEN_DISABLED")
CombatHider:RegisterEvent("PLAYER_REGEN_ENABLED")
CombatHider:SetScript("OnEvent", function(self, event)
	for frameName, showEvent in pairs(FramesToHide)
		local frame = _G[frameName]
		if frame then
			frame:SetShown(event == showEvent)
		end
	end
end)
Aryae21 is offline   Reply With Quote