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 for _, pos in ipairs(self.positions) do
19 return self.db.profile.indicators[pos][item[#item]];
21 set = function(item, value)
22 self.db.profile.indicators[pos][item[#item]] = value;
32 return table.concat(self.db.profile.indicators[pos]["auras"], "\n");
34 set = function(item, value)
36 for aura in string.gmatch(value, "[^\n]+") do
37 aura = string.gsub(aura, "^%s*(.-)%s$", "%1");
38 if tonumber(aura) then
39 table.insert(t, tonumber(aura));
41 table.insert(t, aura);
44 self.db.profile.indicators[pos]["auras"] = t;
50 name = "Only cast by me",
54 name = "Show remaining time",
68 return unpack(self.db.profile.indicators[pos]["textColor"]);
70 set = function(item, r, g, b, a)
71 self.db.profile.indicators[pos]["textColor"] = {r, g, b, a};
85 name = "Use default icon",
86 disabled = function() return not self.db.profile.indicators[pos]["showIcon"] end,
100 return unpack(self.db.profile.indicators[pos]["iconColor"]);
102 set = function(item, r, g, b, a)
103 self.db.profile.indicators[pos]["iconColor"] = {r, g, b, a};
104 self:RefreshConfig();
113 local profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(OmaRF.db);
114 local options = createOptionsTable(OmaRF);
115 local config = LibStub("AceConfig-3.0");
116 config:RegisterOptionsTable("Indicators", options);
117 config:RegisterOptionsTable("Indicators Profiles", profiles);
119 local dialog = LibStub("AceConfigDialog-3.0");
120 OmaRF.optionsFrames = {};
121 OmaRF.optionsFrames.Indicators = dialog:AddToBlizOptions("Indicators", "Indicators");
122 OmaRF.optionsFrames.Profile = dialog:AddToBlizOptions("Indicators Profiles", "Profiles", "Indicators");