Hi all,
I'm just trying to write a simple addon that inserts timestamps at the start of every chat message (I know, that's been done before, but I'm just trying to learn, so I thought I'd start with something small).
At this point, I'm trying to override SharedChatContainer:OnChatEvent:
Lua Code:
function SharedChatContainer:OnChatEvent(event, formattedEvent, category)
formattedEvent = GetTimestamp() .. formattedEvent -- My code
for i=1, #self.windows do
if IsChatContainerTabCategoryEnabled(self.id, i, category) then
self:AddEventMessageToWindow(self.windows[i], formattedEvent, category)
end
end
end
But that doesn't seem to work for some reason. The error I am getting is 'expecting function instead of nil', so I've already understood that the function is unable to access the Timestamps table. Why? Is there some way to work around this?
And yes, I do want to call the GetTimestamp() function, because I am formatting the result of ZO_FormatClockTime() before using it.
Thanks for your help and happy new year