path formatting for Script and Include within XML
I haven't seen this covered anywhere and thought I would bring it up as I was experimenting with it.
I am extremely logical in the way I organize things, including file structures. As a result, it absolutely kills me to have 5 or 6 xml and lua scripts in the root directory of my mod, with varying names that just makes the directory look cluttered and badly organized. So I have taken to "tidying up" the directory structure. That I tried to do is this:
Took an existing mod with no bugs that I created (yet to be released) and threw all of my xml and lua scripts into a subdirectory called source. Graphics are in a subdirectory called artwork, and hopefully, this structure is what I plan to use in all my future addons. Then in the root I have my toc file, and a single xml file called manifest.xml which contains Script and Include directives to bring in my scripts and xml files from the source directory. Basically it looks like this:
MyMod/source/xml and lua files.....
The problem I ran into is this:
Include uses relative path to the addon directory, so you can use source\file.xml as the path.
Script however does one of two things. It allows you to use a file in the same directory as the file you are including it with OR you must use the full path to the file, just like when you define images. So for this instance, it would be Interface\AddOns\myMod\source\script.lua
I tried numerous ways of doing it, including the following:
None seemed to work, except the full path mentioned above. What I am asking here I guess, is if anyone else has had experience with Script paths that are not in the same directory as the toc file. Is there an easier way to do it? I would have preferred it to use the same directory pathing as Include, but it doesn't want to. Not sure I should even worry about it, because it DOES work using the full path, it just isn't the way I would have preferred.
On a side note, Include does NOT take full pathing like Script does, it only takes relative.
|All times are GMT -6. The time now is 09:20 PM.|
vBulletin © 2016, Jelsoft Enterprises Ltd