WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Any Resources for the Addon Settings Panels? (https://www.wowinterface.com/forums/showthread.php?t=15582)

schnoggo 03-30-08 11:07 AM

Any Resources for the Addon Settings Panels?
 
My less-than-exhaustive search hasn't lead me to any mention of this new 2.4 feature.
Anyone have a good link to a forum post or some sample code?

Kaomie 03-30-08 02:30 PM

I think Omen2 and the new SCT are already hooking into the addons tab of the preferences, you might want to dig into their code.

As far as modifying the other game options tabs I haven't really seen anything yet. I guess if you run the official Blizz AddOnKit against the current client you should be able to browse the current code, maybe somewhere into OptionsFrame.xml/lua.

Just some ideas...

Tekkub 03-30-08 03:30 PM

Ace addons (Omen) use a library to make their config panels... so ripping apart their code might not help much. I suggest you look at addons making basic frames first, learn that, then consider using libraries to make you job easier (I.E. understand HOW it's done before you use the lib).

Most of my addons that have been updated this weekend have hand-made panels. Go rip apart TourGuide or Squeenix or such.

Kaomie 03-30-08 03:36 PM

Quote:

Originally Posted by Tekkub (Post 86879)
Ace addons (Omen) use a library to make their config panels... so ripping apart their code might not help much.

I never said to stop at the addons themselves, just mentioning somewhere to start as it is being done :) Those are the only two that I use so far that popped-up in my addons configuration tab, but I am sure there are more and will be a lot more soon. I guess you do need to go and look into the libraries to see how it is actually done, I have not checked inside at all.

Tekkub 03-30-08 03:44 PM

Well I meant that libs can be less than friendly to read sometimes... but then I'm thinking of Ace2 there.

Anywho, the thing of it all, really, is that there is nothing fancy about this new system. All you do is make a frame, attach a "name" to it, and call one function to register it. That's all detailed in the thread linked from the 2.4 changes thread. The hard part is creating all the frames you want, and there's nothing new with regards to that in the patch.

Seerah 03-30-08 04:13 PM

Other addons that make use of the new options system are OmniCC and Bongos3.

schnoggo 03-31-08 01:44 PM

All good suggestions. I'll take a peek at what Bongos is doing while I unpack the client :)

Tekkub 03-31-08 01:50 PM

I highly recommend that you create your frames via lua in the base frame's OnShow instead of via XML. That will delay the cost until the frame is actually shown instead of on login... since config frames are something that are not usually used every session.

That looks something like:
Code:

local f = CreateFrame("Frame", nil, UIParent)
f.name = "My addon"
f:Hide()
f:SetScript("OnShow", function(self)
  -- Make your frames
  self:SetScript("OnShow", nil)
end
InterfaceOptions_AddCategory(f)



All times are GMT -6. The time now is 11:58 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI