Download
(3 Kb)
Download
Updated: 05/22/14 11:32 PM
Compatibility:
Craglorn (1.1)
Live (1.0)
Updated:05/22/14 11:32 PM
Created:04/14/14 02:12 AM
Monthly downloads:21
Total downloads:3,599
Favorites:3
MD5:
libChat
Version: 1.1
by: Puddy [More]
libChat is a library that allows you to modify chat messages without taking control of the entire message.

With libChat, your addon can modify the sender's name, the text, or the formatting of the message.

To use libChat (requires libStub), include libChat.lua with your addon and add

Code:
local LC = LibStub('libChat-1.0')
near the top of your code.

To register with libChat, use one of the following:
Code:
LC:registerName(myFunction)
LC:registerText(myFunction)
LC:registerFormat(myFunction)
where "myFunction" is a function that accepts 3 variables: channel ID code, from name, and text.

When using registerName, you return only the name.
When using registerText, you return only the text.
When using registerFormat, you return a formatted string that will be displayed in the chat window.
Returning nil for any of these will cause the message to not be displayed.

libChat is released under the BSD 2-clause license.
v 1.1
======
Updated to allow multiple addons to register for the same modifier
Optional Files (0)


Archived Files (1)
File Name
Version
Size
Uploader
Date
1.0
3kB
04/14/14 02:12 AM


Post A Reply Comment Options
Unread 05/21/14, 05:59 AM  
Wobin
 
Wobin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 78
File comments: 192
Uploads: 7
Multiple addons

What happens when multiple addons register with libChat? Is there any function chaining to make sure all the associated handlers are called?

As far as I can tell, calling ZO_ChatSystem_AddEventHandler(CHANNEL, handler) actually -replaces- the handler in the chat system, thus causing any multiple of chat addons to overwrite the handler.

If libChat could handle registration and just process all handlers, that might be a way around the issue.

However, interactions and order of execution would then be problematic.
Last edited by Wobin : 05/21/14 at 06:02 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: