diff --git a/Zframework/background.lua b/Zframework/background.lua index f6e42307..22f81786 100644 --- a/Zframework/background.lua +++ b/Zframework/background.lua @@ -24,6 +24,9 @@ end function BG.getList() return BGlist end +function BG.remList(name) + table.remove(BGlist,TABLE.find(BGlist,name)) +end function BG.send(...) if BG.event then BG.event(...) diff --git a/main.lua b/main.lua index b8ba421a..88e9835e 100644 --- a/main.lua +++ b/main.lua @@ -380,6 +380,7 @@ for _,v in next,fs.getDirectoryItems('parts/backgrounds')do BG.add(name,require('parts.backgrounds.'..name)) end end +BG.remList('none')BG.remList('gray')BG.remList('custom') --Load scene files from SOURCE ONLY for _,v in next,fs.getDirectoryItems('parts/scenes')do if isSafeFile('parts/scenes/'..v)then diff --git a/parts/backgrounds/custom.lua b/parts/backgrounds/custom.lua index fd80962a..0d098cfa 100644 --- a/parts/backgrounds/custom.lua +++ b/parts/backgrounds/custom.lua @@ -18,8 +18,10 @@ function back.resize() end function back.draw() gc_clear(.1,.1,.1) - gc_setColor(1,1,1,alpha) - mDraw(image,mx,my,nil,k) + if image then + gc_setColor(1,1,1,alpha) + mDraw(image,mx,my,nil,k) + end end function back.event(a,img) if a then alpha=a end