bugfix
Fixed :removeChild()
This commit is contained in:
@@ -36,9 +36,6 @@ return function(name, basalt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function getChild(self, name)
|
local function getChild(self, name)
|
||||||
if (type(name)=="table") then
|
|
||||||
name = name:getName()
|
|
||||||
end
|
|
||||||
for _, v in ipairs(children) do
|
for _, v in ipairs(children) do
|
||||||
if v.element:getName() == name then
|
if v.element:getName() == name then
|
||||||
return v.element
|
return v.element
|
||||||
@@ -47,7 +44,7 @@ return function(name, basalt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function getDeepChild(self, name)
|
local function getDeepChild(self, name)
|
||||||
local maybeChild = getChild(name)
|
local maybeChild = self:getChild(name)
|
||||||
if (maybeChild ~= nil) then
|
if (maybeChild ~= nil) then
|
||||||
return maybeChild
|
return maybeChild
|
||||||
end
|
end
|
||||||
@@ -87,7 +84,7 @@ return function(name, basalt)
|
|||||||
|
|
||||||
local function removeChild(self, element)
|
local function removeChild(self, element)
|
||||||
if (type(element)=="string") then
|
if (type(element)=="string") then
|
||||||
element = getChild(element:getName())
|
element = self:getChild(element)
|
||||||
end
|
end
|
||||||
if (element==nil) then
|
if (element==nil) then
|
||||||
return
|
return
|
||||||
@@ -95,11 +92,13 @@ return function(name, basalt)
|
|||||||
for i, v in ipairs(children) do
|
for i, v in ipairs(children) do
|
||||||
if v.element:getName() == element:getName() then
|
if v.element:getName() == element:getName() then
|
||||||
table.remove(children, i)
|
table.remove(children, i)
|
||||||
|
self:removeEvents(element)
|
||||||
|
sorted = false
|
||||||
|
self:updateDraw()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:removeEvents(element)
|
return false
|
||||||
sorted = false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function removeChildren(self)
|
local function removeChildren(self)
|
||||||
|
|||||||
@@ -147,6 +147,8 @@ return function(name, basalt)
|
|||||||
loadImage = function(self, path)
|
loadImage = function(self, path)
|
||||||
if(fs.exists(path))then
|
if(fs.exists(path))then
|
||||||
local newBimg = images.loadBIMG(path)
|
local newBimg = images.loadBIMG(path)
|
||||||
|
print(newBimg[1][1])
|
||||||
|
sleep(1)
|
||||||
bimgLibrary = bimg(newBimg)
|
bimgLibrary = bimg(newBimg)
|
||||||
activeFrame = 1
|
activeFrame = 1
|
||||||
bimgFrame = bimgLibrary.getFrameObject(1)
|
bimgFrame = bimgLibrary.getFrameObject(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user