rework map rendering

This commit is contained in:
Eduardo Bart
2012-01-29 22:00:12 -02:00
parent 4276bd680d
commit 9db7bd2602
62 changed files with 1244 additions and 752 deletions

View File

@@ -36,10 +36,10 @@ function UIMap:onDrop(widget, mousePos)
spinbox:setCurrentIndex(data)
local okButton = moveWindow:getChildById('buttonOk')
okButton.onClick = function() Game.move(widget.currentDragThing, tile:getPos(), spinbox:getCurrentIndex()) okButton:getParent():destroy() widget.currentDragThing = nil end
okButton.onClick = function() Game.move(widget.currentDragThing, tile:getPosition(), spinbox:getCurrentIndex()) okButton:getParent():destroy() widget.currentDragThing = nil end
moveWindow.onEnter = okButton.onClick
else
Game.move(widget.currentDragThing, tile:getPos(), 1)
Game.move(widget.currentDragThing, tile:getPosition(), 1)
end
return true

View File

@@ -1,11 +1,11 @@
function Thing:isInsideContainer()
local pos = self:getPos()
local pos = self:getPosition()
return (pos and pos.x == 65535 and pos.y >= 64)
end
function Thing:getContainerId()
local pos = self:getPos()
local pos = self:getPosition()
if not pos then return 0 end
return pos.y - 64
end