View Single Post
01/04/17, 04:06 AM   #6
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
The addon ChatStamp add a date stamp to the chat message.. but also pchat and maybe other addons..

by looking at ChatStamp code I would like to replace

Lua Code:
  1. function CS.addChatStamp()
  2.     ...
  3.    
  4.     return chattime
  5.        
  6. end

by your Timestamps.GetTimestamp() code which should return the timestamp.



Your code can't work....
okayyyy now it can work because zos rewrited it because of gamepad chat made at last DLC, but for for 2 years, SharedChatContainer was local.



Your code will break other addons potentially ... because it's chat.. and chat is a UI space where all other addons fights each others. If you rewrite a function, consider another addon perhaps rewrite it also. or use it.. Having to deal when your addon can potentially conflicts wth others on your very first addon.. is not a good thing.



Hacking ESOUI Code for 1st addon is not good.. It's like you wanted to learn C by hacking the Linux Kernel before knowing few concepts that you learn after being a C-Guru for years.

Just do something easier.. or do this .. differently ?


It was just advices of an old coder.

ps:

Lua Code:
  1. function SharedChatContainer:OnChatEvent(event, formattedEvent, category)
  2.         formattedEvent = Timestamps.GetTimestamp() .. formattedEvent           -- My code
  3.         for i=1, #self.windows do
  4.             if IsChatContainerTabCategoryEnabled(self.id, i, category) then
  5.                 self:AddEventMessageToWindow(self.windows[i], formattedEvent, category)
  6.             end
  7.         end
  8.     end

Last edited by Ayantir : 01/04/17 at 04:10 AM.
  Reply With Quote