Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local db
- local defaults = {
- profile = {
- },
- global = {
- hasUpdate = false,
- hasChildren = false,
- hasName = false,
- isVisible = false
- }
- }
- local alphabet = {
- "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"
- }
- local options = {
- name = "FrameFiesta",
- type = "group",
- handler = FF,
- childGroups = "tab",
- args = {
- framesTab = {
- order = 2,
- type = "group",
- name = "frames",
- childGroups = "tab",
- args = {
- toggleVisible = {
- type = "execute",
- order = 1,
- name = "Refresh",
- desc = "",
- func = "addArgs",
- },
- frames = {
- order = 2,
- type = "group",
- name = "Frames",
- childGroups = "tab",
- args = dbStructContainer
- }
- }
- },
- }
- }
- local function iterate(frame, shown, letter)
- local args = { }
- local step = 0
- for k, v in pairs(frame) do
- if string.sub(v, 1, 1) == letter then
- step = step + 1
- settings = {
- order = step,
- type = "toggle",
- enabled = shown[k],
- name = tostring(v),
- set = function(info, value)
- shown[k] = _G[v]:IsShown()
- if shown[k] then
- _G[v]:Hide()
- else
- _G[v]:Show()
- end
- shown[k] = _G[v]:IsShown()
- end,
- get = function(info) return shown[k] end
- },
- insert(args, step-1, settings)
- end
- end
- return args
- end
- function FF:addArgs()
- emptyTable(dbStructContainer)
- emptyTable(dbStruct)
- local steps = 0
- for k, v in pairs(alphabet) do
- steps = steps + 1
- dbStruct = {
- order = steps,
- type = "group",
- name = tostring(v),
- childGroups = "tab",
- args = iterate(loneFrame, loneFrameShown, v),
- }
- insert(dbStructContainer, steps, dbStruct)
- end
- FF.db.global.args = dbStructContainer
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement