整理代码
This commit is contained in:
1
conf.lua
1
conf.lua
@@ -1,6 +1,5 @@
|
|||||||
VERSION_CODE=1303
|
VERSION_CODE=1303
|
||||||
VERSION_NAME="Alpha V0.13.3"
|
VERSION_NAME="Alpha V0.13.3"
|
||||||
love.setDeprecationOutput(false)
|
|
||||||
function love.conf(t)
|
function love.conf(t)
|
||||||
t.identity="Techmino"--Saving folder
|
t.identity="Techmino"--Saving folder
|
||||||
t.version="11.1"
|
t.version="11.1"
|
||||||
|
|||||||
29
main.lua
29
main.lua
@@ -8,10 +8,10 @@
|
|||||||
optimization is welcomed if you also love tetromino game
|
optimization is welcomed if you also love tetromino game
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
local fs=love.filesystem
|
|
||||||
|
|
||||||
--?
|
--Declaration
|
||||||
goto REM love=require"love"::REM::--Just tell IDE to load love-api, no actual usage
|
goto REM love=require"love"::REM::--Just tell IDE to load love-api, no actual usage
|
||||||
|
local fs=love.filesystem
|
||||||
NONE={}function NULL()end
|
NONE={}function NULL()end
|
||||||
DBP=print--Use this in permanent code
|
DBP=print--Use this in permanent code
|
||||||
TIME=love.timer.getTime
|
TIME=love.timer.getTime
|
||||||
@@ -31,6 +31,7 @@ ERRDATA={}
|
|||||||
|
|
||||||
--System setting
|
--System setting
|
||||||
math.randomseed(os.time()*626)
|
math.randomseed(os.time()*626)
|
||||||
|
love.setDeprecationOutput(false)
|
||||||
love.keyboard.setKeyRepeat(true)
|
love.keyboard.setKeyRepeat(true)
|
||||||
love.keyboard.setTextInput(false)
|
love.keyboard.setTextInput(false)
|
||||||
love.mouse.setVisible(false)
|
love.mouse.setVisible(false)
|
||||||
@@ -46,23 +47,6 @@ for _,v in next,{"conf","record","replay"}do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Delete some useless files
|
|
||||||
for _,v in next,{
|
|
||||||
"client.so",
|
|
||||||
"cold_clear.dll",
|
|
||||||
"CCloader.dll",
|
|
||||||
"tech_u.dat",
|
|
||||||
"tech_u+.dat",
|
|
||||||
"sprintFix.dat",
|
|
||||||
"sprintLock.dat",
|
|
||||||
"marathon_u.dat",
|
|
||||||
"infinite.dat",
|
|
||||||
"infinite_dig.dat",
|
|
||||||
"conf/account",
|
|
||||||
}do
|
|
||||||
if fs.getInfo(v)then fs.remove(v)end
|
|
||||||
end
|
|
||||||
|
|
||||||
--Collect files of old version
|
--Collect files of old version
|
||||||
if fs.getInfo("data.dat")or fs.getInfo("key.dat")or fs.getInfo("settings.dat")then
|
if fs.getInfo("data.dat")or fs.getInfo("key.dat")or fs.getInfo("settings.dat")then
|
||||||
for k,v in next,{
|
for k,v in next,{
|
||||||
@@ -239,8 +223,6 @@ for _,v in next,fs.getDirectoryItems("parts/shaders")do
|
|||||||
if fs.getRealDirectory("parts/shaders/"..v)~=SAVEDIR then
|
if fs.getRealDirectory("parts/shaders/"..v)~=SAVEDIR then
|
||||||
local name=v:sub(1,-6)
|
local name=v:sub(1,-6)
|
||||||
SHADER[name]=love.graphics.newShader("parts/shaders/"..name..".glsl")
|
SHADER[name]=love.graphics.newShader("parts/shaders/"..name..".glsl")
|
||||||
else
|
|
||||||
LOG.print("Dangerous file : %SAVE%/parts/shaders/"..v)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -251,8 +233,6 @@ for _,v in next,fs.getDirectoryItems("parts/backgrounds")do
|
|||||||
local name=v:sub(1,-5)
|
local name=v:sub(1,-5)
|
||||||
BG.add(name,require("parts.backgrounds."..name))
|
BG.add(name,require("parts.backgrounds."..name))
|
||||||
end
|
end
|
||||||
else
|
|
||||||
LOG.print("Dangerous file : %SAVE%/parts/backgrounds/"..v)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -262,8 +242,6 @@ for _,v in next,fs.getDirectoryItems("parts/scenes")do
|
|||||||
local sceneName=v:sub(1,-5)
|
local sceneName=v:sub(1,-5)
|
||||||
SCN.add(sceneName,require("parts.scenes."..sceneName))
|
SCN.add(sceneName,require("parts.scenes."..sceneName))
|
||||||
LANG.addScene(sceneName)
|
LANG.addScene(sceneName)
|
||||||
else
|
|
||||||
LOG.print("Dangerous file : %SAVE%/parts/scenes/"..v)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
LANG.set(SETTING.lang)
|
LANG.set(SETTING.lang)
|
||||||
@@ -358,7 +336,6 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if autoRestart then
|
if autoRestart then
|
||||||
-- love.window.showMessageBox("重启更新 Restart to Update","检测到大版本更新,请重启游戏完成\nOld version detected & saving file changed, please restart the game",{"Get it!"},"info",true)
|
|
||||||
love.event.quit("restart")
|
love.event.quit("restart")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user