From 8bc879d295307ed36832f2490f6d450d970335d2 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Sat, 14 Jan 2012 18:14:40 -0200 Subject: [PATCH] limite chat upto 10 labels --- modules/game_console/console.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index c7309368..3ba7b502 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -103,10 +103,15 @@ function Console.addTabText(text, speaktype, tab) text = os.date('%H:%M') .. ' ' .. text end - local label = createWidget('ConsoleLabel', consoleTabBar:getTabPanel(tab)) + local panel = consoleTabBar:getTabPanel(tab) + local label = createWidget('ConsoleLabel', panel) label:setText(text) label:setColor(speaktype.color) consoleTabBar:blinkTab(tab) + + if panel:getChildCount() > 10 then + panel:removeChild(panel:getFirstChild()) + end end function Console.sendCurrentMessage()