Print index of note

This commit is contained in:
2025-01-15 12:32:52 +01:00
parent efe0002e02
commit d54e93ad85

View File

@@ -106,14 +106,18 @@ function shared.Noter.Init()
end
end
---@param index number
---@param note Note
local function PrintNote(note)
print(string.format("[%s] %s: %s", note.source, note.date, note.note))
local function PrintNote(index, note)
if Heimdall_Data.config.noter.debug then
print(string.format("[%s] Printing note at index %d for: %s", ModuleName, index, note.source))
print(string.format("[%s] [%s][%d] %s: %s", ModuleName, note.source, index, note.date, note.note))
end
---@type Message
local msg = {
channel = "CHANNEL",
data = Heimdall_Data.config.noter.masterChannel,
message = string.format("[%s] %s: %s", note.source, note.date, note.note)
message = string.format("[%s][%d] %s: %s", note.source, index, note.date, note.note)
}
table.insert(shared.messenger.queue, msg)
end
@@ -136,7 +140,7 @@ function shared.Noter.Init()
print(string.format("[%s] Printing notes from %d to %d for: %s", ModuleName, start, finish, name))
end
for i = start, finish do
PrintNote(notes[i])
PrintNote(i, notes[i])
end
return
end
@@ -177,7 +181,7 @@ function shared.Noter.Init()
print(string.format("[%s] Printing note %s at index %s", ModuleName, name, i))
shared.dumpTable(Heimdall_Data.config.notes[name][i])
end
PrintNote(Heimdall_Data.config.notes[name][i])
PrintNote(i, Heimdall_Data.config.notes[name][i])
end
end
end