3 function CreateDefaults()
5 indicatorFont = "Arial Narrow",
10 Defaults.profile["auras"..i] = "";
11 Defaults.profile["textSize"..i] = 10;
12 Defaults.profile["color"..i] = {r = 1, g = 1, b = 1, a = 1,};
13 Defaults.profile["mine"..i] = false;
14 Defaults.profile["stack"..i] = true;
15 Defaults.profile["debuffColor"..i] = false;
16 Defaults.profile["showText"..i] = true;
17 Defaults.profile["showIcon"..i] = true;
18 Defaults.profile["useDefaultIcon"..i] = true;
19 Defaults.profile["iconSize"..i] = 10;
24 function CreateOptions ()
28 get = function(item) return Indicators.db.profile[item[#item]] end,
29 set = function(item, value) Indicators.db.profile[item[#item]] = value; Indicators:RefreshConfig() end,
33 dialogControl = "LSM30_Font",
34 name = "Indicator Font",
35 desc = "Adjust the font used for the indicators",
36 values = AceGUIWidgetLSMlists.font,
42 desc = "Enable/Disable indicators",
44 set = function(item, value)
45 Indicators.db.profile[item[#item]] = value
49 Indicators:OnDisable()
56 --- Add options for each indicator
57 local indicatorNames = {"Top Left", "Top Right", "Center", "Bottom Left", "Bottom Right"}
59 Options.args["i"..i] = {}
60 Options.args["i"..i].type = 'group'
61 Options.args["i"..i].name = indicatorNames[i]
62 Options.args["i"..i].order = i*10+10
63 Options.args["i"..i].args = {}
64 Options.args["i"..i].args["auras"..i] = {
66 name = "Buffs/Debuffs",
67 desc = "The buffs/debuffs to show in this indicator. Put each buff/debuff on a separate line. You can use 'Magic/Poison/Curse/Disease' to show any debuff of that type.",
72 Options.args["i"..i].args["mine"..i] = {
75 desc = "Only show buffs/debuffs cast by me",
78 Options.args["i"..i].args.textHeader = {
80 name = "Text Counter",
83 Options.args["i"..i].args["showText"..i] = {
85 name = "Show text counter",
86 desc = "Show a text counter specifying the time left of the buff/debuff",
89 Options.args["i"..i].args["textSize"..i] = {
99 Options.args["i"..i].args.coloringHeader = {
104 Options.args["i"..i].args["debuffColor"..i] = {
106 name = "Color by debuff type",
107 desc = "Color the text depending on the debuff type, will override any other coloring (poison = green, magic = blue etc)",
110 Options.args["i"..i].args["color"..i] = {
112 name = "Default color",
113 desc = "Default color of the indicator",
115 local t = Indicators.db.profile[item[#item]]
116 return t.r, t.g, t.b, t.a
118 set = function(item, r, g, b, a)
119 local t = Indicators.db.profile[item[#item]]
120 t.r, t.g, t.b, t.a = r, g, b, a
121 Indicators:RefreshConfig()
125 Options.args["i"..i].args.stackHeader = {
130 Options.args["i"..i].args["stack"..i] = {
132 name = "Show stack size",
133 desc = "Show stack size for buffs/debuffs that stack",
136 Options.args["i"..i].args.iconHeader = {
141 Options.args["i"..i].args["showIcon"..i] = {
144 desc = "Show an icon if the buff/debuff are on the unit",
147 Options.args["i"..i].args["useDefaultIcon"..i] = {
149 name = "Use default icon",
150 desc = "Show default icon instead of the ability's.",
151 disabled = function () return not Indicators.db.profile["showIcon"..i] end,
154 Options.args["i"..i].args["iconSize"..i] = {
167 local SlashCommands = {
173 desc = "Enable indicators",
174 func = function() Indicators.db.profile.enabled = true; Indicators:OnEnable() end,
179 desc = "Disable indicators",
180 func = function() Indicators.db.profile.enabled = false; Indicators:OnDisable() end,
185 desc = "Show config",
186 func = function() Indicators:ShowConfig() end,
191 function Indicators:ShowConfig()
192 InterfaceOptionsFrame_OpenToCategory(self.optionsFrames.Profile)
193 InterfaceOptionsFrame_OpenToCategory(self.optionsFrames.Indicators)
196 function Indicators:SetupOptions()
199 self.db = LibStub("AceDB-3.0"):New("IndicatorsDB", Defaults)
202 local profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)
206 local config = LibStub("AceConfig-3.0")
207 config:RegisterOptionsTable("Raid Frame Indicators", Options)
208 config:RegisterOptionsTable("Raid Frame Indicators Profiles", profiles)
210 -- Register slash commands
211 config:RegisterOptionsTable("Raid Frame Indicators Options", SlashCommands, {"indicators", "raidframeindicators"})
213 -- Add to Blizz option pane
214 local dialog = LibStub("AceConfigDialog-3.0")
215 self.optionsFrames = {}
216 self.optionsFrames.Indicators = dialog:AddToBlizOptions("Raid Frame Indicators","Raid Frame Indicators")
217 self.optionsFrames.Profile = dialog:AddToBlizOptions("Raid Frame Indicators Profiles","Profiles", "Raid Frame Indicators")