WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   How to import oUF from an other AddOn. (https://www.wowinterface.com/forums/showthread.php?t=42635)

Aftermathhqt 02-17-12 11:05 AM

How to import oUF from an other AddOn.
 
Basicly this how it looks

AftermathhUI - which includes oUF

Now i created:

AftermathhUI_Raid_Healing
AftermathhUI_Raid_DPS

in the .toc i putted:

## RequiredDeps: AftermathhUI, !Beautycase

and in the top of the .lua files

local parent, ns = ...
local oUF = ns.oUF or oUF

is there somthing more you should do?

p3lim 02-17-12 12:56 PM

You want to embed oUF into your own addon?

haste 02-17-12 03:17 PM

I'm not trying to be a total ass with this, but could you please skim through the "When you ask" section of How to ask questions the smart way. Your last couple of questions have been a mess.

As a bystander, it really seems like you ask first and try later. You also withhold information like they are business secrets. It only makes it frustrating for people to help you, increases the noise and drag out the time it takes to answer. So, in the future, please include as much related information as you can.

That being said. I'm assuming you want to embed oUF in AftermathhUI, while having AftermathhUI_Raid_Healing and AftermathhUI_Raid_DPS as alternative external add-ons for AftermathhUI internal oUF. On top of this I assume that you haven't defined X-oUF in the TOC file of AftermathhUI.

Based on these assumptions the answer would be: No, that won't work. oUF isn't a (shared) library and the only reason it supports embedding is so you can safely hide it away from the scary world outside.

What you can do to solve this, is to define X-oUF in the TOC, with something like AftermathhUI_oUF. This will make oUF add itself to the global AftermathhUI_oUF as well as the internal namespace of the host add-on. oUF itself actually uses this feature to define itself as _G.oUF.

You have to note that oUF doesn't allow you to define X-oUF as oUF in "third party" releases. I know there are several people who distribute oUF without this block or by-pass it, but that doesn't mean I approve of it. As a bonus, it also blows up horribly if you have both internal oUF at _G.oUF and external oUF.

Aftermathhqt 02-17-12 05:53 PM

Quote:

Originally Posted by haste (Post 252682)
I'm not trying to be a total ass with this, but could you please skim through the "When you ask" section of How to ask questions the smart way. Your last couple of questions have been a mess.

As a bystander, it really seems like you ask first and try later. You also withhold information like they are business secrets. It only makes it frustrating for people to help you, increases the noise and drag out the time it takes to answer. So, in the future, please include as much related information as you can.

That being said. I'm assuming you want to embed oUF in AftermathhUI, while having AftermathhUI_Raid_Healing and AftermathhUI_Raid_DPS as alternative external add-ons for AftermathhUI internal oUF. On top of this I assume that you haven't defined X-oUF in the TOC file of AftermathhUI.

Based on these assumptions the answer would be: No, that won't work. oUF isn't a (shared) library and the only reason it supports embedding is so you can safely hide it away from the scary world outside.

What you can do to solve this, is to define X-oUF in the TOC, with something like AftermathhUI_oUF. This will make oUF add itself to the global AftermathhUI_oUF as well as the internal namespace of the host add-on. oUF itself actually uses this feature to define itself as _G.oUF.

You have to note that oUF doesn't allow you to define X-oUF as oUF in "third party" releases. I know there are several people who distribute oUF without this block or by-pass it, but that doesn't mean I approve of it. As a bonus, it also blows up horribly if you have both internal oUF at _G.oUF and external oUF.

Uhmm.. sorry for explaning bad :/

Ahh, alright.. i see. Sorry for being a mess..

Thanks for the help..

@P3lim its already embed into AftermathhUI.


All times are GMT -6. The time now is 05:54 PM.

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