Basic testing of join hook
This commit is contained in:
parent
1bcb5bd205
commit
7a224ea81f
2 changed files with 15 additions and 3 deletions
|
@ -1,8 +1,11 @@
|
||||||
ChatSaver = LibStub('AceAddon-3.0'):NewAddon('ChatSaver','AceHook-3.0','AceEvent-3.0');
|
ChatSaver = LibStub('AceAddon-3.0'):NewAddon('ChatSaver','AceHook-3.0','AceEvent-3.0');
|
||||||
local core = ChatSaver;
|
local core = ChatSaver;
|
||||||
|
|
||||||
|
local db;
|
||||||
|
|
||||||
function core:OnInitialize()
|
function core:OnInitialize()
|
||||||
self:RegisterEvent('PLAYER_LOGIN','ReloadUI');
|
self:RegisterEvent('PLAYER_LOGIN','ReloadUI');
|
||||||
|
self:Hook(SlashCmdList,'JOIN','JoinChannel',true);
|
||||||
end
|
end
|
||||||
|
|
||||||
function core:ReloadUI()
|
function core:ReloadUI()
|
||||||
|
@ -22,14 +25,20 @@ function core:ReloadUI()
|
||||||
myChannels[5] = 'ncabads';
|
myChannels[5] = 'ncabads';
|
||||||
myChannels[6] = 'ncafail';
|
myChannels[6] = 'ncafail';
|
||||||
|
|
||||||
--debugging
|
|
||||||
for index,channel in pairs(myChannels) do
|
for index,channel in pairs(myChannels) do
|
||||||
if(channel ~= channelList[index]) then
|
if(channel ~= channelList[index]) then
|
||||||
print('Channel ',channel,' not joined. Rejoining now!');
|
print('Channel ',channel,' not joined. Rejoining now!');
|
||||||
JoinPermanentChannel(channel);
|
JoinPermanentChannel(channel);
|
||||||
|
|
||||||
|
local i = 1;
|
||||||
|
while ( DEFAULT_CHAT_FRAME.channelList[i] ) do
|
||||||
|
i = i + 1;
|
||||||
|
end
|
||||||
|
DEFAULT_CHAT_FRAME.channelList[i] = channel;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--AddChatWindowChannel(chatFrameIndex, "channel") - Make a chat channel visible in a specific ChatFrame.
|
function core:JoinChannel()
|
||||||
--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:
|
--need to store channel in db
|
||||||
|
end
|
|
@ -6,7 +6,10 @@
|
||||||
## Dependencies:
|
## Dependencies:
|
||||||
## OptionalDeps:
|
## OptionalDeps:
|
||||||
## DefaultState: enabled
|
## DefaultState: enabled
|
||||||
|
## SavedVariables: ChatSaverDB
|
||||||
|
|
||||||
Libs\LibStub\LibStub.lua
|
Libs\LibStub\LibStub.lua
|
||||||
|
Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml
|
||||||
Libs\AceAddon-3.0\AceAddon-3.0.xml
|
Libs\AceAddon-3.0\AceAddon-3.0.xml
|
||||||
Libs\AceEvent-3.0\AceEvent-3.0.xml
|
Libs\AceEvent-3.0\AceEvent-3.0.xml
|
||||||
Libs\AceHook-3.0\AceHook-3.0.xml
|
Libs\AceHook-3.0\AceHook-3.0.xml
|
||||||
|
|
Loading…
Reference in a new issue