View Single Post
07-26-10, 05:56 AM   #11
Mischback
A Cobalt Mageweaver
 
Mischback's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 221
Ok, let's start from the beginning:

1.create the folder structure(should look like this)
Code:
Word of Warcraft
    -> Interface
        -> AddOns
            -> YOUR_LAYOUT
                -> embedded_oUF
                    -> oUF.xml (and all the other content of the original oUF-directory)
                -> layout.lua
                -> YOUR_LAYOUT.toc
2. Edit your .toc-file, so the embedded oUF-version is used
Code:
## Interface: 30300
## Author: YOUR_NAME
## Title: YOUR_LAYOUT
## X-oUF: embedded_oUF

embedded_oUF/oUF.xml
layout.lua
Please note the "##X-oUF" and the "embedded_oUF/oUF.xml". Here's the first part of the magic!

3. Edit your layout.lua-file, so it will use the embedded oUF-version or looking for a globally visible one.
Start your layout.lua with
Code:
local ADDON_NAME, ns = ... -- get the addons namespace to exchange functions between core and layout
local oUF = ns.oUF or oUF     -- get oUF
assert(oUF, "YOUR_LAYOUT was unable to locate oUF install.")
The first-line fetches the addon-name and the addon's namespace (ns) from the vararg list.
The second line will look for oUF (it may be found in the addon's namespace, if it is embedded, or it may be globally visible, if you have a "normal" oUF-installation) and make it locally visible, so you will use the right one, when calling oUF:Spawn (for example).

Now it should work with the embedded oUF-installation.

Last edited by Mischback : 07-26-10 at 06:28 AM.
  Reply With Quote