mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
change in topmenu and some fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
Skills = {}
|
||||
|
||||
-- private variables
|
||||
local skillWindow
|
||||
local skillsWindow
|
||||
local skillsButton
|
||||
|
||||
-- private functions
|
||||
@@ -19,7 +19,7 @@ local function getNumberString(number)
|
||||
end
|
||||
|
||||
local function setSkillValue(id, value)
|
||||
local skill = skillWindow:recursiveGetChildById(id)
|
||||
local skill = skillsWindow:recursiveGetChildById(id)
|
||||
|
||||
if skill then
|
||||
local widget = skill:getChildById('value')
|
||||
@@ -28,7 +28,7 @@ local function setSkillValue(id, value)
|
||||
end
|
||||
|
||||
local function setSkillPercent(id, percent, tooltip)
|
||||
local skill = skillWindow:recursiveGetChildById(id)
|
||||
local skill = skillsWindow:recursiveGetChildById(id)
|
||||
|
||||
if skill then
|
||||
local widget = skill:getChildById('percent')
|
||||
@@ -42,19 +42,22 @@ end
|
||||
|
||||
-- public functions
|
||||
function Skills.create()
|
||||
skillWindow = displayUI('skills.otui', { parent = Game.gameRightPanel })
|
||||
skillsWindow = displayUI('skills.otui', { parent = Game.gameRightPanel })
|
||||
skillsWindow:hide()
|
||||
skillsButton = TopMenu.addGameButton('skillsButton', 'Skills (Ctrl+S)', '/core_styles/icons/skills.png', Skills.toggle)
|
||||
end
|
||||
|
||||
function Skills.destroy()
|
||||
--skillsButton:destroy()
|
||||
--skillsButton = nil
|
||||
skillWindow:destroy()
|
||||
skillWindow = nil
|
||||
skillsButton:destroy()
|
||||
skillsButton = nil
|
||||
skillsWindow:destroy()
|
||||
skillsWindow = nil
|
||||
end
|
||||
|
||||
function Skills.toggle()
|
||||
|
||||
local visible = not skillsWindow:isExplicitlyVisible()
|
||||
skillsWindow:setVisible(visible)
|
||||
skillsButton:setOn(visible)
|
||||
end
|
||||
|
||||
function Skills.onSkillButtonClick(button)
|
||||
|
@@ -33,7 +33,7 @@ SkillPercentPanel < ProgressBar
|
||||
MiniWindow
|
||||
id: skillWindow
|
||||
text: Skills
|
||||
size: 200 350
|
||||
height: 350
|
||||
|
||||
Panel
|
||||
id: skillPanel
|
||||
|
Reference in New Issue
Block a user