From 0c648a8c1e4371ee1105975beb40eb6afa3054d7 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 18 Sep 2020 23:09:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=BA=8F=E5=88=97=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=85=89=E6=A0=87=E5=8F=B3=E7=A7=BB10=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/languages.lua | 30 +++++--- Zframework/widgetList.lua | 12 +-- main.lua | 2 +- parts/gametoolfunc.lua | 1 + parts/scenes.lua | 158 +++++++++++++++++++------------------- 5 files changed, 107 insertions(+), 96 deletions(-) diff --git a/Zframework/languages.lua b/Zframework/languages.lua index 750ee9fd..6acc3625 100644 --- a/Zframework/languages.lua +++ b/Zframework/languages.lua @@ -220,13 +220,13 @@ local langList={ visible="能见度", freshLimit="锁延刷新限制", easyFresh="普通刷新锁延", - fineKill="非极简即死", + fineKill="强制极简", opponent="对手", life="命数", pushSpeed="上涨速度", norm="←基本规则", - seq="序列设置(Tab)→", + sequence="序列设置(Tab)→", back="返回", }, custom_seq={ @@ -235,6 +235,7 @@ local langList={ V="V",W="W",X="X",J5="J5",L5="L5",R="R",Y="Y",N="N",H="H",I5="I5", left="←", right="→", + ten="+10", backsp="#preBag then + S.cur=0 + end + elseif key=="ten"then + S.cur=min(S.cur+10,#preBag) elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then if #preBag>0 then sys.setClipboardText("Techmino SEQ:"..copySequence()) @@ -1306,47 +1314,37 @@ do--custom_seq if not pasteSequence(str)then LOG.print(text.dataCorrupted,color.red) end + elseif key=="backspace"then + if S.cur>0 then + rem(preBag,S.cur) + S.cur=S.cur-1 + end + elseif key=="delete"then + if S.sure>20 then + preBag={} + S.cur=0 + S.sure=0 + SFX.play("finesseError",.7) + else + S.sure=50 + end + elseif key=="tab"then + if kb.isDown("lshift","rshift")then + SCN.swapTo("custom_rule","swipeR") + else + SCN.swapTo("custom_draw","swipeL") + end + elseif key=="escape"then + SCN.back() + elseif type(key)=="number"then + S.cur=S.cur+1 + ins(preBag,S.cur,key) elseif #key==1 then local i=(kb.isDown("lshift","lalt","rshift","ralt")and minoKey2 or minoKey)[key] if i then - local C=s.cur+1 + local C=S.cur+1 ins(preBag,C,i) - s.cur=C - end - else - if key=="left"then - s.cur=s.cur-1 - if s.cur==-1 then - s.cur=#preBag - end - elseif key=="right"then - s.cur=s.cur+1 - if s.cur>#preBag then - s.cur=0 - end - elseif key=="backspace"then - local C=s.cur - if C>0 then - rem(preBag,C) - s.cur=C-1 - end - elseif key=="tab"then - if kb.isDown("lshift","rshift")then - SCN.swapTo("custom_rule","swipeR") - else - SCN.swapTo("custom_draw","swipeL") - end - elseif key=="escape"then - SCN.back() - elseif key=="delete"then - if sceneTemp.sure>20 then - preBag={} - sceneTemp.cur=0 - sceneTemp.sure=0 - SFX.play("finesseError",.7) - else - sceneTemp.sure=50 - end + S.cur=C end end end @@ -1360,27 +1358,28 @@ do--custom_seq gc.setColor(1,1,1) gc.draw(drawableText.custom,20,5) + --Draw frame gc.setLineWidth(4) gc.rectangle("line",100,110,1080,260) - setFont(30) local bag=preBag - local len=#bag + --Draw lenth setFont(40) - gc.print(len,120,310) + gc.print(#bag,120,310) + --Draw sequence local L=TEXTURE.miniBlock local lib=SKIN.libColor local set=setting.skin - local x,y=120,136 - local cx,cy=120,136 - for i=1,len do + local x,y=120,136--Next block pos + local cx,cy=120,136--Cursor-center pos + for i=1,#bag do local B=L[bag[i]] gc.setColor(lib[set[bag[i]]]) gc.draw(B,x,y,nil,15,15,0,B:getHeight()*.5) x=x+B:getWidth()*15+10 - if x>1126 then + if x>1100 then x,y=120,y+50 end if i==S.cur then @@ -1388,13 +1387,14 @@ do--custom_seq end end + --Draw cursor gc.setColor(.5,1,.5,.6+.4*sin(Timer()*6.26)) gc.line(cx-5,cy-20,cx-5,cy+20) --Confirm reset if S.sure>0 then gc.setColor(1,1,1,S.sure*.02) - gc.draw(drawableText.question,980,470) + gc.draw(drawableText.question,980,570) end end end @@ -2324,13 +2324,13 @@ do--setting_sound end function mouseDown.setting_sound(x,y,k) - local s=sceneTemp - if x>780 and x<980 and y>470 and s.jump==0 then - s.jump=10 - local t=Timer()-s.last + local S=sceneTemp + if x>780 and x<980 and y>470 and S.jump==0 then + S.jump=10 + local t=Timer()-S.last if t>1 then VOC.play((t<1.5 or t>15)and"doubt"or rnd()<.8 and"happy"or"egg") - s.last=Timer() + S.last=Timer() end end end @@ -2454,72 +2454,72 @@ do--setting_key end function keyDown.setting_key(key) - local s=sceneTemp + local S=sceneTemp if key=="escape"then - if s.kS then - s.kS=false + if S.kS then + S.kS=false SFX.play("finesseError",.5) else SCN.back() end - elseif s.kS then + elseif S.kS then for y=1,20 do if keyMap[1][y]==key then keyMap[1][y]=""break end if keyMap[2][y]==key then keyMap[2][y]=""break end end - keyMap[s.board][s.kb]=key + keyMap[S.board][S.kb]=key SFX.play("reach",.5) - s.kS=false + S.kS=false elseif key=="return"or key=="space"then - s.kS=true + S.kS=true SFX.play("lock",.5) elseif key=="up"or key=="w"then - if s.kb>1 then - s.kb=s.kb-1 + if S.kb>1 then + S.kb=S.kb-1 SFX.play("move",.5) end elseif key=="down"or key=="s"then - if s.kb<20 then - s.kb=s.kb+1 + if S.kb<20 then + S.kb=S.kb+1 SFX.play("move",.5) end elseif key=="left"or key=="a"or key=="right"or key=="d"then - s.board=3-s.board + S.board=3-S.board SFX.play("rotate",.5) end end function gamepadDown.setting_key(key) - local s=sceneTemp + local S=sceneTemp if key=="back"then - if s.jS then - s.jS=false + if S.jS then + S.jS=false SFX.play("finesseError",.5) else SCN.back() end - elseif s.jS then + elseif S.jS then for y=1,20 do if keyMap[3][y]==key then keyMap[3][y]=""break end if keyMap[4][y]==key then keyMap[4][y]=""break end end - keyMap[2+s.board][s.js]=key + keyMap[2+S.board][S.js]=key SFX.play("reach",.5) - s.jS=false + S.jS=false elseif key=="start"then - s.jS=true + S.jS=true SFX.play("lock",.5) elseif key=="dpup"then - if s.js>1 then - s.js=s.js-1 + if S.js>1 then + S.js=S.js-1 SFX.play("move",.5) end elseif key=="dpdown"then - if s.js<20 then - s.js=s.js+1 + if S.js<20 then + S.js=S.js+1 SFX.play("move",.5) end elseif key=="dpleft"or key=="dpright"then - s.board=3-s.board + S.board=3-S.board SFX.play("rotate",.5) end end