Thread Tools Display Modes
08/12/14, 05:42 AM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,980
Save last used chat type for each chat tab?

Maybe this was asked before but I could not find it with the forum's search.
So I'll ask again:

Is there a possibility to save the channel you have last written in for each chat tab?

For example:
Tab 1: General chat -> Last talkted in /z
Tab 2: Guilds -> Last talked in /g2
Tab 3: Group -> Last talked in /p
Tab 4: Tells -> Last talked to /t player1

Currently eso is not remembering the last chat command, if you switch between the tabs.
But I'd love to get it to this behaviour :-)

Thanks for any ideas, hints to existing addons etc.
  Reply With Quote
08/12/14, 06:36 AM   #2
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
There are no direct events to work with the Chat tabs. I can't even be notified of name changes or categories being toggeled (UCT has to use a timer to save changes and that in 2014).

There might be some pre-hook event or direct access to the UI element wich allows you to be notified if the active tab changes, but I avoid those areas.

There is no direct way to set the chat channel either. However, if you use Startmessage with a proper channel /slashID (not the same as a slash command!), it will switch to that channel.
But again, there migh be some undokumneted way for this.
  Reply With Quote
08/12/14, 08:28 AM   #3
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,980
OK, this is like the answer I had expected. Too bad :-( Thanks for your input!

Maybe someone has tested this already:
At which time do the events EVENT_CHAT_CHANNEL_JOIN and EVENT_CHAT_CHANNEL_LEAVE fire? If you join a specific chat channel (like "zone" or "zonefr"), and if you leave it by changing to another channel?

If this would be the case one could try to get the currently active control of the chat tabs (if any variable is telling us that the tab is currently selected. Maybe it is :HasFocus() ) and save the channel name upon change to a table.
I assume that we can read the channelname somehow...
When the even EVENT_CHAT_CHANNEL_JOIN is fired the active chat tab could be determined again and the saved channelname will be added to the beginning of send messages, or will be put into the edit control where we start to type the text).

Many maybes :-) I'll try it as I find the time.
  Reply With Quote
08/12/14, 08:44 AM   #4
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by Baertram View Post
OK, this is like the answer I had expected. Too bad :-( Thanks for your input!

Maybe someone has tested this already:
At which time do the events EVENT_CHAT_CHANNEL_JOIN and EVENT_CHAT_CHANNEL_LEAVE fire? If you join a specific chat channel (like "zone" or "zonefr"), and if you leave it by changing to another channel?

If this would be the case one could try to get the currently active control of the chat tabs (if any variable is telling us that the tab is currently selected. Maybe it is :HasFocus() ) and save the channel name upon change to a table.
I assume that we can read the channelname somehow...
When the even EVENT_CHAT_CHANNEL_JOIN is fired the active chat tab could be determined again and the saved channelname will be added to the beginning of send messages, or will be put into the edit control where we start to type the text).

Many maybes :-) I'll try it as I find the time.
Install bug eater and type "/zgoo events" into the chat. You get a nice overview of every event that is fired and can even look at the parameters.

As far as I can tell those Events are no longer used. There were used for the old beta version API wich allowed custom channels (and addons changing the channel, via CreateChannel, JoinChannel). The respective functions have been removed.
  Reply With Quote
08/12/14, 08:52 AM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Lua Code:
  1. EVENT_MANAGER:RegisterForEvent("ChatMemory", EVENT_PLAYER_ACTIVATED, function(event)
  2.    EVENT_MANAGER:UnregisterForEvent("ChatMemory", event)
  3.  
  4.    local sv = {}
  5.  
  6.    --save current settings
  7.    ZO_PreHook(CHAT_SYSTEM, "ValidateChatChannel", function(self)
  8.       local tabIndex = self.primaryContainer.currentBuffer:GetParent().tab.index
  9.       sv[tabIndex] = sv[tabIndex] or {}
  10.       sv[tabIndex].channel = self.currentChannel
  11.       sv[tabIndex].target = self.currentTarget
  12.    end)
  13.  
  14.    --load settings
  15.    ZO_PreHook(CHAT_SYSTEM.primaryContainer, "HandleTabClick", function(self, tab)
  16.       local tabIndex = tab.index
  17.       if sv[tabIndex] then
  18.          CHAT_SYSTEM:SetChannel(sv[tabIndex].channel, sv[tabIndex].target)
  19.       end
  20.    end)
  21. end)
Code above works just for primary container, but it should be sufficient as it's not possible to have more chat containers without addons (ChatMultiWindow).
  Reply With Quote
08/12/14, 09:04 AM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,980
Is there anything you haven't tried/coded with ESO yet, Garkin? :-)
Many many thanks! I'll test it when I get home later.
  Reply With Quote
08/12/14, 08:12 PM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,980
FCO Chat Tab Brain

I coded this simple addon with your code:
FCO Chat Tab Brain

Maybe someone else likes this possibility too.
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » Save last used chat type for each chat tab?


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