This commit is contained in:
OTCv8
2020-11-16 08:43:23 +01:00
parent a4f9250ddb
commit 2d1cbaae12
141 changed files with 14564 additions and 106 deletions

View File

@@ -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

View File

@@ -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