enable skills and vip window on right panel

This commit is contained in:
Eduardo Bart
2011-11-03 10:17:10 -02:00
parent 101f608d40
commit 14ce1c8183
19 changed files with 115 additions and 30 deletions

View File

@@ -1,9 +1,12 @@
skillWindow = nil
Skills = {}
-- private variables
local 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)
-- public functions
function Skills.create()
skillWindow = loadUI("/skills/skills.otui", Game.gameRightPanel)
local skillPanel = skillWindow:getChildById('skillPanel')
@@ -31,6 +34,12 @@ function csw()
end
end
function Skills.destroy()
skillWindow:destroy()
skillWindow = nil
end
-- hooked events
function Game.setSkill(id, level, percent)
local skillPanel = skillWindow:getChildById('skillPanel')
local levelLabel = skillPanel:getChildById('skillLevel' .. id)

View File

@@ -0,0 +1,18 @@
Module
name: skills
description: Manage skills window
author: OTClient team
website: https://github.com/edubart/otclient
autoLoad: true
dependencies:
- game
onLoad: |
require 'skills'
Skills.create()
return true
onUnload:
Skills.destroy()

View File

@@ -33,15 +33,15 @@ SkillPercentPanel < UIWidget
anchors.left: parent.left
anchors.right: parent.right
Window
MiniWindow
id: skillWindow
title: Skills
size: 200 200
size: 200 185
Panel
id: skillPanel
anchors.fill: parent
margin.top: 19
margin.top: 26
margin.bottom: 3
margin.left: 3
margin.right: 3