Commit 6ce3697f authored by Simpy's avatar Simpy 🐹

more options

parent 22df28a9
......@@ -260,13 +260,13 @@ function FCT:EnableMode(fb, parent, mode)
text.Spell:FontTemplate(fb.font, fb.fontSize, fb.fontOutline)
text.Spell:Point('BOTTOM', text, 'TOP', 0, 5)
if fb.radius ~= nil then text.radius = fb.radius else text.radius = 64 end
if fb.ScrollTime ~= nil then text.scrollTime = fb.ScrollTime else text.scrollTime = 1.5 end
if fb.FadeTime ~= nil then text.fadeTime = fb.FadeTime else text.fadeTime = text.scrollTime / 3 end
if fb.DirectionX ~= nil then text.xDirection = fb.DirectionX else text.xDirection = 1 end
if fb.DirectionY ~= nil then text.yDirection = fb.DirectionY else text.yDirection = 1 end
if fb.AlternateX ~= nil then text.alternateX = fb.AlternateX else text.alternateX = true end
if fb.AlternateY ~= nil then text.alternateY = fb.AlternateY else text.alternateY = false end
text.radius = fb.radius
text.scrollTime = fb.ScrollTime
text.fadeTime = fb.FadeTime
text.xDirection = fb.DirectionX
text.yDirection = fb.DirectionY
text.alternateX = fb.AlternateX
text.alternateY = fb.AlternateY
text.x = text.xDirection * ns.LS.xOffsets[fb.anim]
text.y = text.yDirection * ns.LS.yOffsets[fb.anim]
......@@ -282,6 +282,37 @@ function FCT:EnableMode(fb, parent, mode)
end
end
function FCT:SetOptions(fb, db)
fb.enable = db.enable
fb.font = db.font
fb.fontSize = db.fontSize
fb.fontOutline = db.fontOutline
fb.alternateIcon = db.alternateIcon
fb.shakeDuration = db.shakeDuration
fb.critShake = db.critShake
fb.textShake = db.textShake
fb.showIcon = fb.showIcon
fb.showName = fb.showName
fb.showHots = fb.showHots
fb.showDots = fb.showDots
fb.isTarget = fb.isTarget
fb.isPlayer = fb.isPlayer
fb.showPet = fb.showPet
fb.exclude = fb.exclude
fb.mode = db.mode
-- advanced animation settings
fb.anim = db.advanced.anim
fb.numTexts = db.advanced.numTexts
fb.radius = db.advanced.radius
fb.FadeTime = db.advanced.FadeTime
fb.ScrollTime = db.advanced.ScrollTime
fb.DirectionX = db.advanced.DirectionX
fb.DirectionY = db.advanced.DirectionY
fb.AlternateY = db.advanced.AlternateY
fb.AlternateX = db.advanced.AlternateX
end
--[[
function FCT:Hook(x)
local fb = x and x.Feedback
......
......@@ -115,14 +115,8 @@ FCT.options = {
name = " ",
width = "full"
},
numTexts = {
order = 18,
name = L["Text Amount"],
type = "range",
min = 1, max = 30, step = 1,
},
mode = {
order = 19,
order = 18,
name = L["Mode"],
type = "select",
values = {
......@@ -130,22 +124,76 @@ FCT.options = {
['LS'] = 'Animation'
},
},
anim = {
order = 20,
name = L["Animation"],
type = "select",
values = {
["fountain"] = L["Fountain"],
["vertical"] = L["Vertical"],
["horizontal"] = L["Horizontal"],
["diagonal"] = L["Diagonal"],
["static"] = L["Static"],
["random"] = L["Random"]
},
advanced = {
order = 19,
type = "group",
name = L["Advanced"],
guiInline = true,
args = {
numTexts = {
order = 1,
name = L["Text Amount"],
type = "range",
min = 1, max = 30, step = 1,
},
anim = {
order = 2,
name = L["Animation"],
type = "select",
values = {
["fountain"] = L["Fountain"],
["vertical"] = L["Vertical"],
["horizontal"] = L["Horizontal"],
["diagonal"] = L["Diagonal"],
["static"] = L["Static"],
["random"] = L["Random"]
},
},
radius = {
order = 3,
name = L["Radius"],
type = "range",
min = 0, max = 256, step = 1,
},
ScrollTime = {
order = 3,
name = L["Scroll Time"],
type = "range",
min = 0, max = 5, step = 0.1,
},
FadeTime = {
order = 4,
name = L["Fade Time"],
type = "range",
min = 0, max = 5, step = 0.1,
},
AlternateX = {
order = 1,
type = "toggle",
name = L["Alternate X"],
},
AlternateY = {
order = 1,
type = "toggle",
name = L["Alternate Y"],
},
DirectionX = {
order = 5,
name = L["Direction X"],
type = "range",
min = 0, max = 100, step = 1,
},
DirectionY = {
order = 6,
name = L["Direction Y"],
type = "range",
min = 0, max = 100, step = 1,
},
}
},
}
function FCT:AddOptions(arg1, arg2)
function FCT:AddOptions(arg1, arg2, arg3)
if E.Options.args.ElvFCT.args[arg1].args[arg2] then return end
if arg1 == 'colors' then
......@@ -163,6 +211,11 @@ function FCT:AddOptions(arg1, arg2)
set = function(info, value) FCT.db[arg1].frames[arg2][ info[#info] ] = value end,
args = FCT.options
}
if arg3 then
E.Options.args.ElvFCT.args[arg1].args[arg2].get = function(info) return FCT.db[arg1].frames[arg2][arg3][ info[#info] ] end
E.Options.args.ElvFCT.args[arg1].args[arg2].set = function(info, value) FCT.db[arg1].frames[arg2][arg3][ info[#info] ] = value end
end
end
end
......@@ -229,8 +282,12 @@ function FCT:Options()
for name in pairs(ns.defaults.nameplates.frames) do
FCT:AddOptions('nameplates', name)
end
for name in pairs(ns.defaults.unitframes.frames) do
FCT:AddOptions('unitframes', name)
for name, obj in pairs(ns.defaults.unitframes.frames) do
if type(obj) == 'table' then
FCT:AddOptions('unitframes', name, obj)
else
FCT:AddOptions('unitframes', name)
end
end
for index in pairs(ns.colors) do
FCT:AddOptions('colors', index)
......
......@@ -44,8 +44,6 @@ ns.frames = {
mode = 'Simpy',
alternateIcon = false,
shakeDuration = 0.25,
numTexts = 25,
anim = 'fountain',
critShake = false,
textShake = false,
showIcon = false,
......@@ -57,6 +55,17 @@ ns.frames = {
showPet = true,
exclude = {
[145109] = true, -- Ysera's Gift (self healing)
},
advanced = {
anim = 'fountain',
radius = 64,
numTexts = 25,
ScrollTime = 1.5,
FadeTime = 0.5,
DirectionX = 1,
DirectionY = 1,
AlternateX = true,
AlternateY = false,
}
}
......
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