From 1d8e657536a7307406df11d6e44a3e2a6cff09f5 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 12 Dec 2024 16:49:31 +0100 Subject: [PATCH] Add zones to deathreporter --- DeathReporter.lua | 11 +++++++++-- Heimdall.lua | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/DeathReporter.lua b/DeathReporter.lua index d0ef933..b5df9df 100644 --- a/DeathReporter.lua +++ b/DeathReporter.lua @@ -21,11 +21,18 @@ function data.DeathReporter.Init() end recentDeaths[destination] = GetTime() 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(destination), tostring(spellName), - tostring(overkill)) + tostring(overkill), + tostring(zone)) + ---@type Message local msg = { channel = "CHANNEL", diff --git a/Heimdall.lua b/Heimdall.lua index 6e1e1ad..a20b8bf 100644 --- a/Heimdall.lua +++ b/Heimdall.lua @@ -62,6 +62,7 @@ local function init() ---@field throttle number ---@field doWhisper boolean ---@field notifyChannel string + ---@field zoneOverride string? --- Data --- ---@class HeimdallMessengerData @@ -135,6 +136,7 @@ local function init() throttle = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "throttle" }, 10), doWhisper = data.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "doWhisper" }, true), 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" }, { -- "Extazyk",