ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Receive a chat tab name (https://www.esoui.com/forums/showthread.php?t=5183)

Asto 09/26/15 02:27 PM

Receive a chat tab name
 
Hello,

i can sent chat messages to specific chat tabs like this small and dirty examle for the first tab:
Lua Code:
  1. CHAT_SYSTEM["containers"][1]["windows"][1].buffer:AddMessage(message)

But how can i receive the name of the first chat tab? It has a method GetName() but that's not the label, just the controller id ("ZO_ChatWindowTemplate13").

I've looked into the data with zgoo, but couldn't find the real label anywhere. Any ideas? :)

---

i want to add some settings for my addon to select a chat tab for the output. Or is there a way to add an channel for an addon and to select the channel via chat-tab settings of eso?

Ayantir 09/26/15 02:39 PM

Why don't you simply just use

Lua Code:
  1. d(message)
  2. --
  3. CHAT_SYSTEM:AddMessage(message)

? and let the chat addons doing their job ? ^^^^^^^^


For your question, it's :

Lua Code:
  1. CHAT_SYSTEM.containers[1]:GetTabName(numTab)

For interested people, send a (fake) message to a category : will display the message where the category is enabled in tab options categories are : http://wiki.esoui.com/Globals#ChatChannelCategories
This exemple is nice when dislpaying messages for a specific guild per exemple (or the party).


Lua Code:
  1. -- Can occur if event is before EVENT_PLAYER_ACTIVATED
  2.     if CHAT_SYSTEM then
  3.         if CHAT_SYSTEM.primaryContainer then
  4.             CHAT_SYSTEM.primaryContainer:OnChatEvent(nil, displayedMessage, category)
  5.         end
  6.     end

Writing directly to textbuffer is not a good practice :(

Asto 10/01/15 06:37 AM

Thanks - currently I'm using the simple AddMessage method but thought about writing to the buffer directly
But you are right, that's a bad practice

Thanks for the snippet with the message categories :)

Explanation:
A user of my addon noticed the output appearing in every chat tab instead of only the first one. So i thought i add an option to select the chat tab where the output will appear. During the debugging process i found out that without pChat it's working as expected (only appearing in tab 1). With pChat, the messages appear in every tab. So for now, i'll simply stick with the AddMessage.

Do we use pChat wrong? :/

Ayantir 10/01/15 07:26 AM

You should not have problem if you only use
Lua Code:
  1. d(...)
  2. CHAT_SYSTEM:AddMessage(message)
  3. CHAT_SYSTEM.primaryContainer:OnChatEvent(nil, displayedMessage, category)

And with the third, you already broke certain addons which enable multi containers.

And for your problem, it's because with pChat, I enable system messages per default in every tab. (it was enable in every tab or disable everywhere).

you can simply uncheck system message by unchecking in tab options the "system" entry (added by pchat).



You can see more detailled explanations here

http://www.esoui.com/downloads/filei...ge=11#comments (and in page 13).

Asto 10/01/15 07:48 AM

Ah okay thanks, i will forward that info to the user :o


All times are GMT -6. The time now is 03:03 AM.

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