From a350ff31822d6f9d5ee82b08fa6bcde84035e34e Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 29 Nov 2021 04:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E8=83=8C=E6=99=AF=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=83=8C=E6=99=AF=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E4=B8=8D=E5=88=B0=E7=89=B9=E6=AE=8A=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/background.lua | 3 +++ main.lua | 1 + parts/backgrounds/custom.lua | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) 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