ChatSaver/ChatSaver.lua

36 lines
1.2 KiB
Lua
Raw Normal View History

2011-05-25 05:05:57 -04:00
ChatSaver = LibStub('AceAddon-3.0'):NewAddon('ChatSaver','AceHook-3.0','AceEvent-3.0');
local core = ChatSaver;
2011-05-25 05:36:29 -04:00
function core:OnInitialize()
2011-05-25 05:05:57 -04:00
self:RegisterEvent('PLAYER_LOGIN','ReloadUI');
end
function core:ReloadUI()
2011-05-25 05:36:29 -04:00
channelList = {};
for i = 1, select("#",GetChannelList()), 2 do
local index,channel = select(i,GetChannelList());
channelList[index] = channel;
end
2011-05-25 05:44:45 -04:00
--force channel list for now
2011-05-25 05:36:29 -04:00
myChannels = {};
myChannels[1] = 'General';
myChannels[2] = 'Trade';
myChannels[3] = 'LocalDefense';
myChannels[4] = 'ncaheal';
myChannels[5] = 'ncabads';
myChannels[6] = 'ncafail';
2011-05-25 05:44:45 -04:00
--debugging
2011-05-25 05:36:29 -04:00
for index,channel in pairs(myChannels) do
if(channel ~= channelList[index]) then
print('Channel ',channel,' not joined. Rejoining now!');
JoinPermanentChannel(channel);
end
end
2011-05-25 05:05:57 -04:00
end
--AddChatWindowChannel(chatFrameIndex, "channel") - Make a chat channel visible in a specific ChatFrame.
--Chat output architecture has changed since release; calling this function alone is no longer sufficient to add a channel to a particular frame in the default UI. Use ChatFrame_AddChannel(chatFrame, "channelName") instead, like so: