Support to miniwindow margin, fix protocollogin connectCallback, pt translation

This commit is contained in:
Henrique Santiago 2013-02-27 23:45:03 -03:00
parent eb46b96ffa
commit 46aa0c005f
5 changed files with 11 additions and 7 deletions

View File

@ -303,6 +303,7 @@ locale = {
["Send Message"] = "Enviar Mensagem", ["Send Message"] = "Enviar Mensagem",
["Send"] = "Enviar", ["Send"] = "Enviar",
["Server List"] = "Lista de Servidores", ["Server List"] = "Lista de Servidores",
["Server list"] = "Lista de servidores",
["Server Log"] = "Registro do servidor", ["Server Log"] = "Registro do servidor",
["Server"] = "Servidor", ["Server"] = "Servidor",
["Set Outfit"] = "Escolher Roupa", ["Set Outfit"] = "Escolher Roupa",

View File

@ -166,9 +166,10 @@ end
function UIMiniWindow:onDragLeave(droppedWidget, mousePos) function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
if self.movedWidget then if self.movedWidget then
self.setMovedChildMargin(0) self.setMovedChildMargin(self.movedOldMargin or 0)
self.movedWidget = nil self.movedWidget = nil
self.setMovedChildMargin = nil self.setMovedChildMargin = nil
self.movedOldMargin = nil
self.movedIndex = nil self.movedIndex = nil
end end
@ -190,14 +191,16 @@ function UIMiniWindow:onDragMove(mousePos, mouseMoved)
end end
if self.movedWidget then if self.movedWidget then
self.setMovedChildMargin(0) self.setMovedChildMargin(self.movedOldMargin or 0)
self.setMovedChildMargin = nil self.setMovedChildMargin = nil
end end
if mousePos.y < childCenterY then if mousePos.y < childCenterY then
self.movedOldMargin = child:getMarginTop()
self.setMovedChildMargin = function(v) child:setMarginTop(v) end self.setMovedChildMargin = function(v) child:setMarginTop(v) end
self.movedIndex = 0 self.movedIndex = 0
else else
self.movedOldMargin = child:getMarginBottom()
self.setMovedChildMargin = function(v) child:setMarginBottom(v) end self.setMovedChildMargin = function(v) child:setMarginBottom(v) end
self.movedIndex = 1 self.movedIndex = 1
end end
@ -209,7 +212,7 @@ function UIMiniWindow:onDragMove(mousePos, mouseMoved)
end end
if not overAnyWidget and self.movedWidget then if not overAnyWidget and self.movedWidget then
self.setMovedChildMargin(0) self.setMovedChildMargin(self.movedOldMargin or 0)
self.movedWidget = nil self.movedWidget = nil
end end

View File

@ -135,7 +135,7 @@ function UIScrollArea:ensureChildVisible(child)
if deltaY > 0 then if deltaY > 0 then
self.verticalScrollBar:increment(deltaY) self.verticalScrollBar:increment(deltaY)
end end
else elseif self.horizontalScrollBar then
local deltaX = paddingRect.x - child:getX() local deltaX = paddingRect.x - child:getX()
if deltaX > 0 then if deltaX > 0 then
self.horizontalScrollBar:decrement(deltaX) self.horizontalScrollBar:decrement(deltaX)

View File

@ -16,7 +16,7 @@ function ProtocolLogin:login(host, port, accountName, accountPassword)
self.accountName = accountName self.accountName = accountName
self.accountPassword = accountPassword self.accountPassword = accountPassword
self.connectCallback = sendLoginPacket self.connectCallback = self.sendLoginPacket
self:connect(host, port) self:connect(host, port)
end end
@ -86,7 +86,8 @@ end
function ProtocolLogin:onConnect() function ProtocolLogin:onConnect()
self.gotConnection = true self.gotConnection = true
self:sendLoginPacket() self:connectCallback()
self.connectCallback = nil
end end
function ProtocolLogin:onRecv(msg) function ProtocolLogin:onRecv(msg)

View File

@ -27,7 +27,6 @@
#include <framework/otml/otml.h> #include <framework/otml/otml.h>
#include <framework/core/modulemanager.h> #include <framework/core/modulemanager.h>
#include <framework/core/module.h> #include <framework/core/module.h>
#include <framework/sound/soundmanager.h>
#include <framework/util/crypt.h> #include <framework/util/crypt.h>
#include <framework/core/resourcemanager.h> #include <framework/core/resourcemanager.h>
#include <framework/graphics/texturemanager.h> #include <framework/graphics/texturemanager.h>