From 26e66b313f7b53e33e0514e41b781bef3913ced9 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 1 Dec 2021 02:40:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=94=B6=E6=8B=BE=E5=90=84?= =?UTF-8?q?=E7=A7=8Dui=E7=9B=B8=E5=85=B3=20=E7=A9=BA=E5=BF=83=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=BB=9F=E4=B8=80=E5=8A=A0=E4=B8=8A=E7=81=B0=E8=89=B2?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E6=96=B9=E4=BE=BF=E8=A7=82=E5=AF=9F=20?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/color.lua | 4 +-- Zframework/widget.lua | 48 +++++++++++++++++++++++++--------- parts/scenes/app_calc.lua | 2 ++ parts/scenes/app_cubefield.lua | 10 ++++--- parts/scenes/app_link.lua | 31 ++++++++++------------ parts/scenes/app_polyforge.lua | 4 +-- parts/scenes/app_schulteG.lua | 12 ++++++--- parts/scenes/dict.lua | 2 +- parts/scenes/lang.lua | 4 +-- parts/scenes/mode.lua | 4 +-- 10 files changed, 75 insertions(+), 46 deletions(-) diff --git a/Zframework/color.lua b/Zframework/color.lua index 6e3c9449..f5672f75 100644 --- a/Zframework/color.lua +++ b/Zframework/color.lua @@ -73,9 +73,9 @@ local COLOR={ lGray= {hsv(0.02, 0.06, 0.86)}, white= {hsv(0.01, 0.02, 0.99)}, - xGray= {hsv(0.00, 0.00, 0.42,.8)}, + xGray= {hsv(0.00, 0.00, 0.35,.8)}, lxGray= {hsv(0.00, 0.00, 0.62,.8)}, - dxGray= {hsv(0.00, 0.00, 0.26,.8)}, + dxGray= {hsv(0.00, 0.00, 0.16,.8)}, } for k,v in next,{ R='red', F='fire', O='orange', Y='yellow', L='lime', J='jade', G='green', A='aqua', C='cyan', N='navy', S='sea', B='blue', V='violet', P='purple', M='magenta', W='wine', diff --git a/Zframework/widget.lua b/Zframework/widget.lua index d646208f..53361f42 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -148,9 +148,9 @@ function button:isAbove(x,y) local ATV=self.ATV return x>self.x-ATV and - y>self.y-ATV and + y>self.y and x0 then - gc_setLineWidth(2) gc_setColor(.97,.97,.97,ATV*.125) - gc_rectangle('line',x-ATV+2,y-ATV+2,w+2*ATV-4,h+2*ATV-4,3) + gc_rectangle('line',x-ATV,y,w+2*ATV,h,3) end --Drawable local obj=self.obj local ox,oy=obj:getWidth()*.5,obj:getHeight()*.5 - local y0=y+h*.5-ATV*.5 + local y0=y+h*.5 gc_setColor(1,1,1,.2+ATV*.05) if self.align=='M'then local x0=x+w*.5 @@ -219,9 +221,9 @@ function button:press(_,_,k) SYSFX.newRectRipple( 6, self.x-ATV, - self.y-ATV-WIDGET.scrollPos, + self.y-WIDGET.scrollPos, self.w+2*ATV, - self.h+2*ATV + self.h ) if self.sound then SFX.play('button') @@ -301,6 +303,10 @@ function key:draw() local align=self.align local r,g,b=c[1],c[2],c[3] + --Background + gc_setColor(0,0,0,.3) + gc_rectangle('fill',x,y,w,h,4) + --Frame if not self.noFrame then gc_setColor(.2+r*.8,.2+g*.8,.2+b*.8,.7) @@ -415,6 +421,10 @@ function switch:draw() local x,y=self.x,self.y local ATV=self.ATV + --Background + gc_setColor(0,0,0,.3) + gc_rectangle('fill',x,y-25,50,50,4) + --Frame gc_setLineWidth(2) gc_setColor(1,1,1,.6+ATV*.1) @@ -700,6 +710,10 @@ function selector:draw() local w=self.w local ATV=self.ATV + --Background + gc_setColor(0,0,0,.3) + gc_rectangle('fill',x,y,w,60,4) + --Frame gc_setColor(1,1,1,.6+ATV*.1) gc_setLineWidth(2) @@ -863,9 +877,15 @@ function inputBox:draw() local x,y,w,h=self.x,self.y,self.w,self.h local ATV=self.ATV - gc_setColor(1,1,1,ATV*.08) - gc_rectangle('fill',x,y,w,h,3) + --Background + gc_setColor(0,0,0,.4) + gc_rectangle('fill',x,y,w,h,4) + --Highlight + gc_setColor(1,1,1,ATV*.08*(math.sin(TIME()*4.2)*.2+.8)) + gc_rectangle('fill',x,y,w,h,4) + + --Frame gc_setColor(1,1,1) gc_setLineWidth(3) gc_rectangle('line',x,y,w,h,3) @@ -1023,8 +1043,8 @@ function textBox:draw() local lineH=self.lineH --Background - gc_setColor(0,0,0,.4) - gc_rectangle('fill',x,y,w,h,3) + gc_setColor(0,0,0,.3) + gc_rectangle('fill',x,y,w,h,4) --Frame gc_setLineWidth(2) @@ -1197,6 +1217,10 @@ function listBox:draw() gc_push('transform') gc_translate(x,y) + --Background + gc_setColor(0,0,0,.4) + gc_rectangle('fill',0,0,w,h,4) + --Frame gc_setColor(WIDGET.sel==self and COLOR.lN or COLOR.Z) gc_setLineWidth(2) diff --git a/parts/scenes/app_calc.lua b/parts/scenes/app_calc.lua index b047c98e..eb6de02d 100644 --- a/parts/scenes/app_calc.lua +++ b/parts/scenes/app_calc.lua @@ -135,6 +135,8 @@ function scene.keyDown(key) end function scene.draw() + gc.setColor(COLOR.dX) + gc.rectangle('fill',100,80,650,150,5) gc.setColor(COLOR.Z) gc.setLineWidth(2) gc.rectangle('line',100,80,650,150,5) diff --git a/parts/scenes/app_cubefield.lua b/parts/scenes/app_cubefield.lua index e29920f1..dfe4ab93 100644 --- a/parts/scenes/app_cubefield.lua +++ b/parts/scenes/app_cubefield.lua @@ -216,6 +216,9 @@ function scene.update(dt) end end +local function _sunStencil() + gc.rectangle('fill',-60,-440,120,120) +end function scene.draw() --Health bar if life1>0 then @@ -235,12 +238,11 @@ function scene.draw() gc.rotate(rot) --Draw sun + gc.setStencilTest('notequal',1) + gc.stencil(_sunStencil) gc.setColor(.7,.5,.3) gc.circle('fill',0,-380-sunH,60) - - --Draw sun-board - gc.setColor(.08,.08,.084) - gc.rectangle('fill',-60,-440,120,120) + gc.setStencilTest() --Draw direction if play then diff --git a/parts/scenes/app_link.lua b/parts/scenes/app_link.lua index 3b380bba..aac71b64 100644 --- a/parts/scenes/app_link.lua +++ b/parts/scenes/app_link.lua @@ -51,7 +51,6 @@ local iconList={ } gc.setDefaultFilter('linear','linear') -local sure=0 local invis local state local startTime,time @@ -253,21 +252,14 @@ end function scene.keyDown(key,isRep) if isRep then return end if key=='r'then - if state~=1 or sure>.2 then + if state~=1 or tryReset()then newGame() - else - sure=1 - MES.new('info',"Press again") end elseif key=='z'or key=='x'then love.mousepressed(ms.getPosition()) elseif key=='escape'then - if state~=1 then - if tryBack()then - SCN.back() - end - else - sure=1 + if state~=1 or tryBack()then + SCN.back() end elseif state==0 then if key=='q'then @@ -292,8 +284,6 @@ function scene.update(dt) score1=score1+MATH.sign(score-score1)+int((score-score1)*.1+.5) end - if sure>0 then sure=sure-dt end - for i=#lines,1,-1 do local L=lines[i] L.time=L.time+dt @@ -309,6 +299,10 @@ function scene.draw() gc.translate(field.x,field.y) gc.scale(field.w/field.c,field.h/field.r) + --Background + gc.setColor(COLOR.dX) + gc.rectangle('fill',0,0,field.w,field.h) + --Matrix local mono=state==0 or invis and not field.full if mono then @@ -348,12 +342,9 @@ function scene.draw() gc.line(lines[i].line) end gc.pop() + --Frame if state==2 then - --Draw no-setting area - gc.setColor(1,0,0,.3) - gc.rectangle('fill',0,100,155,80) - gc.setColor(.9,.9,0)--win elseif state==1 then gc.setColor(.9,.9,.9)--game @@ -363,6 +354,12 @@ function scene.draw() gc.setLineWidth(6) gc.rectangle('line',field.x-5,field.y-5,field.w+10,field.h+10) + --Draw no-setting area + if state==2 then + gc.setColor(1,0,0,.3) + gc.rectangle('fill',0,100,155,80) + end + --Maxcombo setFont(20)gc.setColor(COLOR.dF) gc.print(maxCombo,1142,1) diff --git a/parts/scenes/app_polyforge.lua b/parts/scenes/app_polyforge.lua index 43f5f343..546e5995 100644 --- a/parts/scenes/app_polyforge.lua +++ b/parts/scenes/app_polyforge.lua @@ -159,8 +159,8 @@ function scene.draw() gc.setColor(0,0,0,timer/50) gc.print("POLYFORGE",20,620) setFont(30) - gc.print("Idea by ImpactBlue Studios",860,630) - gc.print("n-Spire ver. & ported & improved by MrZ",670,670) + gc.printf("Idea by ImpactBlue Studios",0,630,1260,'right') + gc.printf("n-Spire ver. & ported & improved by MrZ",0,670,1260,'right') end end diff --git a/parts/scenes/app_schulteG.lua b/parts/scenes/app_schulteG.lua index bd388ccf..e1b3bad2 100644 --- a/parts/scenes/app_schulteG.lua +++ b/parts/scenes/app_schulteG.lua @@ -125,11 +125,9 @@ function scene.draw() setFont(70) mStr(state==1 and progress or state==0 and"Ready"or state==2 and"Win",1130,300) + gc.setColor(COLOR.dX) + gc.rectangle('fill',310,30,660,660) if state==2 then - --Draw no-setting area - gc.setColor(1,0,0,.3) - gc.rectangle('fill',15,295,285,250) - gc.setColor(.9,.9,0)--win elseif state==1 then gc.setColor(.9,.9,.9)--game @@ -139,6 +137,12 @@ function scene.draw() gc.setLineWidth(10) gc.rectangle('line',310,30,660,660) + --Draw no-setting area + if state==2 then + gc.setColor(1,0,0,.3) + gc.rectangle('fill',15,295,285,250) + end + local width=640/rank local mono=state==0 or invis and state==1 and progress>0 gc.setLineWidth(4) diff --git a/parts/scenes/dict.lua b/parts/scenes/dict.lua index b1ad9f35..eec588ff 100644 --- a/parts/scenes/dict.lua +++ b/parts/scenes/dict.lua @@ -186,7 +186,7 @@ function scene.draw() gc.printf(t,306,180,950) setFont(30) - gc.setColor(1,1,1,.4+.2*sin(TIME()*4)) + gc.setColor(1,1,1,.4+.05*sin(TIME()*12.6)) gc.rectangle('fill',20,143+35*(selected-scrollPos),280,35) setFont(30) diff --git a/parts/scenes/lang.lua b/parts/scenes/lang.lua index 9bfc30e6..546213e9 100644 --- a/parts/scenes/lang.lua +++ b/parts/scenes/lang.lua @@ -4,7 +4,7 @@ local langList={ zh_trad="繁體中文", en="English", fr="Français", - es="Español", + es="Español\nCastellano", pt="Português", zh_grass="机翻", @@ -33,7 +33,7 @@ scene.widgetList={ WIDGET.newButton{x=225,y=331,w=255,h=120,font=40, fText=langList.en, color='L',code=function()_setLang('en')end}, WIDGET.newButton{x=500,y=331,w=255,h=120,font=40, fText=langList.fr, color='J',code=function()_setLang('fr')end}, - WIDGET.newButton{x=775,y=331,w=255,h=120,font=40, fText=langList.es, color='G',code=function()_setLang('es')end}, + WIDGET.newButton{x=775,y=331,w=255,h=120,font=35, fText=langList.es, color='G',code=function()_setLang('es')end}, WIDGET.newButton{x=1050,y=331,w=255,h=120,font=40, fText=langList.pt, color='dG',code=function()_setLang('pt')end}, WIDGET.newButton{x=271,y=472,w=346,h=120,font=45, fText=langList.zh_grass,color='N',code=function()_setLang('zh_grass')end}, diff --git a/parts/scenes/mode.lua b/parts/scenes/mode.lua index 4fba7481..11b5adac 100644 --- a/parts/scenes/mode.lua +++ b/parts/scenes/mode.lua @@ -284,7 +284,7 @@ function scene.draw() --Score board if sel then local M=MODES[sel] - gc_setColor(COLOR.X) + gc_setColor(COLOR.lX) gc_rectangle('fill',920,0,360,720,5)--Info board gc_setColor(COLOR.Z) setFont(40)mStr(text.modes[sel][1],1100,5) @@ -295,7 +295,7 @@ function scene.draw() end if M.score then mText(TEXTOBJ.highScore,1100,240) - gc_setColor(COLOR.dX) + gc_setColor(COLOR.X) gc_rectangle('fill',940,290,320,280,5)--Highscore board local L=M.records gc_setColor(1,1,1)