From fb5544ce0fab23e03ab8a8bfc3f1961d497c34aa Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sat, 21 Jan 2023 14:15:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=9F=E5=BA=A6=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=BE=AE=E8=B0=83=E5=A4=96?= =?UTF-8?q?=E8=A7=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/draw.lua | 75 +++++++++++++++++++++++-------------------- parts/texture.lua | 4 --- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/parts/player/draw.lua b/parts/player/draw.lua index e0396d1f..51033145 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -30,7 +30,6 @@ local hideBoardStencil={ down=function() gc_rectangle('fill',0,-300,300,300,6) end, all=function() gc_rectangle('fill',0,-600,300,600,6) end, } -local dialFrame=TEXTURE.dial.frame local dialNeedle=TEXTURE.dial.needle local multiple=TEXTURE.multiple local playerborder=TEXTURE.playerBorder @@ -571,41 +570,47 @@ local function _drawNext(P,repMode) end gc_translate(-488,-20) end -local function _getDialBackColor(speed) - return - speed<60 and {.5,.5,.5} or - speed<120 and {1,1,1} or - speed<180 and {.2,.8,.8} or - speed<240 and {.26,1,.26} or - speed<300 and {1,1,.26} or - speed<420 and {1,.5,0} or - {1,0,0} -end -local function _getDialColor(speed) - return - speed<60 and {1,1,1} or - speed<120 and {.2,.8,.8} or - speed<180 and {.26,1,.26} or - speed<240 and {1,1,.26} or - speed<300 and {1,.5,0} or - {1,0,0} -end -local function _drawDial(x,y,speed) - local theta=3*math.pi/2+((math.pi*(speed<300 and speed or 150+speed/2)/30)%MATH.tau) - gc_setColor(_getDialBackColor(speed)) - gc_draw(dialNeedle,x+40,y+40,theta,nil,nil,1,1) -- should we keep this? - gc_setColor(0,0,0,.4) - gc.circle('fill',x+40,y+40,36) - gc_setColor(_getDialBackColor(speed)) - gc_draw(dialFrame,x,y) - gc_setLineWidth(6) - gc_setColor(_getDialColor(speed)) - if speed<420 then - gc.arc('line','open',x+40,y+40,37,3*math.pi/2,theta) - else - gc.circle('line',x+40,y+40,37) +local _drawDial do + local function _getDialBackColor(speed) + if speed<60 then return COLOR.H + elseif speed<120 then return COLOR.Z + elseif speed<180 then return COLOR.lC + elseif speed<240 then return COLOR.lG + elseif speed<300 then return COLOR.lY + elseif speed<420 then return COLOR.O + else return COLOR.R + end + end + local function _getDialColor(speed) + if speed<60 then return COLOR.Z + elseif speed<120 then return COLOR.lC + elseif speed<180 then return COLOR.lG + elseif speed<240 then return COLOR.lY + elseif speed<300 then return COLOR.O + else return COLOR.R + end + end + function _drawDial(x,y,speed) + local theta=3*math.pi/2+((math.pi*(speed<300 and speed or 150+speed/2)/30)%MATH.tau) + + gc_setColor(0,0,0,.4) + gc.circle('fill',x+40,y+40,36) + + gc_setColor(1,1,1) + gc_draw(dialNeedle,x+40,y+40,theta,nil,nil,1,1) + + gc_setLineWidth(3) + gc_setColor(_getDialBackColor(speed)) + gc.circle('line',x+40,y+40,37) + + gc_setColor(_getDialColor(speed)) + if speed<420 then + gc.arc('line','open',x+40,y+40,37,3*math.pi/2,theta) + else + gc.circle('line',x+40,y+40,37) + end + setFont(30)GC.mStr(int(speed),x+40,y+19) end - setFont(30)GC.mStr(int(speed),x+40,y+19) end local function _drawFinesseCombo_norm(P) if P.finesseCombo>2 then diff --git a/parts/texture.lua b/parts/texture.lua index 1f010cfd..e7906d7e 100644 --- a/parts/texture.lua +++ b/parts/texture.lua @@ -148,10 +148,6 @@ TEXTURE.gridLines=(function() end)() TEXTURE.dial={ - frame=GC.DO{80,80, - {'setLW',3}, - {'dCirc',40,40,38}, - }, needle=GC.DO{32,3, {'setLW',3}, {'fRect',0,0,32,3,2},