Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Locales/deDE.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local L = LibStub("AceLocale-3.0"):NewLocale("NameplateSCT", "deDE")
if not L then return end

L["Fireworks Settings"] = "Fireworks Settings"
L["Fireworks Duration"] = "Fireworks Duration"
L["Duration of the fireworks animation"] = "Duration of the fireworks animation"

--L["Unfortunately Blizzard has not added a SCT API in Midnight, until they do this addon will not have any functionality."]
--L["If you want to enable or disable the blizzard SCT you can do so here"] = true
--L["Thank you for the years of support, and hopefully we'll be able to bring NameplateSCT back in the future! - Justwait"] = true
Expand Down Expand Up @@ -53,6 +57,9 @@ L["Enable"] = "Aktivieren"
--L["Font Flags"] = "Font Flags"
L["Font"] = "Schriftart"
--L["Fountain"] = "Fountain"
L["Fireworks"] = "Feuerwerk"
L["Fireworks Radius"] = "Fireworks Radius"
L["Start radius for fireworks animation"] = "Start radius for fireworks animation"
--L["Has soft max/min, you can type whatever you'd like into the editbox"] = "Has soft max/min, you can type whatever you'd like into the editbox"
--L["Hide hits that are below a running average of your recent damage output"] = "Hide hits that are below a running average of your recent damage output"
--L["Hide hits that are below this threshold."] = "Hide hits that are below this threshold."
Expand Down
6 changes: 6 additions & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ L["Filters"] = true
L["Font Flags"] = true
L["Font"] = true
L["Fountain"] = true
L["Fireworks"] = true
L["Fireworks Radius"] = true
L["Fireworks Settings"] = true
L["Fireworks Duration"] = true
L["Duration of the fireworks animation"] = true
L["Start radius for fireworks animation"] = true
L["Has soft max/min, you can type whatever you'd like into the editbox"] = true
L["Hide hits that are below a running average of your recent damage output"] = true
L["Hide hits that are below this threshold."] = true
Expand Down
7 changes: 7 additions & 0 deletions Locales/esES.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local L = LibStub("AceLocale-3.0"):NewLocale("NameplateSCT", "esES")
if not L then return end

L["Fireworks Settings"] = "Fireworks Settings"
L["Fireworks Duration"] = "Fireworks Duration"
L["Duration of the fireworks animation"] = "Duration of the fireworks animation"

--L["Unfortunately Blizzard has not added a SCT API in Midnight, until they do this addon will not have any functionality."]
--L["If you want to enable or disable the blizzard SCT you can do so here"] = true
--L["Thank you for the years of support, and hopefully we'll be able to bring NameplateSCT back in the future! - Justwait"] = true
Expand Down Expand Up @@ -53,6 +57,9 @@ L["Display only the icon for damage.\nWill not change Miss, Dodge, Parry, etc di
--L["Font Flags"] = "Font Flags"
--L["Font"] = "Font"
--L["Fountain"] = "Fountain"
L["Fireworks"] = "Fuegos artificiales"
L["Fireworks Radius"] = "Fireworks Radius"
L["Start radius for fireworks animation"] = "Start radius for fireworks animation"
--L["Has soft max/min, you can type whatever you'd like into the editbox"] = "Has soft max/min, you can type whatever you'd like into the editbox"
--L["Hide hits that are below a running average of your recent damage output"] = "Hide hits that are below a running average of your recent damage output"
--L["Hide hits that are below this threshold."] = "Hide hits that are below this threshold."
Expand Down
7 changes: 7 additions & 0 deletions Locales/esMX.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local L = LibStub("AceLocale-3.0"):NewLocale("NameplateSCT", "esMX")
if not L then return end

L["Fireworks Settings"] = "Fireworks Settings"
L["Fireworks Duration"] = "Fireworks Duration"
L["Duration of the fireworks animation"] = "Duration of the fireworks animation"

--L["Unfortunately Blizzard has not added a SCT API in Midnight, until they do this addon will not have any functionality."]
--L["If you want to enable or disable the blizzard SCT you can do so here"] = true
--L["Thank you for the years of support, and hopefully we'll be able to bring NameplateSCT back in the future! - Justwait"] = true
Expand Down Expand Up @@ -53,6 +57,9 @@ if not L then return end
--L["Font Flags"] = "Font Flags"
--L["Font"] = "Font"
--L["Fountain"] = "Fountain"
L["Fireworks"] = "Fuegos artificiales"
L["Fireworks Radius"] = "Fireworks Radius"
L["Start radius for fireworks animation"] = "Start radius for fireworks animation"
--L["Has soft max/min, you can type whatever you'd like into the editbox"] = "Has soft max/min, you can type whatever you'd like into the editbox"
--L["Hide hits that are below a running average of your recent damage output"] = "Hide hits that are below a running average of your recent damage output"
--L["Hide hits that are below this threshold."] = "Hide hits that are below this threshold."
Expand Down
7 changes: 7 additions & 0 deletions Locales/frFR.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local L = LibStub("AceLocale-3.0"):NewLocale("NameplateSCT", "frFR")
if not L then return end

L["Fireworks Settings"] = "Fireworks Settings"
L["Fireworks Duration"] = "Fireworks Duration"
L["Duration of the fireworks animation"] = "Duration of the fireworks animation"

--L["Unfortunately Blizzard has not added a SCT API in Midnight, until they do this addon will not have any functionality."]
--L["If you want to enable or disable the blizzard SCT you can do so here"] = true
--L["Thank you for the years of support, and hopefully we'll be able to bring NameplateSCT back in the future! - Justwait"] = true
Expand Down Expand Up @@ -53,6 +57,9 @@ L["Evaded"] = "Évité"
--L["Font Flags"] = "Font Flags"
L["Font"] = "Police de caractère"
L["Fountain"] = "Fontaine"
L["Fireworks"] = "Feux d'artifice"
L["Fireworks Radius"] = "Fireworks Radius"
L["Start radius for fireworks animation"] = "Start radius for fireworks animation"
--L["Has soft max/min, you can type whatever you'd like into the editbox"] = "Has soft max/min, you can type whatever you'd like into the editbox"
L["Hide hits that are below a running average of your recent damage output"] = "Cacher les dégâts qui sont en dessous de la moyenne des dégâts récents"
--L["Hide hits that are below this threshold."] = "Hide hits that are below this threshold."
Expand Down
7 changes: 7 additions & 0 deletions Locales/koKR.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local L = LibStub("AceLocale-3.0"):NewLocale("NameplateSCT", "koKR")
if not L then return end

L["Fireworks Settings"] = "Fireworks Settings"
L["Fireworks Duration"] = "Fireworks Duration"
L["Duration of the fireworks animation"] = "Duration of the fireworks animation"

--L["Unfortunately Blizzard has not added a SCT API in Midnight, until they do this addon will not have any functionality."]
--L["If you want to enable or disable the blizzard SCT you can do so here"] = true
--L["Thank you for the years of support, and hopefully we'll be able to bring NameplateSCT back in the future! - Justwait"] = true
Expand Down Expand Up @@ -53,6 +57,9 @@ L["Evaded"] = "벗어남"
L["Font Flags"] = "글꼴 외곽선"
L["Font"] = "글꼴"
L["Fountain"] = "분수"
L["Fireworks"] = "불꽃놀이"
L["Fireworks Radius"] = "Fireworks Radius"
L["Start radius for fireworks animation"] = "Start radius for fireworks animation"
L["Has soft max/min, you can type whatever you'd like into the editbox"] = "최대/최소 값이 있습니다, 입력창에 원하는 값을 입력할 수 있습니다."
L["Hide hits that are below a running average of your recent damage output"] = "피해량이 최근 피해량의 평균보다 낮으면 숨깁니다"
--L["Hide hits that are below this threshold."] = "Hide hits that are below this threshold."
Expand Down
7 changes: 7 additions & 0 deletions Locales/ruRU.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local L = LibStub("AceLocale-3.0"):NewLocale("NameplateSCT", "ruRU")
if not L then return end

L["Fireworks Settings"] = "Fireworks Settings"
L["Fireworks Duration"] = "Fireworks Duration"
L["Duration of the fireworks animation"] = "Duration of the fireworks animation"

--L["Unfortunately Blizzard has not added a SCT API in Midnight, until they do this addon will not have any functionality."]
--L["If you want to enable or disable the blizzard SCT you can do so here"] = true
--L["Thank you for the years of support, and hopefully we'll be able to bring NameplateSCT back in the future! - Justwait"] = true
Expand Down Expand Up @@ -53,6 +57,9 @@ L["Evaded"] = "Избежание"
L["Font Flags"] = "Параметры шрифта"
L["Font"] = "Шрифт"
L["Fountain"] = "Фонтан"
L["Fireworks"] = "Фейерверк"
L["Fireworks Radius"] = "Fireworks Radius"
L["Start radius for fireworks animation"] = "Start radius for fireworks animation"
L["Has soft max/min, you can type whatever you'd like into the editbox"] = "Имеет неограниченный минимум/максимум, можно ввести любое число в поле ввода"
L["Hide hits that are below a running average of your recent damage output"] = "Скрыть слабые удары, которые ниже среднего урона персонажа"
--L["Hide hits that are below this threshold."] = "Hide hits that are below this threshold."
Expand Down
7 changes: 7 additions & 0 deletions Locales/zhCN.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local L = LibStub("AceLocale-3.0"):NewLocale("NameplateSCT", "zhCN")
if not L then return end

L["Fireworks Settings"] = "烟花设置"
L["Fireworks Duration"] = "烟花持续时间"
L["Duration of the fireworks animation"] = "烟花动画的持续时间"

L["Unfortunately Blizzard has not added a SCT API in Midnight, until they do this addon will not have any functionality."] = "不幸的是,暴雪在《至暗之夜》版本中仍未添加浮动战斗文字的相关API。在实现此功能前,该插件将无法正常运行。"
L["If you want to enable or disable the blizzard SCT you can do so here"] = "如需启用或禁用暴雪浮动战斗文字(SCT),可在此处设置"
L["Thank you for the years of support, and hopefully we'll be able to bring NameplateSCT back in the future! - Justwait"] = "感谢大家多年来的支持,希望未来我们能重新推出NameplateSCT!- Justwait"
Expand Down Expand Up @@ -53,6 +57,9 @@ L["Filters"] = "过滤器"
L["Font Flags"] = "字体描边"
L["Font"] = "字体"
L["Fountain"] = "弧形"
L["Fireworks"] = "烟花"
L["Fireworks Radius"] = "烟花起始半径"
L["Start radius for fireworks animation"] = "烟花动画的起始半径"
L["Has soft max/min, you can type whatever you'd like into the editbox"] = "有最大值/最小值限制,可在输入框中输入规则内的任意数值"
L["Hide hits that are below a running average of your recent damage output"] = "隐藏低于最近攻击平均值的伤害"
L["Hide hits that are below this threshold."] = "隐藏低于此阈值的命中伤害。"
Expand Down
7 changes: 7 additions & 0 deletions Locales/zhTW.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
local L = LibStub("AceLocale-3.0"):NewLocale("NameplateSCT", "zhTW")
if not L then return end

L["Fireworks Settings"] = "煙火設定"
L["Fireworks Duration"] = "煙火持續時間"
L["Duration of the fireworks animation"] = "煙火動畫的持續時間"

--L["Unfortunately Blizzard has not added a SCT API in Midnight, until they do this addon will not have any functionality."]
--L["If you want to enable or disable the blizzard SCT you can do so here"] = true
--L["Thank you for the years of support, and hopefully we'll be able to bring NameplateSCT back in the future! - Justwait"] = true
Expand Down Expand Up @@ -53,6 +57,9 @@ L["Filters"] = "過濾器"
L["Font Flags"] = "文字樣式"
L["Font"] = "字體"
L["Fountain"] = "潮吹噴泉"
L["Fireworks"] = "煙花"
L["Fireworks Radius"] = "煙火起始半徑"
L["Start radius for fireworks animation"] = "煙火動畫的起始半徑"
L["Has soft max/min, you can type whatever you'd like into the editbox"] = "有軟上限 / 下限,請隨意輸入喜愛的數值。"
L["Hide hits that are below a running average of your recent damage output"] = "隱藏低於最近輸出平均值的傷害。"
L["Hide hits that are below this threshold."] = "隱藏低於此閥值的命中。"
Expand Down
136 changes: 129 additions & 7 deletions NameplateSCT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ local animationValues = {
["verticalDown"] = L["Vertical Down"],
["fountain"] = L["Fountain"],
["rainfall"] = L["Rainfall"],
["fireworks"] = L["Fireworks"],
["disabled"] = L["Disabled"]
}

Expand Down Expand Up @@ -172,6 +173,8 @@ local defaults = {
autoattack = "fountain",
autoattackcrit = "verticalUp",
animationspeed = 1,
fireworksRadius = 100,
fireworksDuration = 1,
},

animationsPersonal = {
Expand Down Expand Up @@ -583,6 +586,56 @@ local function powSizing(elapsed, duration, start, middle, finish)
return size
end

-- CSS linear() points
local linearPoints = {
{0, 0},
{0.036, 0.21},
{0.074, 0.402},
{0.113, 0.568},
{0.153, 0.711},
{0.173, 0.772},
{0.194, 0.83},
{0.215, 0.882},
{0.237, 0.929},
{0.259, 0.97},
{0.282, 1.008},
{0.306, 1.04},
{0.33, 1.067},
{0.349, 1.084},
{0.369, 1.099},
{0.389, 1.111},
{0.41, 1.12},
{0.432, 1.127},
{0.454, 1.13},
{0.477, 1.132},
{0.501, 1.13},
{0.54, 1.124},
{0.585, 1.111},
{0.629, 1.095},
{0.755, 1.044},
{0.795, 1.03},
{0.832, 1.019},
{0.873, 1.01},
{0.913, 1.004},
{0.954, 1.001},
{1, 1}
}

local function GetLinearEasing(p)
if p <= 0 then return linearPoints[1][2] end
if p >= 1 then return linearPoints[#linearPoints][2] end

for i = 1, #linearPoints - 1 do
local p1 = linearPoints[i]
local p2 = linearPoints[i+1]
if p >= p1[1] and p < p2[1] then
local percent = (p - p1[1]) / (p2[1] - p1[1])
return p1[2] + (p2[2] - p1[2]) * percent
end
end
return linearPoints[#linearPoints][2]
end

local function AnimationOnUpdate()
if (next(animating)) then
for fontString, _ in pairs(animating) do
Expand Down Expand Up @@ -656,15 +709,32 @@ local function AnimationOnUpdate()
_, yOffset = verticalPath(elapsed, fontString.animatingDuration, -fontString.distance)
xOffset = fontString.rainfallX
yOffset = yOffset + fontString.rainfallStartY
elseif (fontString.animation == "fireworks") then
-- 烟花效果:从配置的起始半径圆周向四周发散
local angle = fontString.fireworksAngle or (math.random() * 2 * math.pi)
local progress = elapsed / fontString.animatingDuration
-- 使用自定义的 linear() 缓动函数
local easedProgress = GetLinearEasing(progress)
local distance = (fontString.fireworksDistance or 100) * easedProgress

-- 获取配置的起始半径
local startRadius = NameplateSCT.db.global.animations.fireworksRadius
xOffset = (startRadius + distance) * math.cos(angle)
yOffset = (startRadius + distance) * math.sin(angle)
-- elseif (fontString.animation == "shake") then
-- TODO
end

if (not UnitIsDead(fontString.unit) and fontString.anchorFrame and fontString.anchorFrame:IsShown()) then
if fontString.unit == "player" then -- player frame
fontString:SetPoint("CENTER", fontString.anchorFrame, "CENTER", NameplateSCT.db.global.xOffsetPersonal + xOffset + randomX[fontString], NameplateSCT.db.global.yOffsetPersonal + yOffset + randomY[fontString]) -- Only allows for adjusting vertical offset
else -- nameplate frames
fontString:SetPoint("CENTER", fontString.anchorFrame, "CENTER", NameplateSCT.db.global.xOffset + xOffset + randomX[fontString], NameplateSCT.db.global.yOffset + yOffset + randomY[fontString])
if fontString.animation == "fireworks" then
-- 烟花效果忽略全局偏移和随机抖动,始终相对于中心
fontString:SetPoint("CENTER", fontString.anchorFrame, "CENTER", xOffset, yOffset)
else
if fontString.unit == "player" then -- player frame
fontString:SetPoint("CENTER", fontString.anchorFrame, "CENTER", NameplateSCT.db.global.xOffsetPersonal + xOffset + randomX[fontString], NameplateSCT.db.global.yOffsetPersonal + yOffset + randomY[fontString]) -- Only allows for adjusting vertical offset
else -- nameplate frames
fontString:SetPoint("CENTER", fontString.anchorFrame, "CENTER", NameplateSCT.db.global.xOffset + xOffset + randomX[fontString], NameplateSCT.db.global.yOffset + yOffset + randomY[fontString])
end
end
else
recycleFontString(fontString)
Expand Down Expand Up @@ -703,6 +773,9 @@ function NameplateSCT:Animate(fontString, anchorFrame, duration, animation)
fontString.distance = math.random(ANIMATION_RAINFALL_Y_MIN, ANIMATION_RAINFALL_Y_MAX)
fontString.rainfallX = math.random(-ANIMATION_RAINFALL_X_MAX, ANIMATION_RAINFALL_X_MAX)
fontString.rainfallStartY = -math.random(ANIMATION_RAINFALL_Y_START_MIN, ANIMATION_RAINFALL_Y_START_MAX)
elseif (animation == "fireworks") then
fontString.fireworksAngle = math.random() * 2 * math.pi
fontString.fireworksDistance = math.random(80, 150)
-- elseif (animation == "shake") then
-- fontString.deflection = ANIMATION_SHAKE_DEFLECTION
-- fontString.numShakes = ANIMATION_SHAKE_NUM_SHAKES
Expand Down Expand Up @@ -1135,7 +1208,11 @@ function NameplateSCT:DisplayText(guid, text, size, animation, spellId, pow, spe
end
end
end
self:Animate(fontString, nameplate, NameplateSCT.db.global.animations.animationspeed, animation)
local duration = NameplateSCT.db.global.animations.animationspeed
if animation == "fireworks" then
duration = NameplateSCT.db.global.animations.fireworksDuration
end
self:Animate(fontString, nameplate, duration, animation)
end

function NameplateSCT:DisplayIconWithoutText(guid, size, animation, spellId, pow, spellName)
Expand Down Expand Up @@ -1201,7 +1278,11 @@ function NameplateSCT:DisplayIconWithoutText(guid, size, animation, spellId, pow
end
end
end
self:Animate(fontString, nameplate, NameplateSCT.db.global.animations.animationspeed, animation)
local duration = NameplateSCT.db.global.animations.animationspeed
if animation == "fireworks" then
duration = NameplateSCT.db.global.animations.fireworksDuration
end
self:Animate(fontString, nameplate, duration, animation)
end

function NameplateSCT:DisplayTextOverkill(guid, text, size, animation, spellId, pow, spellName)
Expand Down Expand Up @@ -1263,7 +1344,11 @@ function NameplateSCT:DisplayTextOverkill(guid, text, size, animation, spellId,
end
end
end
self:Animate(fontString, nameplate, NameplateSCT.db.global.animations.animationspeed, animation)
local duration = NameplateSCT.db.global.animations.animationspeed
if animation == "fireworks" then
duration = NameplateSCT.db.global.animations.fireworksDuration
end
self:Animate(fontString, nameplate, duration, animation)
end

function NameplateSCT:ColorText(startingText, guid, playerGUID, school, spellName, crit)
Expand Down Expand Up @@ -1416,6 +1501,43 @@ local menu = {
order = 1,
width = "full",
},
fireworksSettings = {
type = 'header',
name = L["Fireworks Settings"],
order = 1.2,
},
fireworksRadius = {
type = 'range',
name = L["Fireworks Radius"],
desc = L["Start radius for fireworks animation"],
disabled = function() return not NameplateSCT.db.global.enabled end,
min = 0,
max = 200,
step = 20,
get = function() return NameplateSCT.db.global.animations.fireworksRadius end,
set = function(_, newValue) NameplateSCT.db.global.animations.fireworksRadius = newValue end,
order = 1.3,
width = "normal",
},
fireworksDuration = {
type = 'range',
name = L["Fireworks Duration"],
desc = L["Duration of the fireworks animation"],
disabled = function() return not NameplateSCT.db.global.enabled end,
min = 0.5,
max = 3,
step = 0.5,
get = function() return NameplateSCT.db.global.animations.fireworksDuration end,
set = function(_, newValue) NameplateSCT.db.global.animations.fireworksDuration = newValue end,
order = 1.4,
width = "normal",
},
fireworksSpacer = {
type = 'description',
name = "",
order = 1.5,
width = "full",
},
ability = {
type = 'select',
name = L["Abilities"],
Expand Down