WoWInterface SVN BattleBar

[/] [trunk/] [Config.lua] - Rev 6

Compare with Previous | Blame | View Log

local L = LibStub("AceLocale-3.0"):GetLocale("BattleBar")

local options = {
        type = "group",
        args = {
                config = {
                        type = "execute",
                        name = L["Configure"],
                        desc = L["Open the configuration dialog"],
                        func = function() BB:ShowConfig() end,
                        guiHidden = true
                },
                toggle = {
                        type = "execute",
                        name = L["Toggle"],
                        desc = L["Toggle the BattleBar"],
                        func = function() BB:ToggleDialog() end,
                        guiHidden = true
                },
                refresh = {
                        type = "execute",
                        name = "Refresh",
                        desc = "Refresh the interface, forcing an update.",
                        func = function() BB:BattlegroundCheck(); BB:UpdateInfo(); end
                },
                debug = {
                        type = "toggle",
                        name = L["Debug Mode"],
                        desc = L["Toggle Debug Mode"],
                        get = function(info) return BB.db.profile.debug end,
                        set = function(info, v) BB.db.profile.debug = v end
                },
                list = {
                        type = "group",
                        name = "List",
                        desc = "List Options",
                        args = {
                                sortMode = {
                                        type = "select",
                                        name = "Sort Mode",
                                        desc = "The Sorting Mode for the List",
                                        values = { kbs = "Killing Blows", dmg = "Damage Done", heal = "Healing Done" },
                                        style = "radio",
                                        get = function(info) return BB.db.profile.sortMode end,
                                        set = function(info, v) BB.db.profile.sortMode = v; BB:Gui_Update() end
                                },
                                showFaction = {
                                        type = "select",
                                        name = "Show Faction",
                                        desc = "The Faction(s) you wish to show.",
                                        values = { both = "Both", alliance = "Alliance", horde = "Horde" },
                                        style = "radio",
                                        get = function(info) return BB.db.profile.faction end,
                                        set = function(info, v) BB.db.profile.faction = v; BB:Gui_Update() end
                                },
                                showCount = {
                                        type = "range",
                                        name = L["Show Count"],
                                        desc = L["How many players should be shown on the BattleBar"],
                                        min = 5,
                                        max = 20,
                                        step = 1,
                                        get = function(info) return BB.db.profile.gui.showCount end,
                                        set = function(info, v) BB.db.profile.gui.showCount = v BB:Gui_Update() end
                                },
                                showSelf = {
                                        type = "toggle",
                                        name = L["Show Self"],
                                        desc = L["Show yourself regardless of position on the scoreboard"],
                                        get = function(info) return BB.db.profile.gui.showSelf end,
                                        set = function(info, v) BB.db.profile.gui.showSelf = v BB:Gui_Update() end
                                }
                        }
                },
                behaviour = {
                        type = "group",
                        name = "Behaviour",
                        desc = "General BattleBar Behaviour Options",
                        args = {
                                hideMode = {
                                        type = "toggle",
                                        name = "Hide Mode",
                                        desc = "Toggles 'Hide Mode' which will makes BattleBar completely invisible when not in a battleground.",
                                        get = function(info) return BB.db.profile.behaviour.hideMode end,
                                        set = function(info, v)
                                                BB.db.profile.behaviour.hideMode = v
                                                BB:Gui_Update();
                                        end
                                },
                                rolloverMode = {
                                        type = "toggle",
                                        name = "Rollover Mode",
                                        desc = "Toggles 'Rollover Mode' which will makes BattleBar's Scoreboard hidden until you mouse-over the title-bar.",
                                        get = function(info) return BB.db.profile.behaviour.rolloverMode end,
                                        set = function(info, v)
                                                BB.db.profile.behaviour.rolloverMode = v
                                                BB:Gui_Update();
                                        end
                                }
                        }
                },
                gui = {
                        type = "group",
                        name = L["Appearance"],
                        desc = L["Appearance"],
                        args = {
                                update = {
                                        type = "execute",
                                        name = L["Update"],
                                        desc = L["Update GUI"],
                                        func = function() BB:Gui_Update() end,
                                        guiHidden = true
                                },
                        },
                        guiHidden = true
                }
        }
}

BB.configOptions = options
LibStub("AceConfig-3.0"):RegisterOptionsTable("BattleBar", options, {"battlebar", "bb"})

Compare with Previous | Blame