mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
Save miniwindows states
This commit is contained in:
@@ -35,7 +35,7 @@ function Skills.init()
|
||||
onSkillChange = Skills.onSkillChange
|
||||
})
|
||||
|
||||
skillsWindow = displayUI('skills.otui', GameInterface.getLeftPanel())
|
||||
skillsWindow = displayUI('skills.otui', GameInterface.getRightPanel())
|
||||
skillsButton = TopMenu.addGameToggleButton('skillsButton', tr('Skills') .. ' (Ctrl+S)', 'skills.png', Skills.toggle)
|
||||
skillsButton:setOn(true)
|
||||
Keyboard.bindKeyDown('Ctrl+S', Skills.toggle)
|
||||
@@ -84,9 +84,17 @@ function Skills.refresh()
|
||||
end
|
||||
|
||||
function Skills.toggle()
|
||||
local visible = not skillsWindow:isExplicitlyVisible()
|
||||
skillsWindow:setVisible(visible)
|
||||
skillsButton:setOn(visible)
|
||||
if skillsButton:isOn() then
|
||||
skillsWindow:close()
|
||||
skillsButton:setOn(false)
|
||||
else
|
||||
skillsWindow:open()
|
||||
skillsButton:setOn(true)
|
||||
end
|
||||
end
|
||||
|
||||
function Skills.onMiniWindowClose()
|
||||
skillsButton:setOn(false)
|
||||
end
|
||||
|
||||
function Skills.onSkillButtonClick(button)
|
||||
|
@@ -33,9 +33,9 @@ SkillPercentPanel < ProgressBar
|
||||
MiniWindow
|
||||
id: skillWindow
|
||||
!text: tr('Skills')
|
||||
height: 350
|
||||
height: 150
|
||||
icon: skills.png
|
||||
@onClose: Skills.toggle()
|
||||
@onClose: Skills.onMiniWindowClose()
|
||||
|
||||
MiniWindowContents
|
||||
anchors.fill: parent
|
||||
|
Reference in New Issue
Block a user