2011-11-02 04:02:56 +01:00
|
|
|
Background = { }
|
|
|
|
|
|
|
|
-- private variables
|
|
|
|
local background
|
|
|
|
|
|
|
|
-- public functions
|
2012-01-07 18:36:58 +01:00
|
|
|
function Background.init()
|
2012-01-03 01:42:53 +01:00
|
|
|
background = displayUI('background.otui')
|
2012-02-05 23:42:35 +01:00
|
|
|
background:lower()
|
2012-02-20 03:27:08 +01:00
|
|
|
|
2012-03-16 14:28:29 +01:00
|
|
|
local clientVersionLabel = background:getChildById('clientVersionLabel')
|
|
|
|
clientVersionLabel:setText('OTClient ' .. g_app.getVersion() .. '\n' ..
|
2012-03-22 22:47:52 +01:00
|
|
|
'Rev ' .. g_app.getBuildRevision() .. '\n' ..
|
2012-03-28 21:32:18 +02:00
|
|
|
'Protocol ' .. g_game.getProtocolVersion() .. '\n' ..
|
2012-03-16 14:28:29 +01:00
|
|
|
'Built on ' .. g_app.getBuildDate())
|
2012-03-18 14:34:39 +01:00
|
|
|
|
|
|
|
if not g_game.isOnline() then
|
|
|
|
Effects.fadeIn(clientVersionLabel, 1500)
|
|
|
|
end
|
2012-03-16 14:28:29 +01:00
|
|
|
|
2012-02-20 03:27:08 +01:00
|
|
|
connect(g_game, { onGameStart = Background.hide })
|
|
|
|
connect(g_game, { onGameEnd = Background.show })
|
2011-11-02 04:02:56 +01:00
|
|
|
end
|
|
|
|
|
2012-01-07 18:36:58 +01:00
|
|
|
function Background.terminate()
|
2012-02-20 03:27:08 +01:00
|
|
|
disconnect(g_game, { onGameStart = Background.hide })
|
|
|
|
disconnect(g_game, { onGameEnd = Background.show })
|
|
|
|
|
2012-03-23 14:48:05 +01:00
|
|
|
Effects.cancelFade(background:getChildById('clientVersionLabel'))
|
2011-11-02 04:02:56 +01:00
|
|
|
background:destroy()
|
|
|
|
background = nil
|
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
|
|
|
|
|
|
|
|
function Background.hide()
|
|
|
|
background:hide()
|
|
|
|
end
|
|
|
|
|
|
|
|
function Background.show()
|
|
|
|
background:show()
|
|
|
|
end
|