Thread Tools Display Modes
01-01-09, 03:17 PM   #1
Freki
A Deviate Faerie Dragon
 
Freki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 18
How to preserve default channel order

Hi,

I'm trying to create a chat channel to send data through to other users of the addon. This is fine. The problem arises with my addon taking over the default channel order... people get used to doing "/1 slj" or "/2 jasdlkfj" and I don't want my addon to make, say, channel 1 to FrekisAmazingAddon. What's the simplest way to go about avoiding this? Should I manually scan the channels every load and make sure they're in proper order?

Thanks for the help,
Andrew
  Reply With Quote
01-01-09, 04:48 PM   #2
Sekrin
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 150
Who are you trying to share information with? If it's people in the same raid/group or the same guild, then WoW has built-in functionality to deal with this - take a look at http://www.wowwiki.com/API_SendAddonMessage for info.

If it's just random people across the entire server then you could try looking for the events that indicate a player is logging or reloading the UI (such as "PLAYER_LOGOUT"), and then leaving the channel, before joining it again when the player next enters the world....

Note that I haven't actually tried this, but it should work.
__________________
  Reply With Quote
01-01-09, 05:23 PM   #3
Bangerz
A Fallenroot Satyr
 
Bangerz's Avatar
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 27
Could you just create/join the channel say 5 seconds after login?
  Reply With Quote
01-01-09, 07:15 PM   #4
Sekrin
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 150
Originally Posted by Bangerz View Post
Could you just create/join the channel say 5 seconds after login?
The problem with just doing that is that WoW remembers what channels you were last joined to when you logout/login.

Since my first post, I've also remembered when I had a whole bunch of custom channels open. WoW would always choose the next channel in order and it only re-ordered those when I left a channel (and after a UI reload).

The long and the short of it is that I don't think you need to worry about it too much as the only time it's likely to be an issue is when WoW goes and forgets all about the channels you're supposed to be in (which it does on occasion).
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to preserve default channel order


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