remove useless files
This commit is contained in:
parent
5d54971568
commit
a9bf1cee36
|
@ -1,17 +0,0 @@
|
||||||
Module
|
|
||||||
name: game
|
|
||||||
description: Create the game interface, where the ingame stuff starts
|
|
||||||
author: OTClient team
|
|
||||||
website: https://github.com/edubart/otclient
|
|
||||||
autoLoad: true
|
|
||||||
dependencies:
|
|
||||||
- core
|
|
||||||
- tibiafiles
|
|
||||||
- topmenu
|
|
||||||
- entergame
|
|
||||||
- background
|
|
||||||
|
|
||||||
onLoad: |
|
|
||||||
require 'game'
|
|
||||||
require 'textmessage'
|
|
||||||
return true
|
|
|
@ -1,60 +0,0 @@
|
||||||
TextMessage = {}
|
|
||||||
|
|
||||||
-- require styles
|
|
||||||
importStyles '/game/ui/textmessage.otui'
|
|
||||||
|
|
||||||
-- private variables
|
|
||||||
local bottomLabelWidget, centerLabelWidget
|
|
||||||
local messageTypes = {
|
|
||||||
first = 12,
|
|
||||||
{ type = 'MessageOrange', color = '#C87832', showOnConsole = true, showOnWindow = false },
|
|
||||||
{ type = 'MessageOrange', color = '#C87832', showOnConsole = true, showOnWindow = false },
|
|
||||||
{ type = 'MessageRed', color = '#C83200', showOnConsole = true, showOnWindow = true, windowLocation = 'CenterLabel' },
|
|
||||||
{ type = 'MessageWhite', color = '#FFFFFF', showOnConsole = true, showOnWindow = true, windowLocation = 'CenterLabel' },
|
|
||||||
{ type = 'MessageWhite', color = '#FFFFFF', showOnConsole = true, showOnWindow = true, windowLocation = 'BottomLabel' },
|
|
||||||
{ type = 'MessageWhite', color = '#FFFFFF', showOnConsole = true, showOnWindow = true, windowLocation = 'BottomLabel' },
|
|
||||||
{ type = 'MessageGreen', color = '#3FBE32', showOnConsole = true, showOnWindow = true, windowLocation = 'CenterLabel' },
|
|
||||||
{ type = 'MessageWhite', color = '#FFFFFF', showOnConsole = false, showOnWindow = true, windowLocation = 'BottomLabel' },
|
|
||||||
{ type = 'MessageBlue', color = '#3264C8', showOnConsole = true, showOnWindow = false },
|
|
||||||
{ type = 'MessageRed', color = '#C83200', showOnConsole = true, showOnWindow = false }
|
|
||||||
}
|
|
||||||
|
|
||||||
-- public functions
|
|
||||||
function TextMessage.create()
|
|
||||||
bottomLabelWidget = UILabel.create()
|
|
||||||
Game.gameMapPanel:addChild(bottomLabelWidget)
|
|
||||||
|
|
||||||
centerLabelWidget = UILabel.create()
|
|
||||||
Game.gameMapPanel:addChild(centerLabelWidget)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- hooked events
|
|
||||||
function Game.onTextMessage(type, message)
|
|
||||||
local messageType = messageTypes[type - messageTypes.first]
|
|
||||||
|
|
||||||
if messageType.showOnConsole then
|
|
||||||
-- TODO
|
|
||||||
end
|
|
||||||
|
|
||||||
if messageType.showOnWindow then
|
|
||||||
local label
|
|
||||||
if messageType.windowLocation == 'BottomLabel' then
|
|
||||||
label = bottomLabelWidget
|
|
||||||
elseif messageType.windowLocation == 'CenterLabel' then
|
|
||||||
label = centerLabelWidget
|
|
||||||
end
|
|
||||||
|
|
||||||
label:setVisible(true)
|
|
||||||
label:setForegroundColor(messageType.color)
|
|
||||||
label:setText(message)
|
|
||||||
|
|
||||||
label:setStyle(messageType.windowLocation)
|
|
||||||
|
|
||||||
time = #message * 75
|
|
||||||
scheduleEvent(function()
|
|
||||||
label:setVisible(false)
|
|
||||||
end, time)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
connect(Game, { onLogin = TextMessage.create })
|
|
|
@ -1,14 +0,0 @@
|
||||||
Module
|
|
||||||
name: health_mana
|
|
||||||
description: Displays health and mana points
|
|
||||||
author: OTClient team
|
|
||||||
website: https://github.com/edubart/otclient
|
|
||||||
autoLoad: true
|
|
||||||
dependencies:
|
|
||||||
- game
|
|
||||||
|
|
||||||
onLoad: |
|
|
||||||
require 'viplist'
|
|
||||||
return true
|
|
||||||
|
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
HealthMana = {}
|
|
||||||
|
|
||||||
-- private variables
|
|
||||||
local healthManaPanel = nil
|
|
||||||
|
|
||||||
-- public functions
|
|
||||||
function HealthMana.create()
|
|
||||||
healthManaPanel = loadUI("/health_mana/health_mana.otui", Game.gameRightPanel)
|
|
||||||
|
|
||||||
local healthLabel = UILabel.create()
|
|
||||||
healthManaPanel:addChild(healthLabel)
|
|
||||||
healthLabel:setId('healthLabel')
|
|
||||||
healthLabel:setStyle('HealthLabel')
|
|
||||||
healthLabel:setText('0 / 0')
|
|
||||||
|
|
||||||
local manaLabel = UILabel.create()
|
|
||||||
healthManaPanel:addChild(manaLabel)
|
|
||||||
manaLabel:setId('manaLabel')
|
|
||||||
manaLabel:setStyle('ManaLabel')
|
|
||||||
manaLabel:setText('1 / 1')
|
|
||||||
|
|
||||||
healthManaPanel:setHeight(healthLabel:getHeight() + manaLabel:getHeight())
|
|
||||||
end
|
|
||||||
|
|
||||||
function HealthMana.destroy()
|
|
||||||
healthManaPanel:destroy()
|
|
||||||
healthManaPanel = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- hooked events
|
|
||||||
function Game.onHealthChange(health, maxHealth)
|
|
||||||
local label = healthManaPanel:getChildById('healthLabel')
|
|
||||||
label:setText(health .. ' / ' .. maxHealth)
|
|
||||||
end
|
|
||||||
|
|
||||||
function Game.onManaChange(mana, maxMana)
|
|
||||||
local label = healthManaPanel:getChildById('manaLabel')
|
|
||||||
label:setText(mana .. ' / ' .. maxMana)
|
|
||||||
end
|
|
||||||
|
|
||||||
connect(Game, { onLogin = HealthMana.create,
|
|
||||||
onLogout = HealthMana.destroy })
|
|
|
@ -1,29 +0,0 @@
|
||||||
HealthLabel < Label
|
|
||||||
color: red
|
|
||||||
background-color: green
|
|
||||||
align: center
|
|
||||||
font: verdana-11px-monochrome
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
image: /core_styles/images/empty_rect.png
|
|
||||||
|
|
||||||
ManaLabel < Label
|
|
||||||
color: blue
|
|
||||||
background-color: red
|
|
||||||
align: center
|
|
||||||
font: verdana-11px-monochrome
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
image: /core_styles/images/empty_rect.png
|
|
||||||
|
|
||||||
UIWindow
|
|
||||||
id: healthManaPanel
|
|
||||||
width: 192
|
|
||||||
margin.top: 6
|
|
||||||
margin.left: 6
|
|
||||||
margin.right: 6
|
|
||||||
move policy: free updated
|
|
||||||
image: /core_styles/images/empty_rect.png
|
|
||||||
|
|
Loading…
Reference in New Issue