This commit is contained in:
Henrique 2011-09-13 18:54:23 -03:00
parent 35f7b816ee
commit d814932a16
3 changed files with 103 additions and 0 deletions

40
modules/game/skill.lua Normal file
View File

@ -0,0 +1,40 @@
skillWindow = nil
local skills = {"Fist Fighting", "Club Fighting", "Sword Fighting", "Axe Fighting", "Distance Fighting", "Shielding", "Fishing"}
function csw()
skillWindow = loadUI("/game/ui/skillwindow.otui", UI.root)
local skillPanel = skillWindow:getChildById('skillPanel')
-- create first widget cause of layout
local widget = UIWidget.create()
skillPanel:addChild(widget)
widget:setStyle('SkillFirstWidget')
-- create skills
for i=1,#skills,1 do
local nameLabel = UILabel.create()
skillPanel:addChild(nameLabel)
nameLabel:setStyle('SkillNameLabel')
nameLabel:setText(skills[i])
local levelLabel = UILabel.create()
skillPanel:addChild(levelLabel)
levelLabel:setStyle('SkillLevelLabel')
levelLabel:setId('skillLevelId' .. i)
levelLabel:setText('10')
local percentPanel = UIWidget.create()
skillPanel:addChild(percentPanel)
percentPanel:setStyle('SkillPercentPanel')
end
end
function Game.setSkill(id, level, percent)
local skillPanel = skillWindow:getChildById('skillPanel')
local levelLabel = skillPanel:getChildById('skillLevel' .. id)
end

View File

@ -0,0 +1,47 @@
SkillFirstWidget < UIWidget
margin.top: 2
anchors.top: parent.top
SkillNameLabel < Label
font: tibia-10px-monochrome
margin.top: 2
margin.left: 10
margin.right: 10
anchors.top: prev.bottom
anchors.left: parent.left
anchors.right: parent.right
SkillLevelLabel < Label
font: tibia-10px-monochrome
align: right
margin.top: 2
margin.left: 10
margin.right: 10
anchors.top: prev.top
anchors.left: parent.left
anchors.right: parent.right
SkillPercentPanel < UIWidget
color: blue
background-color: red
height: 4
margin.top: 2
margin.left: 10
margin.right: 10
anchors.top: prev.bottom
anchors.left: parent.left
anchors.right: parent.right
Window
id: skillWindow
title: Skills
size: 200 200
Panel
id: skillPanel
anchors.fill: parent
margin.top: 19
margin.bottom: 3
margin.left: 3
margin.right: 3

View File

@ -0,0 +1,16 @@
VipListLabel < Label
font: tibia-10px-monochrome
margin.left: 30
Window
id: vipWindow
title: VIP
size: 200 200
TextList
id: vipList
anchors.fill: parent
margin.top: 19
margin.bottom: 3
margin.left: 3
margin.right: 3