Eduardo Bart c0611bfe2a restore some game functionallity
* i'm gradually restoring game functionality with the new modules design, though still a lot to do
* you can reload all scripts and modules using Ctrl+R shortcut while playing (finally! this is the reason of all this rework)
* a bunch of fixes, but new regression too :P
* fix performance issue that could lead freezes in the client in older machines
* completely new game module with new design
* fix crashs in map render
* remove uigame.cpp (now every game input is via lua)
* enable DEBUG macro by default, with it you are able to view any possible lua leak while running
2012-03-18 10:35:45 -03:00

40 lines
892 B
Lua

Background = { }
-- private variables
local background
-- public functions
function Background.init()
background = displayUI('background.otui')
background:lower()
local clientVersionLabel = background:getChildById('clientVersionLabel')
clientVersionLabel:setText('OTClient ' .. g_app.getVersion() .. '\n' ..
'Built on ' .. g_app.getBuildDate())
if not g_game.isOnline() then
Effects.fadeIn(clientVersionLabel, 1500)
end
connect(g_game, { onGameStart = Background.hide })
connect(g_game, { onGameEnd = Background.show })
end
function Background.terminate()
disconnect(g_game, { onGameStart = Background.hide })
disconnect(g_game, { onGameEnd = Background.show })
background:destroy()
background = nil
Background = nil
end
function Background.hide()
background:hide()
end
function Background.show()
background:show()
end