change in topmenu and some fixes

This commit is contained in:
Eduardo Bart
2012-01-23 11:47:15 -02:00
parent e3096c1648
commit d500de9aa0
18 changed files with 93 additions and 59 deletions

View File

@@ -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)

View File

@@ -33,7 +33,7 @@ SkillPercentPanel < ProgressBar
MiniWindow
id: skillWindow
text: Skills
size: 200 350
height: 350
Panel
id: skillPanel