mirror of
				https://github.com/OTCv8/otclientv8.git
				synced 2025-10-31 10:56:24 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
| -- private variables
 | |
| local background
 | |
| local clientVersionLabel
 | |
| 
 | |
| -- public functions
 | |
| function init()
 | |
|   background = g_ui.displayUI('background')
 | |
|   background:lower()
 | |
| 
 | |
|   clientVersionLabel = background:getChildById('clientVersionLabel')
 | |
|   clientVersionLabel:setText('OTClientV8 ' .. g_app.getVersion() .. '\nrev ' .. g_app.getBuildRevision() .. '\nMade by:\n' .. g_app.getAuthor() .. "")
 | |
|   
 | |
|   if not g_game.isOnline() then
 | |
|     addEvent(function() g_effects.fadeIn(clientVersionLabel, 1500) end)
 | |
|   end
 | |
| 
 | |
|   connect(g_game, { onGameStart = hide })
 | |
|   connect(g_game, { onGameEnd = show })
 | |
| end
 | |
| 
 | |
| function terminate()
 | |
|   disconnect(g_game, { onGameStart = hide })
 | |
|   disconnect(g_game, { onGameEnd = show })
 | |
| 
 | |
|   g_effects.cancelFade(background:getChildById('clientVersionLabel'))
 | |
|   background:destroy()
 | |
| 
 | |
|   Background = nil
 | |
| end
 | |
| 
 | |
| function hide()
 | |
|   background:hide()
 | |
| end
 | |
| 
 | |
| function show()
 | |
|   background:show()
 | |
| end
 | |
| 
 | |
| function hideVersionLabel()
 | |
|   background:getChildById('clientVersionLabel'):hide()
 | |
| end
 | |
| 
 | |
| function setVersionText(text)
 | |
|   clientVersionLabel:setText(text)
 | |
| end
 | |
| 
 | |
| function getBackground()
 | |
|   return background
 | |
| end | 
