View Single Post
12-11-09, 01:10 PM   #9
yj589794
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 314
Within oUF_HealComm4 I currently use the following which if safe for servers running patch 3.2.X and patch 3.3:

Code:
local oUF
local parent
if(...) then
	parent = ...
else
	parent = debugstack():match[[\AddOns\(.-)\]]
end

local global = GetAddOnMetadata(parent, 'X-oUF')
assert(global, 'X-oUF needs to be defined in the parent add-on.')
if(...) then
	local _, ns = ...
	oUF = ns.oUF or _G[global]
else
	oUF = _G[global]
end

a version that supports only servers running patch 3.3 would be:
Code:
local parent, ns = ...
local global = GetAddOnMetadata(parent, 'X-oUF')
assert(global, 'X-oUF needs to be defined in the parent add-on.')
local oUF = ns.oUF or _G[global]

I think all current live servers run patch 3.3. It just depends on what patch the China servers will be at if they ever get running again.
  Reply With Quote