mirror of
https://github.com/edubart/otclient.git
synced 2025-10-13 19:14:56 +02:00
rename item data to count, add function to get current class name in lua
This commit is contained in:
@@ -21,12 +21,12 @@ local function onUseWithMouseRelease(self, mousePosition, mouseButton)
|
||||
if mouseButton == MouseLeftButton then
|
||||
local clickedWidget = Game.gameUi:recursiveGetChildByPos(mousePosition)
|
||||
if clickedWidget then
|
||||
if clickedWidget.getTile then
|
||||
if clickedWidget:getClassName() == 'Tile' then
|
||||
local tile = clickedWidget:getTile(mousePosition)
|
||||
if tile then
|
||||
Game.useWith(Game.selectedThing, tile:getTopMultiUseThing())
|
||||
end
|
||||
elseif clickedWidget.getItem and not clickedWidget:isVirtual() then
|
||||
elseif clickedWidget:getClassName() == 'UIItem' and not clickedWidget:isVirtual() then
|
||||
Game.useWith(Game.selectedThing, clickedWidget:getItem())
|
||||
end
|
||||
end
|
||||
|
@@ -26,7 +26,7 @@ function UIMap:onDrop(widget, mousePos)
|
||||
local tile = self:getTile(mousePos)
|
||||
if not tile then return false end
|
||||
|
||||
local data = widget.currentDragThing:getData()
|
||||
local data = widget.currentDragThing:getCount()
|
||||
if widget.currentDragThing:isStackable() and data > 1 then
|
||||
widget.parsed = true
|
||||
local moveWindow = displayUI('/game/movewindow.otui')
|
||||
|
Reference in New Issue
Block a user