Thread Tools Display Modes
08/31/15, 02:41 PM   #1
Asto
 
Asto's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 18
pChat / LibChat Message Length

Hello

I have a mysterious problem with the chat output of my addon combined with pChat.

It works fine, with color formatting and everything how i want it to work. But if players use pChat, the chat messages are cut after an undefined length:



Green: Without color-formatting (less chars), the entire text is displayed
Yellow: With full color-formatting (longest char-count), it's cut early
Red: Only half of the color-formatting, more chars are displayed but still not the entire message

Without pChat and full color-formatting, everything works fine...

Edit: If i print the numbers 1-9 two times (1...91...9), every number with it's own color, it works fine without pChat. With pChat it's cut off after the second numeber 1... don't get it :/

Code:
CHAT_SYSTEM:AddMessage(""
                    .."|c".."F27C7C".."1".."|r"
                    .."|c".."71DE73".."2".."|r"
                    .."|c".."F27C7C".."3".."|r"
                    .."|c".."71DE73".."4".."|r"
                    .."|c".."F27C7C".."5".."|r"
                    .."|c".."71DE73".."6".."|r"
                    .."|c".."F27C7C".."7".."|r"
                    .."|c".."71DE73".."8".."|r"
                    .."|c".."F27C7C".."9".."|r"
                    -- and again
                    .."|c".."71DE73".."1".."|r"
                    -- cut off by pchat here
                    .."|c".."F27C7C".."2".."|r"
                    .."|c".."71DE73".."3".."|r"
                    .."|c".."F27C7C".."4".."|r"
                    .."|c".."71DE73".."5".."|r"
                    .."|c".."F27C7C".."6".."|r"
                    .."|c".."71DE73".."7".."|r"
                    .."|c".."F27C7C".."8".."|r"
                    .."|c".."71DE73".."9".."|r"
)
Any ideas what causes this? Couldn't find anything in the pChat code or pChat LibChat lib...
Otherwise: Is there a way to detect pChat and disable the color formatting / show a hint for the users?

Last edited by Asto : 08/31/15 at 03:02 PM.
  Reply With Quote
08/31/15, 03:07 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Vielleicht akzeptiert das Chatfenster nur x Zeichen (inklusive der Farb-Formatierungszeichen), wenn der Chat von einem Addon kommt bzw. manuell eingetragen wird im Chatfenster Text Eingabefeld.
Also so etwas wie die maximale Chattext Länge, die es ja auch wirklich gibt.
Zähl mal nach, wieviele zeichen das bei normaler Nachricht sind und ob sich das deckt mit der farbformatierten Textlänge wo abgeschnitten wird.

My idea would be that the chat message only accepts a certain number of character (including the chat color format characters).
As there is definately a maximum character length for new chat messages this could be the same value as the chat text, where you specify many color code additions. Maybe check the length against your test with the 1..9 character length.
  Reply With Quote
08/31/15, 03:15 PM   #3
Asto
 
Asto's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 18
Danke für die schnelle Antwort

Hmm yeah looks like that. But is there a difference between CHAT_SYSTEM:AddMessage with and without pChat? The color formatted strings work as expected without pChat. So the max length has to be shorter with pChat enabled?
  Reply With Quote
08/31/15, 03:57 PM   #4
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I do rewrite CHAT_SYSTEM:AddMessage in pChat, so yes, there's a difference.
And yes a message get its limits reduced due to pChat footprint. I already have some issues, but I don't have solutions for now, just maybe use less colors, sorry.

Problem is link handlers added to handle copy. If you desactivate pChat copy in addon options, it should work.
  Reply With Quote
09/01/15, 02:23 AM   #5
Asto
 
Asto's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 18
Thank you Ayantir for the fast (and official) response.

Well, so i have to find another way, maybe splitting those messages. Normally, the messages are short, but users have the option to enable the details output.

Can you name an exact max string length or does it depend on the messages?
  Reply With Quote
09/01/15, 11:12 AM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
I guess it should be the message length of your example, concatenated:
Code:
|cF27C7C1|r|c71DE732|r|cF27C7C3|r|c71DE734|r|cF27C7C5|r|c71DE736|r|cF27C7C7|r|c71DE738|r|cF27C7C9|r|c71DE731|r
--Error message here
11 characters for each block X 10 = 110 characters in total?
Maybe it is longer if you only use characters without the color statements, just check it by adding 1234567890123456789012345678901234567890.... blocks
  Reply With Quote
09/10/15, 08:49 AM   #7
Asto
 
Asto's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 18
Ayantir, did you receive my private message about a possible solution in pchat?
  Reply With Quote
09/10/15, 09:04 AM   #8
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I did, but because didn't updated yet all my addons, pChat working fine, and not a lot of things to add in this addon urgently .. I didn't looked at it deeply ^^

For your solution, I still need to look at and check exactly what's the limitations of a :AddMessage() to a textbuffer control
  Reply With Quote
09/10/15, 12:45 PM   #9
Asto
 
Asto's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 18
Okay thanks

Take all the time you need. I was just curious if you received the message
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » pChat / LibChat Message Length


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off