mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 06:03:27 +02:00
Version 2.6 - http://otclient.net/showthread.php?tid=552
This commit is contained in:
@@ -165,8 +165,7 @@ function UIMiniWindow:setup()
|
||||
self:eraseSettings({height = true})
|
||||
end
|
||||
end
|
||||
|
||||
if selfSettings.closed and not self.forceOpen then
|
||||
if selfSettings.closed and not self.forceOpen and not self.containerWindow then
|
||||
self:close(true)
|
||||
end
|
||||
|
||||
@@ -174,7 +173,7 @@ function UIMiniWindow:setup()
|
||||
self:lock(true)
|
||||
end
|
||||
else
|
||||
if not self.forceOpen and self.autoOpen ~= nil and (self.autoOpen == 0 or self.autoOpen == false) then
|
||||
if not self.forceOpen and self.autoOpen ~= nil and (self.autoOpen == 0 or self.autoOpen == false) and not self.containerWindow then
|
||||
self:close(true)
|
||||
end
|
||||
end
|
||||
@@ -185,7 +184,7 @@ function UIMiniWindow:setup()
|
||||
self.miniLoaded = true
|
||||
|
||||
if self.save then
|
||||
if oldParent and oldParent:getClassName() == 'UIMiniWindowContainer' then
|
||||
if oldParent and oldParent:getClassName() == 'UIMiniWindowContainer' and not self.containerWindow then
|
||||
addEvent(function() oldParent:order() end)
|
||||
end
|
||||
if newParent and newParent:getClassName() == 'UIMiniWindowContainer' and newParent ~= oldParent then
|
||||
@@ -350,6 +349,20 @@ function UIMiniWindow:eraseSettings(data)
|
||||
g_settings.setNode('MiniWindows', settings)
|
||||
end
|
||||
|
||||
function UIMiniWindow:clearSettings()
|
||||
if not self.save then return end
|
||||
|
||||
local settings = g_settings.getNode('MiniWindows')
|
||||
if not settings then
|
||||
settings = {}
|
||||
end
|
||||
|
||||
local id = self:getId()
|
||||
settings[id] = {}
|
||||
|
||||
g_settings.setNode('MiniWindows', settings)
|
||||
end
|
||||
|
||||
function UIMiniWindow:saveParent(parent)
|
||||
local parent = self:getParent()
|
||||
if parent then
|
||||
|
@@ -168,7 +168,15 @@ function UIMiniWindowContainer:scheduleInsert(widget, index)
|
||||
local placed = false
|
||||
for nIndex,nWidget in pairs(self.scheduledWidgets) do
|
||||
if nIndex - 1 <= self:getChildCount() then
|
||||
self:insertChild(nIndex, nWidget)
|
||||
local oldParent = nWidget:getParent()
|
||||
if oldParent ~= self then
|
||||
if oldParent then
|
||||
oldParent:removeChild(nWidget)
|
||||
end
|
||||
self:insertChild(nIndex, nWidget)
|
||||
else
|
||||
self:moveChildToIndex(nWidget, nIndex)
|
||||
end
|
||||
self.scheduledWidgets[nIndex] = nil
|
||||
placed = true
|
||||
break
|
||||
@@ -176,7 +184,6 @@ function UIMiniWindowContainer:scheduleInsert(widget, index)
|
||||
end
|
||||
if not placed then break end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user