libChat3 is a library Chat for The Elder Scrolls Online.
Use libGarfield to be sure that libChat3 is not overwrite by another addOn.
- libChat3.5 will add full support for libChat4 to prepare the transition to libChat4.
- libChat4 : Break changes, libChat4 will be incompatible with backwards-versions ;
Allow several addon listeners on one event (without conflict) :
- registerName
- registerText
- registerAppendDDSBeforeAll
- registerAppendTextBeforeAll
- registerAppendDDSBeforeSender
- registerAppendTextBeforeSender
- registerAppendDDSAfterSender
- registerAppendTextAfterSender
- registerAppendDDSBeforeText
- registerAppendTextBeforeText
- registerAppendDDSAfterText
- registerAppendTextAfterText
Event Schema to add text element :
Mini :
| message |
| {___1___} | {Sender} | {___2___} | {Text} | {___3___} |
| BfAll | playerLink | text | ..... |
Full :
| | ___1___ | {Sender} | ___2___ | {Text} | ___3___ |
| Position : | BeforeAll | {OptEsoFormat} | BeforeSender | | AfterSender | {OptEsoFormat} | BeforeText | | AfterText | {OptEsoFormat} | ............ |
| Index : | DDS_ | Text_ | | DDS_ | Text_ | | Text_ | DDS_ | | DDS_ | Text_ | | Text_ | DDS_ | | ............ |
| Variable : | channelLink | | playerLink | | text | | ............ |
*{OptEsoFormat} = {OptionnalESOUIFormat}[/code]
local LC = LibStub('libChat-1.0')
-- Replace / Parse the player name :
LC:registerFrom(function(channelID, from, isCustomerService, fromDisplayName) return from end)-- /!\ 4 arguments
-- Replace / Parse the text :
LC:registerText(function(channelID, from, text, isCustomerService, fromDisplayName) return text end)
-- Add text element (watch the schema to get the position name) :
local position = "BeforeAll"
local index = "Text'"
LC:["registerAppend" .. index .. position](function(channelID, from, text, isCustomerService, fromDisplayName) return ">>" end)
Old version and How to use : libChat2.