mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 14:13:27 +02:00
Version 0.95 BETA
This commit is contained in:
50
modules/client_background/background.lua
Normal file
50
modules/client_background/background.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
-- private variables
|
||||
local background
|
||||
local clientVersionLabel
|
||||
|
||||
-- public functions
|
||||
function init()
|
||||
background = g_ui.displayUI('background')
|
||||
background:lower()
|
||||
|
||||
clientVersionLabel = background:getChildById('clientVersionLabel')
|
||||
clientVersionLabel:setText(g_app.getName() .. ' ' .. g_app.getVersion() .. '\nMade by:\n' .. g_app.getAuthor() .. "\notclient@otclient.ovh")
|
||||
|
||||
|
||||
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
|
10
modules/client_background/background.otmod
Normal file
10
modules/client_background/background.otmod
Normal file
@@ -0,0 +1,10 @@
|
||||
Module
|
||||
name: client_background
|
||||
description: Handles the background of the login screen
|
||||
author: edubart
|
||||
website: https://github.com/edubart/otclient
|
||||
sandboxed: true
|
||||
scripts: [ background ]
|
||||
dependencies: [ client_topmenu ]
|
||||
@onLoad: init()
|
||||
@onUnload: terminate()
|
24
modules/client_background/background.otui
Normal file
24
modules/client_background/background.otui
Normal file
@@ -0,0 +1,24 @@
|
||||
Panel
|
||||
id: background
|
||||
image-source: /images/background
|
||||
image-smooth: true
|
||||
image-fixed-ratio: true
|
||||
anchors.top: topMenu.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
margin-top: 1
|
||||
focusable: false
|
||||
|
||||
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
|
Reference in New Issue
Block a user