WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Embedding - Hmm.. (https://www.wowinterface.com/forums/showthread.php?t=34120)

iNoob 07-22-10 03:57 PM

Embedding - Hmm..
 
No matter what layout im trying to do this with, I simply cant get it to work. The layout will throw a lua error (as if oUF wasn't there(which it isn't, I wanna embed it))

Any idea what I am doing wrong? I know it's not a hella' lotta' info, but I'm doing exactly as you are instructing me to

haste 07-22-10 08:53 PM

Quote:

Originally Posted by iNoob (Post 199550)
No matter what layout im trying to do this with, I simply cant get it to work. The layout will throw a lua error (as if oUF wasn't there(which it isn't, I wanna embed it))

Any idea what I am doing wrong? I know it's not a hella' lotta' info, but I'm doing exactly as you are instructing me to

How are you trying to do this? It's not like we know anything about what you've tried and what you've done.

To me it just sounds like you aren't loading the oUF core files before the layout in your embed setup. That's really all the help I can give you based on the information you've posted.

Mischback 07-23-10 12:54 AM

The guide is very helpfull, so if you followed the instructions, you should be fine...

I simply added
Code:

## X-oUF: PSoUF

PSoUF\oUF.xml

in my .toc and
Code:

local oUF = ns.oUF or oUF
assert(oUF, "<name> was unable to locate oUF install.")

in my layout-file.

The folder PSoUF is a copy of the original oUF-folder, only renamed it, nothing changed in the sources (k, I have changed something in there, otherwise there would be no need to embed oUF, but it has nothing to do with the embedding itsself).

Sojik 07-23-10 02:19 PM

Quote:

Originally Posted by Mischback (Post 199634)
(k, I have changed something in there, otherwise there would be no need to embed oUF, but it has nothing to do with the embedding itsself).

I can think of reasons to embed other than that. I don't think you should be distributing an edited oUF, personally.

Mischback 07-23-10 02:25 PM

Releasing a layout with a nice feature is pointless, if the feature is not working due to a known bug in oUF... So I embedded it for the current release and will thankfully remove the embedded oUF once the bug is fixed.

Sojik 07-23-10 02:39 PM

Oh, sorry for assuming the worst. :o

iNoob 07-25-10 05:54 PM

Tried your tut and the one in the forums
 
All it gives is this


attempt to index global 'ns' (a nil value)

Mischback 07-26-10 01:03 AM

Quote:

Originally Posted by iNoob (Post 200074)
attempt to index global 'ns' (a nil value)

Obviously you have to fetch the namespace (ns) before you could do this...

Code:

local ADDON_NAME, ns = ...

iNoob 07-26-10 04:41 AM

I still cant get this to work, here my code in the top of the layout...
 
local للللللل, ns = ...
print("[Debug] UF's loaded")
local oUF = ns.oUF or oUF
assert(oUF, "<name> was unable to locate oUF install.")

haste 07-26-10 04:55 AM

Quote:

Originally Posted by iNoob (Post 200132)
local للللللل, ns = ...
print("[Debug] UF's loaded")
local oUF = ns.oUF or oUF
assert(oUF, "<name> was unable to locate oUF install.")

What's up with "للللللل"?
How does your TOC look?
How does the folder and file structure look?

Mischback 07-26-10 05:56 AM

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.

yj589794 07-26-10 06:25 AM

Quote:

Originally Posted by Mischback (Post 200139)
Code:

assert(oUF, "<name> was unable to locate oUF install.")

It is advisable to change the <name> part of the error string to something unique. (like the name of your addon)
That way you can be sure that the error originated within your layout, rather than some other oUF layout/plugin that happens to use the same message.

Mischback 07-26-10 06:28 AM

*hust* fixed...

iNoob 07-26-10 08:50 AM

Quote:

Originally Posted by haste (Post 200134)
What's up with "للللللل"?
How does your TOC look?
How does the folder and file structure look?

Whoa. I have no idea how that came out like that, I can't even make those fancy letters :P

iNoob 07-26-10 08:58 AM

Quote:

Originally Posted by Mischback (Post 200139)
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."

Freebaser 07-26-10 09:08 AM

Quote:

Originally Posted by iNoob (Post 200158)
Whoa. I have no idea how that came out like that, I can't even make those fancy letters :P

What text editor are you using?

Mischback 07-26-10 09:42 AM

Quote:

Originally Posted by iNoob (Post 200158)
Whoa. I have no idea how that came out like that, I can't even make those fancy letters :P

Coming from Germany, I've got those "fancy letters" right here on my keyboard... ;)

To your problem: I pretty much copied my current setup for you, so, if I didn't make any copy/paste-failures, it should work. Pls give us
a) your .toc,
b) your layout.lua (first lines should be sufficient) and
c) describe your folder-structure.

Another workaround to get you started: Go grab my layout, install it, and

1) edit oUF_PredatorSimple.toc (insert your name and so on, delete all listed files and keep just the reference to PSoUF/oUF.xml and then set a reference to your layout-file (layout.lua). Rename the file to "YOURADDON.toc"

2) delete the "media"-folder

3) delete "settings.lua", "lib.lua" and "core.lua"

4) KEEP the folder "PSoUF"!

5) Open up MY layout.lua, delete everything from line 14 to EOF (so keep the oUF-embedding-stuff) and paste your own layout-code.

iNoob 07-27-10 12:16 PM

You wont believe this...
 
I found the reason myself and... be ready for a full-facedesk. I USED AN ANCIENT VERSION OF oUF! :mad: - Gawd...

That was the reason the lua errors arose -.-'

Thanks for your help ^^


All times are GMT -6. The time now is 11:10 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI