More fixes for 9.6

And add ping bindings :D
This commit is contained in:
Eduardo Bart
2012-07-30 07:59:08 -03:00
parent 05436e135a
commit 52f81c53f9
14 changed files with 73 additions and 35 deletions

View File

@@ -11,21 +11,21 @@ end
function UIMiniWindowContainer:onDrop(widget, mousePos)
if widget:getClassName() == 'UIMiniWindow' then
local oldParent = widget:getParent()
if oldParent == self then
return true
end
if oldParent then
oldParent:removeChild(widget)
local oldParent = widget:getParent()
if oldParent == self then
return true
end
if widget.movedWidget then
local index = self:getChildIndex(widget.movedWidget)
self:insertChild(index + widget.movedIndex, widget)
else
self:addChild(widget)
end
if oldParent then
oldParent:removeChild(widget)
end
if widget.movedWidget then
local index = self:getChildIndex(widget.movedWidget)
self:insertChild(index + widget.movedIndex, widget)
else
self:addChild(widget)
end
return true
end
@@ -47,7 +47,7 @@ end
function UIMiniWindowContainer:scheduleInsert(widget, index)
if index - 1 > self:getChildCount() then
if self.scheduledWidgets[index] then
warning('replacing scheduled widget id ' .. widget:getId())
pwarning('replacing scheduled widget id ' .. widget:getId())
end
self.scheduledWidgets[index] = widget
else

View File

@@ -32,7 +32,6 @@ function UIItem:onDrop(widget, mousePos)
if itemPos.x == toPos.x and itemPos.y == toPos.y and itemPos.z == toPos.z then return false end
if item:getCount() > 1 then
g_game.look(item)
modules.game_interface.moveStackableItem(item, toPos)
else
g_game.move(item, toPos, 1)

View File

@@ -380,6 +380,11 @@ function onOpenNpcTrade(items)
addEvent(show) -- player goods has not been parsed yet
end
function closeNpcTrade()
g_game.closeNpcTrade()
hide()
end
function onCloseNpcTrade()
hide()
end

View File

@@ -33,7 +33,7 @@ MainWindow
id: npcWindow
!text: tr('NPC Trade')
size: 550 515
@onEscape: g_game.closeNpcTrade()
@onEscape: modules.game_npctrade.closeNpcTrade()
TabButton
id: buyTab
@@ -264,4 +264,4 @@ MainWindow
width: 64
anchors.right: parent.right
anchors.bottom: parent.bottom
@onClick: g_game.closeNpcTrade()
@onClick: modules.game_npctrade.closeNpcTrade()

View File

@@ -150,6 +150,7 @@ function destroy()
currentColorBox = nil
currentClotheButtonBox = nil
colorBoxes = {}
addons = nil
end
end

View File

@@ -12,4 +12,4 @@ MiniWindow
MiniWindowContents
layout: verticalBox
anchors.fill: parent
@onMousePress: onVipListMousePress()
&onMousePress: modules.game_viplist.onVipListMousePress