Ryan a20dfa2b8f Add 'mulit/' from commit '285fa7e933d1986bcbd354294c05cee40ef43cea'
git-subtree-dir: mulit
git-subtree-mainline: 69233e59c8a641ceb835daae961ebce1127faa79
git-subtree-split: 285fa7e933d1986bcbd354294c05cee40ef43cea
2017-07-28 11:17:18 -04:00

37 lines
962 B
Plaintext

function gui:newDropFrame(name,x, y, w, h, sx ,sy ,sw ,sh)
x,y,w,h,sx,sy,sw,sh=filter(name, x, y, w, h, sx ,sy ,sw ,sh)
local c=self:newBase("DropFrame",name, x, y, w, h, sx ,sy ,sw ,sh)
c.WasBeingDragged=false
c.IsBeingDragged=false
c.Draggable=false
c.funcD={}
function c:GetDroppedItems()
local t=self:getChildren()
local tab={}
for i=1,#t do
if t[i].Type=="TextImageButtonFrameDrag" then
table.insert(tab,t[i])
end
end
return tab
end
function c:OnDropped(func)
table.insert(self.funcD,func)
end
c:OnUpdate(function(self)
if _GuiPro.DragItem then
if _GuiPro.DragItem.Type=="TextImageButtonFrameDrag" and love.mouse.isDown(_GuiPro.DragItem.dragbut or "m")==false and self:IsHovering() then
local t=_GuiPro.DragItem
_GuiPro.DragItem={}
for i=1,#t.funcD do
t.funcD[i](self,t)
end
for i=1,#self.funcD do
self.funcD[i](self,t)
end
_GuiPro.hasDrag=false
end
end
end)
return c
end