fix move on different floors, dragqueen border on uiitem

This commit is contained in:
Henrique Santiago
2012-01-20 23:01:11 -02:00
parent 820f94a1d9
commit e3096c1648
6 changed files with 10 additions and 15 deletions

View File

@@ -1,6 +1,9 @@
function UIItem:onDragEnter(mousePos)
local item = self:getItem()
if not item then return false end
self:setBorderWidth('1')
self:setBorderColor('#ffffff')
self.currentDragThing = item
setTargetCursor()
@@ -10,6 +13,7 @@ end
function UIItem:onDragLeave(widget, mousePos)
self.currentDragThing = nil
restoreCursor()
self:setBorderWidth('0')
return true
end
@@ -23,7 +27,6 @@ function UIItem:onDrop(widget, mousePos)
return true
end
function UIItem:onMouseRelease(mousePosition, mouseButton)
local item = self:getItem()
if not item or not self:containsPoint(mousePosition) then return false end

View File

@@ -19,10 +19,11 @@ end
function UIMap:onDrop(widget, mousePos)
if not widget or not widget.currentDragThing then return false end
local pos = self:getPosition(mousePos)
local tile = self:getTile(mousePos)
if not tile then return false end
local count = 1 -- todo make a window for it
Game.move(widget.currentDragThing, pos, count)
Game.move(widget.currentDragThing, tile:getPos(), count)
return true
end