RaidWatch 2

Templates / Plugin Template

--[[
   Description of pluign, purpose, usage and so on
]]--

----------------------------------
-- Create plugin
local plugin = RW:Plugin([PluginName])
if not plugin then return end

----------------------------------
-- Locals 
local AceGUI = LibStub("AceGUI-3.0")


local defaults = {
	profile = {
		PluginEnabled = true,
	}
}

----------------------------------
-- Init

function plugin:OnRegister()
	self.db = RW.db:RegisterNamespace([PluginName], defaults)
	db = self.db.profile
	
	self.db.RegisterCallback(self, "OnProfileChanged", "Reset")
	self.db.RegisterCallback(self, "OnProfileCopied", "Reset")
	self.db.RegisterCallback(self, "OnProfileReset", "Reset")	
end

function plugin:PluginEnable()
	if not db.PluginEnabled then
		self:Disable()
		return
	end
end

function plugin:PluginDisable()
end

function plugin:Reset()
	db = self.db.profile
end

-- If options is a function then the expected return value(s)  is of AceGUI-widget types
-- else if should be an AceConfig options table.
function plugin:GetOptions()
       return [order], "Category1", "Category2", "pluginName", options, icon
end

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Jan 13, 2010
Last updated
Jul 14, 2010

Author