优化速度表的代码,微调外观

This commit is contained in:
MrZ_26
2023-01-21 14:15:38 +08:00
parent 051f0d484c
commit fb5544ce0f
2 changed files with 40 additions and 39 deletions

View File

@@ -30,7 +30,6 @@ local hideBoardStencil={
down=function() gc_rectangle('fill',0,-300,300,300,6) end, down=function() gc_rectangle('fill',0,-300,300,300,6) end,
all=function() gc_rectangle('fill',0,-600,300,600,6) end, all=function() gc_rectangle('fill',0,-600,300,600,6) end,
} }
local dialFrame=TEXTURE.dial.frame
local dialNeedle=TEXTURE.dial.needle local dialNeedle=TEXTURE.dial.needle
local multiple=TEXTURE.multiple local multiple=TEXTURE.multiple
local playerborder=TEXTURE.playerBorder local playerborder=TEXTURE.playerBorder
@@ -571,34 +570,39 @@ local function _drawNext(P,repMode)
end end
gc_translate(-488,-20) gc_translate(-488,-20)
end end
local _drawDial do
local function _getDialBackColor(speed) local function _getDialBackColor(speed)
return if speed<60 then return COLOR.H
speed<60 and {.5,.5,.5} or elseif speed<120 then return COLOR.Z
speed<120 and {1,1,1} or elseif speed<180 then return COLOR.lC
speed<180 and {.2,.8,.8} or elseif speed<240 then return COLOR.lG
speed<240 and {.26,1,.26} or elseif speed<300 then return COLOR.lY
speed<300 and {1,1,.26} or elseif speed<420 then return COLOR.O
speed<420 and {1,.5,0} or else return COLOR.R
{1,0,0} end
end end
local function _getDialColor(speed) local function _getDialColor(speed)
return if speed<60 then return COLOR.Z
speed<60 and {1,1,1} or elseif speed<120 then return COLOR.lC
speed<120 and {.2,.8,.8} or elseif speed<180 then return COLOR.lG
speed<180 and {.26,1,.26} or elseif speed<240 then return COLOR.lY
speed<240 and {1,1,.26} or elseif speed<300 then return COLOR.O
speed<300 and {1,.5,0} or else return COLOR.R
{1,0,0}
end end
local function _drawDial(x,y,speed) 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) 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_setColor(0,0,0,.4)
gc.circle('fill',x+40,y+40,36) 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_setColor(_getDialBackColor(speed))
gc_draw(dialFrame,x,y) gc.circle('line',x+40,y+40,37)
gc_setLineWidth(6)
gc_setColor(_getDialColor(speed)) gc_setColor(_getDialColor(speed))
if speed<420 then if speed<420 then
gc.arc('line','open',x+40,y+40,37,3*math.pi/2,theta) gc.arc('line','open',x+40,y+40,37,3*math.pi/2,theta)
@@ -607,6 +611,7 @@ local function _drawDial(x,y,speed)
end end
setFont(30)GC.mStr(int(speed),x+40,y+19) setFont(30)GC.mStr(int(speed),x+40,y+19)
end end
end
local function _drawFinesseCombo_norm(P) local function _drawFinesseCombo_norm(P)
if P.finesseCombo>2 then if P.finesseCombo>2 then
local S=P.stat local S=P.stat

View File

@@ -148,10 +148,6 @@ TEXTURE.gridLines=(function()
end)() end)()
TEXTURE.dial={ TEXTURE.dial={
frame=GC.DO{80,80,
{'setLW',3},
{'dCirc',40,40,38},
},
needle=GC.DO{32,3, needle=GC.DO{32,3,
{'setLW',3}, {'setLW',3},
{'fRect',0,0,32,3,2}, {'fRect',0,0,32,3,2},