restore old modules

* partially restore vip, battle, healthbar, skills and inventory modules
* more fixes on UIWidgets
* implement UIMiniWindow close/minimize functionality
* allow drag and drop miniwindows beteween game panels
This commit is contained in:
Eduardo Bart
2012-03-28 11:10:21 -03:00
parent e2ea267703
commit 8d14d9bc99
34 changed files with 301 additions and 196 deletions

View File

@@ -1,6 +1,7 @@
Inventory = {}
-- private variables
local inventoryWindow
local inventoryPanel
local inventoryButton
@@ -13,7 +14,9 @@ function Inventory.init()
Keyboard.bindKeyDown('Ctrl+I', Inventory.toggle)
inventoryPanel = displayUI('inventory.otui', GameInterface.getRightPanel()):getChildById('inventoryPanel')
inventoryWindow = displayUI('inventory.otui', GameInterface.getRightPanel())
inventoryWindow.onClose = Inventory.toggle
inventoryPanel = inventoryWindow:getChildById('contentsPanel')
inventoryButton = TopMenu.addGameToggleButton('inventoryButton', 'Inventory (Ctrl+I)', 'inventory.png', Inventory.toggle)
inventoryButton:setOn(true)
@@ -30,15 +33,16 @@ function Inventory.terminate()
Keyboard.unbindKeyDown('Ctrl+I')
inventoryPanel:destroy()
inventoryPanel = nil
inventoryWindow:destroy()
inventoryButton:destroy()
inventoryWindow = nil
inventoryButton = nil
inventoryPanel = nil
end
function Inventory.toggle()
local visible = not inventoryPanel:isExplicitlyVisible()
inventoryPanel:setVisible(visible)
local visible = not inventoryWindow:isExplicitlyVisible()
inventoryWindow:setVisible(visible)
inventoryButton:setOn(visible)
end

View File

@@ -2,12 +2,10 @@ MiniWindow
id: inventoryMiniWindow
text: Inventory
icon: inventory.png
width: 192
height: 154
height: 180
@onClose: Inventory.toggle()
MiniWindowContents
id: inventoryPanel
Item
// head
id: slot1
@@ -37,7 +35,6 @@ MiniWindow
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin-top: 5
margin-bottom: 10
&position: {x=65535, y=8, z=0}
Item