mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
creature square init, inventory improvements
This commit is contained in:
@@ -29,7 +29,7 @@ function Inventory.destroy()
|
||||
end
|
||||
|
||||
-- hooked events
|
||||
function Game.onInventoryChange(slot, item)
|
||||
function Inventory.onInventoryChange(slot, item)
|
||||
local slotId
|
||||
if slot == InventorySlotHead then
|
||||
slotId = 'head'
|
||||
@@ -57,5 +57,18 @@ function Game.onInventoryChange(slot, item)
|
||||
itemWidget:setItem(item)
|
||||
end
|
||||
|
||||
function Inventory.onFreeCapacityChange(freeCapacity)
|
||||
local widget = window:getChildById('capacity')
|
||||
widget:setText("Cap:\n" .. freeCapacity)
|
||||
end
|
||||
|
||||
function Inventory.onSoulChange(soul)
|
||||
local widget = window:getChildById('soul')
|
||||
widget:setText("Soul:\n" .. soul)
|
||||
end
|
||||
|
||||
connect(Game, { onLogin = Inventory.create,
|
||||
onLogout = Inventory.destroy })
|
||||
onLogout = Inventory.destroy,
|
||||
onInventoryChange = Inventory.onInventoryChange,
|
||||
onFreeCapacityChange = Inventory.onFreeCapacityChange,
|
||||
onSoulChange = Inventory.onSoulChange })
|
||||
|
@@ -15,57 +15,83 @@ UIWindow
|
||||
id: armor
|
||||
anchors.top: prev.bottom
|
||||
anchors.horizontalCenter: prev.horizontalCenter
|
||||
margin.top: 10
|
||||
margin.top: 5
|
||||
|
||||
Item
|
||||
id: legs
|
||||
anchors.top: prev.bottom
|
||||
anchors.horizontalCenter: prev.horizontalCenter
|
||||
margin.top: 10
|
||||
margin.top: 5
|
||||
|
||||
Item
|
||||
id: feet
|
||||
anchors.top: prev.bottom
|
||||
anchors.horizontalCenter: prev.horizontalCenter
|
||||
margin.top: 10
|
||||
margin.top: 5
|
||||
|
||||
Item
|
||||
id: necklace
|
||||
anchors.top: parent.top
|
||||
anchors.right: head.left
|
||||
margin.top: 15
|
||||
margin.right: 10
|
||||
margin.top: 10
|
||||
margin.right: 5
|
||||
|
||||
Item
|
||||
id: left
|
||||
anchors.top: prev.bottom
|
||||
anchors.horizontalCenter: prev.horizontalCenter
|
||||
margin.top: 10
|
||||
margin.top: 5
|
||||
|
||||
Item
|
||||
id: ring
|
||||
anchors.top: prev.bottom
|
||||
anchors.horizontalCenter: prev.horizontalCenter
|
||||
margin.top: 10
|
||||
margin.top: 5
|
||||
|
||||
Item
|
||||
id: backpack
|
||||
anchors.top: parent.top
|
||||
anchors.left: head.right
|
||||
margin.top: 15
|
||||
margin.left: 10
|
||||
margin.top: 10
|
||||
margin.left: 5
|
||||
|
||||
Item
|
||||
id: right
|
||||
anchors.top: prev.bottom
|
||||
anchors.horizontalCenter: prev.horizontalCenter
|
||||
margin.top: 10
|
||||
margin.top: 5
|
||||
|
||||
Item
|
||||
id: ammo
|
||||
anchors.top: prev.bottom
|
||||
anchors.horizontalCenter: prev.horizontalCenter
|
||||
margin.top: 10
|
||||
|
||||
|
||||
margin.top: 5
|
||||
|
||||
Label
|
||||
id: soul
|
||||
anchors.top: ring.bottom
|
||||
anchors.bottom: feet.bottom
|
||||
anchors.left: ring.left
|
||||
anchors.right: ring.right
|
||||
margin.top: 5
|
||||
|
||||
align: center
|
||||
|
||||
border-image:
|
||||
source: /core_styles/images/panel_flat.png
|
||||
border: 4
|
||||
|
||||
Label
|
||||
id: capacity
|
||||
anchors.top: ammo.bottom
|
||||
anchors.bottom: feet.bottom
|
||||
anchors.left: ammo.left
|
||||
anchors.right: ammo.right
|
||||
margin.top: 5
|
||||
|
||||
align: center
|
||||
|
||||
border-image:
|
||||
source: /core_styles/images/panel_flat.png
|
||||
border: 4
|
||||
|
||||
|
Reference in New Issue
Block a user