Reopen last channels on login.
This commit is contained in:
parent
7666466349
commit
4aeb9edfae
|
@ -54,6 +54,7 @@ local channels
|
||||||
local channelsWindow
|
local channelsWindow
|
||||||
local ownPrivateName
|
local ownPrivateName
|
||||||
local messageHistory = {}
|
local messageHistory = {}
|
||||||
|
local lastChannels = {}
|
||||||
local currentMessageIndex = 0
|
local currentMessageIndex = 0
|
||||||
local ignoreNpcMessages = false
|
local ignoreNpcMessages = false
|
||||||
|
|
||||||
|
@ -186,6 +187,10 @@ local function onGameStart()
|
||||||
if tab then
|
if tab then
|
||||||
addEvent(function() consoleTabBar:selectTab(tab) end, false)
|
addEvent(function() consoleTabBar:selectTab(tab) end, false)
|
||||||
end
|
end
|
||||||
|
for _, channelid in pairs(lastChannels) do
|
||||||
|
g_game.joinChannel(channelid)
|
||||||
|
end
|
||||||
|
lastChannels = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- public functions
|
-- public functions
|
||||||
|
@ -265,7 +270,9 @@ function Console.terminate()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Console.clear()
|
function Console.clear()
|
||||||
|
lastChannels = {}
|
||||||
for channelid, channelname in pairs(channels) do
|
for channelid, channelname in pairs(channels) do
|
||||||
|
table.insert(lastChannels, tonumber(channelid))
|
||||||
local tab = consoleTabBar:getTab(channelname)
|
local tab = consoleTabBar:getTab(channelname)
|
||||||
consoleTabBar:removeTab(tab)
|
consoleTabBar:removeTab(tab)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue