From 6db87aa78b34eaa2a702b63bed00d79067015808 Mon Sep 17 00:00:00 2001 From: AndreFaramir Date: Tue, 24 Apr 2012 08:39:45 -0300 Subject: [PATCH] fixing my mistakes =x --- modules/game_console/console.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 11d93615..58233bfa 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -109,7 +109,14 @@ local function onOpenChannel(channelId, channelName) Console.addChannel(channelName, channelId) end -local function onOpenPrivateChannel(channelId, channelName) +local function onOpenPrivateChannel(receiver) + local privateTab = Console.getTab(receiver) + if privateTab == nil then + Console.addTab(receiver) + end +end + +local function onOpenOwnPrivateChannel(channelId, channelName) local privateTab = Console.getTab(channelName) if privateTab == nil then Console.addChannel(channelName, channelId, true) @@ -123,7 +130,7 @@ local function onCloseChannel(channelId) local tab = Console.getTab(channel) if tab then consoleTabBar:removeTab(tab) - end + end end end @@ -175,7 +182,8 @@ function Console.init() connect(g_game, { onCreatureSpeak = onCreatureSpeak, onChannelList = onChannelList, onOpenChannel = onOpenChannel, - onOpenOwnPrivateChannel = onOpenPrivateChannel, + onOpenPrivateChannel = onOpenPrivateChannel, + onOpenOwnPrivateChannel = onOpenOwnPrivateChannel, onCloseChannel = onCloseChannel, onGameEnd = Console.clear }) @@ -209,6 +217,7 @@ function Console.terminate() disconnect(g_game, { onCreatureSpeak = onCreatureSpeak, onChannelList = onChannelList, onOpenChannel = onOpenChannel, + onOpenPrivateChannel = onOpenPrivateChannel, onOpenOwnPrivateChannel = onOpenPrivateChannel, onCloseChannel = onCloseChannel, onGameEnd = Console.clear })