modeData地位提升,模式环境变量target移入其中,大规模整理代码,可读性增强

This commit is contained in:
MrZ626
2021-03-23 19:11:05 +08:00
parent ac8a41004b
commit 374f2ab779
76 changed files with 356 additions and 373 deletions

View File

@@ -1,6 +1,5 @@
local gc=love.graphics
local kb=love.keyboard
local int=math.floor
local ins,rem=table.insert,table.remove
local C=COLOR
@@ -256,7 +255,7 @@ do--commands.help(arg)
--help or help [page]
local page=arg==""and 1 or tonumber(arg)
if page then
if page==int(page)and page>=1 and page<=maxPage then
if page==math.floor(page)and page>=1 and page<=maxPage then
log"Use help [page] to view more commands,"
log"or help [command_name] for details of a command."
log""
@@ -366,7 +365,7 @@ commands.bye=backScene
--Game commands
function commands.fn(n)
if tonumber(n)then
n=int(tonumber(n))
n=math.floor(tonumber(n))
if n>=1 and n<=12 then
love.keypressed("f"..n)
return

View File

@@ -1,6 +1,4 @@
local gc=love.graphics
local int=math.floor
local sin,log=math.sin,math.log10
local format=string.format
@@ -251,7 +249,7 @@ function scene.draw()
if M.sel>0 then
_=M.color
gc.setColor(_[1],_[2],_[3],T)
mStr(M.id,810+M.no%8*60,560+int(M.no/8)*45)
mStr(M.id,810+M.no%8*60,560+math.floor(M.no/8)*45)
end
end
end

View File

@@ -1,5 +1,4 @@
local gc=love.graphics
local int=math.floor
local scene={}
@@ -76,7 +75,7 @@ end
local function sliderShow(S)
S=S.disp()
return S.."F "..int(S*16.67).."ms"
return S.."F "..math.floor(S*16.67).."ms"
end
scene.widgetList={
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},

View File

@@ -1,5 +1,4 @@
local gc=love.graphics
local int=math.floor
local scene={}
@@ -12,7 +11,7 @@ end
function scene.draw()
local t=TIME()
local b=int(t*2)%16+1
local b=math.floor(t*2)%16+1
gc.setColor(1,1,1)
gc.draw(SKIN.curText[b],710,540,t%6.28319,2,nil,15,15)
gc.setColor(1,1,1,t*2%1)

View File

@@ -1,5 +1,3 @@
local int=math.floor
local scene={}
local mini,b2b,b3b,pc
@@ -28,7 +26,7 @@ function scene.keyDown(key)
elseif b3b then VOC.play("b3b",CHN)
end
if key>=10 then
VOC.play(blockName[int(key/10)].."spin",CHN)
VOC.play(blockName[math.floor(key/10)].."spin",CHN)
end
if lineCount[key%10]then VOC.play(lineCount[key%10],CHN)end
if pc then VOC.play("perfect_clear",CHN)end