otclient/modules/corelib/widgets/uiminiwindowcontainer.lua
Eduardo Bart 8761220deb Refactoring and flexibility changes
* Split game module into game and game_interface
* Move core_lib to corelib
* Move miniwindow to corelib
* Introduce init.lua script for initializing the client, giving much more flexibility
* OTClient is no longer Application derived and is much simpler
2012-06-19 21:16:52 -03:00

33 lines
759 B
Lua

UIMiniWindowContainer = extends(UIWidget)
function UIMiniWindowContainer.create()
local container = UIMiniWindowContainer.internalCreate()
container:setFocusable(false)
container:setPhantom(true)
return container
end
function UIMiniWindowContainer:onDrop(widget, mousePos)
if widget:getClassName() == 'UIMiniWindow' then
local oldParent = widget:getParent()
if oldParent == self then
return true
end
oldParent:removeChild(widget)
if widget.movedWidget then
local index = self:getChildIndex(widget.movedWidget)
self:insertChild(index + widget.movedIndex, widget)
else
self:addChild(widget)
end
return true
end
end
function UIMiniWindowContainer:getClassName()
return 'UIMiniWindowContainer'
end