API/Options

Guilder:DisableModule(module)

Disable a module properly.
Unlike module:Disable(), this tracks it in the DB

Parameters

module
the module to disable

Usage

Guilder:DisableModule(MyModule)


Guilder:EnableModule(module)

Enable a module properly.
Unlike module:Enable(), this tracks it in the DB

Parameters

module
the module to enable

Usage

Guilder:EnableModule(MyModule)


Guilder:IterateEnabledModules()

Iterate over all enabled modules

Return value

iterator which returns the id and module

Usage

  for id, module in Guilder:IterateEnabledModules() do
    doSomethingWith(module)
  end


Module:SetDefaults(defaults)

Set the module's database defaults.
This will cause module.db to be set.

Parameters

defaults
defaults on a per-profile basis. can be nil.

Usage

MyModule:SetDefaults({ color = { 1, 0, 0, 1 } })


Module:SetDescription(description)

Set the localised description of the module.

Parameters

description
the localised description of the module, as a full sentence, including a period at the end.

Usage

MyModule:SetDescription("This does a lot of things.")


Module:SetGlobalOptionsFunction

(func) Set the function to be called that will return a tuple of key-value pairs that will be merged onto the options table for the module options.

Parameters

func
function to call

Usage

  MyModule:SetGlobalOptionsFunction(function(self)
    return 'someOption', { name = "Some option", } -- etc
  end)


Module:SetIcon(icon)

Set the localised icon for the module.

Parameters

icon
the path to the icon to use

Usage

MyModule:SetIcon([[Interface\Addons\MyModule\myicon]])


Module:SetName(name)

Set the localised name of the module.

Parameters

name
the localised name of the module, with proper spacing, and in Title Case.

Usage

MyModule:SetName("My Module")



Comments

Posts Quoted:
Reply
Clear All Quotes