2011-11-02 04:02:56 +01:00
|
|
|
-- private variables
|
|
|
|
local background
|
2013-02-18 17:16:22 +01:00
|
|
|
local clientVersionLabel
|
2011-11-02 04:02:56 +01:00
|
|
|
|
|
|
|
-- public functions
|
2013-01-18 23:39:11 +01:00
|
|
|
function init()
|
|
|
|
background = g_ui.displayUI('background')
|
2012-02-05 23:42:35 +01:00
|
|
|
background:lower()
|
2012-02-20 03:27:08 +01:00
|
|
|
|
2013-02-18 17:16:22 +01:00
|
|
|
clientVersionLabel = background:getChildById('clientVersionLabel')
|
2013-01-18 23:39:11 +01:00
|
|
|
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' ..
|
2017-11-29 00:42:15 +01:00
|
|
|
'Built on ' .. g_app.getBuildDate() .. '\n' .. g_app.getBuildCompiler())
|
2012-03-18 14:34:39 +01:00
|
|
|
|
|
|
|
if not g_game.isOnline() then
|
2013-02-18 17:16:22 +01:00
|
|
|
addEvent(function() g_effects.fadeIn(clientVersionLabel, 1500) end)
|
2012-03-18 14:34:39 +01:00
|
|
|
end
|
2012-03-16 14:28:29 +01:00
|
|
|
|
2013-01-18 23:39:11 +01:00
|
|
|
connect(g_game, { onGameStart = hide })
|
|
|
|
connect(g_game, { onGameEnd = show })
|
2011-11-02 04:02:56 +01:00
|
|
|
end
|
|
|
|
|
2013-01-18 23:39:11 +01:00
|
|
|
function terminate()
|
|
|
|
disconnect(g_game, { onGameStart = hide })
|
|
|
|
disconnect(g_game, { onGameEnd = show })
|
2012-02-20 03:27:08 +01:00
|
|
|
|
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-20 03:27:08 +01:00
|
|
|
|
2012-02-07 01:41:53 +01:00
|
|
|
Background = nil
|
2011-11-02 04:02:56 +01:00
|
|
|
end
|
|
|
|
|
2013-01-18 23:39:11 +01:00
|
|
|
function hide()
|
2011-11-02 04:02:56 +01:00
|
|
|
background:hide()
|
|
|
|
end
|
|
|
|
|
2013-01-18 23:39:11 +01:00
|
|
|
function show()
|
2011-11-02 04:02:56 +01:00
|
|
|
background:show()
|
|
|
|
end
|
2012-08-06 21:15:20 +02:00
|
|
|
|
2013-01-18 23:39:11 +01:00
|
|
|
function hideVersionLabel()
|
2012-08-06 21:15:20 +02:00
|
|
|
background:getChildById('clientVersionLabel'):hide()
|
|
|
|
end
|
2013-02-18 17:16:22 +01:00
|
|
|
|
|
|
|
function setVersionText(text)
|
|
|
|
clientVersionLabel:setText(text)
|
|
|
|
end
|
2017-10-22 23:31:45 +02:00
|
|
|
|
|
|
|
function getBackground()
|
|
|
|
return background
|
|
|
|
end
|