ESOUI SVN TaosGroupUltimate

[/] [trunk/] [TaosGroupUltimate/] [ui/] [SettingsWindow.lua] - Rev 13

Go to most recent revision | Compare with Previous | Blame | View Log

--[[
        Addon: Taos Group Ultimate
        Author: TProg Taonnor
        Created by @Taonnor
]]--

--[[
        Global variables
]]--
local LOG_ACTIVE = false

--[[
        Class SettingsWindow
]]--
SettingsWindow = {}
SettingsWindow.__index = SettingsWindow

--[[
        Class Members
]]--
SettingsWindow.MainMenuName = "TaosGroupUltimateSettingsMainMenu"


--[[
        Initialize creates settings window
]]--
function SettingsWindow.Initialize(major, minor, patch)
    if (LOG_ACTIVE) then 
        logTrace("SettingsWindow.Initialize")
        logDebug("major: " .. major, "minor: " .. minor, "patch: " .. patch)
    end

        local panelData = {
                type = "panel",
                name = "Taos Group Ultimate",
                author = "TProg Taonnor",
                version = major .. "." .. minor .. "." .. patch,
                slashCommand = "/taosGroupUltimate",
                registerForDefaults = true
        }

        local optionsData = {
                [1] = {
                        type = "header",
                        name = GetString(TGU_OPTIONS_HEADER),
                },
                [2] = {
                        type = "checkbox",
                        name = GetString(TGU_OPTIONS_DRAG_LABEL),
                        tooltip = GetString(TGU_OPTIONS_DRAG_TOOLTIP),
                        getFunc = 
               function() 
                   return SettingsHandler.SavedVariables.Movable
               end,
                        setFunc = 
               function(value) 
                                    SettingsHandler.SavedVariables.Movable = value
                    SimpleList:SetControlMovable(value)
                            end,
                        default = SettingsHandler.SavedVariables.Movable
                },
        }
        
        local LAM = LibStub("LibAddonMenu-2.0")
        LAM:RegisterAddonPanel(SettingsWindow.MainMenuName, panelData)
        LAM:RegisterOptionControls(SettingsWindow.MainMenuName, optionsData)
end

Go to most recent revision | Compare with Previous | Blame