fix use with, improve move, change icons, improve topbar

This commit is contained in:
Eduardo Bart
2012-01-24 16:39:16 -02:00
parent fb386b3845
commit 24aab00431
46 changed files with 185 additions and 108 deletions

View File

@@ -1,9 +1,8 @@
function UIItem:onDragEnter(mousePos)
local item = self:getItem()
if not item then return false end
self:setBorderWidth('1')
self:setBorderColor('#ffffff')
self:setBorderWidth(1)
self.currentDragThing = item
setTargetCursor()
@@ -13,7 +12,7 @@ end
function UIItem:onDragLeave(widget, mousePos)
self.currentDragThing = nil
restoreCursor()
self:setBorderWidth('0')
self:setBorderWidth(0)
return true
end
@@ -24,9 +23,20 @@ function UIItem:onDrop(widget, mousePos)
local count = widget.currentDragThing:getData()
Game.move(widget.currentDragThing, pos, count)
self:setBorderWidth(0)
return true
end
function UIItem:onHoverChange(hovered)
if g_ui.getDraggingWidget() and self ~= g_ui.getDraggingWidget() then
if hovered then
self:setBorderWidth(1)
else
self:setBorderWidth(0)
end
end
end
function UIItem:onMouseRelease(mousePosition, mouseButton)
local item = self:getItem()
if not item or not self:containsPoint(mousePosition) then return false end