ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   pChat / LibChat Message Length (https://www.esoui.com/forums/showthread.php?t=5098)

Asto 08/31/15 02:41 PM

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... :confused:
Otherwise: Is there a way to detect pChat and disable the color formatting / show a hint for the users?

Baertram 08/31/15 03:07 PM

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.

Asto 08/31/15 03:15 PM

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?

Ayantir 08/31/15 03:57 PM

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.

Asto 09/01/15 02:23 AM

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?

Baertram 09/01/15 11:12 AM

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

Asto 09/10/15 08:49 AM

Ayantir, did you receive my private message about a possible solution in pchat? :)

Ayantir 09/10/15 09:04 AM

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 :)

Asto 09/10/15 12:45 PM

Okay thanks :)

Take all the time you need. I was just curious if you received the message ;)


All times are GMT -6. The time now is 09:18 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI