Save console messages #263, change settings names

This commit is contained in:
Henrique Santiago
2013-02-14 15:30:45 -02:00
parent 5fc1ac8051
commit 07dd78002b
3 changed files with 20 additions and 6 deletions

View File

@@ -137,11 +137,11 @@ function init()
g_keyboard.bindKeyDown('Ctrl+E', removeCurrentTab)
g_keyboard.bindKeyDown('Ctrl+H', openHelp)
-- Ignore List
loadIgnoreSettings()
load()
end
function terminate()
save()
disconnect(g_game, { onTalk = onTalk,
onChannelList = onChannelList,
onOpenChannel = onOpenChannel,
@@ -181,6 +181,20 @@ function terminate()
Console = nil
end
function save()
local settings = {}
settings.messageHistory = messageHistory
g_settings.setNode('game_console', settings)
end
function load()
local settings = g_settings.getNode('game_console')
if settings then
messageHistory = settings.messageHistory or {}
end
loadIgnoreSettings()
end
function onTabChange(tabBar, tab)
if tab == defaultTab or tab == serverTab then
consolePanel:getChildById('closeChannelButton'):disable()