Resolve "Merge the best from 7.40 branch"

This commit is contained in:
Erikas Kontenis
2022-04-06 14:58:52 +00:00
parent 3bd1a6f07e
commit 155da3573c
928 changed files with 43723 additions and 1221 deletions

View File

@@ -0,0 +1,49 @@
-- 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

View File

@@ -0,0 +1,9 @@
Module
name: client_background
description: Handles the background of the login screen
author: edubart
website: https://github.com/edubart/otclient
sandboxed: true
scripts: [ background ]
@onLoad: init()
@onUnload: terminate()

View File

@@ -0,0 +1,21 @@
UIWidget
id: background
anchors.fill: parent
focusable: false
image-source: /images/background
image-smooth: true
image-fixed-ratio: true
margin-top: 1
UILabel
id: clientVersionLabel
background-color: #00000099
anchors.right: parent.right
anchors.bottom: parent.bottom
text-align: center
text-auto-resize: false
width: 220
height: 90
padding: 2
color: #ffffff
font: terminus-14px-bold