I've changed this code at modules/corelib/ui/uiminiwindow.lua
TO THIS CODE, BASED UPON THIS MOD: [MOD] Windows (BP, EQ, Battle etc.) can be dragged only to 'panels' (right/left) (https://otland.net/threads/mod-windows-bp-eq-battle-etc-can-be-dragged-only-to-panels-right-left.233809/)
And now, when I move windows arround sometimes apears empty spaces... any ideias to solve it? thx in advance
Lua:
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
if self.movedWidget then
self.setMovedChildMargin(self.movedOldMargin or 0)
self.movedWidget = nil
self.setMovedChildMargin = nil
self.movedOldMargin = nil
self.movedIndex = nil
end
UIWindow:onDragLeave(self, droppedWidget, mousePos)
self:saveParent(self:getParent())
end
TO THIS CODE, BASED UPON THIS MOD: [MOD] Windows (BP, EQ, Battle etc.) can be dragged only to 'panels' (right/left) (https://otland.net/threads/mod-windows-bp-eq-battle-etc-can-be-dragged-only-to-panels-right-left.233809/)
Lua:
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
local children = rootWidget:recursiveGetChildrenByMarginPos(mousePos)
local dropInPanel = 0
for i=1,#children do
local child = children[i]
if child:getId() == 'leftPanel1' or child:getId() == 'rightPanel1' then
dropInPanel = 1
end
end
if dropInPanel == 0 then
tmpp = self
if (modules.game_interface.getLeftPanel():isVisible()) then
if modules.game_interface.getRootPanel():getWidth() / 2 < mousePos.x then
addEvent(function() tmpp:setParent(modules.game_interface.getRightPanel()) end)
else
addEvent(function() tmpp:setParent(modules.game_interface.getLeftPanel()) end)
end
else
addEvent(function() tmpp:setParent(modules.game_interface.getRightPanel()) end)
end
end
UIWindow:onDragLeave(self, droppedWidget, mousePos)
self:saveParent(self:getParent())
end
And now, when I move windows arround sometimes apears empty spaces... any ideias to solve it? thx in advance
Last edited: