mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
make menu work
This commit is contained in:
@@ -17,9 +17,6 @@ local InventorySlotAmmo = 10
|
||||
-- public functions
|
||||
function Inventory.create()
|
||||
window = UI.display('inventory.otui', { parent = Game.gameRightPanel })
|
||||
|
||||
local itemWidget = window:getChildById('feet')
|
||||
window:setHeight(itemWidget:getPosition().y + itemWidget:getHeight() - window:getPosition().y)
|
||||
end
|
||||
|
||||
function Inventory.destroy()
|
||||
@@ -66,6 +63,13 @@ function Inventory.onSoulChange(soul)
|
||||
widget:setText("Soul:\n" .. soul)
|
||||
end
|
||||
|
||||
function Inventory.onInventoryItemMousePress(itemWidget, mousePos, mouseButton)
|
||||
local menu = UIPopupMenu.create()
|
||||
menu:addOption('Look', function() print('look') end)
|
||||
menu:addOption('Use', function() print('use') end)
|
||||
menu:display(mousePos)
|
||||
end
|
||||
|
||||
connect(Game, { onLogin = Inventory.create,
|
||||
onLogout = Inventory.destroy,
|
||||
onInventoryChange = Inventory.onInventoryChange,
|
||||
|
Reference in New Issue
Block a user