parent
08a88e3842
commit
46df3c7dbe
@ -1 +1 @@
|
||||
You can plance any personal addons here.
|
||||
This folder work exactly as modules folder, however is intended to place only addons here.
|
||||
|
@ -0,0 +1,30 @@
|
||||
UIMiniWindow = extends(UIWindow)
|
||||
|
||||
function UIMiniWindow.create()
|
||||
local miniwindow = UIMiniWindow.internalCreate()
|
||||
return miniwindow
|
||||
end
|
||||
|
||||
function UIMiniWindow:onMousePress(mousePos, mouseButton)
|
||||
local parent = self:getParent()
|
||||
if parent:getClassName() ~= 'UIMiniWindowContainer' then
|
||||
self:raise()
|
||||
end
|
||||
end
|
||||
|
||||
function UIMiniWindow:onDragEnter(mousePos)
|
||||
local parent = self:getParent()
|
||||
if parent:getClassName() == 'UIMiniWindowContainer' then
|
||||
local containerParent = parent:getParent()
|
||||
parent:removeChild(self)
|
||||
containerParent:addChild(self)
|
||||
end
|
||||
|
||||
local oldPos = self:getPosition()
|
||||
self.movingReference = { x = mousePos.x - oldPos.x, y = mousePos.y - oldPos.y }
|
||||
self:setPosition(oldPos)
|
||||
end
|
||||
|
||||
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
|
||||
-- TODO: drop on other interfaces
|
||||
end
|
@ -0,0 +1,12 @@
|
||||
UIMiniWindowContainer = extends(UIWidget)
|
||||
|
||||
function UIMiniWindowContainer.create()
|
||||
local container = UIMiniWindowContainer.internalCreate()
|
||||
container:setFocusable(false)
|
||||
container:setPhantom(true)
|
||||
return container
|
||||
end
|
||||
|
||||
function UIMiniWindowContainer:getClassName()
|
||||
return 'UIMiniWindowContainer'
|
||||
end
|
@ -1,6 +0,0 @@
|
||||
Module
|
||||
name: game_miniwindow
|
||||
description: Manage game miniwindow
|
||||
author: OTClient team
|
||||
website: https://github.com/edubart/otclient
|
||||
onLoad:
|
Loading…
Reference in new issue