2011-11-02 01:02:56 -02:00
|
|
|
-- private variables
|
|
|
|
|
local background
|
2013-02-18 13:16:22 -03:00
|
|
|
local clientVersionLabel
|
2011-11-02 01:02:56 -02:00
|
|
|
|
|
|
|
|
-- public functions
|
2013-01-18 20:39:11 -02:00
|
|
|
function init()
|
2021-07-19 19:24:59 -03:00
|
|
|
background = g_ui.displayUI('background')
|
|
|
|
|
background:lower()
|
|
|
|
|
|
|
|
|
|
clientVersionLabel = background:getChildById('clientVersionLabel')
|
2022-04-29 23:14:24 -03:00
|
|
|
clientVersionLabel:setText(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' .. 'Rev ' ..
|
|
|
|
|
g_app.getBuildRevision() .. ' (' .. g_app.getBuildCommit() .. ')\n' .. 'Built on ' ..
|
2022-06-03 13:31:48 -03:00
|
|
|
g_app.getBuildDate() .. '\n' .. g_app.getBuildCompiler() .. ' - ' ..
|
|
|
|
|
g_app.getBuildArch())
|
2022-04-29 23:14:24 -03:00
|
|
|
|
2022-08-17 12:51:56 -03:00
|
|
|
if not g_game.isOnline() then
|
|
|
|
|
addEvent(function()
|
|
|
|
|
g_effects.fadeIn(clientVersionLabel, 1500)
|
|
|
|
|
end)
|
|
|
|
|
end
|
2022-04-29 23:14:24 -03:00
|
|
|
|
|
|
|
|
connect(g_game, {
|
|
|
|
|
onGameStart = hide
|
|
|
|
|
})
|
|
|
|
|
connect(g_game, {
|
|
|
|
|
onGameEnd = show
|
|
|
|
|
})
|
2011-11-02 01:02:56 -02:00
|
|
|
end
|
|
|
|
|
|
2013-01-18 20:39:11 -02:00
|
|
|
function terminate()
|
2022-04-29 23:14:24 -03:00
|
|
|
disconnect(g_game, {
|
|
|
|
|
onGameStart = hide
|
|
|
|
|
})
|
|
|
|
|
disconnect(g_game, {
|
|
|
|
|
onGameEnd = show
|
|
|
|
|
})
|
2012-02-20 00:27:08 -02:00
|
|
|
|
2021-07-19 19:24:59 -03:00
|
|
|
g_effects.cancelFade(background:getChildById('clientVersionLabel'))
|
|
|
|
|
background:destroy()
|
2012-02-20 00:27:08 -02:00
|
|
|
|
2021-07-19 19:24:59 -03:00
|
|
|
background = nil
|
|
|
|
|
clientVersionLabel = nil
|
2011-11-02 01:02:56 -02:00
|
|
|
end
|
|
|
|
|
|
2022-08-17 12:51:56 -03:00
|
|
|
function hide()
|
|
|
|
|
background:hide()
|
|
|
|
|
end
|
2011-11-02 01:02:56 -02:00
|
|
|
|
2022-08-17 12:51:56 -03:00
|
|
|
function show()
|
|
|
|
|
background:show()
|
|
|
|
|
end
|
2012-08-06 16:15:20 -03:00
|
|
|
|
2022-08-17 12:51:56 -03:00
|
|
|
function hideVersionLabel()
|
|
|
|
|
background:getChildById('clientVersionLabel'):hide()
|
|
|
|
|
end
|
2013-02-18 13:16:22 -03:00
|
|
|
|
2022-08-17 12:51:56 -03:00
|
|
|
function setVersionText(text)
|
|
|
|
|
clientVersionLabel:setText(text)
|
|
|
|
|
end
|
2017-10-22 23:31:45 +02:00
|
|
|
|
2022-08-17 12:51:56 -03:00
|
|
|
function getBackground()
|
|
|
|
|
return background
|
|
|
|
|
end
|