Commit 9b712080 authored by Simpy's avatar Simpy 🐹

advanced options

parent 68613c01
......@@ -13,7 +13,7 @@ local sin, cos, pi, rand = math.sin, math.cos, math.pi, math.random
local band, guid, uisu, gsi, cf = bit.band, UnitGUID, UnitIsUnit, GetSpellInfo, CreateFrame
local info = CombatLogGetCurrentEventInfo
ns.objects, ns.spells, ns.exclude = {}, {}, {}
ns.objects, ns.spells = {}, {}
ns.CT, ns.SC = E:CopyTable({}, CombatFeedbackText), ns.colors
ns.CT.MISFIRE = _G.COMBAT_TEXT_MISFIRE
......@@ -143,7 +143,7 @@ function FCT:Update(frame, fb)
if tb or pb then return end
if e == 'SPELL_HEAL' or (fb.showHots and e == 'SPELL_PERIODIC_HEAL') then
if not ns.exclude[h] then a, b, d = j, k, ns.SC[-3] end
if not fb.exclude[h] then a, b, d = j, k, ns.SC[-3] end
elseif e == 'RANGE_DAMAGE' then
a, b, d = j, l, ns.SC[-2]
elseif e == 'SWING_DAMAGE' then
......
......@@ -193,7 +193,7 @@ FCT.options = {
},
}
function FCT:AddOptions(arg1, arg2, arg3)
function FCT:AddOptions(arg1, arg2)
if E.Options.args.ElvFCT.args[arg1].args[arg2] then return end
if arg1 == 'colors' then
......@@ -207,8 +207,20 @@ function FCT:AddOptions(arg1, arg2, arg3)
order = FCT.orders[arg2][1],
name = L[FCT.orders[arg2][2]],
type = "group",
get = function(info) return FCT.db[arg1].frames[arg2][ info[#info] ] end,
set = function(info, value) FCT.db[arg1].frames[arg2][ info[#info] ] = value end,
get = function(info)
if info[4] == 'advanced' or info[4] == 'exclude' then
return FCT.db[arg1].frames[arg2][info[4]][ info[#info] ]
else
return FCT.db[arg1].frames[arg2][ info[#info] ]
end
end,
set = function(info, value)
if info[4] == 'advanced' or info[4] == 'exclude' then
FCT.db[arg1].frames[arg2][info[4]][ info[#info] ] = value
else
FCT.db[arg1].frames[arg2][ info[#info] ] = value
end
end,
args = FCT.options
}
end
......@@ -274,11 +286,11 @@ function FCT:Options()
},
}
for name, obj in pairs(ns.defaults.nameplates.frames) do
FCT:AddOptions('nameplates', name, obj)
for name in pairs(ns.defaults.nameplates.frames) do
FCT:AddOptions('nameplates', name)
end
for name, obj in pairs(ns.defaults.unitframes.frames) do
FCT:AddOptions('unitframes', name, obj)
for name in pairs(ns.defaults.unitframes.frames) do
FCT:AddOptions('unitframes', name)
end
for index in pairs(ns.colors) do
FCT:AddOptions('colors', index)
......@@ -367,15 +379,10 @@ function FCT:Initialize()
-- Database
FCT.data = E:CopyTable({}, ns.defaults)
FCT.data.colors = E:CopyTable({}, ns.colors)
for name in pairs(ns.defaults.nameplates.frames) do
E:CopyTable(FCT.data.nameplates.frames[name], ns.frames)
end
for name in pairs(ns.defaults.unitframes.frames) do
E:CopyTable(FCT.data.unitframes.frames[name], ns.frames)
end
for name in pairs(ns.defaults.nameplates.frames) do E:CopyTable(FCT.data.nameplates.frames[name], ns.frames) end
for name in pairs(ns.defaults.unitframes.frames) do E:CopyTable(FCT.data.unitframes.frames[name], ns.frames) end
FCT.db = E:CopyTable({}, FCT.data)
_G.ElvFCT = E:CopyTable(FCT.db, _G.ElvFCT)
-- Events
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment