tibia-client/modules/client_background/background.lua

43 lines
1.1 KiB
Lua
Raw Normal View History

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-06-26 00:13:30 +02:00
background = g_ui.displayUI('background.otui')
background:lower()
local clientVersionLabel = background:getChildById('clientVersionLabel')
clientVersionLabel:setText('OTClient ' .. g_app.getVersion() .. '\n' ..
'Rev ' .. g_app.getBuildRevision() .. '\n' ..
'Protocol ' .. g_game.getProtocolVersion() .. '\n' ..
'Built on ' .. g_app.getBuildDate())
if not g_game.isOnline() then
2012-06-26 00:13:30 +02:00
g_effects.fadeIn(clientVersionLabel, 1500)
end
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()
disconnect(g_game, { onGameStart = Background.hide })
disconnect(g_game, { onGameEnd = Background.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()
background = nil
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