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

Comments

Posts Quoted:
Reply
Clear All Quotes