Commit 81be9372 authored by Simpy's avatar Simpy 🐹

todo 1 add number style (comma, short, none)

parent 2c079692
......@@ -12,6 +12,7 @@ local bit, type, unpack, next = bit, type, unpack, next
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
local buln = BreakUpLargeNumbers
ns.objects, ns.spells, ns.color = {}, {}, {}
ns.CT = E:CopyTable({}, _G.CombatFeedbackText)
......@@ -123,6 +124,16 @@ function FCT:GP(a)
end
end
function FCT:Prefix(style, number)
if style == 'BLIZZARD' then
return buln(number)
elseif style == 'SHORT' then
return E:ShortValue(number)
else
return number
end
end
function FCT:Update(frame, fb)
local a, b, c, d -- amount, critical, spellSchool, dmgColor
local _, e, _, f, _, _, _, g, _, _, _, h, _, i, j, _, _, k, _, _, l = info()
......@@ -209,7 +220,7 @@ function FCT:Update(frame, fb)
text:FontTemplate(fb.font, fb.fontSize + (b and 4 or 0), fb.fontOutline)
text:SetTextColor(unpack(d or (ns.CT[a] and ns.color[00]) or FCT:GP(c) or ns.color[01]))
text:SetText(ns.CT[a] or a)
text:SetText(ns.CT[a] or FCT:Prefix(fb.numberStyle, a))
text:Show()
if b then
......@@ -325,6 +336,7 @@ function FCT:SetOptions(fb, db)
fb.fontOutline = db.fontOutline
fb.alternateIcon = db.alternateIcon
fb.shakeDuration = db.shakeDuration
fb.numberStyle = db.numberStyle
fb.critShake = db.critShake
fb.textShake = db.textShake
fb.showIcon = db.showIcon
......
......@@ -77,8 +77,15 @@ FCT.options = {
mode = { order = 1, name = L["Mode"], type = "select",
values = { ['Simpy'] = L["Fade"], ['LS'] = L["Animation"] },
},
iconSize = { order = 2, name = L["Icon Size"], type = "range", min = 10, max = 30, step = 1 },
shakeDuration = { order = 3, name = L["Shake Duration"], type = "range", min = 0, max = 1, step = 0.1 },
numberStyle = { order = 2, name = L["Number Style"], type = "select",
values = {
['NONE'] = _G.NONE,
['SHORT'] = L["Short"],
['BLIZZARD'] = L["Blizzard"],
},
},
iconSize = { order = 3, name = L["Icon Size"], type = "range", min = 10, max = 30, step = 1 },
shakeDuration = { order = 4, name = L["Shake Duration"], type = "range", min = 0, max = 1, step = 0.1 },
}
},
offsets = {
......
......@@ -110,6 +110,7 @@ ns.frames = {
isPlayer = true,
showPet = true,
iconSize = 16,
numberStyle = 'SHORT',
textY = 0,
textX = 0,
iconY = 0,
......
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