Lua Code:
EVENT_MANAGER:RegisterForEvent("ChatMemory", EVENT_PLAYER_ACTIVATED, function(event)
EVENT_MANAGER:UnregisterForEvent("ChatMemory", event)
local sv = {}
--save current settings
ZO_PreHook(CHAT_SYSTEM, "ValidateChatChannel", function(self)
local tabIndex = self.primaryContainer.currentBuffer:GetParent().tab.index
sv[tabIndex] = sv[tabIndex] or {}
sv[tabIndex].channel = self.currentChannel
sv[tabIndex].target = self.currentTarget
end)
--load settings
ZO_PreHook(CHAT_SYSTEM.primaryContainer, "HandleTabClick", function(self, tab)
local tabIndex = tab.index
if sv[tabIndex] then
CHAT_SYSTEM:SetChannel(sv[tabIndex].channel, sv[tabIndex].target)
end
end)
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).