Thread Tools Display Modes
02-17-12, 11:05 AM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
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?
  Reply With Quote
02-17-12, 12:56 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
You want to embed oUF into your own addon?
  Reply With Quote
02-17-12, 03:17 PM   #3
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
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.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
02-17-12, 05:53 PM   #4
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by haste View Post
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.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » How to import oUF from an other AddOn.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off