WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Interface toc file, loading issue (https://www.wowinterface.com/forums/showthread.php?t=57624)

Sinaris 10-21-19 07:27 AM

Interface toc file, loading issue
 
Hello folks,

after some years i started to work on my (new/old) interface again. But for some odd reason my files are not loading in the right direction.

I am using the same template files i used a couple of years ago.

TestUI
Code:

Core\Engine.lua
Core\Commands.lua
TestUI.toc
TestUI.xml

TestUI_ConfigUI
Code:

Core\Core.lua
TestUI_ConfigUI.toc


The main files has some small loading engine like i used before:

Code:

local AddOnName, Engine = ...

Engine[1] = {} -- UI
Engine[2] = {} -- DB
Engine[3] = {} -- M
Engine[4] = {} -- L

_G[AddOnName] = Engine

print( AddOnName .. ' loaded!' )

The file is loading. Ingame i got the print message.

The toc file is looking like this:

Code:

## Interface: 80205
## Title: TestUI
## OptionalDeps: TestUI_ConfigUI
## SavedVariables: TestUIData
## SavedVariablesPerCharacter: TestUIDataPerChar, CurrencyData

TestUI.xml

Everything is loading. So there are no loading issue with the main addon.


but when i want to load the TestUI Config file with this content:

TOC file

Code:

## Interface: 80205
## Title: TestUI ConfigUI
## Version: 16
## RequiredDeps: TestUI
## SavedVariables: TestUIConfigAll, TestUIConfigPublic
## SavedVariablesPerCharacter: TestUIConfigPrivate

Locales\English.lua

Core\Core.lua


Core.lua
Code:

local UI, DB, M, L = unpack( TestUI )

if TestUI then
        print( 'TestUI loaded!' )
else
        print( 'TestUI not loaded!' )
end


i got this ingame error:

Code:

Message: Interface\AddOns\TestUI_ConfigUI\Core\Core.lua:1: bad argument #1 to 'unpack' (table expected, got nil)
Time: Mon Oct 21 15:17:35 2019
Count: 1
Stack: Interface\AddOns\TestUI_ConfigUI\Core\Core.lua:1: bad argument #1 to 'unpack' (table expected, got nil)
[C]: in function `unpack'
Interface\AddOns\TestUI_ConfigUI\Core\Core.lua:1: in main chunk

Locals: (*temporary) = nil
(*temporary) = "table expected, got nil"

i dont understand it because the main addon is loaded and the ConfigUI must be loaded after the main addon.
Back in the past i used the same code without any errors.

Maybe someone can help me out.

The Files can be found here:

natias.de/TestUI.rar

d87 10-21-19 07:40 AM

Try removing OptionalDeps to config from the main toc, maybe that'll help

Sinaris 10-21-19 07:48 AM

When i remove the OptionalDeps entrie the ConfigUI loads without any errors.
Now i am confused because i used it in the past the same way.
I want to have the config ui as a optional addon and not as a must have loaded addon for the main ui

Kanegasi 10-21-19 08:18 AM

Dependencies, whether required or optional, are loaded before the add-on that declares them as dependencies. Config is loaded before Test, but with the deps line removed, Test now loads before Config.

d87 10-21-19 09:02 AM

Quote:

Originally Posted by Sinaris (Post 334351)
When i remove the OptionalDeps entrie the ConfigUI loads without any errors.
Now i am confused because i used it in the past the same way.
I want to have the config ui as a optional addon and not as a must have loaded addon for the main ui

That's what "## LoadOnDemand: 1" is for (or just nothing if you want to always load config if enabled), not OptionalDeps. And you were doing it wrong in the past too. Your main addon doesn't "depend" on config, dependencies should form a tree, not a circle

JDoubleU00 10-21-19 04:20 PM

In your files you are referencing the .toc which should not be in there AFAIK. Could this be part of your problem?

TestUI
Code:

Core\Engine.lua
Core\Commands.lua
TestUI.toc
TestUI.xml

TestUI_ConfigUI
Code:

Core\Core.lua
TestUI_ConfigUI.toc

Seerah 10-22-19 03:38 PM

Quote:

Originally Posted by JDoubleU00 (Post 334362)
In your files you are referencing the .toc which should not be in there AFAIK. Could this be part of your problem?

TestUI
Code:

Core\Engine.lua
Core\Commands.lua
TestUI.toc
TestUI.xml

TestUI_ConfigUI
Code:

Core\Core.lua
TestUI_ConfigUI.toc

Pretty sure that's just his folder contents/hierarchy. ;)

Sinaris 10-23-19 12:48 PM

Quote:

Originally Posted by d87 (Post 334353)
That's what "## LoadOnDemand: 1" is for (or just nothing if you want to always load config if enabled), not OptionalDeps. And you were doing it wrong in the past too. Your main addon doesn't "depend" on config, dependencies should form a tree, not a circle

Thanks for the hint. I will look at this!


Quote:

Originally Posted by Seerah (Post 334378)
Pretty sure that's just his folder contents/hierarchy. ;)

Right. Its the structure of the Addon Folders


All times are GMT -6. The time now is 03:07 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI