Thread Tools Display Modes
09-12-08, 06:39 AM   #1
BDelacroix
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Blizzard Interface Options

Apparently, not too long ago, Blizzard added the ability to have your mod options attach to their interface options GUI.

I've been looking for information on how to tell Blizzard's Interface Options box that my addon exists to do this.

I know the standard answer is to read someone's code (which was used as a threat of punishment when I was in college, but seems standard now). Even so, the only addons that have been doing this that I have are ACE addons. I don't want to do ACE.

So, does anyone have a pointer to where to go to find out about this or perhaps an addon (that isn't ACE) to (eeeugh) read through?

Thank you.

In the meantime, I'll keep looking. The Wowwiki howto is using myAddons so that tells me its before 2.4 (or whenever Blizzard put this capability in the UI).
  Reply With Quote
09-12-08, 06:54 AM   #2
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
http://www.wowwiki.com/Using_the_Int...s_Addons_panel

perhaps an addon (that isn't ACE) to (eeeugh) read through?
You could take a look at a few of my mods for examples SellOut or ExcessBaggage
  Reply With Quote
09-12-08, 07:18 AM   #3
BDelacroix
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Now there's an idea. Thank you.

Aha, another author that doesn't use XML. Good on ya.

The opinions expressed in this message do not necessarily reflect those of WowInterface or its affiliates.

Last edited by BDelacroix : 09-12-08 at 08:18 AM. Reason: added remark
  Reply With Quote
09-12-08, 07:39 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
I use LibSimpleOptions, its great to make this easier on the author(s)
  Reply With Quote
09-12-08, 08:33 AM   #5
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
oO

It's so easy by default ... for what do you need a library?
  Reply With Quote
09-12-08, 08:57 AM   #6
BDelacroix
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Here is the answer (found here):

Basically, to make an options panel, you make a frame like you do for anything else. Put your stuff in the frame just like you would normally.

You then need to define certain fields. To keep to the example in the thread linked I'll pretend panel is my options frame.

panel.name must be defined. It would be helpful if its the name of your addon but I imagine wow has no idea. You could put any string here.

After that, the rest are optional.

panel.okay is the function that will happen when you click ok. IE: you push the changed variables to the ones your addon will use.

panel.cancel is the function that will happen when you click cancel.

panel.default is the function that will happen when you click default.

You need to call the function InterfaceOptions_AddCategory(panel) to push your panel on the list of those Blizzard will recognize.

It really is that easy.
  Reply With Quote
09-12-08, 09:05 AM   #7
Quezacolt
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 6
This is from UIOptionsFrame.lua, extractable with Blizzard's AddOnKit.exe:

Code:
---------------------------------------------------------------------------------------------------
-- HOWTO: Add new categories of options
--
-- The new Interface Options frames allows authors to place their configuration
-- frames (aka "panels") alongside the panels for modifying the default UI.
--
-- Adding a new panel to the Interface Options frame is a fairly straightforward process.
-- Any frame can be used as a panel as long as it implements the required values and methods.
-- Once a frame is ready to be used as a panel, it must be registered using the function
-- InterfaceOptions_AddCategory, i.e. InterfaceOptions_AddCategory(panel)
--
-- Panels can be designated as sub-categories of existing options. These panels are listed
-- with smaller text, offset, and tied to parent categories. The parent categories can be expanded
-- or collapsed to toggle display of their sub-categories.
--
-- When players select a category of options from the Interface Options frame, the panel associated
-- with that category will be anchored to the right hand side of the Interface Options frame and shown.
--
-- The following members and methods are used by the Interface Options frame to display and organize panels.
--
-- panel.name - string (required)	
--	The name of the AddOn or group of configuration options. 
--	This is the text that will display in the AddOn options list.
--
-- panel.parent - string (optional)
--	Name of the parent of the AddOn or group of configuration options. 
--	This identifies "panel" as the child of another category.
--	If the parent category doesn't exist, "panel" will be displayed as a regular category.
--
-- panel.okay - function (optional)
--	This method will run when the player clicks "okay" in the Interface Options. 
--
-- panel.cancel - function (optional)
--	This method will run when the player clicks "cancel" in the Interface Options. 
--	Use this to revert their changes.
--
-- panel.default - function (optional)
--	This method will run when the player clicks "defaults". 
--	Use this to revert their changes to your defaults.
--					
-- EXAMPLE -- Use XML to create a frame, and through its OnLoad function, make the frame a panel.
--
--	MyAddOn.xml
--		<Frame name="ExamplePanel">
--			<Scripts>
--				<OnLoad>
--					ExamplePanel_OnLoad(self);
--				</OnLoad>
--			</Scripts>
--		</Frame>
--
--	MyAddOn.lua
--		function ExamplePanel_OnLoad (panel)
--			panel.name = "My AddOn"
--			InterfaceOptions_AddCategory(panel);
--		end
--
-- EXAMPLE -- Dynamically create a frame and use it as a subcategory for "My AddOn".
--
--	local panel = CreateFrame("FRAME", "ExampleSubCategory");
--	panel.name = "My SubCategory";
--	panel.parent = "My AddOn";
--
--	InterfaceOptions_AddCategory(panel);
--
-- EXAMPLE -- Create a frame with a control, an okay and a cancel method
--
--	--[[ Create a frame to use as the panel ]] -- 
--	local panel = CreateFrame("FRAME", "ExamplePanel");
--	panel.name = "My AddOn";
--
--	-- [[ When the player clicks okay, set the original value to the current setting ]] --
--	panel.okay = 
--		function (self)
--			self.originalValue = MY_VARIABLE;
--		end
--
--	-- [[ When the player clicks cancel, set the current setting to the original value ]] --
--	panel.cancel =
--		function (self)
--			MY_VARIABLE = self.originalValue;
--		end
--
--	-- [[ Add the panel to the Interface Options ]] --
--	InterfaceOptions_AddCategory(panel);
-------------------------------------------------------------------------------------------------
When your panel gets shown, it will be auto-sized to the correct dimensions. BEFORE it gets shown, it's size is 0,0 (tested a while ago, may not be true anymore). Just wanna let you know in case that causes you trouble.
__________________
-- To code of programmer none compare,
-- Leaves his users seeing double;
-- To defy its efficiency none would dare,
-- Don't report anything, I might get in trouble!
  Reply With Quote
01-07-11, 02:12 AM   #8
silentstone7
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 14
I know this thread is old, but does anyone know what happens in the default Addons Interface panel if someone clicks from one category to another? For example, if I open my addon's panel of options, then open a child of that panel, and change something, then go to another child of my panel without clicking okay... What will happen?

Another way of asking this...does changing the panel you are looking at in the Interface options without clicking okay save your changes/discard your changes/call a function?
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Blizzard Interface Options


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