From 51cc1a44d9d845fbb916b519787a00be68ff6d06 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 4 Jan 2021 21:54:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E7=9A=84=E8=83=8C=E6=99=AF=E5=88=97=E8=A1=A8=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/background.lua | 13 +++++++++---- parts/scenes/customGame.lua | 7 +------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Zframework/background.lua b/Zframework/background.lua index c9b865ba..c1256f27 100644 --- a/Zframework/background.lua +++ b/Zframework/background.lua @@ -1,23 +1,28 @@ -local BGlist={ +local BGs={ none={ draw=function() love.graphics.clear(.15,.15,.15) end } } +local BGlist={"none"} local BG={ cur="none", default="none", init=false, resize=false, update=NULL, - draw=BGlist.none.draw, + draw=BGs.none.draw, event=false, discard=NULL, } function BG.add(name,bg) - BGlist[name]=bg + BGs[name]=bg + BGlist[#BGlist+1]=name +end +function BG.getList() + return BGlist end function BG.send(...) if BG.event then @@ -34,7 +39,7 @@ function BG.set(background) if background==BG.cur or not SETTING.bg then return end BG.discard() BG.cur=background - background=BGlist[background] + background=BGs[background] if not background then LOG.print("No BG called"..background,"warn") return diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index 05ca48a4..4e76e477 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -153,12 +153,7 @@ scene.widgetList={ WIDGET.newSelector{name="fall", x=410, y=230,w=220,color="yellow", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=WIDGET.lnk_CUSval("fall"),code=WIDGET.lnk_CUSsto("fall")}, --Else - WIDGET.newSelector{name="bg", - x=1070, y=150,w=250,color="yellow", - list={"none","grey","glow","rgb","flink","wing","fan","badapple","welcome","aura","bg1","bg2","rainbow","rainbow2","tunnel","lightning","lightning2","matrix","space","snow"}, - disp=WIDGET.lnk_CUSval("bg"), - code=function(i)CUSTOMENV.bg=i BG.set(i)end - }, + WIDGET.newSelector{name="bg", x=1070, y=150,w=250,color="yellow",list=BG.getList(),disp=WIDGET.lnk_CUSval("bg"), code=function(i)CUSTOMENV.bg=i BG.set(i)end}, WIDGET.newSelector{name="bgm", x=1070, y=230,w=250,color="yellow", list=BGM.getList(), disp=WIDGET.lnk_CUSval("bgm"), code=function(i)CUSTOMENV.bgm=i BGM.play(i)end}, --Copy/Paste/Start