diff --git a/Zframework/widgetList.lua b/Zframework/widgetList.lua index 1fe50215..7a3673b9 100644 --- a/Zframework/widgetList.lua +++ b/Zframework/widgetList.lua @@ -470,11 +470,13 @@ local Widgets={ }, p15={ newButton({name="reset", x=160,y=100,w=180,h=100,color="lGreen", font=40,code=pressKey("space")}), - newSlider({name="color", x=110,y=250,w=170,unit=4,show=false, font=30,disp=function()return sceneTemp.color end,code=function(v)sceneTemp.color=v end,hide=function()return sceneTemp.state<2 end}), - newSwitch({name="blind", x=200,y=330,w=60, font=40,disp=function()return sceneTemp.blind end,code=pressKey("b"),hide=function()return sceneTemp.state>0 end}), - newSwitch({name="slide", x=200,y=420,w=60, font=40,disp=function()return sceneTemp.slide end,code=pressKey("s"),hide=function()return sceneTemp.state>0 end}), - newSwitch({name="pathVis", x=200,y=510,w=60, font=40,disp=function()return sceneTemp.pathVis end,code=pressKey("p"),hide=function()return sceneTemp.state>0 and sceneTemp.slide end}), - newSwitch({name="revKB", x=200,y=600,w=60, font=40,disp=function()return sceneTemp.revKB end,code=pressKey("r"),hide=function()return sceneTemp.state>0 end}), + newSlider({name="color", x=110,y=250,w=170,unit=4,show=false, font=30,disp=function()return sceneTemp.color end,code=function(v)sceneTemp.color=v end,hide=function()return sceneTemp.state<2 end}), + newSwitch({name="blind", x=200,y=330,w=60, font=40,disp=function()return sceneTemp.blind end,code=pressKey("b"),hide=function()return sceneTemp.state==1 end}), + newSwitch({name="slide", x=200,y=420,w=60, font=40,disp=function()return sceneTemp.slide end,code=pressKey("s"),hide=function()return sceneTemp.state==1 end}), + newSwitch({name="pathVis", x=200,y=510,w=60, font=40,disp=function()return sceneTemp.pathVis end,code=pressKey("p"),hide=function()return sceneTemp.state==1 and sceneTemp.slide end}), + newSwitch({name="revKB", x=200,y=600,w=60, font=40,disp=function()return sceneTemp.revKB end,code=pressKey("r"),hide=function()return sceneTemp.state==1 end}), + newButton({name="back", x=1140,y=640,w=180,h=80,color="white", font=35,code=BACK}), + }, newButton({name="back", x=1140,y=640,w=180,h=80,color="white", font=35,code=BACK}), }, help={ diff --git a/parts/scenes.lua b/parts/scenes.lua index 4fc0f2cb..79666eba 100644 --- a/parts/scenes.lua +++ b/parts/scenes.lua @@ -297,12 +297,13 @@ do--p15 elseif k=="s"then if S.state==0 then S.slide=not S.slide + if not S.slide then + S.pathVis=false + end end elseif k=="p"then - if S.state==0 then - if S.slide then - S.pathVis=not S.pathVis - end + if S.state==0 and S.slide then + S.pathVis=not S.pathVis end elseif k=="b"then if S.state==0 then @@ -408,20 +409,20 @@ do--p15 gc.print(format("%.3f",S.time),1026,80) gc.print(S.move,1026,150) - if S.state==1 then gc.setColor(.9,.9,.9) --game + if S.state==2 then gc.setColor(.9,.9,0) --win + elseif S.state==1 then gc.setColor(.9,.9,.9)--game elseif S.state==0 then gc.setColor(.2,.8,.2)--ready - elseif S.state==2 then gc.setColor(.9,.9,0) --win end gc.setLineWidth(10) gc.rectangle("line",313,33,654,654,18) gc.setLineWidth(4) local x,y=S.x,S.y + local blind=S.blind and S.state==1 setFont(80) for i=1,4 do for j=1,4 do if x~=j or y~=i then - local blind=S.blind and S.state==1 local N=S.board[i][j] local C=blind and 1 or S.color