Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Addon = LibStub("AceAddon-3.0"):GetAddon("BasicUI")
- local Module = Addon:NewModule("Buffs")
- local L = setmetatable({}, { __index = function(t,k)
- local v = tostring(k)
- rawset(t, k, v)
- return v
- end })
- local db
- local defaults = {
- profile = {
- enable = true,
- scale = 1.19,
- }
- }
- function Module:OnInitialize()
- self.db = Addon.db:RegisterNamespace("Buffs", defaults)
- db = self.db.profile
- self:SetEnabledState(Addon:GetModuleEnabled("Buffs"))
- end
- function Module:OnEnable()
- -- set up stuff here
- db = self.db.profile
- BuffFrame:ClearAllPoints()
- BuffFrame:SetPoint('TOPRIGHT', Minimap, 'TOPLEFT', -25, 0)
- BuffFrame:SetScale(db.scale)
- end
- -- Leave this out if the module doesn't have any settings:
- function Module:Refresh()
- db = self.db.profile -- update the upvalue
- -- change stuff here
- BuffFrame:SetScale(db.scale)
- end
- -- Leave this out if the module doesn't have any options:
- local options
- function Module:GetOptions()
- options = options or {
- type = "group",
- name = L["Buffs"],
- desc = L["Buff Module for BasicUI."],
- get = function(info) return db[ info[#info] ] end,
- set = function(info, value) db[ info[#info] ] = value; end,
- args = {
- ---------------------------
- --Option Type Seperators
- sep1 = {
- type = "description",
- order = 2,
- name = " ",
- },
- sep2 = {
- type = "description",
- order = 3,
- name = " ",
- },
- sep3 = {
- type = "description",
- order = 4,
- name = " ",
- },
- sep4 = {
- type = "description",
- order = 5,
- name = " ",
- },
- ---------------------------
- enable = {
- type = "toggle",
- order = 1,
- name = L["Enable"],
- desc = L["Enables Buff Module."],
- width = "full",
- },
- scale = {
- type = "range",
- order = 5,
- name = L["Buff Scale"],
- --desc = L["Controls the scaling of the Buff Frames"],
- min = 0.05, max = 5, step = 0.05,
- disabled = function() return not db.enable end,
- set = function(info, value)
- db[ info[#info] ] = value
- Module:Refresh()
- end,
- },
- }
- }
- return options
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement