优化速度表的代码,微调外观
This commit is contained in:
@@ -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,41 +570,47 @@ local function _drawNext(P,repMode)
|
|||||||
end
|
end
|
||||||
gc_translate(-488,-20)
|
gc_translate(-488,-20)
|
||||||
end
|
end
|
||||||
local function _getDialBackColor(speed)
|
local _drawDial do
|
||||||
return
|
local function _getDialBackColor(speed)
|
||||||
speed<60 and {.5,.5,.5} or
|
if speed<60 then return COLOR.H
|
||||||
speed<120 and {1,1,1} or
|
elseif speed<120 then return COLOR.Z
|
||||||
speed<180 and {.2,.8,.8} or
|
elseif speed<180 then return COLOR.lC
|
||||||
speed<240 and {.26,1,.26} or
|
elseif speed<240 then return COLOR.lG
|
||||||
speed<300 and {1,1,.26} or
|
elseif speed<300 then return COLOR.lY
|
||||||
speed<420 and {1,.5,0} or
|
elseif speed<420 then return COLOR.O
|
||||||
{1,0,0}
|
else return COLOR.R
|
||||||
end
|
end
|
||||||
local function _getDialColor(speed)
|
end
|
||||||
return
|
local function _getDialColor(speed)
|
||||||
speed<60 and {1,1,1} or
|
if speed<60 then return COLOR.Z
|
||||||
speed<120 and {.2,.8,.8} or
|
elseif speed<120 then return COLOR.lC
|
||||||
speed<180 and {.26,1,.26} or
|
elseif speed<180 then return COLOR.lG
|
||||||
speed<240 and {1,1,.26} or
|
elseif speed<240 then return COLOR.lY
|
||||||
speed<300 and {1,.5,0} or
|
elseif speed<300 then return COLOR.O
|
||||||
{1,0,0}
|
else return COLOR.R
|
||||||
end
|
end
|
||||||
local function _drawDial(x,y,speed)
|
end
|
||||||
local theta=3*math.pi/2+((math.pi*(speed<300 and speed or 150+speed/2)/30)%MATH.tau)
|
function _drawDial(x,y,speed)
|
||||||
gc_setColor(_getDialBackColor(speed))
|
local theta=3*math.pi/2+((math.pi*(speed<300 and speed or 150+speed/2)/30)%MATH.tau)
|
||||||
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(_getDialBackColor(speed))
|
|
||||||
gc_draw(dialFrame,x,y)
|
gc_setColor(1,1,1)
|
||||||
gc_setLineWidth(6)
|
gc_draw(dialNeedle,x+40,y+40,theta,nil,nil,1,1)
|
||||||
gc_setColor(_getDialColor(speed))
|
|
||||||
if speed<420 then
|
gc_setLineWidth(3)
|
||||||
gc.arc('line','open',x+40,y+40,37,3*math.pi/2,theta)
|
gc_setColor(_getDialBackColor(speed))
|
||||||
else
|
gc.circle('line',x+40,y+40,37)
|
||||||
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
|
end
|
||||||
setFont(30)GC.mStr(int(speed),x+40,y+19)
|
|
||||||
end
|
end
|
||||||
local function _drawFinesseCombo_norm(P)
|
local function _drawFinesseCombo_norm(P)
|
||||||
if P.finesseCombo>2 then
|
if P.finesseCombo>2 then
|
||||||
|
|||||||
@@ -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},
|
||||||
|
|||||||
Reference in New Issue
Block a user