Fix deathreporter
This commit is contained in:
@@ -92,7 +92,7 @@ local function init()
|
|||||||
---@field debug boolean
|
---@field debug boolean
|
||||||
---@field throttle number
|
---@field throttle number
|
||||||
---@field doWhisper boolean
|
---@field doWhisper boolean
|
||||||
---@field notifyChannel string
|
---@field masterChannel string
|
||||||
---@field zoneOverride string?
|
---@field zoneOverride string?
|
||||||
---@field duelThrottle number
|
---@field duelThrottle number
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ local function init()
|
|||||||
debug = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "debug" }, false),
|
debug = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "debug" }, false),
|
||||||
throttle = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "throttle" }, 10),
|
throttle = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "throttle" }, 10),
|
||||||
doWhisper = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "doWhisper" }, true),
|
doWhisper = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "doWhisper" }, true),
|
||||||
notifyChannel = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "notifyChannel" }, "Agent"),
|
masterChannel = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "masterChannel" }, "Agent"),
|
||||||
zoneOverride = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "zoneOverride" }, nil),
|
zoneOverride = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "zoneOverride" }, nil),
|
||||||
duelThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "duelThrottle" }, 5),
|
duelThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "deathReporter", "duelThrottle" }, 5),
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## Interface: 70300
|
## Interface: 70300
|
||||||
## Title: Heimdall
|
## Title: Heimdall
|
||||||
## Version: 3.2.2
|
## Version: 3.2.3
|
||||||
## Notes: Watches over areas and alerts when hostiles spotted
|
## Notes: Watches over areas and alerts when hostiles spotted
|
||||||
## Author: Cyka
|
## Author: Cyka
|
||||||
## SavedVariables: Heimdall_Data
|
## SavedVariables: Heimdall_Data
|
||||||
|
BIN
Heimdall.zip
(Stored with Git LFS)
BIN
Heimdall.zip
(Stored with Git LFS)
Binary file not shown.
@@ -842,20 +842,20 @@ function shared.Config.Init()
|
|||||||
end)
|
end)
|
||||||
deathReporterConfigFrame:Add(duelThrottle, 2, 6)
|
deathReporterConfigFrame:Add(duelThrottle, 2, 6)
|
||||||
|
|
||||||
local notifyChannel = CreateBasicSmallEditBox("HeimdallDeathReporterConfigNotifyChannel",
|
local masterChannel = CreateBasicSmallEditBox("HeimdallDeathReporterConfigMasterChannel",
|
||||||
deathReporterConfigFrame.frame, shared.L[Heimdall_Data.config.locale].config.notifyChannel,
|
deathReporterConfigFrame.frame, shared.L[Heimdall_Data.config.locale].config.masterChannel,
|
||||||
Heimdall_Data.config.deathReporter.notifyChannel,
|
Heimdall_Data.config.deathReporter.masterChannel,
|
||||||
function(self)
|
function(self)
|
||||||
local text = self:GetText()
|
local text = self:GetText()
|
||||||
if string.match(text, "%S+") then
|
if string.match(text, "%S+") then
|
||||||
Heimdall_Data.config.deathReporter.notifyChannel = text
|
Heimdall_Data.config.deathReporter.masterChannel = text
|
||||||
print("Notify channel set to", tostring(text))
|
print("Master channel set to", tostring(text))
|
||||||
else
|
else
|
||||||
print("Invalid channel name", tostring(text))
|
print("Invalid channel name", tostring(text))
|
||||||
self:SetText(Heimdall_Data.config.deathReporter.notifyChannel)
|
self:SetText(Heimdall_Data.config.deathReporter.masterChannel)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
deathReporterConfigFrame:Add(notifyChannel, 2, 6)
|
deathReporterConfigFrame:Add(masterChannel, 2, 6)
|
||||||
|
|
||||||
local zoneOverride = CreateBasicSmallEditBox("HeimdallDeathReporterConfigZoneOverride",
|
local zoneOverride = CreateBasicSmallEditBox("HeimdallDeathReporterConfigZoneOverride",
|
||||||
deathReporterConfigFrame.frame, shared.L[Heimdall_Data.config.locale].config.zoneOverride,
|
deathReporterConfigFrame.frame, shared.L[Heimdall_Data.config.locale].config.zoneOverride,
|
||||||
|
@@ -92,14 +92,6 @@ function shared.DeathReporter.Init()
|
|||||||
SetMapByID(GetCurrentMapAreaID())
|
SetMapByID(GetCurrentMapAreaID())
|
||||||
local zoneId = GetCurrentMapAreaID()
|
local zoneId = GetCurrentMapAreaID()
|
||||||
|
|
||||||
source = source or "unknown"
|
|
||||||
destination = destination or "unknown"
|
|
||||||
spellName = spellName or "unknown"
|
|
||||||
location = location or "unknown"
|
|
||||||
zoneId = zoneId or 0
|
|
||||||
x = x or 0
|
|
||||||
y = y or 0
|
|
||||||
|
|
||||||
---@type Message
|
---@type Message
|
||||||
local msg = {
|
local msg = {
|
||||||
channel = "CHANNEL",
|
channel = "CHANNEL",
|
||||||
@@ -187,7 +179,7 @@ function shared.DeathReporter.Init()
|
|||||||
local source, destination = string.match(msg, "([^ ]+) has defeated ([^ ]+) in a duel")
|
local source, destination = string.match(msg, "([^ ]+) has defeated ([^ ]+) in a duel")
|
||||||
if Heimdall_Data.config.deathReporter.debug then
|
if Heimdall_Data.config.deathReporter.debug then
|
||||||
print(string.format("[%s] Received system message: %s", ModuleName, msg))
|
print(string.format("[%s] Received system message: %s", ModuleName, msg))
|
||||||
print(string.format("[%s] Source: %s, Destination: %s", ModuleName, source, destination))
|
print(string.format("[%s] Source: %s, Destination: %s", ModuleName, tostring(source), tostring(destination)))
|
||||||
end
|
end
|
||||||
if not source or not destination then return end
|
if not source or not destination then return end
|
||||||
source = string.match(source, "([^-]+)")
|
source = string.match(source, "([^-]+)")
|
||||||
|
4
_L.lua
4
_L.lua
@@ -8,7 +8,7 @@ shared.L = {
|
|||||||
whoerNew = "%s %s of class %s, race %s (%s) and guild %s in %s, first seen: %s, last seen: %s, times seen: %d",
|
whoerNew = "%s %s of class %s, race %s (%s) and guild %s in %s, first seen: %s, last seen: %s, times seen: %d",
|
||||||
whoerMoved = "%s of class %s (%s - %s) and guild %s moved to %s",
|
whoerMoved = "%s of class %s (%s - %s) and guild %s moved to %s",
|
||||||
whoerGone = "%s of class %s and guild %s left %s",
|
whoerGone = "%s of class %s and guild %s left %s",
|
||||||
killed = "%s killed %s with %s in %s (%s) at [%s](%2.2f, %2.2f)",
|
killed = "%s killed %s with %s in %s at [%s](%2.2f, %2.2f)",
|
||||||
tidbits = {
|
tidbits = {
|
||||||
hostile = "hostile",
|
hostile = "hostile",
|
||||||
friendly = "friendly",
|
friendly = "friendly",
|
||||||
@@ -81,7 +81,7 @@ shared.L = {
|
|||||||
"%s %s класса %s, расы %s (%s) и гильдии %s в %s, первый раз видели: %s, последний раз видели: %s, раз видели: %d",
|
"%s %s класса %s, расы %s (%s) и гильдии %s в %s, первый раз видели: %s, последний раз видели: %s, раз видели: %d",
|
||||||
whoerMoved = "%s класса %s (%s - %s) и гильдии %s переместился в %s",
|
whoerMoved = "%s класса %s (%s - %s) и гильдии %s переместился в %s",
|
||||||
whoerGone = "%s класса %s и гильдии %s покинул %s",
|
whoerGone = "%s класса %s и гильдии %s покинул %s",
|
||||||
killed = "%s убил %s с %s в %s (%s) на [%s](%2.2f, %2.2f)",
|
killed = "%s убил %s с %s в %s на [%s](%2.2f, %2.2f)",
|
||||||
-- A lot of this shit I get straight from the API in english (my locale)
|
-- A lot of this shit I get straight from the API in english (my locale)
|
||||||
-- So there is no need to translate it from english to english
|
-- So there is no need to translate it from english to english
|
||||||
tidbits = {
|
tidbits = {
|
||||||
|
Reference in New Issue
Block a user