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 |
Barnicle |
View Public Profile |
Send a private message to Barnicle |
Send email to Barnicle |
Find More Posts by Barnicle |
Add Barnicle to Your Buddy List |
silvereyes |
View Public Profile |
Send a private message to silvereyes |
Send email to silvereyes |
Find More Posts by silvereyes |
Add silvereyes to Your Buddy List |
silvereyes |
View Public Profile |
Send a private message to silvereyes |
Send email to silvereyes |
Find More Posts by silvereyes |
Add silvereyes to Your Buddy List |
silvereyes |
View Public Profile |
Send a private message to silvereyes |
Send email to silvereyes |
Find More Posts by silvereyes |
Add silvereyes to Your Buddy List |
silvereyes |
View Public Profile |
Send a private message to silvereyes |
Send email to silvereyes |
Find More Posts by silvereyes |
Add silvereyes to Your Buddy List |
11/07/19, 06:06 AM | ||
I've thought a bit about the issue and guess I'll change the tag setting to allow four values:
Last edited by sirinsidiator : 11/07/19 at 06:07 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 |
11/06/19, 10:54 PM | |
I'm definitely considering adding LibChatMessage to my addons, but I have a problem.
Most of my addons already allow toggling between long and short prefixes in addon settings, but LibChatMessage only offers a global toggle, hidden in a slash command that users will never see. Do you have any suggestions on how to handle this without completely confusing users? |
|
|
silvereyes |
View Public Profile |
Send a private message to silvereyes |
Send email to silvereyes |
Find More Posts by silvereyes |
Add silvereyes 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.