From 4aeb9edfae5753a7fe59572c000c3c47f171e5e2 Mon Sep 17 00:00:00 2001 From: Kamil Date: Mon, 9 Jul 2012 17:00:16 +0200 Subject: [PATCH] Reopen last channels on login. --- modules/game_console/console.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 8604503c..2f04c951 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -54,6 +54,7 @@ local channels local channelsWindow local ownPrivateName local messageHistory = {} +local lastChannels = {} local currentMessageIndex = 0 local ignoreNpcMessages = false @@ -186,6 +187,10 @@ local function onGameStart() if tab then addEvent(function() consoleTabBar:selectTab(tab) end, false) end + for _, channelid in pairs(lastChannels) do + g_game.joinChannel(channelid) + end + lastChannels = {} end -- public functions @@ -265,7 +270,9 @@ function Console.terminate() end function Console.clear() + lastChannels = {} for channelid, channelname in pairs(channels) do + table.insert(lastChannels, tonumber(channelid)) local tab = consoleTabBar:getTab(channelname) consoleTabBar:removeTab(tab) end