View Single Post
07-26-10, 08:58 AM   #15
iNoob
A Deviate Faerie Dragon
Join Date: Jul 2010
Posts: 15
Originally Posted by Mischback View Post
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.

Thank you very much for taking your time to do this

However, it still doesn't work! - I made a new addons *just* with the UF's to be sure nothing else is interfering with it. Appereantly, theres a problem with loading oUF since it throws this:

Message: Interface\AddOns\Test\layout.lua:3: Test was unable to locate oUF install.
Time: Mon Jul 26 16:56:05 2010
Count: 1
Stack: [C]: in function `assert'
Interface\AddOns\Test\layout.lua:3: in main chunk

Locals: (*temporary) = nil
(*temporary) = "Test was unable to locate oUF install."
  Reply With Quote