mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
Checked off some Market TODO's.
* Added some market offer constraints: offer creation exhaustion and now checks balance to validate sell offers. * Fixed the depot updating issue (no longer requires updateDepotItemCount function) * Can now silence the MarketProtocol messages. * Few minor market fixes.
This commit is contained in:
@@ -9,11 +9,15 @@ function UIMiniWindowContainer.create()
|
||||
return container
|
||||
end
|
||||
|
||||
function UIMiniWindowContainer:getClassName()
|
||||
return 'UIMiniWindowContainer'
|
||||
end
|
||||
|
||||
function UIMiniWindowContainer:onDrop(widget, mousePos)
|
||||
if widget:getClassName() == 'UIMiniWindow' then
|
||||
local oldParent = widget:getParent()
|
||||
if oldParent == self then
|
||||
return true
|
||||
return true
|
||||
end
|
||||
|
||||
if oldParent then
|
||||
@@ -21,10 +25,10 @@ function UIMiniWindowContainer:onDrop(widget, mousePos)
|
||||
end
|
||||
|
||||
if widget.movedWidget then
|
||||
local index = self:getChildIndex(widget.movedWidget)
|
||||
self:insertChild(index + widget.movedIndex, widget)
|
||||
local index = self:getChildIndex(widget.movedWidget)
|
||||
self:insertChild(index + widget.movedIndex, widget)
|
||||
else
|
||||
self:addChild(widget)
|
||||
self:addChild(widget)
|
||||
end
|
||||
|
||||
return true
|
||||
@@ -97,7 +101,3 @@ function UIMiniWindowContainer:saveChildren()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UIMiniWindowContainer:getClassName()
|
||||
return 'UIMiniWindowContainer'
|
||||
end
|
||||
|
@@ -45,6 +45,16 @@ function UIRadioGroup:selectWidget(selectedWidget)
|
||||
signalcall(self.onSelectionChange, self, selectedWidget, previousSelectedWidget)
|
||||
end
|
||||
|
||||
function UIRadioGroup:clearSelected()
|
||||
if not self.selectedWidget then return end
|
||||
|
||||
local previousSelectedWidget = self.selectedWidget
|
||||
self.selectedWidget:setChecked(false)
|
||||
self.selectedWidget = nil
|
||||
|
||||
signalcall(self.onSelectionChange, self, nil, previousSelectedWidget)
|
||||
end
|
||||
|
||||
function UIRadioGroup:getSelectedWidget()
|
||||
return self.selectedWidget
|
||||
end
|
Reference in New Issue
Block a user