Skip to content

Instantly share code, notes, and snippets.

@zachwlewis
Created February 20, 2013 07:47
Show Gist options
  • Save zachwlewis/4993734 to your computer and use it in GitHub Desktop.
Save zachwlewis/4993734 to your computer and use it in GitHub Desktop.
Using Blizzard's Interface Options Addons Panel in World of Warcraft
function MyAddOnSettingsFrame_OnLoad(self)
-- Set the name for the Category for the Panel
self.name = "My AddOn" .. GetAddOnMetadata("MyAddon", "Version")
-- When the player clicks okay, run this function.
self.okay = function (self) print("MyAddOnSettings: Okay clicked") end
-- When the player clicks cancel, run this function.
self.cancel = function (self) print("MyAddOnSettings: Cancel clicked.") end
-- Add the panel to the Interface Options
InterfaceOptions_AddCategory(self)
end
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ .. \FrameXML\UI.xsd">
<Script file="MyAddOnSettings.lua"/>
<Frame name="MyAddOnSettingsFrame">
<Scripts>
<OnLoad function="MyAddOnSettingsFrame_OnLoad"/>
</Scripts>
</Frame>
</Ui>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment