整理代码

This commit is contained in:
MrZ626
2021-06-06 12:26:30 +08:00
parent b7b630fc81
commit ef8bf5fc3e
6 changed files with 19 additions and 21 deletions

View File

@@ -86,7 +86,7 @@ MODES= require"parts.modes"
FIELD[1]=DATA.newBoard()
--First start for phones
if not fs.getInfo("conf/settings")and MOBILE then
if not fs.getInfo('conf/settings')and MOBILE then
SETTING.VKSwitch=true
SETTING.swap=false
SETTING.powerInfo=true
@@ -244,8 +244,8 @@ do
autoRestart=true
end
if STAT.version<1405 then
fs.remove("conf/user")
fs.remove("conf/key")
fs.remove('conf/user')
fs.remove('conf/key')
needSave=true
autoRestart=true
end

View File

@@ -183,8 +183,8 @@ ROYALEDATA={
}
--Userdata tables
RANKS=FILE.load("conf/unlock")or{sprint_10l=0}--Ranks of modes
USER=FILE.load("conf/user")or{--User infomation
RANKS=FILE.load('conf/unlock')or{sprint_10l=0}--Ranks of modes
USER=FILE.load('conf/user')or{--User infomation
--Network infos
uid=false,
authToken=false,
@@ -236,7 +236,7 @@ customEnv0={
bg='blockfall',
bgm='hang out',
}
CUSTOMENV=FILE.load("conf/customEnv")--gameEnv for cutsom game
CUSTOMENV=FILE.load('conf/customEnv')--gameEnv for cutsom game
if not CUSTOMENV or CUSTOMENV.version~=VERSION.code then
CUSTOMENV=TABLE.copy(customEnv0)
else
@@ -314,9 +314,9 @@ SETTING={--Settings
VKIcon=true,--If disp icon
VKAlpha=.3,
}
local S=FILE.load("conf/settings")
local S=FILE.load('conf/settings')
if S then TABLE.update(S,SETTING)end
S=FILE.load("conf/data")
S=FILE.load('conf/data')
if S then--Statistics
STAT=S
else
@@ -335,7 +335,7 @@ else
todayTime=0,
}for i=1,29 do STAT.clear[i]={0,0,0,0,0,0}STAT.spin[i]={0,0,0,0,0,0,0}end
end
keyMap=FILE.load("conf/key")or{--Key setting
keyMap=FILE.load('conf/key')or{--Key setting
keyboard={
left=1,right=2,x=3,z=4,c=5,
up=6,down=7,space=8,a=9,s=10,
@@ -347,7 +347,7 @@ keyMap=FILE.load("conf/key")or{--Key setting
leftshoulder=0,
},
}
VK_org=FILE.load("conf/virtualkey")or{--Virtualkey layout, refresh all VKs' position with this before each game
VK_org=FILE.load('conf/virtualkey')or{--Virtualkey layout, refresh all VKs' position with this before each game
{ava=true, x=80, y=720-200, r=80},--moveLeft
{ava=true, x=320, y=720-200, r=80},--moveRight
{ava=true, x=1280-80, y=720-200, r=80},--rotRight
@@ -369,4 +369,4 @@ VK_org=FILE.load("conf/virtualkey")or{--Virtualkey layout, refresh all VKs' posi
{ava=false, x=900, y=50, r=80},--addToLeft
{ava=false, x=1000, y=50, r=80},--addToRight
}
REPLAY=FILE.load("conf/replay")or{}
REPLAY=FILE.load('conf/replay')or{}

View File

@@ -92,7 +92,6 @@ function netPLY.clear()
end
function netPLY.add(p)
p.connected=false
p.username=p.username
p.place=1e99
p.stat=false
local a=rnd()*6.2832

View File

@@ -12,10 +12,10 @@ local function login()
end
NET.wsconn_user_pswd(email,password)
if savePW then
FILE.save({email,password},"conf/account",'q')
FILE.save({email,password},'conf/account','q')
else
if love.filesystem.getInfo("conf/account")then
love.filesystem.remove("conf/account")
if love.filesystem.getInfo('conf/account')then
love.filesystem.remove('conf/account')
end
end
end
@@ -23,7 +23,7 @@ end
local scene={}
function scene.sceneInit()
local data=FILE.load("conf/account")
local data=FILE.load('conf/account')
if data then
savePW=true
emailBox:setText(data[1])

View File

@@ -9,10 +9,10 @@ local snapUnit=1
local selected--Button selected
local function save1()
FILE.save(VK_org,"conf/vkSave1")
FILE.save(VK_org,'conf/vkSave1')
end
local function load1()
local D=FILE.load("conf/vkSave1")
local D=FILE.load('conf/vkSave1')
if D then
TABLE.update(D,VK_org)
else
@@ -20,10 +20,10 @@ local function load1()
end
end
local function save2()
FILE.save(VK_org,"conf/vkSave2")
FILE.save(VK_org,'conf/vkSave2')
end
local function load2()
local D=FILE.load("conf/vkSave2")
local D=FILE.load('conf/vkSave2')
if D then
TABLE.update(D,VK_org)
else

View File

@@ -3,7 +3,6 @@ local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth
local gc_draw,gc_line=gc.draw,gc.line
local gc_print=gc.print
local abs,int,sin=math.abs,math.floor,math.sin
local mStr=mStr