1 local function createOptionsTable(self)
4 get = function(item) return self.db.profile[item[#item]] end,
5 set = function(item, value) self.db.profile[item[#item]] = value; self:RefreshConfig() end,
14 get = function(item) return self.db.profile.majorAuras[item[#item]] end,
15 set = function(item, value)
16 self.db.profile.majorAuras[item[#item]] = value;
26 return table.concat(self.db.profile.majorAuras["auras"], "\n");
28 set = function(item, value)
30 for aura in string.gmatch(value, "[^\n]+") do
31 aura = string.gsub(aura, "^%s*(.-)%s$", "%1");
32 if tonumber(aura) then
33 table.insert(t, tonumber(aura));
35 table.insert(t, aura);
38 self.db.profile.majorAuras["auras"] = t;
44 name = "Number shown",
71 for _, pos in ipairs(self.positions) do
76 return self.db.profile.indicators[pos][item[#item]];
78 set = function(item, value)
79 self.db.profile.indicators[pos][item[#item]] = value;
89 return table.concat(self.db.profile.indicators[pos]["auras"], "\n");
91 set = function(item, value)
93 for aura in string.gmatch(value, "[^\n]+") do
94 aura = string.gsub(aura, "^%s*(.-)%s$", "%1");
95 if tonumber(aura) then
96 table.insert(t, tonumber(aura));
98 table.insert(t, aura);
101 self.db.profile.indicators[pos]["auras"] = t;
102 self:RefreshConfig();
107 name = "Only cast by me",
111 name = "Show remaining time",
125 return unpack(self.db.profile.indicators[pos]["textColor"]);
127 set = function(item, r, g, b, a)
128 self.db.profile.indicators[pos]["textColor"] = {r, g, b, a};
129 self:RefreshConfig();
134 name = "Show stacks",
142 name = "Use default icon",
143 disabled = function() return not self.db.profile.indicators[pos]["showIcon"] end,
157 return unpack(self.db.profile.indicators[pos]["iconColor"]);
159 set = function(item, r, g, b, a)
160 self.db.profile.indicators[pos]["iconColor"] = {r, g, b, a};
161 self:RefreshConfig();
170 local profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(OmaRF.db);
171 local options = createOptionsTable(OmaRF);
172 local config = LibStub("AceConfig-3.0");
173 config:RegisterOptionsTable("Indicators", options);
174 config:RegisterOptionsTable("Indicators Profiles", profiles);
176 local dialog = LibStub("AceConfigDialog-3.0");
177 OmaRF.optionsFrames = {};
178 OmaRF.optionsFrames.Indicators = dialog:AddToBlizOptions("Indicators", "Indicators");
179 OmaRF.optionsFrames.Profile = dialog:AddToBlizOptions("Indicators Profiles", "Profiles", "Indicators");