整理代码,大规模整理(展开)使用次数不多的局部变量名

框架跟进
This commit is contained in:
MrZ_26
2022-09-10 03:02:00 +08:00
parent ad4365faab
commit f3d08bae1a
106 changed files with 507 additions and 614 deletions

View File

@@ -1,7 +1,6 @@
local gc=love.graphics
local int,rnd=math.floor,math.random
local mStr=GC.mStr
local scene={}
@@ -295,10 +294,10 @@ function scene.draw()
gc.rectangle('line',j*160+163,i*160-117,154,154,8)
if not mono then
gc.setColor(.1,.1,.1)
mStr(N,j*160+240,i*160-96)
mStr(N,j*160+242,i*160-98)
GC.mStr(N,j*160+240,i*160-96)
GC.mStr(N,j*160+242,i*160-98)
gc.setColor(COLOR.Z)
mStr(N,j*160+243,i*160-95)
GC.mStr(N,j*160+243,i*160-95)
end
end
end

View File

@@ -5,7 +5,6 @@ local int,abs=math.floor,math.abs
local rnd,min=math.random,math.min
local ins=table.insert
local setFont=FONT.set
local mStr=GC.mStr
local scene={}
@@ -381,7 +380,7 @@ function scene.draw()
--Score
setFont(40)
setColor(1,.7,.7)
mStr(score,1130,510)
GC.mStr(score,1130,510)
--Messages
if state==2 then
@@ -411,7 +410,7 @@ function scene.draw()
setColor(N<3 and COLOR.D or COLOR.Z)
local fontSize=tileFont[N]
setFont(fontSize)
mStr(tileName[N],320+(x-.5)*160,40+(y-.5)*160-fontSize*.7)
GC.mStr(tileName[N],320+(x-.5)*160,40+(y-.5)*160-fontSize*.7)
end
else
setColor(COLOR.H)
@@ -425,7 +424,7 @@ function scene.draw()
setColor(c,c,c,prevSpawnTime)
local fontSize=tileFont[N]
setFont(fontSize)
mStr(tileName[N],320+(x-.5)*160,40+(y-.5)*160-fontSize*.7)
GC.mStr(tileName[N],320+(x-.5)*160,40+(y-.5)*160-fontSize*.7)
end
end
end
@@ -445,13 +444,13 @@ function scene.draw()
setColor(1,.5,.4)
end
setFont(70)
mStr(tileName[nextTile],220,175)
GC.mStr(tileName[nextTile],220,175)
--Skip CoolDown
if skipper.cd and skipper.cd>0 then
setFont(50)
setColor(1,1,.5)
mStr(skipper.cd,155,600)
GC.mStr(skipper.cd,155,600)
end
--Skip mark

View File

@@ -202,13 +202,13 @@ function scene.draw()
FONT.set(60)
if gameover==0 then
gc.setColor(1,.6,.6)
mStr("RED\nWON",1140,200)
GC.mStr("RED\nWON",1140,200)
elseif gameover==1 then
gc.setColor(.6,.6,1)
mStr("BLUE\nWON",1140,200)
GC.mStr("BLUE\nWON",1140,200)
else
gc.setColor(.8,.8,.8)
mStr("TIE",1140,240)
GC.mStr("TIE",1140,240)
end
else
--Draw current round mark

View File

@@ -171,7 +171,7 @@ function scene.draw()
gc_rectangle('fill',x,y,w,h,12)
end
gc_setColor(1,1,1)
mStr(cardText[c],x+w/2,y-17)
GC.mStr(cardText[c],x+w/2,y-17)
if i==selected then gc_translate(0,10)end
end
for i=1,#pool do
@@ -184,7 +184,7 @@ function scene.draw()
gc_rectangle('fill',x,y,w,h,12)
end
gc_setColor(1,1,1)
mStr(cardText[c],x+w/2,y-17)
GC.mStr(cardText[c],x+w/2,y-17)
end
end

View File

@@ -66,10 +66,10 @@ end
function scene.draw()
FONT.set(60)
mStr(CHAR.icon.import,340,230)
mStr(CHAR.icon.export,940,230)
mStr(time1,340,300)
mStr(time2,940,300)
GC.mStr(CHAR.icon.import,340,230)
GC.mStr(CHAR.icon.export,940,230)
GC.mStr(time1,340,300)
GC.mStr(time2,940,300)
end
scene.widgetList={

View File

@@ -347,8 +347,8 @@ function scene.draw()
--Draw page
setFont(55)
gc.setColor(COLOR.Z)
mStr(page,100,530)
mStr(#FIELD,100,600)
GC.mStr(page,100,530)
GC.mStr(#FIELD,100,600)
gc.rectangle('fill',50,600,100,6)
--Draw mouse & pen color
@@ -431,7 +431,7 @@ function scene.draw()
gc.setColor(1,1,1)
for i=1,7 do
local skin=SETTING.skin[i]-1
mStr(text.block[i],580+(skin%8)*80,90+80*int(skin/8))
GC.mStr(text.block[i],580+(skin%8)*80,90+80*int(skin/8))
end
end

View File

@@ -3,7 +3,6 @@ local kb=love.keyboard
local sin=math.sin
local ins,rem=table.insert,table.remove
local setFont=FONT.set
local gc_setColor,gc_print=gc.setColor,gc.print
local scene={}

View File

@@ -1,6 +1,3 @@
local gc=love.graphics
local rnd=math.random
local BGcolor
local sysAndScn,errorText
local errorShot,errorInfo
@@ -8,7 +5,7 @@ local errorShot,errorInfo
local scene={}
function scene.sceneInit()
BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926}
BGcolor=math.random()>.026 and{.3,.5,.9}or{.62,.3,.926}
sysAndScn=SYSTEM.."-"..VERSION.string.." scene:"..Z.getErr('#').scene
errorText=LOADED and text.errorMsg or"An error has occurred while the game was loading.\nAn error log has been created so you can send it to the author."
errorShot,errorInfo=Z.getErr('#').shot,Z.getErr('#').mes
@@ -22,19 +19,19 @@ function scene.sceneInit()
end
function scene.draw()
gc.clear(BGcolor)
gc.setColor(1,1,1)
gc.draw(errorShot,100,326,nil,512/errorShot:getWidth(),288/errorShot:getHeight())
gc.setColor(COLOR.Z)
setFont(100)gc.print(":(",100,0,0,1.2)
setFont(40)gc.printf(errorText,100,160,SCR.w0-100)
GC.clear(BGcolor)
GC.setColor(1,1,1)
GC.draw(errorShot,100,326,nil,512/errorShot:getWidth(),288/errorShot:getHeight())
GC.setColor(COLOR.Z)
setFont(100)GC.print(":(",100,0,0,1.2)
setFont(40)GC.printf(errorText,100,160,SCR.w0-100)
setFont(20,'mono')
gc.print(sysAndScn,100,630)
GC.print(sysAndScn,100,630)
setFont(15,'mono')
gc.printf(errorInfo[1],626,326,1260-626)
gc.print("TRACEBACK",626,390)
GC.printf(errorInfo[1],626,326,1260-626)
GC.print("TRACEBACK",626,390)
for i=4,#errorInfo do
gc.print(errorInfo[i],626,340+20*i)
GC.print(errorInfo[i],626,340+20*i)
end
end

View File

@@ -1,9 +1,7 @@
local gc,tc=love.graphics,love.touch
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
local gc_draw,gc_line=gc.draw,gc.line
local gc_circle,gc_print=gc.circle,gc.print
local sin=math.sin
local tc=love.touch
local gc_setColor,gc_setLineWidth=GC.setColor,GC.setLineWidth
local gc_draw,gc_line=GC.draw,GC.line
local gc_circle,gc_print=GC.circle,GC.print
local SCR,VK=SCR,VK
local GAME,PLAYERS=GAME,PLAYERS
@@ -308,11 +306,11 @@ function scene.update(dt)
end
end
local tasText=gc.newText(getFont(100),"TAS")
local tasText=GC.newText(getFont(100),"TAS")
local function _drawAtkPointer(x,y)
local t=TIME()
local a=t*3%1*.8
t=sin(t*20)
t=math.sin(t*20)
gc_setColor(.2,.7+t*.2,1,.6+t*.4)
gc_circle('fill',x,y,25,6)

View File

@@ -1,8 +1,7 @@
local gc=love.graphics
local gc_push,gc_pop=gc.push,gc.pop
local gc_translate=gc.translate
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
local gc_rectangle,gc_circle=gc.rectangle,gc.circle
local gc_push,gc_pop=GC.push,GC.pop
local gc_translate=GC.translate
local gc_setColor,gc_setLineWidth=GC.setColor,GC.setLineWidth
local gc_rectangle,gc_circle=GC.rectangle,GC.circle
local isDown=love.keyboard.isDown

View File

@@ -1,7 +1,4 @@
local gc=love.graphics
local max,min,sin,cos=math.max,math.min,math.sin,math.cos
local rnd=math.random
local scene={}
@@ -12,11 +9,11 @@ local studioLogo--Studio logo text object
local logoColor1,logoColor2
local titleTransform={
function(t)gc.translate(0,max(50-t,0)^2/25)end,
function(t)gc.translate(0,-max(50-t,0)^2/25)end,
function(t,i)local d=max(50-t,0)gc.translate(sin(TIME()*3+626*i)*d,cos(TIME()*3+626*i)*d)end,
function(t,i)local d=max(50-t,0)gc.translate(sin(TIME()*3+626*i)*d,-cos(TIME()*3+626*i)*d)end,
function(t)gc.setColor(1,1,1,min(t*.02,1)+rnd()*.2)end,
function(t)GC.translate(0,max(50-t,0)^2/25)end,
function(t)GC.translate(0,-max(50-t,0)^2/25)end,
function(t,i)local d=max(50-t,0)GC.translate(sin(TIME()*3+626*i)*d,cos(TIME()*3+626*i)*d)end,
function(t,i)local d=max(50-t,0)GC.translate(sin(TIME()*3+626*i)*d,-cos(TIME()*3+626*i)*d)end,
function(t)GC.setColor(1,1,1,min(t*.02,1)+math.random()*.2)end,
}
local loadingThread=coroutine.wrap(function()
@@ -97,7 +94,7 @@ local loadingThread=coroutine.wrap(function()
YIELD('loadMode')
for _,M in next,MODES do
M.records=loadFile("record/"..M.name..".rec",'-luaon -canSkip')or M.score and{}
M.icon=M.icon and(modeIcons[M.icon]or gc.newImage("media/image/modeicon/"..M.icon..".png"))
M.icon=M.icon and(modeIcons[M.icon]or GC.newImage("media/image/modeicon/"..M.icon..".png"))
end
YIELD('loadOther')
@@ -119,11 +116,11 @@ local loadingThread=coroutine.wrap(function()
end)
function scene.sceneInit()
studioLogo=gc.newText(getFont(90),"26F Studio")
studioLogo=GC.newText(getFont(90),"26F Studio")
progress=0
maxProgress=10
t1,t2=0,0--Timer
animeType={}for i=1,#SVG_TITLE_FILL do animeType[i]=rnd(#titleTransform)end--Random animation type
animeType={}for i=1,#SVG_TITLE_FILL do animeType[i]=math.random(#titleTransform)end--Random animation type
end
function scene.sceneBack()
love.event.quit()
@@ -159,45 +156,45 @@ end
local titleColor={COLOR.P,COLOR.F,COLOR.V,COLOR.A,COLOR.M,COLOR.N,COLOR.W,COLOR.Y}
function scene.draw()
gc.clear(.08,.08,.084)
GC.clear(.08,.08,.084)
local T=(t1+110)%300
if T<30 then
gc.setLineWidth(4+(30-T)^1.626/62)
GC.setLineWidth(4+(30-T)^1.626/62)
else
gc.setLineWidth(4)
GC.setLineWidth(4)
end
gc.push('transform')
gc.translate(126,100)
GC.push('transform')
GC.translate(126,100)
for i=1,#SVG_TITLE_FILL do
local triangles=love.math.triangulate(SVG_TITLE_FILL[i])
local t=t1-i*15
if t>0 then
gc.push('transform')
GC.push('transform')
titleTransform[animeType[i]](t,i)
local dt=(t1+62-5*i)%300
if dt<20 then
gc.translate(0,math.abs(10-dt)-10)
GC.translate(0,math.abs(10-dt)-10)
end
gc.setColor(titleColor[i][1],titleColor[i][2],titleColor[i][3],min(t*.025,1)*.2)
GC.setColor(titleColor[i][1],titleColor[i][2],titleColor[i][3],min(t*.025,1)*.2)
for j=1,#triangles do
gc.polygon('fill',triangles[j])
GC.polygon('fill',triangles[j])
end
gc.setColor(1,1,1,min(t*.025,1))
gc.polygon('line',SVG_TITLE_LINE[i])
if i==8 then gc.polygon('line',SVG_TITLE_LINE[9])end
gc.pop()
GC.setColor(1,1,1,min(t*.025,1))
GC.polygon('line',SVG_TITLE_LINE[i])
if i==8 then GC.polygon('line',SVG_TITLE_LINE[9])end
GC.pop()
end
end
gc.pop()
GC.pop()
gc.setColor(logoColor1[1],logoColor1[2],logoColor1[3],progress/maxProgress)mDraw(studioLogo,640,400)
gc.setColor(logoColor2[1],logoColor2[2],logoColor2[3],progress/maxProgress)for dx=-2,2,2 do for dy=-2,2,2 do mDraw(studioLogo,640+dx,400+dy)end end
gc.setColor(.2,.2,.2,progress/maxProgress)mDraw(studioLogo,640,400)
GC.setColor(logoColor1[1],logoColor1[2],logoColor1[3],progress/maxProgress)mDraw(studioLogo,640,400)
GC.setColor(logoColor2[1],logoColor2[2],logoColor2[3],progress/maxProgress)for dx=-2,2,2 do for dy=-2,2,2 do mDraw(studioLogo,640+dx,400+dy)end end
GC.setColor(.2,.2,.2,progress/maxProgress)mDraw(studioLogo,640,400)
gc.setColor(COLOR.Z)
GC.setColor(COLOR.Z)
setFont(30)
mStr(text.loadText[loading]or"",640,530)
GC.mStr(text.loadText[loading]or"",640,530)
end
return scene

View File

@@ -1,10 +1,8 @@
local gc=love.graphics
local scene={}
local verName=("%s %s %s"):format(SYSTEM,VERSION.string,VERSION.name)
local tipLength=760
local tip=gc.newText(getFont(30),"")
local tip=GC.newText(getFont(30),"")
local scrollX--Tip scroll position
local widgetX0={
@@ -142,30 +140,30 @@ function scene.update(dt)
end
local function _tipStencil()
gc.rectangle('fill',0,0,tipLength,42)
GC.rectangle('fill',0,0,tipLength,42)
end
function scene.draw()
--Version
setFont(20)
gc.setColor(.6,.6,.6)
mStr(verName,640,110)
GC.setColor(.6,.6,.6)
GC.mStr(verName,640,110)
--Title
gc.setColor(1,1,1)
GC.setColor(1,1,1)
mDraw(TEXTURE.title_color,640,60,nil,.43)
--Tip
gc.setColor(COLOR.Z)
gc.push('transform')
gc.translate(260,650)
gc.setLineWidth(2)
gc.rectangle('line',0,0,tipLength,42,3)
gc.stencil(_tipStencil)
gc.setStencilTest('equal',1)
gc.draw(tip,0+scrollX,0)
gc.setColor(1,1,1,.2)
gc.setStencilTest()
gc.pop()
GC.setColor(COLOR.Z)
GC.push('transform')
GC.translate(260,650)
GC.setLineWidth(2)
GC.rectangle('line',0,0,tipLength,42,3)
GC.stencil(_tipStencil)
GC.setStencilTest('equal',1)
GC.draw(tip,0+scrollX,0)
GC.setColor(1,1,1,.2)
GC.setStencilTest()
GC.pop()
--Player
PLAYERS[1]:draw()
@@ -178,10 +176,10 @@ function scene.draw()
--Connecting mark
if NET.getlock('access_and_login')then
gc.setColor(COLOR.Z)
gc.setLineWidth(10)
GC.setColor(COLOR.Z)
GC.setLineWidth(10)
local t=TIME()*6.26%6.2832
gc.arc('line','open',scene.widgetList[3].x+865,450,40,t,t+4.26)
GC.arc('line','open',scene.widgetList[3].x+865,450,40,t,t+4.26)
end
end

View File

@@ -1,8 +1,6 @@
local gc=love.graphics
local scene={}
local tip=gc.newText(getFont(30),"")
local tip=GC.newText(getFont(30),"")
function scene.sceneInit()
tip:set(text.getTip())
@@ -10,7 +8,7 @@ function scene.sceneInit()
end
function scene.draw()
gc.setColor(1,1,1)
GC.setColor(1,1,1)
mDraw(TEXTURE.title_color,640,160)
mDraw(tip,640,660)
end

View File

@@ -1,7 +1,3 @@
local gc=love.graphics
local kb=love.keyboard
local ins,rem=table.insert,table.remove
local scene={}
local selected--Mod selected
@@ -12,12 +8,12 @@ end
local function _remMod(M)
local i=TABLE.find(GAME.mod,M)
if i then
rem(GAME.mod,i)
table.remove(GAME.mod,i)
end
end
local function _toggleMod(M,back)
if M.sel==0 then
ins(GAME.mod,M)
table.insert(GAME.mod,M)
table.sort(GAME.mod,_modComp)
end
if M.list then
@@ -60,7 +56,7 @@ end
function scene.mouseDown(x,y,k)
for _,M in next,MODOPT do
if(x-M.x)^2+(y-M.y)^2<2000 then
_toggleMod(M,k==2 or kb.isDown('lshift','rshift'))
_toggleMod(M,k==2 or love.keyboard.isDown('lshift','rshift'))
break
end
end
@@ -76,7 +72,7 @@ function scene.keyDown(key)
if key=='tab'or key=='delete'then
if GAME.mod[1]then
while GAME.mod[1]do
rem(GAME.mod).sel=0
table.remove(GAME.mod).sel=0
end
scene.widgetList.unranked.hide=scoreValid()
SFX.play('hold')
@@ -84,7 +80,7 @@ function scene.keyDown(key)
elseif #key==1 then
for _,M in next,MODOPT do
if key==M.key then
_toggleMod(M,kb.isDown('lshift','rshift'))
_toggleMod(M,love.keyboard.isDown('lshift','rshift'))
selected=M
break
end
@@ -109,13 +105,13 @@ function scene.update()
end
function scene.draw()
setFont(40)
gc.setLineWidth(5)
GC.setLineWidth(5)
for _,M in next,MODOPT do
gc.push('transform')
gc.translate(M.x,M.y)
GC.push('transform')
GC.translate(M.x,M.y)
local t=M.time*.01--t range:0~0.1
gc.scale(1+3*t)
gc.rotate(t)
GC.scale(1+3*t)
GC.rotate(t)
local rad,side
if M.unranked then
rad,side=45,5
@@ -123,34 +119,34 @@ function scene.draw()
rad=40
end
local color=M.color
gc.setColor(color[1],color[2],color[3],5*t)
gc.circle('fill',0,0,rad,side)
GC.setColor(color[1],color[2],color[3],5*t)
GC.circle('fill',0,0,rad,side)
gc.setColor(color)
gc.circle('line',0,0,rad,side)
gc.setColor(COLOR.Z)
mStr(M.id,0,-27)
GC.setColor(color)
GC.circle('line',0,0,rad,side)
GC.setColor(COLOR.Z)
GC.mStr(M.id,0,-27)
if M.sel>0 and M.list then
setFont(25)
gc.setColor(1,1,1,10*t)
mStr(M.list[M.sel],20,8)
GC.setColor(1,1,1,10*t)
GC.mStr(M.list[M.sel],20,8)
setFont(40)
end
if M.list then
gc.setColor(1,1,1,t*6)
gc.arc('line','open',0,0,rad+6,0,(M.sel/#M.list)*6.2832)
GC.setColor(1,1,1,t*6)
GC.arc('line','open',0,0,rad+6,0,(M.sel/#M.list)*6.2832)
end
gc.pop()
GC.pop()
end
gc.setColor(COLOR.Z)
GC.setColor(COLOR.Z)
if selected then
setFont(30)
gc.printf(text.modInfo[selected.name],70,540,950)
GC.printf(text.modInfo[selected.name],70,540,950)
else
setFont(25)
gc.printf(text.modInstruction,70,540,950)
GC.printf(text.modInstruction,70,540,950)
end
end

View File

@@ -1,22 +1,18 @@
local gc=love.graphics
local gc_push,gc_pop=gc.push,gc.pop
local gc_translate,gc_scale,gc_rotate,gc_applyTransform=gc.translate,gc.scale,gc.rotate,gc.applyTransform
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
local gc_draw,gc_line=gc.draw,gc.line
local gc_rectangle,gc_circle=gc.rectangle,gc.circle
local gc_print,gc_printf=gc.print,gc.printf
local gc_push,gc_pop=GC.push,GC.pop
local gc_translate,gc_scale,gc_rotate,gc_applyTransform=GC.translate,GC.scale,GC.rotate,GC.applyTransform
local gc_setColor,gc_setLineWidth=GC.setColor,GC.setLineWidth
local gc_draw,gc_line=GC.draw,GC.line
local gc_rectangle,gc_circle=GC.rectangle,GC.circle
local gc_print,gc_printf=GC.print,GC.printf
local ms,kb,tc=love.mouse,love.keyboard,love.touch
local mt=love.math
local max,min=math.max,math.min
local int,abs=math.floor,math.abs
local setFont=FONT.set
local mapCam={
sel=false,--Selected mode ID
xOy=mt.newTransform(0,0,0,1),--Transformation for map display
xOy=love.math.newTransform(0,0,0,1),--Transformation for map display
keyCtrl=false,--If controlling with key
--For auto zooming when enter/leave scene
@@ -272,9 +268,9 @@ function scene.draw()
name=RANK_CHARS[rank]
if name then
gc_setColor(COLOR.dX)
mStr(name,M.x+M.size*.7,M.y-50-M.size*.7)
GC.mStr(name,M.x+M.size*.7,M.y-50-M.size*.7)
gc_setColor(RANK_COLORS[rank])
mStr(name,M.x+M.size*.7+4,M.y-50-M.size*.7-4)
GC.mStr(name,M.x+M.size*.7+4,M.y-50-M.size*.7-4)
end
end
end
@@ -287,8 +283,8 @@ function scene.draw()
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)
setFont(30)mStr(text.modes[sel][2],1100,50)
setFont(40)GC.mStr(text.modes[sel][1],1100,5)
setFont(30)GC.mStr(text.modes[sel][2],1100,50)
setFont(25)gc_printf(text.modes[sel][3],920,110,360,'center')
if M.slowMark then
gc_draw(IMG.ctrlSpeedLimit,1230,50,nil,.4)

View File

@@ -1,7 +1,4 @@
local gc=love.graphics
local gc_setColor,gc_print=gc.setColor,gc.print
local sin=math.sin
local setFont=FONT.set
local author={
battle="Aether & MrZ",
@@ -69,56 +66,56 @@ function scene.draw()
local t=TIME()
--Character
gc.push('transform')
gc.setColor(1,1,1)
gc.translate(906,456)
gc.scale(.6)
GC.draw(IMG.z.character)
GC.draw(IMG.z.screen1, -91, -157+16*math.sin(t))
GC.draw(IMG.z.screen2, 120, -166+16*math.sin(t+1))
gc.setColor(1,1,1,.7+.3*math.sin(.6*t)) GC.draw(IMG.z.particle1, -50, 42+6*math.sin(t*0.36))
gc.setColor(1,1,1,.7+.3*math.sin(.7*t)) GC.draw(IMG.z.particle2, 110+6*math.sin(t*0.92), 55)
gc.setColor(1,1,1,.7+.3*math.sin(.8*t)) GC.draw(IMG.z.particle3, -54+6*math.sin(t*0.48), -248)
gc.setColor(1,1,1,.7+.3*math.sin(.9*t)) GC.draw(IMG.z.particle4, 133, -305+6*math.sin(t*0.40))
gc.pop()
GC.push('transform')
GC.setColor(1,1,1)
GC.translate(906,456)
GC.scale(.6)
mDraw(IMG.z.character)
mDraw(IMG.z.screen1, -91, -157+16*math.sin(t))
mDraw(IMG.z.screen2, 120, -166+16*math.sin(t+1))
GC.setColor(1,1,1,.7+.3*math.sin(.6*t)) mDraw(IMG.z.particle1, -50, 42+6*math.sin(t*0.36))
GC.setColor(1,1,1,.7+.3*math.sin(.7*t)) mDraw(IMG.z.particle2, 110+6*math.sin(t*0.92), 55)
GC.setColor(1,1,1,.7+.3*math.sin(.8*t)) mDraw(IMG.z.particle3, -54+6*math.sin(t*0.48), -248)
GC.setColor(1,1,1,.7+.3*math.sin(.9*t)) mDraw(IMG.z.particle4, 133, -305+6*math.sin(t*0.40))
GC.pop()
gc_setColor(COLOR.Z)
GC.setColor(COLOR.Z)
--Scroller
gc.setLineWidth(2)
gc.line(315,307,315,482)
GC.setLineWidth(2)
GC.line(315,307,315,482)
setFont(50)
gc_print(bgmList[selected],320,355)
GC.print(bgmList[selected],320,355)
setFont(35)
if selected>1 then gc_print(bgmList[selected-1],322,350-30)end
if selected<#bgmList then gc_print(bgmList[selected+1],322,350+65)end
if selected>1 then GC.print(bgmList[selected-1],322,350-30)end
if selected<#bgmList then GC.print(bgmList[selected+1],322,350+65)end
setFont(20)
if selected>2 then gc_print(bgmList[selected-2],322,350-50)end
if selected<#bgmList-1 then gc_print(bgmList[selected+2],322,350+110)end
if selected>2 then GC.print(bgmList[selected-2],322,350-50)end
if selected<#bgmList-1 then GC.print(bgmList[selected+2],322,350+110)end
--Title
if BGM.nowPlay then
GC.draw(TEXTURE.title,570,190,nil,.42)
mDraw(TEXTURE.title,570,190,nil,.42)
local a=-t%2.3/2.3
gc_setColor(1,1,1,math.min(a,1))
GC.draw(TEXTURE.title_color,570,190,nil,.42+.062-.062*a)
GC.setColor(1,1,1,math.min(a,1))
mDraw(TEXTURE.title_color,570,190,nil,.42+.062-.062*a)
end
--Music player
if BGM.nowPlay then
setFont(45)
GC.shadedPrint(BGM.nowPlay,710,508,'left',2)
gc_setColor(sin(t*.5)*.2+.8,sin(t*.7)*.2+.8,sin(t)*.2+.8)
gc_print(BGM.nowPlay,710,508)
GC.setColor(sin(t*.5)*.2+.8,sin(t*.7)*.2+.8,sin(t)*.2+.8)
GC.print(BGM.nowPlay,710,508)
setFont(35)
gc_setColor(1,sin(t*2.6)*.5+.5,sin(t*2.6)*.5+.5)
gc_print(author[BGM.nowPlay]or"MrZ",670,465)
GC.setColor(1,sin(t*2.6)*.5+.5,sin(t*2.6)*.5+.5)
GC.print(author[BGM.nowPlay]or"MrZ",670,465)
setFont(20)
gc_setColor(COLOR.Z)
GC.setColor(COLOR.Z)
local cur=BGM.playing:tell()
local dur=BGM.playing:getDuration()
gc_print(STRING.time_simp(cur%dur).." / "..STRING.time_simp(dur),480,626)
GC.print(STRING.time_simp(cur%dur).." / "..STRING.time_simp(dur),480,626)
end
end

View File

@@ -10,7 +10,7 @@ end
function scene.draw()
gc.setColor(COLOR.Z)
setFont(100)
mStr("Tech League",640,120)
GC.mStr("Tech League",640,120)
drawSelfProfile()
drawOnlinePlayerCount()
end

View File

@@ -1,39 +1,33 @@
local gc=love.graphics
local gc_setColor=gc.setColor
local gc_rectangle=gc.rectangle
local gc_print,gc_printf=gc.print,gc.printf
local kb=love.keyboard
local setFont=FONT.set
local listBox=WIDGET.newListBox{name='list',x=50,y=50,w=1200,h=520,lineH=40,drawF=function(rep,id,ifSel)
if ifSel then
gc_setColor(1,1,1,.3)
gc_rectangle('fill',0,0,1200,40)
GC.setColor(1,1,1,.3)
GC.rectangle('fill',0,0,1200,40)
end
setFont(30)
gc_setColor(.8,.8,.8)
gc_print(id,10,0)
GC.setColor(.8,.8,.8)
GC.print(id,10,0)
if rep.tasUsed then
gc_setColor(COLOR.R)
gc_print("TAS",680,1)
GC.setColor(COLOR.R)
GC.print("TAS",680,1)
end
if rep.available then
gc_setColor(.9,.9,1)
GC.setColor(.9,.9,1)
local modeName=text.modes[rep.mode]
gc_print(modeName and modeName[1].." "..modeName[2]or rep.mode,310,0)
GC.print(modeName and modeName[1].." "..modeName[2]or rep.mode,310,0)
setFont(20)
gc_setColor(1,1,.8)
gc_print(rep.date,80,6)
gc_setColor(1,.4,.4,.6)
gc_printf(rep.version,0,6,1190,'right')
gc_setColor(COLOR.Z)
gc_printf(rep.player,0,6,960,'right')
GC.setColor(1,1,.8)
GC.print(rep.date,80,6)
GC.setColor(1,.4,.4,.6)
GC.printf(rep.version,0,6,1190,'right')
GC.setColor(COLOR.Z)
GC.printf(rep.player,0,6,960,'right')
else
gc_setColor(.6,.6,.6)
gc_print(rep.fileName,80,0)
GC.setColor(.6,.6,.6)
GC.print(rep.fileName,80,0)
end
end}

View File

@@ -8,9 +8,9 @@ function scene.draw()
if SETTING.VKTrack then
love.graphics.setColor(1,1,1)
setFont(30)
mStr(text.VKTchW,140+500*SETTING.VKTchW,800-WIDGET.scrollPos)
mStr(text.VKOrgW,140+500*SETTING.VKTchW+500*SETTING.VKCurW,870-WIDGET.scrollPos)
mStr(text.VKCurW,640+500*SETTING.VKCurW,950-WIDGET.scrollPos)
GC.mStr(text.VKTchW,140+500*SETTING.VKTchW,800-WIDGET.scrollPos)
GC.mStr(text.VKOrgW,140+500*SETTING.VKTchW+500*SETTING.VKCurW,870-WIDGET.scrollPos)
GC.mStr(text.VKCurW,640+500*SETTING.VKCurW,950-WIDGET.scrollPos)
end
end

View File

@@ -84,7 +84,7 @@ function scene.draw()
local L=text.staff
setFont(40)
for i=1,#L do
mStr(L[i],640,950+65*i-T)
GC.mStr(L[i],640,950+65*i-T)
end
gc.setColor(1,1,1)
mDraw(TEXTURE.title_color,640,900-T,nil,.6)

View File

@@ -1,11 +1,9 @@
local gc=love.graphics
local gc_translate=gc.translate
local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
local gc_draw,gc_line=gc.draw,gc.line
local gc_print=gc.print
local gc_translate=GC.translate
local gc_setColor,gc_setLineWidth=GC.setColor,GC.setLineWidth
local gc_draw,gc_line=GC.draw,GC.line
local gc_print=GC.print
local int,sin=math.floor,math.sin
local mStr=GC.mStr
local scene={}
@@ -82,8 +80,8 @@ function scene.draw()
local A,B=form.A1,form.A2
gc_translate(60,80)
gc_setLineWidth(2)
gc.rectangle('line',0,0,560,160,5)
gc.rectangle('line',0,240,560,160,5)
GC.rectangle('line',0,0,560,160,5)
GC.rectangle('line',0,240,560,160,5)
for x=1,6 do
x=80*x
gc_line(x,0,x,160)
@@ -97,15 +95,15 @@ function scene.draw()
for x=1,7 do
gc_setColor(BLOCK_COLORS[SETTING.skin[x]])
setFont(70)
mStr(BLOCK_CHARS[x],80*x-40,-70)
mStr(BLOCK_CHARS[x],80*x-40,170)
GC.mStr(BLOCK_CHARS[x],80*x-40,-70)
GC.mStr(BLOCK_CHARS[x],80*x-40,170)
setFont(25)
for y=1,4 do
mStr(A[x][y],80*x-40,-37+40*y)
mStr(B[x][y],80*x-40,203+40*y)
GC.mStr(A[x][y],80*x-40,-37+40*y)
GC.mStr(B[x][y],80*x-40,203+40*y)
end
mStr(form.Y1[x],80*x-40,163)
mStr(form.Y2[x],80*x-40,403)
GC.mStr(form.Y1[x],80*x-40,163)
GC.mStr(form.Y2[x],80*x-40,403)
end
A,B=form.X1,form.X2
@@ -114,8 +112,8 @@ function scene.draw()
gc_print(spinChars[y],-33,-37+40*y)
gc_print(y,-28,203+40*y)
gc_setColor(COLOR.H)
mStr(A[y],612,-37+40*y)
mStr(B[y],612,203+40*y)
GC.mStr(A[y],612,-37+40*y)
GC.mStr(B[y],612,203+40*y)
end
gc_translate(-60,-80)
end

View File

@@ -1,18 +1,16 @@
local gc=love.graphics
local scene={}
function scene.draw()
--QR Code frame
gc.setLineWidth(2)
gc.rectangle('line',298,98,263,263)
gc.rectangle('line',718,318,250,250)
GC.setLineWidth(2)
GC.rectangle('line',298,98,263,263)
GC.rectangle('line',718,318,250,250)
--Support text
gc.setColor(1,1,1,MATH.sin(TIME()*20)*.3+.6)
GC.setColor(1,1,1,MATH.sin(TIME()*20)*.3+.6)
setFont(30)
mStr(text.support,430+MATH.sin(TIME()*4)*20,363)
mStr(text.support,844-MATH.sin(TIME()*4)*20,570)
GC.mStr(text.support,430+MATH.sin(TIME()*4)*20,363)
GC.mStr(text.support,844-MATH.sin(TIME()*4)*20,570)
end
scene.widgetList={

View File

@@ -1,4 +1,3 @@
local gc=love.graphics
local ins,rem=table.insert,table.remove
local scene={}
@@ -93,8 +92,8 @@ function scene.draw()
setFont(15)
local l=#list
for i=1,l do
gc.setColor(1,1,1,list[i][2]/30)
gc.print(list[i][1],20,20*(l-i+1))
GC.setColor(1,1,1,list[i][2]/30)
GC.print(list[i][1],20,20*(l-i+1))
end
end