View Single Post
12-24-13, 12:18 AM   #18
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by 10leej View Post
... figure out how to test arena/boss frames to make sure they work like I want them to ...
Here is (basically; there are a few drycoded adjustments) what I use to test those frames:

Code:
local groups = { -- Change these to the global names your layout will make.
	arena = { "oUFPhanxArena1", "oUFPhanxArena2", "oUFPhanxArena3", "oUFPhanxArena4", "oUFPhanxArena5",  "oUFPhanxArenaPet1", "oUFPhanxArena2", "oUFPhanxArenaPet3", "oUFPhanxArenaPet4", "oUFPhanxArenaPet5" },
	boss = { "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(group)
	local frames = groups[strlower(strtrim(group))]
	if not frames then return end
	for i = 1, #frames do
		local frame = _G[frames[i]]
		if frame then
			toggle(frame)
		end
	end
end
Usage: "/otest boss" or "/otest arena"
__________________
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