Quantcast Recursing Addons - WoWInterface
Thread Tools Display Modes
07-28-18, 09:27 AM   #1
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 38
Recursing Addons

Hey.

Code:
local Locale = LibStub("AceLocale-3.0"):GetLocale(AddOnName, false);
I get that error when loading into WoW and reloading the UI.

If I understand this right, it should be getting my Addon info from the Addon folder where the TOC is.
I keep all of these Ace Libraries in there own folder that is below the TOC called libraries. I am guessing here, but, I think the code is looking for the addon info in the libraries folder..?

Is it possible to have the "code" look one level up for addon info?
  Reply With Quote
07-28-18, 03:11 PM   #2
myrroddin
A Molten Giant
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 912
It sounds like your toc file is not looking for the Lua files in the correct place. Post your entire toc file code, please.
  Reply With Quote
07-28-18, 05:36 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,169
Originally Posted by myrroddin View Post
It sounds like your toc file is not looking for the Lua files in the correct place. Post your entire toc file code, please.
This is definitely a promising cause to the problem, although I cannot see the error message in your post but if it is the one I have seen a few times since BfA went beta then it appears they have made some adjustments in regards to paths to files in addons.
__________________
  Reply With Quote
07-29-18, 02:31 AM   #4
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 705
Disable ALL other addons. This way you can be sure your addon loads the required libraries itself and paths are correct. And yes, I had to change some relative paths in my xml files for BfA that worked before.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
08-02-18, 08:29 AM   #5
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 38
Sorry, I was away.

I will do the requested post when WoW is available to log into. Thank you SO much.

Ok here is the .toc for the main thing.

Code:
## Interface: 80000
## Title: |cffFF9900Paws|r UI
## Notes: A UI for WoW
## Author: Orangepaw3
## X-Website: Offline at the moment.
## X-Favorite-Food: Potatos.
## Version: 2.0
## SavedVariablesPerCharacter: PawDB

# XML Files
##Libraries/Load_Libraries.xml  -- Commented Out due to loading Libraries not working.


# Lua Files
PawsUI.lua
Modules/Features/afk.lua
Modules/Features/gridalign.lua
Modules/Features/level.lua
# Features/panel.lua
# loader.lua

I do not have the XML anymore, I was trying to modulate as much as possible but am having issues getting the items to load with includes and scripts.

Last edited by candrid : 08-02-18 at 08:55 AM.
  Reply With Quote
08-02-18, 10:29 AM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,169
This is how my mage portals addon handles its files. Hopefully it will help you see how it could be done.

TOC
Code:
## Interface: 80100
## Title: XMage : [ |cffeda55fPortals and Teleports|r ]
## Author: Tina Kirby AKA Xrystal (c) 2014-2020  All Rights Reserved
## Version: 8.0.1.27101.0
## Notes: Mage Portals and Teleports Window 
## RequiredDeps: 
## OptionalDeps: 
## DefaultState: Enabled
## LoadOnDemand: 0
## SavedVariables: XMage_Portals_Settings

XMage_Portals.xml
The main XML file - the Frames are configurable and are based on the templates. They share common code and all the files may need access to the data.
Code:
<UI>
    <Script file = "XMage_Portals_Data.lua" />
    <Script file = "XMage_Portals_Code.lua" />
    
    <Include file = "XMage_Portals_Templates.xml" />
    <Include file = "XMage_Portals_Config.xml" />
    <Include file = "XMage_Portals_Frames.xml" />
</UI>
The config.xml file
Code:
<UI>
    <Script file = "XMage_Portals_Config.lua" />
   
    ... One or more frame definitions

</UI>
The frames.xml file - This file is saying that the frames have customization functions ( they are called from other addons and used by the frame as and when it needs to ).
Code:
<UI>
    
    <Script file = "XMage_Portals_Customization.lua" />
    <Script file = "XMage_Portals_Frames.lua" />
    
    ... One or more frame definitions
</UI>
As long as the file that requires functionality of another file is loaded after it will work. If you find that there are sections you are using several times... put it in a file of its own near the beginning so that the rest of the files have access. And if you aren't using it already, don't forget the local addonName, addonData = ... line to allow the files to share the data.
__________________
  Reply With Quote
08-02-18, 12:31 PM   #7
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 38
Thank you very much!
  Reply With Quote
08-02-18, 05:15 PM   #8
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 38
Slightly off-topic.

I was looking at your addon, which is super neat and I noticed there is a bit of code I have been meaning to ask about.

Code:
local addonName, addonData = ...

It's the "..." part. What do they mean? I've read some books with no direct answer.

Also thank you guys for helping me.
  Reply With Quote
08-02-18, 05:54 PM   #9
Sharparam
A Warpwood Thunder Caller
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 99
Originally Posted by candrid View Post
It's the "..." part. What do they mean? I've read some books with no direct answer.
When WoW loads a script file it passes two arguments to it: the name of the addon and a private table you can use to store data in (to use across different files). You save them by reading them from the "varargs" passed to the file like in the code above.

The private table can be used to share code/functions across different files without having to create a table that lives in the global namespace, making things cleaner
  Reply With Quote
08-02-18, 07:41 PM   #10
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,524
Here is the section in the Lua manual about varargs: https://www.lua.org/pil/5.2.html
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-03-18, 11:37 AM   #11
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 38
Originally Posted by Seerah View Post
Here is the section in the Lua manual about varargs: https://www.lua.org/pil/5.2.html
Thank ya muchly!
  Reply With Quote
08-03-18, 01:34 PM   #12
myrroddin
A Molten Giant
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 912
Xrystal, might be a silly question, but why did you use 80100 as the Interface in your toc file? We are at least 6-8 months away from that build, if not longer. Right now the current Interface is 80000. Unless you either did a typo, or just used it as an example?
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Recursing Addons

Thread Tools
Display Modes

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