Thread Tools Display Modes
08-10-08, 08:13 AM   #1
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
If you need help debugging...

If anyone is having problems in WotLK, I am open to assist in solving those bugs or problems. It seems to be one of my best talents.

I only have a 70 mage on Northend.
  Reply With Quote
08-29-08, 04:49 PM   #2
Tenge
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 9
I posted this over on the official UI forum, but I figure I might find more direcxt answers here, especially if you're proficient with forum code debugging too, Zero.


I started maintaining the Visor2 addon a few years ago for the TBC release, and being very much a Lua novice and not knowing any better, I kept the global-args pattern that it was using (which I've discovered is rather antiquated =).

So fast forward to the present, and I'm finally getting around to updating this addon for the 3.0 Beta and discovered that the "self.args" reference the code has been using (see below) is now coming up as "nil" in Beta and throwing an error.

I'm assuming this related primarily to the blizzard changes quoted below, but the way I'm implementing the arg's seems to be an equal contributor to the problem.

* The blizzard UI is being converted to use 'self' and the other local arguments in favor of 'this' and argN. The old style arguments are going to be obsoleted, so AddOn code needs to be updated too. This may mean there are changes in the signatures of Blizzard UI functions - update code that hooks or replaces the blizzard UI where necessary as well. !!!
Here's what the code looks like now (attached Core.lua as well):

Code:
local options = {
	type='group',
	args= {
		detail = {
			type = 'text',
			name = 'Detail',
			desc = "Displays all of Visor2's settings for the frame.",
			usage = "list|<frame name>",
			get = false,
			set = "DetailedReport",
			order = 1,
		},
		set = {
			type = 'text',
			name = 'Set',
			desc = "The core command within Visor2.  See '/vz help' for details.",
			usage = "<options>",
			get = false,
			set = "SetupFrame",
			order = 2,
		},
etc...
And here's the part where the error occurs (it's saying that self.args = nil, and is expecting a table of course):

Code:
	for _, v in pairs(self.args) do 
		if p[v] then np = true end
	end

So essentially, I'm wondering if anyone has a quick reference or in-code example of the new/proper way to implement addon arg's these days... specifically within the Ace2 or Ace3 framework, but any tips are appreciated.

Edit2:

The more I familiarize myself with the code again, I'm probably confusing the "args" sub-table within the global "options" table (see the code in my last post), with the "self.args" variable. I'm starting to think they're two separate entities, so I'll have to dig a bit deeper.

I just thought of something else as well... need to double-check that I have the latest set of Ace2 libs that are WotLK compatible. I'll d/l and test a bit further when I get home this evening. The "self.args" is likely defined and manipulated within the framework.

Thanks!
Attached Files
File Type: lua Core.lua (12.2 KB, 684 views)

Last edited by Tenge : 08-29-08 at 05:31 PM. Reason: Typo, and added Blizzard quote
  Reply With Quote
08-29-08, 06:37 PM   #3
rodrick
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 34
try options.args

The problem is I don't see what self is set to or what function that code block is in. Regardless if you only have one options table, and it's local to the file that your code block is in you should be able to access it via options.args. If it still comes up nil then either it's being nil'd out before that code is ran or it's a scope problem.
  Reply With Quote
08-29-08, 06:39 PM   #4
rodrick
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 34
Actually the more I think this over the more I'm confused as to what you are trying to do . . . if just updating to the WoLK compatible branch of the Ace2 libs doesn't fix it then PM me the entire file so I can look through it and look for scope, etc.
  Reply With Quote
08-30-08, 09:03 PM   #5
Tenge
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 9
Turns out I goofed when updating to the WotLK-capable Ace2 libraries.
Grabbed the correct ones earlier today, and things are working fine now.
__________________
Tengaaris, 80 Warrior on Durotan
Tėnge, 75 Rogue on Durotan
Tehnne, xx Shaman (new Cata main?)
  Reply With Quote
08-31-08, 11:48 AM   #6
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
That is good. I was waiting to reply until after I seen the problem for myself, but I first had to update my beta client, and then find time between work. (Want to hunt down co-worker that quit.)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » If you need help debugging...

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