Fix buy/sell of stackable items on 8.6
This commit is contained in:
parent
b68df8336a
commit
ada2c9efe9
|
@ -115,8 +115,10 @@ function UIMiniWindowContainer:swapInsert(widget, index)
|
||||||
|
|
||||||
if oldParent == self and oldIndex ~= index then
|
if oldParent == self and oldIndex ~= index then
|
||||||
local oldWidget = self:getChildByIndex(index)
|
local oldWidget = self:getChildByIndex(index)
|
||||||
self:removeChild(oldWidget)
|
if oldWidget then
|
||||||
self:insertChild(oldIndex, oldWidget)
|
self:removeChild(oldWidget)
|
||||||
|
self:insertChild(oldIndex, oldWidget)
|
||||||
|
end
|
||||||
self:removeChild(widget)
|
self:removeChild(widget)
|
||||||
self:insertChild(index, widget)
|
self:insertChild(index, widget)
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,6 +17,7 @@ function UIGameMap:onDragEnter(mousePos)
|
||||||
|
|
||||||
self.currentDragThing = thing
|
self.currentDragThing = thing
|
||||||
g_mouse.setTargetCursor()
|
g_mouse.setTargetCursor()
|
||||||
|
self.cancelNextRelease = true
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ end
|
||||||
function UIItem:onHoverChange(hovered)
|
function UIItem:onHoverChange(hovered)
|
||||||
UIWidget.onHoverChange(self, hovered)
|
UIWidget.onHoverChange(self, hovered)
|
||||||
|
|
||||||
if self:isVirtual() then return end
|
if self:isVirtual() or not self:isDraggable() then return end
|
||||||
|
|
||||||
local draggingWidget = g_ui.getDraggingWidget()
|
local draggingWidget = g_ui.getDraggingWidget()
|
||||||
if draggingWidget and self ~= draggingWidget then
|
if draggingWidget and self ~= draggingWidget then
|
||||||
|
@ -93,7 +93,7 @@ function UIItem:onMouseRelease(mousePosition, mouseButton)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIItem:canAcceptDrop(widget, mousePos)
|
function UIItem:canAcceptDrop(widget, mousePos)
|
||||||
if self:isVirtual() then return false end
|
if self:isVirtual() or not self:isDraggable() then return false end
|
||||||
if not widget or not widget.currentDragThing then return false end
|
if not widget or not widget.currentDragThing then return false end
|
||||||
|
|
||||||
local children = rootWidget:recursiveGetChildrenByPos(mousePos)
|
local children = rootWidget:recursiveGetChildrenByPos(mousePos)
|
||||||
|
|
|
@ -4,6 +4,6 @@ Module
|
||||||
author: BeniS
|
author: BeniS
|
||||||
website: www.otclient.info
|
website: www.otclient.info
|
||||||
sandboxed: true
|
sandboxed: true
|
||||||
scripts: [offerstatistic.lua, marketoffer.lua, marketprotocol.lua, market.lua]
|
scripts: [ offerstatistic.lua, marketoffer.lua, marketprotocol.lua, market.lua ]
|
||||||
@onLoad: init()
|
@onLoad: init()
|
||||||
@onUnload: terminate()
|
@onUnload: terminate()
|
||||||
|
|
|
@ -210,9 +210,7 @@ int Item::getSubType()
|
||||||
{
|
{
|
||||||
if(isSplash() || isFluidContainer())
|
if(isSplash() || isFluidContainer())
|
||||||
return m_countOrSubType;
|
return m_countOrSubType;
|
||||||
if(g_game.getProtocolVersion() >= 900)
|
return 0;
|
||||||
return 0;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Item::getCount()
|
int Item::getCount()
|
||||||
|
|
Loading…
Reference in New Issue