Clean up the modules a little
This commit is contained in:
2
Meta
2
Meta
Submodule Meta updated: 859955aa36...ba3bf263d6
@@ -1,10 +1,9 @@
|
||||
local addonname, shared = ...
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
---@cast addonname string
|
||||
local ModuleName = "AchievementSniffer"
|
||||
|
||||
local HeimdallRoot = "Interface\\AddOns\\Heimdall\\"
|
||||
local TextureRoot = HeimdallRoot .. "Texture\\"
|
||||
-- local HeimdallRoot = "Interface\\AddOns\\Heimdall\\"
|
||||
-- local TextureRoot = HeimdallRoot .. "Texture\\"
|
||||
|
||||
local Achievements = {
|
||||
15,
|
||||
|
@@ -1,6 +1,5 @@
|
||||
local addonname, shared = ...
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
---@cast addonname string
|
||||
local ModuleName = "AgentTracker"
|
||||
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
@@ -37,7 +36,7 @@ function shared.AgentTracker.Init()
|
||||
|
||||
local newAgents = 0
|
||||
for i = 1, count do
|
||||
local name = GetChannelRosterInfo(index, i)
|
||||
name = GetChannelRosterInfo(index, i)
|
||||
if name then
|
||||
local isNewAgent = not Heimdall_Data.config.agents[name]
|
||||
Heimdall_Data.config.agents[name] = date("%Y-%m-%dT%H:%M:%S")
|
||||
|
@@ -1,6 +1,5 @@
|
||||
local addonname, shared = ...
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
---@cast addonname string
|
||||
local ModuleName = "BonkDetector"
|
||||
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
@@ -30,14 +29,23 @@ function shared.BonkDetector.Init()
|
||||
return
|
||||
end
|
||||
|
||||
local source, err = CLEUParser.GetSourceName(...)
|
||||
---@type string|nil, string, string, string, string
|
||||
local err, source, sourceGUID, destination, destinationGUID
|
||||
|
||||
source, err = CLEUParser.GetSourceName(...)
|
||||
if err then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Error getting source name: %s", ModuleName, err))
|
||||
end
|
||||
return
|
||||
end
|
||||
local sourceGUID = CLEUParser.GetSourceGUID(...)
|
||||
sourceGUID, err = CLEUParser.GetSourceGUID(...)
|
||||
if err then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Error getting source GUID: %s", ModuleName, err))
|
||||
end
|
||||
return
|
||||
end
|
||||
if not string.find(sourceGUID, "Player") then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Source %s is not a player, nothing to do", ModuleName, source))
|
||||
@@ -45,14 +53,20 @@ function shared.BonkDetector.Init()
|
||||
return
|
||||
end
|
||||
|
||||
local destination, err = CLEUParser.GetDestName(...)
|
||||
destination, err = CLEUParser.GetDestName(...)
|
||||
if err then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Error getting destination name: %s", ModuleName, err))
|
||||
end
|
||||
return
|
||||
end
|
||||
local destinationGUID = CLEUParser.GetDestGUID(...)
|
||||
destinationGUID, err = CLEUParser.GetDestGUID(...)
|
||||
if err then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Error getting destination GUID: %s", ModuleName, err))
|
||||
end
|
||||
return
|
||||
end
|
||||
if not string.find(destinationGUID, "Player") then
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Destination %s is not a player, nothing to do", ModuleName, destination))
|
||||
|
@@ -1,6 +1,5 @@
|
||||
local addonname, shared = ...
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
---@cast addonname string
|
||||
local ModuleName = "Bully"
|
||||
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
|
@@ -1,6 +1,5 @@
|
||||
local addonname, shared = ...
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
---@cast addonname string
|
||||
local ModuleName = "CombatAlerter"
|
||||
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
@@ -20,7 +19,10 @@ function shared.CombatAlerter.Init()
|
||||
return
|
||||
end
|
||||
|
||||
local destination, err = CLEUParser.GetDestName(...)
|
||||
---@type string|nil, string, string
|
||||
local err, source, destination
|
||||
|
||||
destination, err = CLEUParser.GetDestName(...)
|
||||
if err then
|
||||
if Heimdall_Data.config.combatAlerter.debug then
|
||||
print(string.format("[%s] Error getting destination: %s", ModuleName, err))
|
||||
@@ -39,7 +41,7 @@ function shared.CombatAlerter.Init()
|
||||
return
|
||||
end
|
||||
|
||||
local source, err = CLEUParser.GetSourceName(...)
|
||||
source, err = CLEUParser.GetSourceName(...)
|
||||
if err then
|
||||
if Heimdall_Data.config.combatAlerter.debug then
|
||||
print(string.format("[%s] Error getting source, using 'unknown': %s", ModuleName, err))
|
||||
|
@@ -1,6 +1,5 @@
|
||||
local addonname, shared = ...
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
---@cast addonname string
|
||||
local ModuleName = "Commander"
|
||||
|
||||
local helpMessages = {
|
||||
@@ -78,6 +77,7 @@ function shared.Commander.Init()
|
||||
local function CountPartitioned(arr)
|
||||
local count = Count(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(count)), 200)) do
|
||||
text[#text + 1] = line
|
||||
end
|
||||
@@ -108,6 +108,7 @@ function shared.Commander.Init()
|
||||
local function WhoPartitioned(arr)
|
||||
local who = Who(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(who)), 200)) do
|
||||
text[#text + 1] = "who: " .. line
|
||||
end
|
||||
@@ -134,6 +135,7 @@ function shared.Commander.Init()
|
||||
local function CountClassPartitioned(arr)
|
||||
local countClass = CountClass(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(countClass)), 200)) do
|
||||
text[#text + 1] = line
|
||||
end
|
||||
@@ -212,6 +214,7 @@ function shared.Commander.Init()
|
||||
---@param args string[]
|
||||
local function MacroTarget(args)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
print(string.format("[%s] Macroing: %s", ModuleName, strjoin(" ", unpack(args))))
|
||||
end
|
||||
if #args < 2 or #args % 2 ~= 0 then
|
||||
@@ -313,13 +316,15 @@ function shared.Commander.Init()
|
||||
)
|
||||
then
|
||||
if msg:match(command.keywordRe) then
|
||||
---@diagnostic disable-next-line: redundant-parameter Currently luals does not support variadic functions as a @field
|
||||
local messages = command.callback({ strsplit(",", msg) })
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
print(string.format("[%s] Messages to send: %s", ModuleName, strjoin(", ", unpack(messages))))
|
||||
end
|
||||
for _, message in ipairs(messages) do
|
||||
---@type Message
|
||||
local msg = {
|
||||
local returnmsg = {
|
||||
channel = "C",
|
||||
data = channelname,
|
||||
message = message,
|
||||
@@ -329,7 +334,7 @@ function shared.Commander.Init()
|
||||
shared.dumpTable(msg)
|
||||
end
|
||||
--table.insert(shared.messenger.queue, msg)
|
||||
table.insert(shared.networkMessenger.queue, msg)
|
||||
table.insert(shared.networkMessenger.queue, returnmsg)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -66,16 +66,16 @@ local function MapFromString(str, deliminer, terminator)
|
||||
end
|
||||
return map
|
||||
end
|
||||
---@param map table<any, any>
|
||||
---@param deliminer string
|
||||
---@return string
|
||||
local function MapValueToString(map, deliminer)
|
||||
local str = ""
|
||||
for _, v in pairs(map) do
|
||||
str = str .. tostring(v) .. deliminer
|
||||
end
|
||||
return str
|
||||
end
|
||||
-- ---@param map table<any, any>
|
||||
-- ---@param deliminer string
|
||||
-- ---@return string
|
||||
-- local function MapValueToString(map, deliminer)
|
||||
-- local str = ""
|
||||
-- for _, v in pairs(map) do
|
||||
-- str = str .. tostring(v) .. deliminer
|
||||
-- end
|
||||
-- return str
|
||||
-- end
|
||||
|
||||
---@class GridFrame:Frame
|
||||
---@field name string
|
||||
|
@@ -1,6 +1,5 @@
|
||||
local addonname, shared = ...
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
---@cast addonname string
|
||||
local ModuleName = "Emoter"
|
||||
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
|
Reference in New Issue
Block a user