mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 21:13:26 +02:00
enable skills and vip window on right panel
This commit is contained in:
@@ -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)
|
||||
|
@@ -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()
|
||||
|
||||
|
||||
|
@@ -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
|
Reference in New Issue
Block a user