Thread Tools Display Modes
10-21-19, 07:27 AM   #1
Sinaris
A Wyrmkin Dreamwalker
 
Sinaris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 55
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
  Reply With Quote
10-21-19, 07:40 AM   #2
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
Try removing OptionalDeps to config from the main toc, maybe that'll help
  Reply With Quote
10-21-19, 07:48 AM   #3
Sinaris
A Wyrmkin Dreamwalker
 
Sinaris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 55
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
  Reply With Quote
10-21-19, 09:02 AM   #4
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
Originally Posted by Sinaris View Post
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

Last edited by d87 : 10-21-19 at 09:06 AM.
  Reply With Quote
10-21-19, 08:18 AM   #5
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
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.
  Reply With Quote
10-21-19, 04:20 PM   #6
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
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
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
10-22-19, 03:38 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by JDoubleU00 View Post
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.
__________________
"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
10-23-19, 12:48 PM   #8
Sinaris
A Wyrmkin Dreamwalker
 
Sinaris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 55
Originally Posted by d87 View Post
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!


Originally Posted by Seerah View Post
Pretty sure that's just his folder contents/hierarchy.
Right. Its the structure of the Addon Folders
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Interface toc file, loading issue

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