Thread Tools Display Modes
03-03-11, 07:19 PM   #1
Crissa
A Flamescale Wyrmkin
 
Crissa's Avatar
Join Date: May 2008
Posts: 136
Debuging oGlow's options panel: a case study (Help?)

I'm trying to debug the addon settings panel in oGlow, because it's broken.

However, I can't for the life of me figure out how it's creating this. It seems to do it in ui.lua procedurally... Which may explain why settings get changed for me in seemingly arbitrary ways.

Anyhow, there are two check boxes, and to make it work, both need to be selected. So this means one is superfluous, but in this code, which is which?

I suppose I can poke and prod until it works, but I was hoping someone with experience could walk me through this or point me to some tutorial. None of the addons I've written have ever had options - they just figured out how they were going to work or not when enabled from the character screen.

-Crissa
  Reply With Quote
03-03-11, 10:08 PM   #2
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
Y'know, this post made me think a bit. All I've ever seen in the in-game default options "AddOns" tab for "oGlow" is the "Now with 30% less toxic radiation" thing. No check boxes, no anything else. I finally typed "/oglow" into chat and ... VIOLA'!! Now I get the saying plus ten check boxes. All of them are checked, which is fine since they're all frames I want to see "oGlow" working in.

Weird, eh?

EDIT: Each frame check box is in a defined row and the row is click-able. Click on the row and it expands to give you another check box for a quality setting. Can't click them again to collapse them, though, but clicking on the next row will collapse the previous expanded row. /EDIT

Last edited by jeffy162 : 03-03-11 at 10:17 PM.
  Reply With Quote
03-04-11, 12:12 AM   #3
Crissa
A Flamescale Wyrmkin
 
Crissa's Avatar
Join Date: May 2008
Posts: 136
Hehe. I noticed that, too. That means there's an on-something missing here.

Just editing out the filter uncheck does work, however that means the program is still parsing the filters but not displaying them. I see that it's using parenting to set the names and options, which is very sleek design.

But really, they should use the same setting, as one shouldn't happen without the other.

-Crissa
  Reply With Quote
03-19-11, 10:06 PM   #4
Crissa
A Flamescale Wyrmkin
 
Crissa's Avatar
Join Date: May 2008
Posts: 136
So I sat down tonight and spent a few minutes (okay, more near an hour) figuring out why oGlow didn't display its options panel correctly when clicked on, but did when launched from the command line.

Apparently there was a call in the onshow function of the frame that didn't do anything; it was supposed to call the base function to build the list of items (really an ingenious idea, instead of writing the options panel by hand). But the call didn't affect the operation of the frame. I figured that out right away because it looked like it would be an infinite loop if it were called that way and tried it without.

Then I realized, as I put a naming convention to the frame so that it was called something smarter than 'frame' that the actual function that builds (and finds if they've been checked) the options is called refresh().

Apparently showing a frame via slashcmdlist hits the frame:refresh after frame:onshow; but displaying the frame via the addons panel <i>does not</i> call refresh. So I just added it into the onShow, and boom, it works.

Of course, that means it refreshes twice when called by slash commands, but that sounds like a Blizzard bug. This could be useful at some point... But I don't know where, honestly, since you can't confirm that a user will enter your frame one way instead of another, so why make them different?

-Crissa

Last edited by Crissa : 03-19-11 at 10:59 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Debuging oGlow's options panel: a case study (Help?)


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