14 Commits

30 changed files with 231 additions and 80 deletions

1
.gitignore vendored
View File

@@ -0,0 +1 @@
*.zip

View File

@@ -1 +1,5 @@
C:/Users/Administrator/Seafile/Games-WoW/Ruski/Interface/AddOns/Heimdall/Meta/.luacheckrc
globals = { "CykaPersistentData", "CreateFrame", "GetItemInfo", "aura_env" }
unused_args = false
max_line_length = 150
exclude_files = { "Meta/" }
global = false

View File

@@ -1 +1,14 @@
C:/Users/Administrator/Seafile/Games-WoW/Ruski/Interface/AddOns/Heimdall/Meta/.luarc.json
{
"workspace": {
"library": [
"./Meta"
]
},
"diagnostics.disable": [
"unused-local",
"unused-vararg"
],
"diagnostics.globals": [
"aura_env"
]
}

View File

@@ -2,7 +2,7 @@ local addonname, shared = ...
---@cast shared HeimdallShared
---@cast addonname string
local VERSION = "3.11.0"
local VERSION = "3.12.0"
shared.VERSION = VERSION
local function init()
@@ -26,7 +26,7 @@ local function init()
---@field _L fun(key: string, locale: string): string
---@field _Locale Localization
---@field VERSION string
---@field dumpTable fun(table: any, depth?: number): nil
---@field dump fun(table: any, depth?: number): nil
---@field utf8len fun(input: string): number
---@field padString fun(input: string, targetLength: number, left?: boolean): string
---@field GetOrDefault fun(table: table<any, any>, keys: string[], default: any): any
@@ -59,6 +59,7 @@ local function init()
---@field StinkyCache InitTable
---@field Configurator InitTable
---@field AchievementSniffer InitTable
---@field ChatSniffer InitTable
--- Config ---
---@class HeimdallConfig
@@ -271,11 +272,11 @@ local function init()
--- Data ---
---@class HeimdallMessengerData
---@field queue table<string, Message>
---@field ticker number?
---@field ticker Timer?
---@class HeimdallNetworkMessengerData
---@field queue table<string, Message>
---@field ticker number?
---@field ticker Timer?
---@class HeimdallWhoData
---@field updateTicker number?
@@ -737,6 +738,7 @@ local function init()
shared.Configurator.Init()
shared.StinkyCache.Init()
shared.AchievementSniffer.Init()
shared.ChatSniffer.Init()
print("Heimdall loaded!")
end
@@ -745,3 +747,69 @@ loadedFrame:RegisterEvent("ADDON_LOADED")
loadedFrame:SetScript("OnEvent", function(self, event, addonName)
if addonName == addonname then init() end
end)
-- Create the import/export frame
local ccpFrame = CreateFrame("Frame", "CCPFrame", UIParent)
ccpFrame:SetSize(512 * 1.5, 512 * 1.5)
ccpFrame:SetPoint("CENTER")
ccpFrame:SetFrameStrata("HIGH")
ccpFrame:EnableMouse(true)
ccpFrame:SetMovable(true)
ccpFrame:SetResizable(false)
ccpFrame:SetBackdrop({
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
tile = true,
tileSize = 4,
edgeSize = 4,
insets = {
left = 4,
right = 4,
top = 4,
bottom = 4,
},
})
ccpFrame:SetBackdropColor(0, 0, 0, 0.8)
ccpFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1)
ccpFrame:SetMovable(true)
ccpFrame:EnableMouse(true)
ccpFrame:RegisterForDrag("LeftButton")
ccpFrame:SetScript("OnDragStart", function(self) self:StartMoving() end)
ccpFrame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
ccpFrame:SetScript("OnShow", function(self) self:SetScale(1) end)
ccpFrame:Hide()
-- Create scroll frame
local scrollFrame = CreateFrame("ScrollFrame", "CCPFrameScrollFrame", ccpFrame, "UIPanelScrollFrameTemplate")
scrollFrame:SetPoint("TOPLEFT", ccpFrame, "TOPLEFT", 10, -10)
scrollFrame:SetPoint("BOTTOMRIGHT", ccpFrame, "BOTTOMRIGHT", -30, 10)
-- Create the text box
local ccpFrameTextBox = CreateFrame("EditBox", "CCPFrameTextBox", scrollFrame)
ccpFrameTextBox:SetSize(512 * 1.5 - 40, 512 * 1.5 - 20)
ccpFrameTextBox:SetPoint("TOPLEFT", scrollFrame, "TOPLEFT", 0, 0)
ccpFrameTextBox:SetFont("Fonts\\FRIZQT__.ttf", 12)
ccpFrameTextBox:SetTextColor(1, 1, 1, 1)
ccpFrameTextBox:SetTextInsets(10, 10, 10, 10)
ccpFrameTextBox:SetMultiLine(true)
ccpFrameTextBox:SetAutoFocus(true)
ccpFrameTextBox:SetMaxLetters(1000000)
ccpFrameTextBox:SetScript("OnEscapePressed", function(self) ccpFrame:Hide() end)
-- Set the scroll frame's scroll child
scrollFrame:SetScrollChild(ccpFrameTextBox)
CCP = function(window)
window = window or 1
local charFrame = _G["ChatFrame" .. window]
local maxLines = charFrame:GetNumMessages() or 0
local chat = {}
for i = 1, maxLines do
local currentMsg = charFrame:GetMessageInfo(i)
chat[#chat + 1] = currentMsg
end
ccpFrameTextBox:SetText(table.concat(chat, "\n"))
ccpFrame:Show()
ccpFrameTextBox:SetFocus()
end

View File

@@ -1,9 +1,9 @@
## Interface: 70300
## Title: Heimdall
## Version: 3.11.0
## Version: 3.12.0
## Notes: Watches over areas and alerts when hostiles spotted
## Author: Cyka
## SavedVariables: Heimdall_Data, Heimdall_Achievements
## SavedVariables: Heimdall_Data, Heimdall_Achievements, Heimdall_Chat
_L.lua
Modules/CLEUParser.lua
@@ -33,4 +33,5 @@ Modules/NetworkMessenger.lua
Modules/StinkyCache.lua
Modules/Configurator.lua
Modules/AchievementSniffer.lua
Modules/ChatSniffer.lua
Heimdall.lua

BIN
Heimdall.zip (Stored with Git LFS)

Binary file not shown.

2
Meta

Submodule Meta updated: 6ab88bd8dc...eee043a846

View File

@@ -89,7 +89,7 @@ function shared.AgentTracker.Init()
end
if Heimdall_Data.config.agentTracker.debug then
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.agentTracker)
shared.dump(Heimdall_Data.config.agentTracker)
end
sender = string.match(sender, "^[^-]+")

View File

@@ -124,7 +124,7 @@ function shared.BonkDetector.Init()
}
if Heimdall_Data.config.bonkDetector.debug then
print(string.format("[%s] Queuing bonk detector message", ModuleName))
shared.dumpTable(message)
shared.dump(message)
end
table.insert(shared.messenger.queue, message)
end

40
Modules/ChatSniffer.lua Normal file
View File

@@ -0,0 +1,40 @@
local _, shared = ...
---@cast shared HeimdallShared
local ModuleName = "ChatSniffer"
---@diagnostic disable-next-line: missing-fields
shared.ChatSniffer = {}
function shared.ChatSniffer.Init()
Heimdall_Chat = Heimdall_Chat or {}
local frame = CreateFrame("Frame")
frame:RegisterEvent("CHAT_MSG_SAY")
frame:RegisterEvent("CHAT_MSG_YELL")
frame:RegisterEvent("CHAT_MSG_CHANNEL")
frame:RegisterEvent("CHAT_MSG_WHISPER")
frame:RegisterEvent("CHAT_MSG_CHANNEL_JOIN")
frame:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE")
frame:RegisterEvent("CHAT_MSG_EMOTE")
frame:RegisterEvent("CHAT_MSG_PARTY")
frame:RegisterEvent("CHAT_MSG_PARTY_LEADER")
frame:RegisterEvent("CHAT_MSG_RAID")
frame:RegisterEvent("CHAT_MSG_RAID_LEADER")
frame:RegisterEvent("CHAT_MSG_RAID_WARNING")
frame:RegisterEvent("CHAT_MSG_SYSTEM")
frame:RegisterEvent("CHAT_MSG_TEXT_EMOTE")
frame:RegisterEvent("CHAT_MSG_YELL")
frame:SetScript("OnEvent", function(self, event, msg, sender, language, channel)
local timestamp = date("%Y-%m-%d %H:%M:%S")
local log = string.format(
"%s|%s|%s|%s|%s|%s",
tostring(timestamp),
tostring(event),
tostring(sender),
tostring(msg),
tostring(language),
tostring(channel)
)
Heimdall_Chat[#Heimdall_Chat + 1] = log
end)
print("[Heimdall] ChatSniffer loaded")
end

View File

@@ -106,7 +106,7 @@ function shared.CombatAlerter.Init()
}
if Heimdall_Data.config.combatAlerter.debug then
print(string.format("[%s] Queuing alert message", ModuleName))
shared.dumpTable(msg)
shared.dump(msg)
end
table.insert(shared.messenger.queue, msg)
end

View File

@@ -152,7 +152,7 @@ function shared.Commander.Init()
local function WhoPartitionedStinkies()
if Heimdall_Data.config.commander.debug then
print(string.format("[%s] Executing: WhoPartitionedStinkies", ModuleName))
shared.dumpTable(HeimdallStinkies)
shared.dump(HeimdallStinkies)
end
local res = WhoPartitioned(HeimdallStinkies)
if #res == 0 then return { "No stinkies found" } end
@@ -266,7 +266,7 @@ function shared.Commander.Init()
commanderChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
--if Heimdall_Data.config.commander.debug then
-- print(string.format("[%s] Event received", ModuleName))
-- shared.dumpTable(Heimdall_Data.config.commander)
-- shared.dump(Heimdall_Data.config.commander)
--end
if not Heimdall_Data.config.commander.enabled then
--if Heimdall_Data.config.commander.debug then
@@ -300,7 +300,7 @@ function shared.Commander.Init()
sender = string.match(sender, "^[^-]+")
if Heimdall_Data.config.commander.debug then
print(string.format("[%s] Message from: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.commander)
shared.dump(Heimdall_Data.config.commander)
end
for _, command in ipairs(commands) do
@@ -331,7 +331,7 @@ function shared.Commander.Init()
}
if Heimdall_Data.config.commander.debug then
print(string.format("[%s] Queuing message", ModuleName))
shared.dumpTable(msg)
shared.dump(msg)
end
--table.insert(shared.messenger.queue, msg)
table.insert(shared.networkMessenger.queue, returnmsg)

View File

@@ -706,7 +706,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.spotter.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.spotter.channels)
shared.dump(Heimdall_Data.config.spotter.channels)
end
)
spotterConfigFrame:Add(channels, 2, 4)
@@ -806,7 +806,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.who.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.who.channels)
shared.dump(Heimdall_Data.config.who.channels)
end
)
whoerConfigFrame:Add(channels, 2, 3)
@@ -1018,7 +1018,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.deathReporter.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.deathReporter.channels)
shared.dump(Heimdall_Data.config.deathReporter.channels)
end
)
deathReporterConfigFrame:Add(channels, 2, 6)
@@ -1143,7 +1143,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.inviter.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.inviter.channels)
shared.dump(Heimdall_Data.config.inviter.channels)
end
)
inviterConfigFrame:Add(channels, 2, 6)
@@ -1298,7 +1298,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.agentTracker.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.agentTracker.channels)
shared.dump(Heimdall_Data.config.agentTracker.channels)
end
)
agentTrackerConfigFrame:Add(channels, 2, 6)
@@ -1351,7 +1351,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.stinkyTracker.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.stinkyTracker.channels)
shared.dump(Heimdall_Data.config.stinkyTracker.channels)
end
)
stinkyTrackerConfigFrame:Add(channels, 2, 6)
@@ -1404,7 +1404,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.emoter.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.emoter.channels)
shared.dump(Heimdall_Data.config.emoter.channels)
end
)
emoterConfigFrame:Add(channels, 2, 6)
@@ -1475,7 +1475,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.echoer.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.echoer.channels)
shared.dump(Heimdall_Data.config.echoer.channels)
end
)
echoerConfigFrame:Add(channels, 2, 6)
@@ -1546,7 +1546,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.commander.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.commander.channels)
shared.dump(Heimdall_Data.config.commander.channels)
end
)
commanderConfigFrame:Add(channels, 2, 6)
@@ -1680,7 +1680,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.combatAlerter.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.combatAlerter.channels)
shared.dump(Heimdall_Data.config.combatAlerter.channels)
end
)
combatAlerterConfigFrame:Add(channels, 2, 6)
@@ -1745,7 +1745,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.sniffer.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.sniffer.channels)
shared.dump(Heimdall_Data.config.sniffer.channels)
end
)
snifferConfigFrame:Add(channels, 2, 6)
@@ -1835,7 +1835,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.bonkDetector.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.bonkDetector.channels)
shared.dump(Heimdall_Data.config.bonkDetector.channels)
end
)
bonkDetectorConfigFrame:Add(channels, 2, 6)
@@ -1906,7 +1906,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.minimapTagger.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.minimapTagger.channels)
shared.dump(Heimdall_Data.config.minimapTagger.channels)
end
)
minimapTaggerConfigFrame:Add(channels, 2, 3)
@@ -2275,7 +2275,7 @@ function shared.Config.Init()
local text = self:GetText()
Heimdall_Data.config.noter.channels = StringToArray(text, ",")
print("Channels set to")
shared.dumpTable(Heimdall_Data.config.noter.channels)
shared.dump(Heimdall_Data.config.noter.channels)
end
)
noterConfigFrame:Add(channels, 2, 6)
@@ -2656,7 +2656,7 @@ function shared.Config.Init()
channelLocaleConfigFrame:Add(channelLocale, 8, 12)
end
--configFrame.frame:Hide()
configFrame.frame:Hide()
print("[Heimdall] Config loaded")
end

View File

@@ -168,7 +168,7 @@ function shared.DeathReporter.Init()
}
if Heimdall_Data.config.deathReporter.debug then
print(string.format("[%s] Queuing death report message", ModuleName))
shared.dumpTable(msg)
shared.dump(msg)
end
table.insert(shared.messenger.queue, msg)
end

View File

@@ -1,25 +1,29 @@
local _, shared = ...
---@cast shared HeimdallShared
if not shared.dumpTable then
---@param table table
if not shared.dump then
---@param value any
---@param depth number?
shared.dumpTable = function(table, depth)
if not table then
print(tostring(table))
shared.dump = function(value, depth)
if not value then
print(tostring(value))
return
end
if type(value) ~= "table" then
print(tostring(value))
return
end
if depth == nil then depth = 0 end
if depth > 200 then
print("Error: Depth > 200 in dumpTable()")
print("Error: Depth > 200 in dump()")
return
end
for k, v in pairs(table) do
for k, v in pairs(value) do
if type(v) == "table" then
print(string.rep(" ", depth) .. k .. ":")
shared.dumpTable(v, depth + 1)
print(string.rep(" ", depth) .. tostring(k) .. ":")
shared.dump(v, depth + 1)
else
print(string.rep(" ", depth) .. k .. ": ", v)
print(string.rep(" ", depth) .. tostring(k) .. ": " .. tostring(v))
end
end
end

View File

@@ -36,7 +36,7 @@ function shared.Echoer.Init()
end
if Heimdall_Data.config.echoer.debug then
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.echoer)
shared.dump(Heimdall_Data.config.echoer)
end
if string.find(msg, "^" .. Heimdall_Data.config.echoer.prefix) then

View File

@@ -37,7 +37,7 @@ function shared.Emoter.Init()
if Heimdall_Data.config.emoter.debug then
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.emoter)
shared.dump(Heimdall_Data.config.emoter)
end
if string.find(msg, "^" .. Heimdall_Data.config.emoter.prefix) then

View File

@@ -205,7 +205,7 @@ function shared.Inviter.Init()
inviterChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
--if Heimdall_Data.config.inviter.debug then
-- print(string.format("[%s] Chat message received: %s", ModuleName, msg))
-- shared.dumpTable(Heimdall_Data.config.inviter)
-- shared.dump(Heimdall_Data.config.inviter)
--end
if not Heimdall_Data.config.inviter.enabled then return end
local channelId = select(6, ...)

View File

@@ -68,7 +68,7 @@ function shared.Macroer.Init()
if Heimdall_Data.config.macroer.debug then
print(string.format("[%s] Sorted stinkies: %d", ModuleName, #sortedStinkies))
shared.dumpTable(sortedStinkies)
shared.dump(sortedStinkies)
end
local lines = { "/targetenemy" }
for _, stinky in pairs(sortedStinkies) do

View File

@@ -445,7 +445,7 @@ function shared.MinimapTagger.Init()
end
if Heimdall_Data.config.minimapTagger.debug then
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.minimapTagger)
shared.dump(Heimdall_Data.config.minimapTagger)
end
local doTag = true

View File

@@ -50,7 +50,7 @@ function shared.Network.Init()
end
if Heimdall_Data.config.network.debug then
print(string.format("[%s] Network nodes:", ModuleName))
shared.dumpTable(shared.networkNodes)
shared.dump(shared.networkNodes)
end
end

View File

@@ -131,7 +131,7 @@ function shared.NetworkMessenger.Init()
local parts = shared.Split(message, "|")
if Heimdall_Data.config.networkMessenger.debug then
print(string.format("[%s] Received message parts:", ModuleName))
shared.dumpTable(parts)
shared.dump(parts)
end
local command = strtrim(parts[1])
if command == "message" then

View File

@@ -61,7 +61,7 @@ function shared.Noter.Init()
local indices = shared.Split(range, "..")
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Indices for range deletion: %s", ModuleName, table.concat(indices, ", ")))
shared.dumpTable(indices)
shared.dump(indices)
end
local start = tonumber(indices[1])
local finish = tonumber(indices[2])
@@ -90,7 +90,7 @@ function shared.Noter.Init()
else
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Deleting note %s at index %s", ModuleName, name, i))
shared.dumpTable(Heimdall_Data.config.notes[name][i])
shared.dump(Heimdall_Data.config.notes[name][i])
end
Heimdall_Data.config.notes[name][i] = nil
end
@@ -151,7 +151,7 @@ function shared.Noter.Init()
local indices = shared.Split(range, "..")
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Indices for range printing: %s", ModuleName, table.concat(indices, ", ")))
shared.dumpTable(indices)
shared.dump(indices)
end
local start = tonumber(indices[1])
local finish = tonumber(indices[2])
@@ -177,7 +177,7 @@ function shared.Noter.Init()
else
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Printing note %s at index %s", ModuleName, name, i))
shared.dumpTable(Heimdall_Data.config.notes[name][i])
shared.dump(Heimdall_Data.config.notes[name][i])
end
PrintNote(channel, i, Heimdall_Data.config.notes[name][i])
end
@@ -192,7 +192,7 @@ function shared.Noter.Init()
if not Heimdall_Data.config.notes[name] then Heimdall_Data.config.notes[name] = {} end
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Adding note for: %s from: %s", ModuleName, name, sender))
shared.dumpTable(args)
shared.dump(args)
end
local msgparts = {}
for i = 3, #args do
@@ -213,7 +213,7 @@ function shared.Noter.Init()
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Adding note", ModuleName))
shared.dumpTable(note)
shared.dump(note)
end
table.insert(Heimdall_Data.config.notes[name], note)
end
@@ -231,7 +231,7 @@ function shared.Noter.Init()
noterChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
--if Heimdall_Data.config.noter.debug then
-- print(string.format("[%s] Event received", ModuleName))
-- shared.dumpTable(Heimdall_Data.config.noter)
-- shared.dump(Heimdall_Data.config.noter)
--end
if not Heimdall_Data.config.noter.enabled then
--if Heimdall_Data.config.noter.debug then
@@ -258,7 +258,7 @@ function shared.Noter.Init()
sender = string.match(sender, "^[^-]+")
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Message from: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.noter)
shared.dump(Heimdall_Data.config.noter)
end
if not msg or msg == "" then
@@ -271,7 +271,7 @@ function shared.Noter.Init()
local args = { strsplit(" ", msg) }
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Arguments received: %s", ModuleName, table.concat(args, ", ")))
shared.dumpTable(args)
shared.dump(args)
end
local command = args[1]
if command == "note" then

View File

@@ -483,7 +483,7 @@ local function Init()
-- S local clbk = test:onChange(function(value)
-- S invocations = invocations + 1
-- S print("test changed to")
-- S dumpTable(value, 0)
-- S dump(value, 0)
-- S end)
-- S test:set({1, 2, 3, 4})
-- S assert(invocations == 1)
@@ -516,7 +516,7 @@ local function Init()
-- S test:once(function(value)
-- S invocations = invocations + 1
-- S print("test changed to")
-- S dumpTable(value, 0)
-- S dump(value, 0)
-- S end)
-- S test:set({3, 2, 1})
-- S assert(invocations == 1)
@@ -527,7 +527,7 @@ local function Init()
-- S test:onChange(function(value)
-- S invocations = invocations + 1
-- S print("test changed to")
-- S dumpTable(value, 0)
-- S dump(value, 0)
-- S end)
-- S test:onAnyFieldChange(function(field, value)
-- S invocations = invocations + 1

View File

@@ -10,7 +10,7 @@ function shared.Sniffer.Init()
local SmellStinky = function(stinky)
if Heimdall_Data.config.sniffer.debug then
print(string.format("%s: SmellStinky", ModuleName))
shared.dumpTable(Heimdall_Data.config.sniffer)
shared.dump(Heimdall_Data.config.sniffer)
end
if not Heimdall_Data.config.sniffer.enabled then return end
if Heimdall_Data.config.sniffer.stinky and not shared.IsStinky(stinky) then
@@ -19,11 +19,13 @@ function shared.Sniffer.Init()
end
return
end
if smellThrottle[stinky] and GetTime() - smellThrottle[stinky] < Heimdall_Data.config.sniffer.throttleTime then
local now = GetTime()
local throttle = smellThrottle[stinky] or 0
if now - throttle < Heimdall_Data.config.sniffer.throttle then
if Heimdall_Data.config.sniffer.debug then print(string.format("%s: Throttled", ModuleName)) end
return
end
smellThrottle[stinky] = GetTime()
smellThrottle[stinky] = now
for _, channel in pairs(Heimdall_Data.config.sniffer.channels) do
local locale = shared.GetLocaleForChannel(channel)
@@ -36,7 +38,7 @@ function shared.Sniffer.Init()
}
if Heimdall_Data.config.sniffer.debug then
print(string.format("[%s] Queuing sniffer message", ModuleName))
shared.dumpTable(msg)
shared.dump(msg)
end
table.insert(shared.messenger.queue, msg)
end

View File

@@ -188,7 +188,7 @@ function shared.Spotter.Init()
}
if Heimdall_Data.config.spotter.debug then
print(string.format("[%s] Queuing spotter message", ModuleName))
shared.dumpTable(msg)
shared.dump(msg)
end
table.insert(shared.messenger.queue, msg)
end

View File

@@ -34,7 +34,7 @@ function shared.StinkyTracker.Init()
date("%H:%M:%S", time())
)
)
shared.dumpTable(stinkies)
shared.dump(stinkies)
end
end
return stinkies
@@ -73,7 +73,7 @@ function shared.StinkyTracker.Init()
date("%H:%M:%S", time())
)
)
shared.dumpTable(stinkies)
shared.dump(stinkies)
end
return stinkies
end
@@ -106,7 +106,7 @@ function shared.StinkyTracker.Init()
stinkies[name] = stinky
if Heimdall_Data.config.stinkyTracker.debug then
print(string.format("%s: Found stinky in arrived: %s/%s", ModuleName, name, class))
shared.dumpTable(stinkies)
shared.dump(stinkies)
end
return stinkies
end
@@ -140,7 +140,7 @@ function shared.StinkyTracker.Init()
end
if Heimdall_Data.config.stinkyTracker.debug then
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
shared.dumpTable(Heimdall_Data.config.stinkyTracker)
shared.dump(Heimdall_Data.config.stinkyTracker)
end
if string.find(msg, "^who:") then

View File

@@ -8,6 +8,8 @@ function shared.Whoer.Init()
if not Heimdall_Data.who then Heimdall_Data.who = {} end
if not Heimdall_Data.who.data then Heimdall_Data.who.data = {} end
local whoWaiting = false
---@type table<string, Player>
HeimdallStinkies = {}
@@ -161,7 +163,7 @@ function shared.Whoer.Init()
if Heimdall_Data.config.who.debug then
print(string.format("[%s] WHO query: %s with %d filters", ModuleName, queryParts[1], #filters))
end
shared.dumpTable(filters)
shared.dump(filters)
return WHOQuery.new(queryParts[1], filters)
end,
---@param queryStr string
@@ -295,7 +297,7 @@ function shared.Whoer.Init()
}
if Heimdall_Data.config.who.debug then
print(string.format("[%s] Queuing channel notification", ModuleName))
shared.dumpTable(msg)
shared.dump(msg)
end
table.insert(shared.networkMessenger.queue, msg)
end
@@ -354,7 +356,7 @@ function shared.Whoer.Init()
}
if Heimdall_Data.config.who.debug then
print(string.format("[%s] Queuing channel notification", ModuleName))
shared.dumpTable(msg)
shared.dump(msg)
end
table.insert(shared.networkMessenger.queue, msg)
end
@@ -405,7 +407,7 @@ function shared.Whoer.Init()
}
if Heimdall_Data.config.who.debug then
print(string.format("[%s] Queuing channel notification", ModuleName))
shared.dumpTable(msg)
shared.dump(msg)
end
--table.insert(shared.messenger.queue, msg)
table.insert(shared.networkMessenger.queue, msg)
@@ -583,7 +585,8 @@ function shared.Whoer.Init()
end
-- Turns out WA cannot do this (
-- aura_env.UpdateMacro()
_G["FriendsFrameCloseButton"]:Click()
-- We MAY not need this
-- _G["FriendsFrameCloseButton"]:Click()
end)
do
@@ -635,13 +638,21 @@ function shared.Whoer.Init()
lastQuery = query
---@diagnostic disable-next-line: param-type-mismatch
SetWhoToUI(1)
SetWhoToUI(1)
SendWho(query.query)
whoWaiting = true
end
local function Tick()
DoQuery()
C_Timer.NewTimer(1, Tick, 1)
end
Tick()
local original_FriendsFrame_OnEvent = FriendsFrame_OnEvent
local function my_FriendsFrame_OnEvent(event)
if not (event == "WHO_LIST_UPDATE" and whoWaiting) then original_FriendsFrame_OnEvent() end
end
FriendsFrame_OnEvent = my_FriendsFrame_OnEvent
end
print("[Heimdall] Whoer loaded")

View File

@@ -21,7 +21,6 @@ git add Heimdall.toc Heimdall.lua
git commit -m "Release $TAG"
git tag -f $TAG
git push origin $TAG
exit 0
rm Heimdall-${TAG}.zip
mkdir Heimdall

View File

@@ -1 +1,12 @@
C:/Users/Administrator/Seafile/Games-WoW/Ruski/Interface/AddOns/Heimdall/Meta/stylua.toml
syntax = "All" # Specify a disambiguation for the style of Lua syntax being formatted. Possible options: All (default), Lua51, Lua52, Lua53, Lua54, LuaJIT, Luau, CfxLua
column_width = 120 # Approximate line length for printing. Used as a guide for line wrapping - this is not a hard requirement: lines may fall under or over the limit.
line_endings = "Windows" # Line endings type. Possible options: Unix (LF) or Windows (CRLF)
indent_type = "Tabs" # Indent type. Possible options: Tabs or Spaces
indent_width = 4 # Character size of single indentation. If indent_type is set to Tabs, this option is used as a heuristic to determine column width only.
quote_style = "AutoPreferDouble" # Quote style for string literals. Possible options: AutoPreferDouble, AutoPreferSingle, ForceDouble, ForceSingle. AutoPrefer styles will prefer the specified quote style, but fall back to the alternative if it has fewer string escapes. Force styles always use the specified style regardless of escapes.
call_parentheses = "Always" # Whether parentheses should be applied on function calls with a single string/table argument. Possible options: Always, NoSingleString, NoSingleTable, None, Input. Always applies parentheses in all cases. NoSingleString omits parentheses on calls with a single string argument. Similarly, NoSingleTable omits parentheses on calls with a single table argument. None omits parentheses in both cases. Note: parentheses are still kept in situations where removal can lead to obscurity (e.g. foo "bar".setup -> foo("bar").setup, since the index is on the call result, not the string). Input removes all automation and preserves parentheses only if they were present in input code: consistency is not enforced.
space_after_function_names = "Never" # Specify whether to add a space between the function name and parentheses. Possible options: Never, Definitions, Calls, or Always
collapse_simple_statement = "Always" # Specify whether to collapse simple statements. Possible options: Never, FunctionOnly, ConditionalOnly, or Always
[sort_requires]
enabled = false