mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
Support to miniwindow margin, fix protocollogin connectCallback, pt translation
This commit is contained in:
@@ -166,9 +166,10 @@ end
|
||||
|
||||
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
|
||||
if self.movedWidget then
|
||||
self.setMovedChildMargin(0)
|
||||
self.setMovedChildMargin(self.movedOldMargin or 0)
|
||||
self.movedWidget = nil
|
||||
self.setMovedChildMargin = nil
|
||||
self.movedOldMargin = nil
|
||||
self.movedIndex = nil
|
||||
end
|
||||
|
||||
@@ -190,14 +191,16 @@ function UIMiniWindow:onDragMove(mousePos, mouseMoved)
|
||||
end
|
||||
|
||||
if self.movedWidget then
|
||||
self.setMovedChildMargin(0)
|
||||
self.setMovedChildMargin(self.movedOldMargin or 0)
|
||||
self.setMovedChildMargin = nil
|
||||
end
|
||||
|
||||
if mousePos.y < childCenterY then
|
||||
self.movedOldMargin = child:getMarginTop()
|
||||
self.setMovedChildMargin = function(v) child:setMarginTop(v) end
|
||||
self.movedIndex = 0
|
||||
else
|
||||
self.movedOldMargin = child:getMarginBottom()
|
||||
self.setMovedChildMargin = function(v) child:setMarginBottom(v) end
|
||||
self.movedIndex = 1
|
||||
end
|
||||
@@ -209,7 +212,7 @@ function UIMiniWindow:onDragMove(mousePos, mouseMoved)
|
||||
end
|
||||
|
||||
if not overAnyWidget and self.movedWidget then
|
||||
self.setMovedChildMargin(0)
|
||||
self.setMovedChildMargin(self.movedOldMargin or 0)
|
||||
self.movedWidget = nil
|
||||
end
|
||||
|
||||
|
@@ -135,7 +135,7 @@ function UIScrollArea:ensureChildVisible(child)
|
||||
if deltaY > 0 then
|
||||
self.verticalScrollBar:increment(deltaY)
|
||||
end
|
||||
else
|
||||
elseif self.horizontalScrollBar then
|
||||
local deltaX = paddingRect.x - child:getX()
|
||||
if deltaX > 0 then
|
||||
self.horizontalScrollBar:decrement(deltaX)
|
||||
|
@@ -16,7 +16,7 @@ function ProtocolLogin:login(host, port, accountName, accountPassword)
|
||||
|
||||
self.accountName = accountName
|
||||
self.accountPassword = accountPassword
|
||||
self.connectCallback = sendLoginPacket
|
||||
self.connectCallback = self.sendLoginPacket
|
||||
|
||||
self:connect(host, port)
|
||||
end
|
||||
@@ -86,7 +86,8 @@ end
|
||||
|
||||
function ProtocolLogin:onConnect()
|
||||
self.gotConnection = true
|
||||
self:sendLoginPacket()
|
||||
self:connectCallback()
|
||||
self.connectCallback = nil
|
||||
end
|
||||
|
||||
function ProtocolLogin:onRecv(msg)
|
||||
|
Reference in New Issue
Block a user