Add zones to deathreporter

This commit is contained in:
2024-12-12 16:49:31 +01:00
parent 4d5a7e2706
commit 1d8e657536
2 changed files with 11 additions and 2 deletions

View File

@@ -21,11 +21,18 @@ function data.DeathReporter.Init()
end end
recentDeaths[destination] = GetTime() recentDeaths[destination] = GetTime()
local timer = C_Timer.After(1, function() local timer = C_Timer.After(1, function()
local text = string.format("%s killed %s with %s (%d)", local zone = data.config.deathReporter.zoneOverride
if not zone then
zone = string.format("%s (%s)", GetZoneText(), GetSubZoneText())
end
local text = string.format("%s killed %s with %s (%d) in %s",
tostring(source), tostring(source),
tostring(destination), tostring(destination),
tostring(spellName), tostring(spellName),
tostring(overkill)) tostring(overkill),
tostring(zone))
---@type Message ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "CHANNEL",

View File

@@ -62,6 +62,7 @@ local function init()
---@field throttle number ---@field throttle number
---@field doWhisper boolean ---@field doWhisper boolean
---@field notifyChannel string ---@field notifyChannel string
---@field zoneOverride string?
--- Data --- --- Data ---
---@class HeimdallMessengerData ---@class HeimdallMessengerData
@@ -135,6 +136,7 @@ local function init()
throttle = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "throttle" }, 10), throttle = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "throttle" }, 10),
doWhisper = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "doWhisper" }, true), doWhisper = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "doWhisper" }, true),
notifyChannel = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "notifyChannel" }, "Foobar"), notifyChannel = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "notifyChannel" }, "Foobar"),
zoneOverride = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "zoneOverride" }, nil),
}, },
whisperNotify = data.GetOrDefault(Heimdall_Data, { "config", "whisperNotify" }, { whisperNotify = data.GetOrDefault(Heimdall_Data, { "config", "whisperNotify" }, {
-- "Extazyk", -- "Extazyk",