WoWWiki

This wiki contains inaccurate and out-of-date information. Please head over to https://wowpedia.fandom.com for more accurate and up-to-date game information.

READ MORE

WoWWiki
WoWWiki
Advertisement
AddOn
WoWWiki Hosted AddOn Page (Old)

This AddOn is currently considered old. Content is retained for reference or subsequent updates.

See also OptionHouse at Curse Forge.

OptionHouse-OptionsExample

An example of the configuration screen

OptionHouse is a general master control panel, performance monitor, and centralized configuration mod for your addons. When installed as a separate addon, you can enable and disable addons, load addons that are LoadOnDemand, as well as get general addon metadata. You can use the included performance monitor to sort your addons by memory usage, memory increase per second, along with CPU usage if you have CPU profiling enabled.

First and foremost, OptionHouse was designed to allow an easy centralized place to configure your addons. The library provides a way to categorize your options, and only creates those options screens which are access. In short, this addon will give you a nice place to configure any addons that use OH.

Download OptionHouse at wowinterface.com

There is currently a beta library called HousingAuthority available that handles creation of widgets that can then be displayed inside OptionHouse, you can also see example widgets for some code examples for making the configuration widgets.

Download HousingAuthority at wowinterface.com

Access OptionHouse via the OptionHouse button in the Options screen that appears when you click the escape key.

DongleObject OptionHouse API[]

:RegisterAddon(name[, title, author, version])[]

Registers a new addon.

Args[]

Arg Type Details
name string Name associated with the addon.
title string (Optional) Title to show for the addon.
author string (Optional) Author for the addon.
version string (Optional) Version for the addon.

Returns[]

Return Type Details
OHObject table The OptionHouse Object encapsulating the new OptionHouse addon.

Remarks[]

Currently title, author, and version information is used on the addon management panel tooltips and on the tooltips for the addon in the centralized addon panel, if you use a different name from the addon's folder name then the extra information will not be loaded.

Any registered information will override the toc values when displaying the tooltip in the addon management panel, however only the registered information is used on the centralized addon panel.

If only one category exists and no sub categories, then it'll default to opening it when the addon is clicked on the configuration tab.

An example of registering a category and a sub category.

local OptionHouse = DongleStub("OptionHouse-1.0")
local OHObject = OptionHouse:RegisterAddOn( "FooBar", "FooBar 1.0.0", "YourName", "1.0.0" )
OHObject:RegisterCategory( "Test", FooBar, "ShowTest" )
OHObject:RegisterSubCategory( "Test", "Sub Cat", FooBar, "ShowSubCat" )

OptionHouse Object API[]

OHObject:GetFrame(type)[]

Args[]

Arg Type Details
type string Frame type to return either "main", "addon", "perf" or "manage".

Returns[]

Return Type Details
Frame UIObject The OptionHouse frame requested.

Remarks[]

This was added in r553.

If you were referencing an OptionHouse frame directly by name you will need to update and use :GetFrame(type) instead.

The "main" type is for the main OptionHouse frame, this is the one that everything else is parented to, "addon" is for all of the configurations that addons register, "manage" is for the addon control panel, "perf" is for the performance panel.

OHObject:RegisterCategory(name, handler[, func, noCache, sortID])[]

Args[]

Arg Type Details
name string Name for the category.
handler string/function/table Function/method to call.
func string/function (Optional) Function to call if you're using a handler
noCache boolean/number (Optional) Disable frame caching
sortID number (Optional) Order to sort this category

Remarks[]

If we want to register the handler Foo and the function Bar with OptionHouse you'd need to do RegisterCategory( "Category", Foo, "Bar" ), if you want to just register the function Foo then you'd do RegisterCategory( "Category", Foo )

The function registered must return a frame, unless you specify noCache the frame will be saved and called instead of the function the next time the category is clicked. If you want to detect when the frame is used you must register OnShow with that frame and populate it yourself. When noCache is passed the function will be called every time and the frame will not be cached, useful if you want to use one frame for multiple options.

Frames cannot have a width higher then 630 and a height over 305, if either width or height exceeds those numbers they'll be forced back to 630 and 305, if no width or height is specified then it'll default to 630/305. If no position is set then the frame will be positioned to TOPLEFT, <OHOptionsFrame>, "TOPLEFT", 190, -103, all frames will be parented to the OptionHouse configuration frame.

This applies to all frames and not just cached ones.

The function/handler will be called as: handler.func( handler, cat[, sub cat]) or func( cat[, sub cat])

OHObject:RemoveCategory(name)[]

Removes a register category.

Because the entry is removed from OptionHouse, the frame cache for the category will be cleared and it'll call the registered handler and/or function the next time the category is clicked.

Args[]

Arg Type Details
name string Name of the category to remove

Remarks[]

No errors are generated if the category is nil or doesn't exist.

OHObject:RegisterSubCategory(parentCat, name, handler[, func, noCache, sortID])[]

Args[]

Arg Type Details
parentCat string Name for the parent category.
name string Name for the category.
handler string/function/table Function/method to call.
func string/function (Optional) Function to call if you're using a handler
noCache boolean/number (Optional) Disable frame caching
sortID number (Optional) Order to sort this category

Remarks[]

This functions the same way as OHObject:RegisterCategory() does for frame rules and arguments, parentCat has to be the same as the name you registered in OHObject:RegisterCategory(), and will be shown as a sub category of parentCat.

OHObject:RemoveSubCategory(parentCat, name)[]

Removes a subcategory from a category, like OHOBject:RemoveCategory() the same issue regarding functions being called after the frame is created applies.

Args[]

Arg Type Details
parentCat string Name of the parent category to remove from.
name string Name of the category to remove

Remarks[]

No errors are generated if the category is nil or doesn't exist.

Advertisement