Originally Posted by stealthbr
Hello everyone. I would like to know if it's possible to create an addon that allows the player to cycle through the chat channels with a keybind. In Dungeons & Dragons Online, for instance, you can cycle between chat channels by pressing "[" to go to the chat channel on the left or "]" to go to the chat channel on the right.
Thanks!
|
Do you mean chat channels or chat tabs? It would be completely different code.
Anyway I assume that you want to switch between chat tabs.
Here is source code:
CycleChatTabs.txt
Code:
## APIVersion: 100010
## Title: |cEFEBBECycle Chat Tabs|r 0.1
## Description: Cycle between chat tabs using the keybindings.
## Version: 0.1
## Author: |cEFEBBEGarkin|r
CycleChatTabs.lua
bindings.xml
CycleChatTabs.lua
Lua Code:
ZO_CreateStringId("SI_BINDING_NAME_CYCLE_CHAT_TABS_LEFT", "Cycle through chat tabs - left")
ZO_CreateStringId("SI_BINDING_NAME_CYCLE_CHAT_TABS_RIGHT", "Cycle through chat tabs - right")
bindings.xml
XML Code:
<Bindings>
<Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
<Category name="SI_KEYBINDINGS_CATEGORY_USER_INTERFACE">
<Action name="CYCLE_CHAT_TABS_LEFT">
<Down>
local container = CHAT_SYSTEM.primaryContainer
local index = container.currentBuffer:GetParent().tab.index
index = (index == 1) and (container.hiddenTabStartIndex - 1) or (index - 1)
container.tabGroup:SetClickedButton(container.windows[index].tab)
</Down>
</Action>
<Action name="CYCLE_CHAT_TABS_RIGHT">
<Down>
local container = CHAT_SYSTEM.primaryContainer
local index = container.currentBuffer:GetParent().tab.index
index = (index == container.hiddenTabStartIndex - 1) and 1 or (index + 1)
container.tabGroup:SetClickedButton(container.windows[index].tab)
</Down>
</Action>
</Category>
</Layer>
</Bindings>
Or if you want, I have uploaded it to my Dropbox folder as "CycleChatTabs-0.1.zip" (link in my signature).