diff --git a/Zframework/languages.lua b/Zframework/languages.lua index 54317e6f..ea7c0519 100644 --- a/Zframework/languages.lua +++ b/Zframework/languages.lua @@ -1839,7 +1839,7 @@ function LANG.set(l) text=langList[l] for S,L in next,Widgets do for N,W in next,L do - W.text=text.WidgetText[S][N] + W.text=text.WidgetText[S][W.name] end end for _,s in next,drawableTextLoad do diff --git a/Zframework/paint.lua b/Zframework/paint.lua index f30badb1..671eee9a 100644 --- a/Zframework/paint.lua +++ b/Zframework/paint.lua @@ -168,6 +168,10 @@ function Pnt.main() setFont(30) gc.print(gameVersion,70,125) gc.print(system,610,100) + local L=text.modes[stat.lastPlay] + setFont(25) + gc.print(L[1],700,470) + gc.print(L[2],700,500) players[1]:draw() end function Pnt.mode() diff --git a/Zframework/widget.lua b/Zframework/widget.lua index b95eac3d..0852d2af 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -1,8 +1,9 @@ local gc=love.graphics local kb=love.keyboard -local int=math.floor +local int,abs=math.floor,math.abs local format=string.format -local next=next +local color=color + local EMPTY={} local button={ @@ -15,6 +16,9 @@ end function button:isAbove(x,y) return x>self.x-self.ATV and xself.y-self.ATV and yself.x and xself.y-25 and y0 then gc.setColor(1,1,1,self.ATV*.08) gc.rectangle("fill",x,y,50,50) @@ -86,11 +95,13 @@ function switch:draw() gc.setLineWidth(6) gc.line(x+5,y+25,x+18,y+38,x+45,y+11) end - --checked + + --Frame gc.setLineWidth(4) gc.setColor(1,1,1,.6+self.ATV*.05) gc.rectangle("line",x,y,50,50) - --frame + + --Text local t=self.text if t then gc.setColor(1,1,1) @@ -114,11 +125,15 @@ end function slider:isAbove(x,y) return x>self.x-10 and xself.y-20 and y0 then self.ATV=self.ATV-1 end + if _>0 then self.ATV=_-1 end end if not(self.hide and self.hide())then self.pos=self.pos*.7+self.disp()*.3 @@ -126,6 +141,8 @@ function slider:update() end function slider:draw() local x,y=self.x,self.y + + --Units gc.setColor(1,1,1,.5+self.ATV*.06) gc.setLineWidth(2) local x1,x2=x,x+self.w @@ -133,17 +150,20 @@ function slider:draw() local x=x1+(x2-x1)*p/self.unit gc.line(x,y+7,x,y-7) end - --units + + --Axis gc.setLineWidth(4) gc.line(x1,y,x2,y) - --axis + + --Text local t=self.text if t then gc.setColor(1,1,1) setFont(self.font) gc.printf(t,x-312,y-self.font*.7,300,"right") end - --text + + --Block local x,y,w,h=x1+(x2-x1)*self.pos/self.unit-10-self.ATV*.5,y-16-self.ATV,20+self.ATV,32+2*self.ATV gc.setColor(.8,.8,.8) gc.rectangle("fill",x,y,w,h) @@ -152,7 +172,6 @@ function slider:draw() gc.setColor(1,1,1,self.ATV*.16) gc.rectangle("line",x+1,y+1,w-2,h-2) end - --block end function slider:getInfo() print(format("x=%d,y=%d,w=%d",self.x,self.y,self.w)) @@ -172,36 +191,96 @@ function WIDGET.set(L) end WIDGET.new={} -function WIDGET.new.button(x,y,w,h,color,font,code,hide,N) +function WIDGET.newText(D) local _={ - x=x-w*.5,y=y-h*.5, - w=w,h=h, - color=color, - font=font, - code=code, - hide=hide, - next=N, + name= D.name, + x= D.x, + y= D.y, + align= D.align, + color= color[D.color]or D.color, + font= D.font, + hide= D.hide, }for k,v in next,button do _[k]=v end return _ end -function WIDGET.new.switch(x,y,font,disp,code,hide,N) +function WIDGET.newImage(D) local _={ - x=x,y=y,font=font, - disp=disp, - code=code, - hide=hide, - next=N, + name= D.name, + x= D.x-w*.5, + y= D.y-h*.5, + w= D.w, + h= D.h, + color= color[D.color]or D.color, + font= D.font, + code= D.code, + hide= D.hide, + }for k,v in next,button do _[k]=v end return _ +end +function WIDGET.newButton(D) + local _={ + name= D.name, + + x= D.x-D.w*.5, + y= D.y-D.h*.5, + w= D.w, + h= D.h, + + resCtr={ + D.x,D.y, + D.x-D.w*.35,D.y-D.h*.35, + D.x-D.w*.35,D.y+D.h*.35, + D.x+D.w*.35,D.y-D.h*.35, + D.x+D.w*.35,D.y+D.h*.35, + }, + + color= color[D.color]or D.color, + font= D.font, + code= D.code, + hide= D.hide, + }for k,v in next,button do _[k]=v end return _ +end +function WIDGET.newSwitch(D) + local _={ + name= D.name, + + x= D.x, + y= D.y, + + cx= D.x+25, + cy= D.y, + resCtr={ + D.x+25,D.y, + }, + + font= D.font, + disp= D.disp, + code= D.code, + hide= D.hide, }for k,v in next,switch do _[k]=v end return _ end -function WIDGET.new.slider(x,y,w,unit,font,change,disp,code,hide,N) +function WIDGET.newSlider(D) local _={ - x=x,y=y, - w=w,unit=unit, - font=font, - change=change, - disp=disp, - code=code, - hide=hide, - next=N, + name= D.name, + + x= D.x, + y= D.y, + w= D.w, + + cx= D.x+D.w*.5, + cy= D.y, + resCtr={ + D.x,D.y, + D.x+D.w*.25,D.y, + D.x+D.w*.5,D.y, + D.x+D.w*.75,D.y, + D.x+D.w,D.y, + }, + + unit= D.unit, + font= D.font, + change= D.change, + disp= D.disp, + code= D.code, + hide= D.hide, }for k,v in next,slider do _[k]=v end return _ end @@ -247,27 +326,74 @@ function WIDGET.drag(x,y,dx,dy) end end function WIDGET.keyPressed(i) - if i=="tab"then + if i=="space"or i=="return"then if WIDGET.sel then - WIDGET.sel=kb.isDown("lshift")and WIDGET.sel.prev or WIDGET.sel.next or WIDGET.sel - else - WIDGET.sel=select(2,next(WIDGET.active)) + WIDGET.press() end - elseif i=="space"or i=="return"then - if WIDGET.sel then - WIDGET.press(WIDGET.sel) - end - elseif i=="left"or i=="right"then - local W=WIDGET.sel - if W then - if W.type=="slider"then - local p=W.disp() - local P=i=="left"and(p>0 and p-1)or p0 and p-1)or p10 then + dist=dist+abs(y-WY)*6.26 + if dist10 then + dist=dist+abs(x-WX)*6.26 + if dist35 and setting.frameMul/10 or setting.frameMul/5-4 end,function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end,nil,"text"), - text= newSwitch(1050,180,35,SETval("text"),SETrev("text"),nil,"warn"), - warn= newSwitch(1050,260,35,SETval("warn"),SETrev("warn"),nil,"fullscreen"), - fullscreen=newSwitch(1050,340,35,SETval("fullscreen"),function() + newButton({name="sound", x=200, y=80,w=240,h=80,color="lightCyan",font=35,code=function()SCN.swapTo("setting_sound")end}), + newButton({name="game", x=1080, y=80,w=240,h=80,color="lightCyan",font=35,code=function()SCN.swapTo("setting_game")end}), + newSwitch({name="ghost", x=250, y=180,font=35, disp=SETval("ghost"), code=SETrev("ghost")}), + newSwitch({name="smooth", x=250, y=260,font=25, disp=SETval("smooth"), code=SETrev("smooth")}), + newSwitch({name="center", x=500, y=180,font=35, disp=SETval("center"), code=SETrev("center")}), + newSwitch({name="grid", x=500, y=260,font=30, disp=SETval("grid"), code=SETrev("grid")}), + newSwitch({name="bagLine", x=730, y=180,font=30, disp=SETval("bagLine"), code=SETrev("bagLine")}), + newSlider({name="lockFX", x=350, y=340,w=373,unit=3, font=32,disp=SETval("lockFX"), code=SETsto("lockFX")}), + newSlider({name="dropFX", x=350, y=400,w=373,unit=5, font=32,disp=SETval("dropFX"), code=SETsto("dropFX")}), + newSlider({name="clearFX", x=350, y=460,w=373,unit=3, font=32,disp=SETval("clearFX"), code=SETsto("clearFX")}), + newSlider({name="shakeFX", x=350, y=520,w=373,unit=5, font=32,disp=SETval("shakeFX"), code=SETsto("shakeFX")}), + newSlider({name="atkFX", x=350, y=580,w=373,unit=5, font=32,disp=SETval("atkFX"), code=SETsto("atkFX")}), + newSlider({name="frame", x=350, y=640,w=373,unit=10,font=30,disp=function() + return setting.frameMul>35 and setting.frameMul/10 or setting.frameMul/5-4 + end, + code=function(i)setting.frameMul=i<5 and 5*i+20 or 10*i end}), + newSwitch({name="text", x=1050, y=180, font=35,disp=SETval("text"),code=SETrev("text")}), + newSwitch({name="warn", x=1050, y=260, font=35,disp=SETval("warn"),code=SETrev("warn")}), + newSwitch({name="fullscreen",x=1050,y=340, font=35,disp=SETval("fullscreen"),code=function() setting.fullscreen=not setting.fullscreen love.window.setFullscreen(setting.fullscreen) love.resize(love.graphics.getWidth(),love.graphics.getHeight()) - end,nil,"bg"), - bg= newSwitch(1050,420,35,SETval("bg"),function() + end}), + newSwitch({name="bg", x=1050, y=420, font=35,disp=SETval("bg"),code=function() BG.set("none") setting.bg=not setting.bg BG.set("space") - end,nil,"power"), - power= newSwitch(1050,500,35,SETval("powerInfo"),function() + end}), + newSwitch({name="power", x=1050, y=500,font=35,disp=SETval("powerInfo"),code=function() setting.powerInfo=not setting.powerInfo - end,nil,"back"), - back= newButton(1140,650,200,80,C.white,40,BACK,nil,"sound"), + end}), + newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}), }, setting_sound={ - game= newButton(200,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_game")end, nil,"graphic"), - graphic=newButton(1080,80,240,80,C.lightCyan,35,function()SCN.swapTo("setting_video")end, nil,"sfx"), - sfx= newSlider(180,200,400,10,35,function()SFX.play("blip_1")end, SETval("sfx"), SETsto("sfx"), nil,"stereo"), - stereo= newSlider(180,500,400,10,35,function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, SETval("stereo"), SETsto("stereo"),function()return setting.sfx==0 end,"spawn"), - spawn= newSlider(180,300,400,10,30,function()SFX.play("spawn_1",setting.spawn,nil,true)end,SETval("spawn"), SETsto("spawn"),nil,"bgm"), - bgm= newSlider(180,400,400,10,35,function()BGM.freshVolume()end, SETval("bgm"), SETsto("bgm"), nil,"vib"), - vib= newSlider(750,200,400,5 ,28,function()VIB(2)end, SETval("vib"), SETsto("vib"), nil,"voc"), - voc= newSlider(750,300,400,10,32,function()VOC.play("nya")end, SETval("voc"), SETsto("voc"), nil,"back"), - back= newButton(1140,650,200,80,C.white,40,BACK,nil,"game"), + newButton({name="game", x=200, y=80,w=240,h=80,color="lightCyan",font=35,code=function()SCN.swapTo("setting_game")end}), + newButton({name="graphic", x=1080, y=80,w=240,h=80,color="lightCyan",font=35,code=function()SCN.swapTo("setting_video")end}), + newSlider({name="sfx", x=180, y=200,w=400,unit=10,font=35,code=function()SFX.play("blip_1")end, disp=SETval("sfx"), code=SETsto("sfx")}), + newSlider({name="stereo", x=180, y=500,w=400,unit=10,font=35,code=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end, disp=SETval("stereo"), code=SETsto("stereo"),hide=function()return setting.sfx==0 end}), + newSlider({name="spawn", x=180, y=300,w=400,unit=10,font=30,code=function()SFX.play("spawn_1",setting.spawn,nil,true)end, disp=SETval("spawn"), code=SETsto("spawn")}), + newSlider({name="bgm", x=180, y=400,w=400,unit=10,font=35,code=function()BGM.freshVolume()end, disp=SETval("bgm"), code=SETsto("bgm")}), + newSlider({name="vib", x=750, y=200,w=400,unit=5, font=28,code=function()VIB(2)end, disp=SETval("vib"), code=SETsto("vib")}), + newSlider({name="voc", x=750, y=300,w=400,unit=10,font=32,code=function()VOC.play("nya")end, disp=SETval("voc"), code=SETsto("voc")}), + newButton({name="back", x=1140, y=650,w=200,h=80,color="white",font=40,code=BACK}), }, setting_control={ - das= newSlider(226,200,910, 26, 30,nil,SETval("das"), SETsto("das"), nil,"arr"), - arr= newSlider(226,290,525, 15, 30,nil,SETval("arr"), SETsto("arr"), nil,"sddas"), - sddas= newSlider(226,380,350, 10, 30,nil,SETval("sddas"), SETsto("sddas"),nil,"sdarr"), - sdarr= newSlider(226,470,140, 4, 30,nil,SETval("sdarr"), SETsto("sdarr"),nil,"ihs"), - ihs= newSwitch(1100,290,30, SETval("ihs"), SETrev("ihs"),nil,"irs"), - irs= newSwitch(1100,380,30, SETval("irs"), SETrev("irs"),nil,"ihs"), - ims= newSwitch(1100,470,30, SETval("ims"), SETrev("ims"),nil,"reset"), - reset= newButton(160,580,200, 100,C.lightRed,40,function() + newSlider({name="das", x=226, y=200,w=910, unit=26, font=30,disp=SETval("das"), code=SETsto("das")}), + newSlider({name="arr", x=226, y=290,w=525, unit=15, font=30,disp=SETval("arr"), code=SETsto("arr")}), + newSlider({name="sddas", x=226, y=380,w=350, unit=10, font=30,disp=SETval("sddas"), code=SETsto("sddas")}), + newSlider({name="sdarr", x=226, y=470,w=140, unit=4, font=30,disp=SETval("sdarr"), code=SETsto("sdarr")}), + newSwitch({name="ihs", x=1100, y=290,font=30, disp=SETval("ihs"), code=SETrev("ihs")}), + newSwitch({name="irs", x=1100, y=380,font=30, disp=SETval("irs"), code=SETrev("irs")}), + newSwitch({name="ims", x=1100, y=470,font=30, disp=SETval("ims"), code=SETrev("ims")}), + newButton({name="reset", x=160, y=580,w=200,h=100,color="lightRed",font=40,code=function() local _=setting _.das,_.arr=10,2 _.sddas,_.sdarr=0,2 _.ihs,_.irs,_.ims=false,false,false - end,nil,"back"), - back= newButton(1140,650,200,80,C.white,40,BACK,nil,"das"), + end}), + newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}), }, setting_key={ - back=newButton(1140,650,200,80,C.white,45,BACK), + newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=45,code=BACK}), }, setting_skin={ - prev= newButton(700,100,140,100,C.white,50,function()SKIN.prevSet()end), - next= newButton(860,100,140,100,C.white,50,function()SKIN.nextSet()end), - prev1= newButton(130,230,90,65,C.white,30,prevSkin(1)), - prev2= newButton(270,230,90,65,C.white,30,prevSkin(2)), - prev3= newButton(410,230,90,65,C.white,30,prevSkin(3)), - prev4= newButton(550,230,90,65,C.white,30,prevSkin(4)), - prev5= newButton(690,230,90,65,C.white,30,prevSkin(5)), - prev6= newButton(830,230,90,65,C.white,30,prevSkin(6)), - prev7= newButton(970,230,90,65,C.white,30,prevSkin(7)), + newButton({name="prev", x=700,y=100,w=140,h=100,color="white",font=50,code=function()SKIN.prevSet()end}), + newButton({name="next", x=860,y=100,w=140,h=100,color="white",font=50,code=function()SKIN.nextSet()end}), + newButton({name="prev1", x=130,y=230,w=90,h=65,color="white",font=30,code=prevSkin(1)}), + newButton({name="prev2", x=270,y=230,w=90,h=65,color="white",font=30,code=prevSkin(2)}), + newButton({name="prev3", x=410,y=230,w=90,h=65,color="white",font=30,code=prevSkin(3)}), + newButton({name="prev4", x=550,y=230,w=90,h=65,color="white",font=30,code=prevSkin(4)}), + newButton({name="prev5", x=690,y=230,w=90,h=65,color="white",font=30,code=prevSkin(5)}), + newButton({name="prev6", x=830,y=230,w=90,h=65,color="white",font=30,code=prevSkin(6)}), + newButton({name="prev7", x=970,y=230,w=90,h=65,color="white",font=30,code=prevSkin(7)}), - next1= newButton(130,450,90,65,C.white,30,nextSkin(1)), - next2= newButton(270,450,90,65,C.white,30,nextSkin(2)), - next3= newButton(410,450,90,65,C.white,30,nextSkin(3)), - next4= newButton(550,450,90,65,C.white,30,nextSkin(4)), - next5= newButton(690,450,90,65,C.white,30,nextSkin(5)), - next6= newButton(830,450,90,65,C.white,30,nextSkin(6)), - next7= newButton(970,450,90,65,C.white,30,nextSkin(7)), + newButton({name="next1", x=130,y=450,w=90,h=65,color="white",font=30,code=nextSkin(1)}), + newButton({name="next2", x=270,y=450,w=90,h=65,color="white",font=30,code=nextSkin(2)}), + newButton({name="next3", x=410,y=450,w=90,h=65,color="white",font=30,code=nextSkin(3)}), + newButton({name="next4", x=550,y=450,w=90,h=65,color="white",font=30,code=nextSkin(4)}), + newButton({name="next5", x=690,y=450,w=90,h=65,color="white",font=30,code=nextSkin(5)}), + newButton({name="next6", x=830,y=450,w=90,h=65,color="white",font=30,code=nextSkin(6)}), + newButton({name="next7", x=970,y=450,w=90,h=65,color="white",font=30,code=nextSkin(7)}), - spin1= newButton(130,540,90,65,C.white,30,nextDir(1)), - spin2= newButton(270,540,90,65,C.white,30,nextDir(2)), - spin3= newButton(410,540,90,65,C.white,30,nextDir(3)), - spin4= newButton(550,540,90,65,C.white,30,nextDir(4)), - spin5= newButton(690,540,90,65,C.white,30,nextDir(5)), - --spin6=newButton(825,540,90,65,C.white,30,nextDir(6)),--cannot rotate O - spin7= newButton(970,540,90,65,C.white,30,nextDir(7)), + newButton({name="spin1", x=130,y=540,w=90,h=65,color="white",font=30,code=nextDir(1)}), + newButton({name="spin2", x=270,y=540,w=90,h=65,color="white",font=30,code=nextDir(2)}), + newButton({name="spin3", x=410,y=540,w=90,h=65,color="white",font=30,code=nextDir(3)}), + newButton({name="spin4", x=550,y=540,w=90,h=65,color="white",font=30,code=nextDir(4)}), + newButton({name="spin5", x=690,y=540,w=90,h=65,color="white",font=30,code=nextDir(5)}), + --newButton({name="spin6",x=825,y=540,w=90,h=65,color="white",font=30,code=nextDir(6)}),--cannot rotate O + newButton({name="spin7", x=970,y=540,w=90,h=65,color="white",font=30,code=nextDir(7)}), - skinR= newButton(200,640,220,80,C.lightPurple,35,function() + newButton({name="skinR", x=200,y=640,w=220,h=80,color="lightPurple",font=35,code=function() setting.skin={1,5,8,2,10,3,7,1,5,5,1,8,2,10,3,7,10,7,8,2,8,2,1,5,3} SFX.play("rotate") - end), - faceR= newButton(480,640,220,80,C.lightRed,35,function() + end}), + newButton({name="faceR", x=480,y=640,w=220,h=80,color="lightRed",font=35,code=function() for i=1,25 do setting.face[i]=0 end SFX.play("hold") - end), - back= newButton(1140,650,200,80,C.white,40,BACK), + end}), + newButton({name="back", x=1140,y=650,w=200,h=80,color="white",font=40,code=BACK}), }, setting_touch={ - default=newButton(520,80,170,80,C.white,35,function() + newButton({name="default", x=520,y=80,w=170,h=80,color="white",font=35,code=function() local D=virtualkeySet[sceneTemp.default] for i=1,#VK_org do VK_org[i].ava=false @@ -347,96 +355,98 @@ local Widgets={ end--Replace keys sceneTemp.default=sceneTemp.default%5+1 sceneTemp.sel=nil - end), - snap= newButton(760,80,170,80,C.white,35,function() + end}), + newButton({name="snap", x=760,y=80,w=170,h=80,color="white",font=35,code=function() sceneTemp.snap=sceneTemp.snap%6+1 - end), - option= newButton(520,180,170,80,C.white,40,function() + end}), + newButton({name="option", x=520,y=180,w=170,h=80,color="white",font=40,code=function() SCN.goto("setting_touchSwitch") - end), - back= newButton(760,180,170,80,C.white,40,BACK), - size= newSlider(450,265,460,14,40,nil,function() - return VK_org[sceneTemp.sel].r/10-1 - end, - function(v) - if sceneTemp.sel then - VK_org[sceneTemp.sel].r=10+v*10 - end + end}), + newButton({name="back", x=760,y=180,w=170,h=80,color="white",font=40,code=BACK}), + newSlider({name="size", x=450,y=265,w=460,unit=14,font=40,disp=function() + return VK_org[sceneTemp.sel].r/10-1 end, - function()return not sceneTemp.sel end), + code=function(v) + if sceneTemp.sel then + VK_org[sceneTemp.sel].r=10+v*10 + end + end, + hide=function() + return not sceneTemp.sel + end}), }, setting_touchSwitch={ - b1= newSwitch(280,80, 35,VKAdisp(1),VKAcode(1)), - b2= newSwitch(280,140, 35,VKAdisp(2),VKAcode(2)), - b3= newSwitch(280,200, 35,VKAdisp(3),VKAcode(3)), - b4= newSwitch(280,260, 35,VKAdisp(4),VKAcode(4)), - b5= newSwitch(280,320, 35,VKAdisp(5),VKAcode(5)), - b6= newSwitch(280,380, 35,VKAdisp(6),VKAcode(6)), - b7= newSwitch(280,440, 35,VKAdisp(7),VKAcode(7)), - b8= newSwitch(280,500, 35,VKAdisp(8),VKAcode(8)), - b9= newSwitch(280,560, 35,VKAdisp(9),VKAcode(9)), - b10= newSwitch(280,620, 35,VKAdisp(10),VKAcode(10)), - b11= newSwitch(620,80, 35,VKAdisp(11),VKAcode(11)), - b12= newSwitch(620,140, 35,VKAdisp(12),VKAcode(12)), - b13= newSwitch(620,200, 35,VKAdisp(13),VKAcode(13)), - b14= newSwitch(620,260, 35,VKAdisp(14),VKAcode(14)), - b15= newSwitch(620,320, 35,VKAdisp(15),VKAcode(15)), - b16= newSwitch(620,380, 35,VKAdisp(16),VKAcode(16)), - b17= newSwitch(620,440, 35,VKAdisp(17),VKAcode(17)), - b18= newSwitch(620,500, 35,VKAdisp(18),VKAcode(18)), - b19= newSwitch(620,560, 35,VKAdisp(19),VKAcode(19)), - b20= newSwitch(620,620, 35,VKAdisp(20),VKAcode(20)), - norm= newButton(840,100, 240,80,C.white,35,function()for i=1,20 do VK_org[i].ava=i<11 end end), - pro= newButton(1120,100, 240,80,C.white,35,function()for i=1,20 do VK_org[i].ava=true end end), - hide= newSwitch(1170,200, 40,SETval("VKSwitch"),SETrev("VKSwitch")), - track= newSwitch(1170,300, 35,SETval("VKTrack"),SETrev("VKTrack")), - sfx= newSlider(800,380,180,4,40,function()SFX.play("virtualKey",setting.VKSFX*.25)end,SETval("VKSFX"),SETsto("VKSFX")), - vib= newSlider(800,460,180,2,40,function()VIB(setting.VKVIB)end,SETval("VKVIB"),SETsto("VKVIB")), - icon= newSwitch(850,300, 40,SETval("VKIcon"),SETrev("VKIcon")), - tkset= newButton(1120,420,240,80,C.white,32,function() + newSwitch({name="b1", x=280, y=80, font=35,disp=VKAdisp(1),code=VKAcode(1)}), + newSwitch({name="b2", x=280, y=140, font=35,disp=VKAdisp(2),code=VKAcode(2)}), + newSwitch({name="b3", x=280, y=200, font=35,disp=VKAdisp(3),code=VKAcode(3)}), + newSwitch({name="b4", x=280, y=260, font=35,disp=VKAdisp(4),code=VKAcode(4)}), + newSwitch({name="b5", x=280, y=320, font=35,disp=VKAdisp(5),code=VKAcode(5)}), + newSwitch({name="b6", x=280, y=380, font=35,disp=VKAdisp(6),code=VKAcode(6)}), + newSwitch({name="b7", x=280, y=440, font=35,disp=VKAdisp(7),code=VKAcode(7)}), + newSwitch({name="b8", x=280, y=500, font=35,disp=VKAdisp(8),code=VKAcode(8)}), + newSwitch({name="b9", x=280, y=560, font=35,disp=VKAdisp(9),code=VKAcode(9)}), + newSwitch({name="b10", x=280, y=620, font=35,disp=VKAdisp(10),code=VKAcode(10)}), + newSwitch({name="b11", x=620, y=80, font=35,disp=VKAdisp(11),code=VKAcode(11)}), + newSwitch({name="b12", x=620, y=140, font=35,disp=VKAdisp(12),code=VKAcode(12)}), + newSwitch({name="b13", x=620, y=200, font=35,disp=VKAdisp(13),code=VKAcode(13)}), + newSwitch({name="b14", x=620, y=260, font=35,disp=VKAdisp(14),code=VKAcode(14)}), + newSwitch({name="b15", x=620, y=320, font=35,disp=VKAdisp(15),code=VKAcode(15)}), + newSwitch({name="b16", x=620, y=380, font=35,disp=VKAdisp(16),code=VKAcode(16)}), + newSwitch({name="b17", x=620, y=440, font=35,disp=VKAdisp(17),code=VKAcode(17)}), + newSwitch({name="b18", x=620, y=500, font=35,disp=VKAdisp(18),code=VKAcode(18)}), + newSwitch({name="b19", x=620, y=560, font=35,disp=VKAdisp(19),code=VKAcode(19)}), + newSwitch({name="b20", x=620, y=620, font=35,disp=VKAdisp(20),code=VKAcode(20)}), + newButton({name="norm", x=840, y=100, w=240,h=80,color="white",font=35,code=function()for i=1,20 do VK_org[i].ava=i<11 end end}), + newButton({name="pro", x=1120, y=100, w=240,h=80,color="white",font=35,code=function()for i=1,20 do VK_org[i].ava=true end end}), + newSwitch({name="hide", x=1170, y=200, font=40,disp=SETval("VKSwitch"),code=SETrev("VKSwitch")}), + newSwitch({name="track", x=1170, y=300, font=35,disp=SETval("VKTrack"),code=SETrev("VKTrack")}), + newSlider({name="sfx", x=800, y=380, w=180,unit=4,font=40,change=function()SFX.play("virtualKey",setting.VKSFX*.25)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")}), + newSlider({name="vib", x=800, y=460, w=180,unit=2,font=40,change=function()VIB(setting.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")}), + newSwitch({name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")}), + newButton({name="tkset", x=1120, y=420, w=240,h=80,color="white",font=32,code=function() SCN.goto("setting_trackSetting") - end,function()return not setting.VKTrack end), - alpha= newSlider(840,540,400,10,40,nil,SETval("VKAlpha"),SETsto("VKAlpha")), - back= newButton(1120,620,200,80,C.white,45,BACK), + end,hide=function()return not setting.VKTrack end}), + newSlider({name="alpha", x=840, y=540, w=400,unit=10,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")}), + newButton({name="back", x=1120, y=620, w=200,h=80,color="white",font=45,code=BACK}), }, setting_trackSetting={ - VKDodge=newSwitch(400,200, 35,SETval("VKDodge"),SETrev("VKDodge")), - VKTchW= newSlider(140,310,1000,10,35,nil,SETval("VKTchW"),function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end), - VKCurW= newSlider(140,370,1000,10,35,nil,SETval("VKCurW"),function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end), - back= newButton(1080,600,240,80,C.white,45,BACK), + newSwitch({name="VKDodge", x=400, y=200, font=35,SETval("VKDodge"),SETrev("VKDodge")}), + newSlider({name="VKTchW", x=140, y=310, w=1000, unit=10,font=35,disp=SETval("VKTchW"),code=function(i)setting.VKTchW=i;setting.VKCurW=math.max(setting.VKCurW,i)end}), + newSlider({name="VKCurW", x=140, y=370, w=1000, unit=10,font=35,disp=SETval("VKCurW"),code=function(i)setting.VKCurW=i;setting.VKTchW=math.min(setting.VKTchW,i)end}), + newButton({name="back", x=1080, y=600, w=240, h=80,color="white",font=45,code=BACK}), }, setting_lang={ - chi= newButton(160,100,200,120,C.white,45,setLang(1),nil,"chi2"), - chi2= newButton(380,100,200,120,C.white,45,setLang(2),nil,"eng"), - eng= newButton(600,100,200,120,C.white,45,setLang(3),nil,"str"), - str= newButton(820,100,200,120,C.white,45,setLang(4),nil,"back"), - back= newButton(640,600,200,80,C.white,40,BACK,nil,"chi"), + newButton({name="chi", x=160, y=100,w=200,h=120,color="white",font=45,code=setLang(1)}), + newButton({name="chi2", x=380, y=100,w=200,h=120,color="white",font=45,code=setLang(2)}), + newButton({name="eng", x=600, y=100,w=200,h=120,color="white",font=45,code=setLang(3)}), + newButton({name="str", x=820, y=100,w=200,h=120,color="white",font=45,code=setLang(4)}), + newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}), }, help={ - staff= newButton(980,500,150,80,C.white,32,function()SCN.goto("staff")end,nil,"his"), - his= newButton(1160,500,150,80,C.white,32,function()SCN.goto("history")end,nil,"qq"), - qq= newButton(1070,600,200,80,C.white,32,function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,mobileHide,"back"), - back= newButton(640,600,200,80,C.white,40,BACK,nil,"staff"), + newButton({name="staff", x=980, y=500,w=150,h=80,color="white",font=32,code=function()SCN.goto("staff")end}), + newButton({name="his", x=1160, y=500,w=150,h=80,color="white",font=32,code=function()SCN.goto("history")end}), + newButton({name="qq", x=1070, y=600,w=200,h=80,color="white",font=32,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=mobileHide}), + newButton({name="back", x=640, y=600,w=200,h=80,color="white",font=40,code=BACK}), }, staff={ - back= newButton(1160,630,150,80,C.white,40,BACK), + newButton({name="back", x=1160, y=630,w=150,h=80,color="white",font=40,code=BACK}), }, history={ - prev= newButton(1155,170,180,180,C.white,65,pressKey("up"),function()return sceneTemp[2]==1 end), - next= newButton(1155,400,180,180,C.white,65,pressKey("down"),function()return sceneTemp[2]==#sceneTemp[1]end), - back= newButton(1155,600,180,90,C.white,40,BACK), + newButton({name="prev", x=1155, y=170,w=180,h=180,color="white",font=65,code=pressKey("up"),hide=function()return sceneTemp[2]==1 end}), + newButton({name="next", x=1155, y=400,w=180,h=180,color="white",font=65,code=pressKey("down"),hide=function()return sceneTemp[2]==#sceneTemp[1]end}), + newButton({name="back", x=1155, y=600,w=180,h=90,color="white",font=40,code=BACK}), }, stat={ - path= newButton(980,620,250,80,C.white,25,function()love.system.openURL(love.filesystem.getSaveDirectory())end,mobileHide,"back"), - back= newButton(640,620,200,80,C.white,40,BACK,nil,"path"), + newButton({name="path", x=980, y=620,w=250,h=80,color="white",font=25,code=function()love.system.openURL(love.filesystem.getSaveDirectory())end,hide=mobileHide}), + newButton({name="back", x=640, y=620,w=200,h=80,color="white",font=40,code=BACK}), }, debug={ - killWTM=newButton(340,200,260,100,C.white,35,function() + newButton({name="killWTM", x=340, y=200,w=260,h=100,color="white",font=35,code=function() marking=nil TEXT.show("\68\69\86\58\87\97\116\101\114\109\97\114\107\32\82\101\109\111\118\101\100",640,360,60,"stretch",.6) SFX.play("clear") - end), - unlock= newButton(640,200,260,100,C.white,40,function() + end}), + newButton({name="unlock", x=640,y=200,w=260,h=100,color="white",font=40,code=function() for name,M in next,Modes do if not modeRanks[name]then modeRanks[name]=M.score and 0 or 6 @@ -445,8 +455,8 @@ local Widgets={ FILE.saveUnlock() TEXT.show("\68\69\86\58\85\78\76\79\67\75\65\76\76",640,360,60,"stretch",.6) SFX.play("clear_2") - end), - reset= newButton(940,200,260,100,C.white,40,function() + end}), + newButton({name="reset", x=940,y=200,w=260,h=100,color="white",font=40,code=function() sceneTemp.ct=sceneTemp.ct+1 if sceneTemp.ct==1 then TEXT.show("RESET ALL DATA?",640,360,50,"appear",.5) @@ -465,20 +475,14 @@ local Widgets={ TEXT.show("ALL SAVING FILE DELETED",640,360,60,"stretch",.4) SCN.back() end - end), - back= newButton(640,620,200,80,C.white,40,BACK), + end}), + newButton({name="back", x=640,y=620,w=200,h=80,color="white",font=40,code=BACK}), }, } + +--Remove temp vars mobileHide,SETval,SETsto,SETrev=nil pressKey,setPen,prevSkin,nextSkin=nil nextDir,VKAdisp,VKAcode,setLang=nil -newButton,newSwitch,newSlider=nil - -for _,L in next,Widgets do - for _,W in next,L do - if W.next then - W.next,L[W.next].prev=L[W.next],W - end - end -end +newText,newImage,newButton,newSwitch,newSlider=nil return Widgets \ No newline at end of file diff --git a/main.lua b/main.lua index 28d1c496..fb454efa 100644 --- a/main.lua +++ b/main.lua @@ -86,6 +86,16 @@ if fs.getInfo("virtualkey.dat")then FILE.loadVK()end --update data file S=stat +while #modeRanks>73 do + table.remove(modeRanks) +end +if modeRanks[73]==6 then modeRanks[73]=0 end +if modeRanks[1]then--rename key of modeRanks + local L=modeRanks + for i=1,#L do + L[Modes[i].name],L[i]=L[i] + end +end if S.version=="Alpha V0.9.1"then setting.spawn=0 end diff --git a/parts/getTip.lua b/parts/getTip.lua index 47fb0942..7d941fe6 100644 --- a/parts/getTip.lua +++ b/parts/getTip.lua @@ -7,12 +7,12 @@ if setting.lang==1 or setting.lang==2 then "tetr.io 也很好玩!", "Techminohaowan", "Techmino 好玩!", - "S T S D 必 死", + "STSD必死", "REGRET!!", "osu好玩!", "O spin Triple!", "nullpomino 也很好玩!", - "Naki 可爱!", + "Naki 可爱", "Miya:喵!", "Miya 可爱!", "LrL RlR LLr RRl RRR LLL FFF RfR RRf rFF", @@ -59,6 +59,7 @@ if setting.lang==1 or setting.lang==2 then "戴上耳机以获得最佳体验", "大满贯10连击消四全清!", "车车人在此", + "茶娘可爱", "草(日本语)", "不要在上课时玩游戏!", "不要盯着bug不放", @@ -67,6 +68,8 @@ if setting.lang==1 or setting.lang==2 then "本游戏难度上限很高, 做好心理准备", "本游戏可不是休闲游戏", "啊这,不会吧不会吧", + "626r/s", + "40行世界纪录:15.654s", "3.1415926535897932384", "26连T2来一个?", "20G本质是一套全新的游戏规则", @@ -77,8 +80,8 @@ if setting.lang==1 or setting.lang==2 then "11renPC!", "<方块研究所>有一个Nspire-CX版本!", "↑↑↓↓←→←→BABA", - '"免费吃鸡方块"', "(RUR'U')R'FR2U'R'U'(RUR'F')", + '"免费吃鸡方块"', } elseif setting.lang==3 then L={ @@ -110,7 +113,6 @@ elseif setting.lang==3 then "O spin triple!", "Nothing will happen when some special day come", "Not animation,real loading!", - "Naki so cute!", "Miya:Nya!", "Miya so cute!", "Minesweeper is fun!", @@ -146,6 +148,7 @@ elseif setting.lang==3 then "Also try jstris!", "ALLSPIN!", "少女祈禱中", + "40L WR: 15.654s", "3.1415926535897932384", "225238922 Bilibili cheers!", "20G actually is a brand new game rule", diff --git a/parts/player.lua b/parts/player.lua index 7c9073ec..97787dd8 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -1360,7 +1360,7 @@ function player.hold(P,ifpre) P.pieceCount=P.pieceCount+1 if P.AI_mode=="CC"then local next=P.next[P.AIdata.next] - if id then + if next then BOT.addNext(P.AI_bot,CCblockID[next.id]) end end @@ -1398,7 +1398,7 @@ function player.popNext(P)--pop next queue to hand P.pieceCount=P.pieceCount+1 if P.AI_mode=="CC"then local next=P.next[P.AIdata.next] - if id then + if next then BOT.addNext(P.AI_bot,CCblockID[next.id]) end end diff --git a/parts/updateLog.lua b/parts/updateLog.lua index 4eb4aef6..697bd8c8 100644 --- a/parts/updateLog.lua +++ b/parts/updateLog.lua @@ -73,6 +73,8 @@ Future outlook: new: debug page independent spawning volume setting + select widgets with arrow keys + display last played mode on title screen change: three little better backgrounds instead of stupid rainbow kick list of i-piece little changed