Thread Tools Display Modes
09/26/15, 02:27 PM   #1
Asto
 
Asto's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 18
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?
  Reply With Quote
09/26/15, 02:39 PM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
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
  Reply With Quote
10/01/15, 06:37 AM   #3
Asto
 
Asto's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 18
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? :/

Last edited by Asto : 10/01/15 at 06:43 AM.
  Reply With Quote
10/01/15, 07:26 AM   #4
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
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).
  Reply With Quote
10/01/15, 07:48 AM   #5
Asto
 
Asto's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 18
Ah okay thanks, i will forward that info to the user
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Receive a chat tab name


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