View Single Post
09-25-14, 01:57 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I use this for testing my layout. Rather than overwriting global functions and tainting your frames, it just tells the frames to display the player unit, so you can test with real health values, auras, etc. Just type the command again to put them back to their original state.

Code:
local frames = {
	"oUFPhanxBoss1",
	"oUFPhanxBoss2",
	"oUFPhanxBoss3",
	"oUFPhanxBoss4",
	"oUFPhanxBoss5",
}

local function toggle(f)
	if f.__realunit then
		f:SetAttribute("unit", f.__realunit)
		f.unit = f.__realunit
		f.__realunit = nil
		f:Hide()
	else
		f.__realunit = f:GetAttribute("unit") or f.unit
		f:SetAttribute("unit", "player")
		f.unit = "player"
		f:Show()
	end
end

SLASH_OUFPHANXTEST1 = "/otest"

SlashCmdList.OUFPHANXTEST = function()
	for i = 1, #frames do
		toggle(_G[frames[i]])
	end
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote