mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
fix warnings and some reloading issues
This commit is contained in:
@@ -177,19 +177,19 @@ function Terminal.hide()
|
||||
end
|
||||
|
||||
function Terminal.addLine(text, color)
|
||||
-- create new line label
|
||||
local numLines = terminalBuffer:getChildCount() + 1
|
||||
local label = createWidget('TerminalLabel', terminalBuffer)
|
||||
label:setId('terminalLabel' .. numLines)
|
||||
label:setText(text)
|
||||
label:setColor(color)
|
||||
|
||||
-- delete old lines if needed
|
||||
local numLines = terminalBuffer:getChildCount() + 1
|
||||
if numLines > MaxLogLines then
|
||||
terminalBuffer:getChildByIndex(1):destroy()
|
||||
else
|
||||
terminalBuffer:setHeight(terminalBuffer:getHeight() + LabelHeight)
|
||||
end
|
||||
|
||||
-- create new line label
|
||||
local label = createWidget('TerminalLabel', terminalBuffer)
|
||||
label:setId('terminalLabel' .. numLines)
|
||||
label:setText(text)
|
||||
label:setColor(color)
|
||||
end
|
||||
|
||||
function Terminal.executeCommand(command)
|
||||
|
Reference in New Issue
Block a user