No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

background.lua 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. -- private variables
  2. local background
  3. local clientVersionLabel
  4. -- public functions
  5. function init()
  6. background = g_ui.displayUI('background')
  7. background:lower()
  8. clientVersionLabel = background:getChildById('clientVersionLabel')
  9. clientVersionLabel:setText(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' ..
  10. 'Rev ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' ..
  11. 'Built on ' .. g_app.getBuildDate() .. '\n' .. g_app.getBuildCompiler())
  12. if not g_game.isOnline() then
  13. addEvent(function() g_effects.fadeIn(clientVersionLabel, 1500) end)
  14. end
  15. connect(g_game, { onGameStart = hide })
  16. connect(g_game, { onGameEnd = show })
  17. end
  18. function terminate()
  19. disconnect(g_game, { onGameStart = hide })
  20. disconnect(g_game, { onGameEnd = show })
  21. g_effects.cancelFade(background:getChildById('clientVersionLabel'))
  22. background:destroy()
  23. Background = nil
  24. end
  25. function hide()
  26. background:hide()
  27. end
  28. function show()
  29. background:show()
  30. end
  31. function hideVersionLabel()
  32. background:getChildById('clientVersionLabel'):hide()
  33. end
  34. function setVersionText(text)
  35. clientVersionLabel:setText(text)
  36. end
  37. function getBackground()
  38. return background
  39. end