tibia-client/modules/client_background/background.lua

51 lines
1.2 KiB
Lua
Raw Normal View History

2011-11-02 04:02:56 +01:00
-- private variables
local background
local clientVersionLabel
2011-11-02 04:02:56 +01:00
-- public functions
function init()
background = g_ui.displayUI('background')
background:lower()
clientVersionLabel = background:getChildById('clientVersionLabel')
clientVersionLabel:setText(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' ..
2012-07-08 18:46:09 +02:00
'Rev ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' ..
'Built on ' .. g_app.getBuildDate())
if not g_game.isOnline() then
addEvent(function() g_effects.fadeIn(clientVersionLabel, 1500) end)
end
connect(g_game, { onGameStart = hide })
connect(g_game, { onGameEnd = show })
2011-11-02 04:02:56 +01:00
end
function terminate()
disconnect(g_game, { onGameStart = hide })
disconnect(g_game, { onGameEnd = show })
2012-06-26 00:13:30 +02:00
g_effects.cancelFade(background:getChildById('clientVersionLabel'))
2011-11-02 04:02:56 +01:00
background:destroy()
2012-02-07 01:41:53 +01:00
Background = nil
2011-11-02 04:02:56 +01:00
end
function hide()
2011-11-02 04:02:56 +01:00
background:hide()
end
function show()
2011-11-02 04:02:56 +01:00
background:show()
end
function hideVersionLabel()
background:getChildById('clientVersionLabel'):hide()
end
function setVersionText(text)
clientVersionLabel:setText(text)
end
function getBackground()
return background
end