整理代码,语言选择界面按钮有颜色了

This commit is contained in:
MrZ626
2021-05-30 17:23:42 +08:00
parent 57f67749dc
commit 2b05efb0ff
47 changed files with 69 additions and 66 deletions

View File

@@ -475,13 +475,18 @@ local devColor={
}
local WS=WS
local WSnames={'app','user','play','stream','chat'}
local WScolor={
{1,.6,.6,.7},
{1,.8,.4,.7},
{1,1,.5,.7},
{.5,1,.8,.7},
{.6,.9,1,.7},
}
local wsBottomImage do
local L={78,18,
{'clear',1,1,1,0},
{'setCL',1,1,1,.3},
{'fRect',60,0,18,18},
}
for i=0,59 do
ins(L,{'setCL',1,1,1,i*.005})
ins(L,{'fRect',i,0,1,18})
end
wsBottomImage=DOGC(L)
end
local ws_deadImg=DOGC{20,20,
{'setFT',20},
{'setCL',1,.3,.3},
@@ -636,16 +641,14 @@ function love.run()
--Websocket status
for i=1,5 do
local status=WS.status(WSnames[i])
gc_setColor(WScolor[i])
gc.rectangle('fill',0,20*i-100,-80,-20)
gc_setColor(1,1,1)
gc.draw(wsBottomImage,-79,20*i-119)
if status=='dead'then
gc_setColor(1,1,1)
gc_draw(ws_deadImg,-20,20*i-120)
elseif status=='connecting'then
gc_setColor(1,1,1,.5+.3*sin(time*6.26))
gc_draw(ws_connectingImg,-20,20*i-120)
elseif status=='running'then
gc_setColor(1,1,1)
gc_draw(ws_runningImg,-20,20*i-120)
end
local t1,t2,t3=WS.getTimers(WSnames[i])