Go to Page... |
## DependsOn: LibChatMessage
local chat = LibChatMessage("MyAddon", "MA") -- long and short tag to identify who is printing the message chat:Print("Simple message") -- instead of d() chat:Printf("Formatted %s", "message") -- instead of df() chat:SetTagColor("ff0000"):Print("Message with a different tag color") -- To change the tag color for e.g. warnings. The message itself can be colored with a color tag, although I can't really recommend doing that chat:SetEnabled(false) -- in case the output of this ChatProxy should be enabled. Could be used when a settings is supposed to disable chat messages for an addon chat:Print("Ignored message") -- won't show up
/chatmessage <command> [argument] <time> [on/off] Enables or disables the time prefix <chat> [on/off] Controls the time prefix on regular chat <format> [auto/12h/24h] Changes the used time format <tag> [off/short/long] Changes the length of the used tag <history> [on/off] Restore old chat after login <age> [seconds] The maximum age of restored chat Example: /chatmessage tag short
local chat = LibChatMessage.Create(longTag, shortTag)
local chat = LibChatMessage(longTag, shortTag)
local chat = chat:SetTagColor(color)
chat:Print(message)
chat:Printf(formatString, ...)
chat:SetEnabled(enabled)
LibChatMessage:ClearChat()
LibChatMessage:ClearHistory()
LibChatMessage:GetHistory()
LibChatMessage:SetTimePrefixEnabled(enabled)
local enabled = LibChatMessage:IsTimePrefixEnabled()
LibChatMessage:SetTimePrefixEnabled(enabled)
local enabled = LibChatMessage:IsTimePrefixEnabled()
LibChatMessage:SetTimePrefixFormat(format)
local format = LibChatMessage:GetTimePrefixFormat()
LibChatMessage:SetTagPrefixMode(mode)
local mode = LibChatMessage:GetTagPrefixMode()
LibChatMessage:SetChatHistoryEnabled(enabled)
local enabled = LibChatMessage:IsChatHistoryEnabled()
local enabled = LibChatMessage:IsChatHistoryActive()
LibChatMessage:SetChatHistoryMaxAge(maxAge)
local maxAge = LibChatMessage:GetChatHistoryMaxAge()
LibChatMessage:RegisterCustomChatLink(YOUR_LINK_TYPE) LibChatMessage:RegisterCustomChatLink(YOUR_LINK_TYPE, reformatLinkFunc)
local function reformatLink(linkStyle, linkType, data, displayText) return ZO_LinkHandler_CreateLinkWithFormat(displayText, nil, linkType, linkStyle, data) end LibChatMessage:RegisterCustomChatLink(YOUR_LINK_TYPE, reformatLink)
function addon:OnLinkClicked(link, button, text, color, linkType, ...) if linkType ~= YOUR_LINK_TYPE then return end if button == MOUSE_BUTTON_INDEX_LEFT then -- Do your stuff elseif button == MOUSE_BUTTON_INDEX_MIDDLE then -- Do your stuff end return true -- link has been handled end function addon:InitLinkHandler() LINK_HANDLER:RegisterCallback(LINK_HANDLER.LINK_CLICKED_EVENT, self.OnLinkClicked, self) LINK_HANDLER:RegisterCallback(LINK_HANDLER.LINK_MOUSE_UP_EVENT, self.OnLinkClicked, self) end
File Name |
Version |
Size |
Uploader |
Date |
1.2.0 |
10kB |
sirinsidiator |
04/22/21 01:33 PM |
|
1.1.3 |
5kB |
sirinsidiator |
03/02/20 01:26 PM |
|
1.1.2 |
5kB |
sirinsidiator |
03/02/20 12:10 PM |
|
1.1.1 |
6kB |
sirinsidiator |
02/25/20 01:55 PM |
|
1.1.0 |
6kB |
sirinsidiator |
02/24/20 02:43 AM |
|
1.0.1 |
5kB |
sirinsidiator |
06/01/19 05:15 AM |
|
1.0.0 |
5kB |
sirinsidiator |
05/28/19 09:18 AM |
Comment Options |
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
04/24/20, 08:18 PM | |
Forum posts: 15
File comments: 29
Uploads: 0
|
Last edited by Lenox : 04/24/20 at 08:30 PM.
|
|
Lenox |
View Public Profile |
Send a private message to Lenox |
Send email to Lenox |
Find More Posts by Lenox |
Add Lenox to Your Buddy List |
03/05/20, 12:45 AM | |||
|
Re: Re: Error when library independently loaded.
|
||
|
BornDownUnder |
View Public Profile |
Send a private message to BornDownUnder |
Send email to BornDownUnder |
Find More Posts by BornDownUnder |
Add BornDownUnder to Your Buddy List |
03/03/20, 02:29 PM | ||
Re: Error when library independently loaded.
|
||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Send email to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
03/03/20, 02:16 PM | |
|
Error when library independently loaded.
I have just started with LibChatMessage, at present it is independent (No addon having need for the library)
Caught a bug, not sure what to make of it (My lua knowledge is very basic at present): Code:
user:/AddOns/LibChatMessage/LibChatMessage.lua:528: function expected instead of nil stack traceback: user:/AddOns/LibChatMessage/LibChatMessage.lua:528: in function 'ReinitializeChatFormatters' <Locals> noop = user:/AddOns/LibChatMessage/LibChatMessage.lua:518, originalRegisterForEvent = [C]:-1, eventId = 131200, eventFormatter = user:/AddOns/LibChatMessage/LibChatMessage.lua:96 </Locals> user:/AddOns/LibChatMessage/LibChatMessage.lua:586: in function 'func' EsoUI/Libraries/Globals/globalapi.lua:207: in function '(anonymous)' |
|
BornDownUnder |
View Public Profile |
Send a private message to BornDownUnder |
Send email to BornDownUnder |
Find More Posts by BornDownUnder |
Add BornDownUnder to Your Buddy List |
03/03/20, 06:24 AM | |
Forum posts: 1
File comments: 3
Uploads: 0
|
Big thanks for your quick fix on this lib.
|
|
Caniblast |
View Public Profile |
Send a private message to Caniblast |
Send email to Caniblast |
Find More Posts by Caniblast |
Add Caniblast to Your Buddy List |
03/03/20, 02:48 AM | ||
|
||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Send email to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
03/02/20, 05:35 PM | |
Forum posts: 9
File comments: 230
Uploads: 0
|
It is a testament to the importance of your library that so many other addons had problems when ZoS made this unexpected change. Thanks for your hard work.
Here is my version of the error if that helps: user:/AddOns/LibChatMessage/LibChatMessage.lua:159: function expected instead of nil stack traceback: user:/AddOns/LibChatMessage/LibChatMessage.lua:159: in function '(anonymous)' [C]: in function 'pcall' user:/AddOns/LibChatMessage/LibChatMessage.lua:158: in function 'SafeAddEventFormatter' |caaaaaa<Locals> eventId = "LibChatMessage", eventFormatter = user:/AddOns/LibChatMessage/LibChatMessage.lua:165 </Locals>|r user:/AddOns/LibChatMessage/LibChatMessage.lua:181: in function '(main chunk)' |caaaaaa<Locals> LIB_IDENTIFIER stack traceback: [C]: in function 'assert' user:/AddOns/LibChatMessage/LibChatMessage.lua:162: in function 'SafeAddEventFormatter' <Locals> eventId = "LibChatMessage", eventFormatter = user:/AddOns/LibChatMessage/LibChatMessage.lua:165, success = F, err = "user:/AddOns/LibChatMessage/Li..." </Locals>|r user:/AddOns/LibChatMessage/LibChatMessage.lua:181: in function '(main chunk)' |caaaaaa<Locals> LIB_IDENTIFIER = "LibChatMessage", lib = [table:1]{chatHistoryActive = T}, TAG_FORMAT = "[%s]", COLOR_FORMAT = "|c%s%s|r", MESSAGE_TEMPLATE = "%s %s", SYSTEM_TAG = "[System]", TIME_FORMAT_AUTO = "[%X]", TIME_FORMAT_12 = "[%I:%M:%S %p]", TIME_FORMAT_24 = "[%T]", TIME_FORMATS = [table:2]{1 = "[%X]"}, TIME_FORMAT_MAPPING = [table:3]{12h = "[%I:%M:%S %p]", auto = "[%X]", 24h = "[%T]"}, REVERSE_TIME_FORMAT_MAPPING = [table:4]{[%X] = "auto", [%I:%M:%S %p] = "12h", [%T] = "24h"}, TAG_PREFIX_OFF = 1, TAG_PREFIX_LONG = 2, TAG_PREFIX_SHORT = 3, TIMESTAMP_INDEX = 1, MAX_HISTORY_LENGTH = 10000, TRIMMED_HISTORY_LENGTH = 9000, strlower = [C]:-1, tconcat = [C]:-1 </Locals>|r
Last edited by Akopian Atrebates : 03/02/20 at 05:37 PM.
|
|
Akopian Atrebates |
View Public Profile |
Send a private message to Akopian Atrebates |
Send email to Akopian Atrebates |
Find More Posts by Akopian Atrebates |
Add Akopian Atrebates to Your Buddy List |
03/02/20, 01:28 PM | |||
|
|||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Send email to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
03/02/20, 01:12 PM | ||
|
||
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Send email to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
03/02/20, 01:01 PM | |
Forum posts: 2
File comments: 7
Uploads: 0
|
Still getting an error after update
Lua Code:
EDIT: The error seems to have fixed itself with a hard game reset rather than a reload.
Last edited by tamedbeast : 03/02/20 at 01:07 PM.
|
|
tamedbeast |
View Public Profile |
Send a private message to tamedbeast |
Send email to tamedbeast |
Find More Posts by tamedbeast |
Add tamedbeast to Your Buddy List |
03/02/20, 12:46 PM | ||
Forum posts: 1
File comments: 64
Uploads: 0
|
March 2 update - LibChat lua messages fixed now
|
|
|
Pyr0xyrecuprotite |
View Public Profile |
Send a private message to Pyr0xyrecuprotite |
Send email to Pyr0xyrecuprotite |
Find More Posts by Pyr0xyrecuprotite |
Add Pyr0xyrecuprotite to Your Buddy List |
03/02/20, 12:13 PM | ||
Re: How to correct the bug !
|
||
|
ZoomStop |
View Public Profile |
Send a private message to ZoomStop |
Send email to ZoomStop |
Find More Posts by ZoomStop |
Add ZoomStop to Your Buddy List |
03/02/20, 12:12 PM | |
I've just uploaded a new version which should work with today's game update!
|
|
|
sirinsidiator |
View Public Profile |
Send a private message to sirinsidiator |
Send email to sirinsidiator |
Find More Posts by sirinsidiator |
Add sirinsidiator to Your Buddy List |
03/02/20, 12:03 PM | |
|
How to correct the bug !
Simply change all the calls of CHAT_ROUTER:AddEventFormatter by ZO_ChatSystem_AddEventHandler !
Because CHAT_ROUTER:AddEventFormatter is no longeur accessible Good game ! |
|
gdfou |
View Public Profile |
Send a private message to gdfou |
Send email to gdfou |
Find More Posts by gdfou |
Add gdfou to Your Buddy List |
You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.