添加代码格式化风格文件
试着格式化一些文件
This commit is contained in:
31
.editorconfig
Normal file
31
.editorconfig
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# EmmyLuaCodeStyle
|
||||||
|
[*.lua]
|
||||||
|
max_line_length = 26000
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
space_around_table_field_list = false
|
||||||
|
space_before_attribute = false
|
||||||
|
space_before_function_call_open_parenthesis = false
|
||||||
|
space_before_closure_open_parenthesis = false
|
||||||
|
space_before_function_call_single_arg = false
|
||||||
|
space_before_open_square_bracket = false
|
||||||
|
space_inside_function_call_parentheses = false
|
||||||
|
space_inside_function_param_list_parentheses = false
|
||||||
|
space_inside_square_brackets = false
|
||||||
|
space_around_table_append_operator = false
|
||||||
|
space_before_inline_comment = false
|
||||||
|
space_around_math_operator = false
|
||||||
|
space_around_logical_operator = false
|
||||||
|
space_around_assign_operator = false
|
||||||
|
space_after_comma = false
|
||||||
|
space_after_comma_in_for_statement = false
|
||||||
|
space_around_concat_operator = false
|
||||||
|
align_call_args = false
|
||||||
|
align_function_params = false
|
||||||
|
align_continuous_assign_statement = true
|
||||||
|
align_continuous_rect_table_field = true
|
||||||
|
align_if_branch = false
|
||||||
|
align_array_table = true
|
||||||
|
ignore_spaces_inside_function_call = true
|
||||||
|
line_space_after_function_statement = keep
|
||||||
|
trailing_table_separator = smart
|
||||||
26
conf.lua
26
conf.lua
@@ -1,6 +1,7 @@
|
|||||||
SYSTEM=love._os if SYSTEM=='OS X' then SYSTEM='macOS' end
|
SYSTEM=love._os
|
||||||
|
if SYSTEM=='OS X' then SYSTEM='macOS' end
|
||||||
MOBILE=SYSTEM=='Android' or SYSTEM=='iOS'
|
MOBILE=SYSTEM=='Android' or SYSTEM=='iOS'
|
||||||
FNNS=SYSTEM:find'\79\83'-- What does FNSF stand for? IDK so don't ask me lol
|
FNNS=SYSTEM:find'\79\83' -- What does FNSF stand for? IDK so don't ask me lol
|
||||||
|
|
||||||
if SYSTEM=='Web' then
|
if SYSTEM=='Web' then
|
||||||
local oldRead=love.filesystem.read
|
local oldRead=love.filesystem.read
|
||||||
@@ -29,7 +30,7 @@ function love.conf(t)
|
|||||||
t.identity=identity -- Saving folder
|
t.identity=identity -- Saving folder
|
||||||
t.version="11.4"
|
t.version="11.4"
|
||||||
t.gammacorrect=false
|
t.gammacorrect=false
|
||||||
t.appendidentity=true -- Search files in source then in save directory
|
t.appendidentity=true -- Search files in source then in save directory
|
||||||
t.accelerometerjoystick=false -- Accelerometer=joystick on ios/android
|
t.accelerometerjoystick=false -- Accelerometer=joystick on ios/android
|
||||||
if t.audio then
|
if t.audio then
|
||||||
t.audio.mic=false
|
t.audio.mic=false
|
||||||
@@ -45,15 +46,16 @@ function love.conf(t)
|
|||||||
M.physics=false
|
M.physics=false
|
||||||
|
|
||||||
local W=t.window
|
local W=t.window
|
||||||
W.vsync=0 -- Unlimited FPS
|
W.vsync=0 -- Unlimited FPS
|
||||||
W.msaa=msaa -- Multi-sampled antialiasing
|
W.msaa=msaa -- Multi-sampled antialiasing
|
||||||
W.depth=0 -- Bits/samp of depth buffer
|
W.depth=0 -- Bits/samp of depth buffer
|
||||||
W.stencil=1 -- Bits/samp of stencil buffer
|
W.stencil=1 -- Bits/samp of stencil buffer
|
||||||
W.display=1 -- Monitor ID
|
W.display=1 -- Monitor ID
|
||||||
W.highdpi=true -- High-dpi mode for the window on a Retina display
|
W.highdpi=true -- High-dpi mode for the window on a Retina display
|
||||||
W.x,W.y=nil,nil -- Position of the window
|
W.x,W.y=nil,nil -- Position of the window
|
||||||
W.borderless=MOBILE -- Display window frame
|
W.borderless=MOBILE -- Display window frame
|
||||||
W.resizable=not MOBILE -- Whether window is resizable
|
W.resizable=not MOBILE -- Whether window is resizable
|
||||||
|
|
||||||
W.fullscreentype=MOBILE and "exclusive" or "desktop" -- Fullscreen type
|
W.fullscreentype=MOBILE and "exclusive" or "desktop" -- Fullscreen type
|
||||||
if portrait then
|
if portrait then
|
||||||
W.width,W.height=720,1280
|
W.width,W.height=720,1280
|
||||||
@@ -62,7 +64,7 @@ function love.conf(t)
|
|||||||
W.width,W.height=1280,720
|
W.width,W.height=1280,720
|
||||||
W.minwidth,W.minheight=640,360
|
W.minwidth,W.minheight=640,360
|
||||||
end
|
end
|
||||||
W.title="Techmino "..require "version".string -- Window title
|
W.title="Techmino "..require"version".string -- Window title
|
||||||
if fs.getInfo('media/image/icon.png') then
|
if fs.getInfo('media/image/icon.png') then
|
||||||
W.icon='media/image/icon.png'
|
W.icon='media/image/icon.png'
|
||||||
end
|
end
|
||||||
|
|||||||
235
main.lua
235
main.lua
@@ -11,8 +11,7 @@
|
|||||||
1. I made a framework called Zframework, *most* code in Zframework are not directly relevant to game;
|
1. I made a framework called Zframework, *most* code in Zframework are not directly relevant to game;
|
||||||
2. "xxx" are texts for reading by player, 'xxx' are string values just used in program;
|
2. "xxx" are texts for reading by player, 'xxx' are string values just used in program;
|
||||||
3. Except "gcinfo" function of lua itself, other "gc" are short for "graphics";
|
3. Except "gcinfo" function of lua itself, other "gc" are short for "graphics";
|
||||||
]]--
|
]]
|
||||||
|
|
||||||
|
|
||||||
-- Var leak check
|
-- Var leak check
|
||||||
-- setmetatable(_G,{__newindex=function(self,k,v) print('>>'..k..string.rep(" ",26-#k),debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v) end})
|
-- setmetatable(_G,{__newindex=function(self,k,v) print('>>'..k..string.rep(" ",26-#k),debug.traceback():match("\n.-\n\t(.-): "))rawset(self,k,v) end})
|
||||||
@@ -46,7 +45,7 @@ FONT.load{
|
|||||||
FONT.setDefault('norm')
|
FONT.setDefault('norm')
|
||||||
FONT.setFallback('norm')
|
FONT.setFallback('norm')
|
||||||
|
|
||||||
SCR.setSize(1280,720)-- Initialize Screen size
|
SCR.setSize(1280,720) -- Initialize Screen size
|
||||||
BGM.setMaxSources(5)
|
BGM.setMaxSources(5)
|
||||||
VOC.setDiversion(.62)
|
VOC.setDiversion(.62)
|
||||||
|
|
||||||
@@ -101,30 +100,32 @@ CHAR=require'parts.char'
|
|||||||
require'parts.gameTables'
|
require'parts.gameTables'
|
||||||
require'parts.gameFuncs'
|
require'parts.gameFuncs'
|
||||||
|
|
||||||
THEME= require'parts.theme'
|
THEME =require'parts.theme'
|
||||||
LINE= require'parts.line'
|
LINE =require'parts.line'
|
||||||
DATA= require'parts.data'
|
DATA =require'parts.data'
|
||||||
|
|
||||||
TEXTURE= require'parts.texture'
|
TEXTURE=require'parts.texture'
|
||||||
SKIN= require'parts.skin'
|
SKIN =require'parts.skin'
|
||||||
USERS= require'parts.users'
|
USERS =require'parts.users'
|
||||||
NET= require'parts.net'
|
NET =require'parts.net'
|
||||||
VK= require'parts.virtualKey'
|
VK =require'parts.virtualKey'
|
||||||
BOT= require'parts.bot'
|
BOT =require'parts.bot'
|
||||||
RSlist= require'parts.RSlist'; DSCP=RSlist.TRS.centerPos
|
RSlist =require'parts.RSlist'; DSCP=RSlist.TRS.centerPos
|
||||||
PLY= require'parts.player'
|
PLY =require'parts.player'
|
||||||
NETPLY= require'parts.netPlayer'
|
NETPLY =require'parts.netPlayer'
|
||||||
MODES= require'parts.modes'
|
MODES =require'parts.modes'
|
||||||
|
|
||||||
setmetatable(TEXTURE,{__index=function(self,k)
|
setmetatable(TEXTURE,{
|
||||||
MES.new('warn',"No texture called: "..k)
|
__index=function(self,k)
|
||||||
self[k]=PAPER
|
MES.new('warn',"No texture called: "..k)
|
||||||
return self[k]
|
self[k]=PAPER
|
||||||
end})
|
return self[k]
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Load mode files
|
-- Load mode files
|
||||||
for i=1,#MODES do
|
for i=1,#MODES do
|
||||||
local m=MODES[i]-- Mode template
|
local m=MODES[i] -- Mode template
|
||||||
if FILE.isSafe('parts/modes/'..m.name) then
|
if FILE.isSafe('parts/modes/'..m.name) then
|
||||||
TABLE.complete(require('parts.modes.'..m.name),MODES[i])
|
TABLE.complete(require('parts.modes.'..m.name),MODES[i])
|
||||||
MODES[m.name],MODES[i]=MODES[i]
|
MODES[m.name],MODES[i]=MODES[i]
|
||||||
@@ -144,7 +145,7 @@ end
|
|||||||
table.insert(_LOADTIMELIST_,("Load Modules: %.3fs"):format(TIME()-_LOADTIME_))
|
table.insert(_LOADTIMELIST_,("Load Modules: %.3fs"):format(TIME()-_LOADTIME_))
|
||||||
|
|
||||||
-- Initialize Zframework
|
-- Initialize Zframework
|
||||||
do-- Z.setCursor
|
do -- Z.setCursor
|
||||||
local normImg=GC.DO{16,16,
|
local normImg=GC.DO{16,16,
|
||||||
{'fCirc',8,8,4},
|
{'fCirc',8,8,4},
|
||||||
{'setCL',1,1,1,.7},
|
{'setCL',1,1,1,.7},
|
||||||
@@ -196,12 +197,12 @@ Z.setOnGlobalKey('f11',function()
|
|||||||
end)
|
end)
|
||||||
Z.setVersionText(VERSION.string)
|
Z.setVersionText(VERSION.string)
|
||||||
Z.setDebugInfo{
|
Z.setDebugInfo{
|
||||||
{"Cache",gcinfo},
|
{"Cache", gcinfo},
|
||||||
{"Tasks",TASK.getCount},
|
{"Tasks", TASK.getCount},
|
||||||
{"Voices",VOC.getQueueCount},
|
{"Voices",VOC.getQueueCount},
|
||||||
{"Audios",love.audio.getSourceCount},
|
{"Audios",love.audio.getSourceCount},
|
||||||
}
|
}
|
||||||
do-- Z.setOnFocus
|
do -- Z.setOnFocus
|
||||||
local function task_autoSoundOff()
|
local function task_autoSoundOff()
|
||||||
while true do
|
while true do
|
||||||
coroutine.yield()
|
coroutine.yield()
|
||||||
@@ -295,43 +296,43 @@ IMG.init{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
SKIN.load{
|
SKIN.load{
|
||||||
{name="crystal_scf",path='media/image/skin/crystal_scf.png'},
|
{name="crystal_scf", path='media/image/skin/crystal_scf.png'},
|
||||||
{name="matte_mrz",path='media/image/skin/matte_mrz.png'},
|
{name="matte_mrz", path='media/image/skin/matte_mrz.png'},
|
||||||
{name="shiny_chno",path='media/image/skin/shiny_chno.png'},
|
{name="shiny_chno", path='media/image/skin/shiny_chno.png'},
|
||||||
{name="contrast_mrz",path='media/image/skin/contrast_mrz.png'},
|
{name="contrast_mrz", path='media/image/skin/contrast_mrz.png'},
|
||||||
{name="polkadots_scf",path='media/image/skin/polkadots_scf.png'},
|
{name="polkadots_scf", path='media/image/skin/polkadots_scf.png'},
|
||||||
{name="toy_scf",path='media/image/skin/toy_scf.png'},
|
{name="toy_scf", path='media/image/skin/toy_scf.png'},
|
||||||
{name="smooth_mrz",path='media/image/skin/smooth_mrz.png'},
|
{name="smooth_mrz", path='media/image/skin/smooth_mrz.png'},
|
||||||
{name="simple_scf",path='media/image/skin/simple_scf.png'},
|
{name="simple_scf", path='media/image/skin/simple_scf.png'},
|
||||||
{name="glass_scf",path='media/image/skin/glass_scf.png'},
|
{name="glass_scf", path='media/image/skin/glass_scf.png'},
|
||||||
{name="penta_scf",path='media/image/skin/penta_scf.png'},
|
{name="penta_scf", path='media/image/skin/penta_scf.png'},
|
||||||
{name="bubble_scf",path='media/image/skin/bubble_scf.png'},
|
{name="bubble_scf", path='media/image/skin/bubble_scf.png'},
|
||||||
{name="minoes_scf",path='media/image/skin/minoes_scf.png'},
|
{name="minoes_scf", path='media/image/skin/minoes_scf.png'},
|
||||||
{name="pure_mrz",path='media/image/skin/pure_mrz.png'},
|
{name="pure_mrz", path='media/image/skin/pure_mrz.png'},
|
||||||
{name="bright_scf",path='media/image/skin/bright_scf.png'},
|
{name="bright_scf", path='media/image/skin/bright_scf.png'},
|
||||||
{name="glow_mrz",path='media/image/skin/glow_mrz.png'},
|
{name="glow_mrz", path='media/image/skin/glow_mrz.png'},
|
||||||
{name="plastic_mrz",path='media/image/skin/plastic_mrz.png'},
|
{name="plastic_mrz", path='media/image/skin/plastic_mrz.png'},
|
||||||
{name="paper_mrz",path='media/image/skin/paper_mrz.png'},
|
{name="paper_mrz", path='media/image/skin/paper_mrz.png'},
|
||||||
{name="yinyang_scf",path='media/image/skin/yinyang_scf.png'},
|
{name="yinyang_scf", path='media/image/skin/yinyang_scf.png'},
|
||||||
{name="cartooncup_earety",path='media/image/skin/cartooncup_earety.png'},
|
{name="cartooncup_earety", path='media/image/skin/cartooncup_earety.png'},
|
||||||
{name="jelly_miya",path='media/image/skin/jelly_miya.png'},
|
{name="jelly_miya", path='media/image/skin/jelly_miya.png'},
|
||||||
{name="guidetris_xmiao_lusisi",path='media/image/skin/guidetris_xmiao_lusisi.png'},
|
{name="guidetris_xmiao_lusisi",path='media/image/skin/guidetris_xmiao_lusisi.png'},
|
||||||
{name="brick_notypey",path='media/image/skin/brick_notypey.png'},
|
{name="brick_notypey", path='media/image/skin/brick_notypey.png'},
|
||||||
{name="gem_notypey",path='media/image/skin/gem_notypey.png'},
|
{name="gem_notypey", path='media/image/skin/gem_notypey.png'},
|
||||||
{name="classic",path='media/image/skin/classic_unknown.png'},
|
{name="classic", path='media/image/skin/classic_unknown.png'},
|
||||||
{name="ball_shaw",path='media/image/skin/ball_shaw.png'},
|
{name="ball_shaw", path='media/image/skin/ball_shaw.png'},
|
||||||
{name="retro_notypey",path='media/image/skin/retro_notypey.png'},
|
{name="retro_notypey", path='media/image/skin/retro_notypey.png'},
|
||||||
{name="pixel_chno",path='media/image/skin/pixel_chno.png'},
|
{name="pixel_chno", path='media/image/skin/pixel_chno.png'},
|
||||||
{name="pastel_chno",path='media/image/skin/pastel_chno.png'},
|
{name="pastel_chno", path='media/image/skin/pastel_chno.png'},
|
||||||
{name="letters_chno",path='media/image/skin/letters_chno.png'},
|
{name="letters_chno", path='media/image/skin/letters_chno.png'},
|
||||||
{name="kanji_chno",path='media/image/skin/kanji_chno.png'},
|
{name="kanji_chno", path='media/image/skin/kanji_chno.png'},
|
||||||
{name="textbone_mrz",path='media/image/skin/textbone_mrz.png'},
|
{name="textbone_mrz", path='media/image/skin/textbone_mrz.png'},
|
||||||
{name="coloredbone_mrz",path='media/image/skin/coloredbone_mrz.png'},
|
{name="coloredbone_mrz", path='media/image/skin/coloredbone_mrz.png'},
|
||||||
{name="wtf",path='media/image/skin/wtf_mrz.png'},
|
{name="wtf", path='media/image/skin/wtf_mrz.png'},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Initialize sound libs
|
-- Initialize sound libs
|
||||||
SFX.init((function()--[Warning] Not loading files here, just get the list of sound needed
|
SFX.init((function() --[Warning] Not loading files here, just get the list of sound needed
|
||||||
local L={}
|
local L={}
|
||||||
for _,v in next,fs.getDirectoryItems('media/effect/chiptune/') do
|
for _,v in next,fs.getDirectoryItems('media/effect/chiptune/') do
|
||||||
if FILE.isSafe('media/effect/chiptune/'..v) then
|
if FILE.isSafe('media/effect/chiptune/'..v) then
|
||||||
@@ -364,12 +365,12 @@ table.insert(_LOADTIMELIST_,("Initialize Modules: %.3fs"):format(TIME()-_LOADTIM
|
|||||||
-- Load settings and statistics
|
-- Load settings and statistics
|
||||||
if
|
if
|
||||||
not (
|
not (
|
||||||
pcall(TABLE.cover, loadFile('conf/user', '-json -canSkip') or loadFile('conf/user', '-luaon -canSkip') or{},USER) and
|
pcall(TABLE.cover, loadFile('conf/user', '-json -canSkip') or loadFile('conf/user', '-luaon -canSkip') or {},USER) and
|
||||||
pcall(TABLE.cover, loadFile('conf/unlock', '-json -canSkip') or loadFile('conf/unlock', '-luaon -canSkip') or{},RANKS) and
|
pcall(TABLE.cover, loadFile('conf/unlock', '-json -canSkip') or loadFile('conf/unlock', '-luaon -canSkip') or {},RANKS) and
|
||||||
pcall(TABLE.update,loadFile('conf/settings', '-json -canSkip') or loadFile('conf/settings', '-luaon -canSkip') or{},SETTING) and
|
pcall(TABLE.update,loadFile('conf/settings', '-json -canSkip') or loadFile('conf/settings', '-luaon -canSkip') or {},SETTING) and
|
||||||
pcall(TABLE.coverR,loadFile('conf/data', '-json -canSkip') or loadFile('conf/data', '-luaon -canSkip') or{},STAT) and
|
pcall(TABLE.coverR,loadFile('conf/data', '-json -canSkip') or loadFile('conf/data', '-luaon -canSkip') or {},STAT) and
|
||||||
pcall(TABLE.cover, loadFile('conf/key', '-json -canSkip') or loadFile('conf/key', '-luaon -canSkip') or{},KEY_MAP) and
|
pcall(TABLE.cover, loadFile('conf/key', '-json -canSkip') or loadFile('conf/key', '-luaon -canSkip') or {},KEY_MAP) and
|
||||||
pcall(TABLE.cover, loadFile('conf/virtualkey','-json -canSkip') or loadFile('conf/virtualkey','-luaon -canSkip') or{},VK_ORG)
|
pcall(TABLE.cover, loadFile('conf/virtualkey','-json -canSkip') or loadFile('conf/virtualkey','-luaon -canSkip') or {},VK_ORG)
|
||||||
)
|
)
|
||||||
then
|
then
|
||||||
MES.new('error',"An error occured during loading, and some data was lost.")
|
MES.new('error',"An error occured during loading, and some data was lost.")
|
||||||
@@ -509,19 +510,21 @@ LANG.init('zh',
|
|||||||
-- 3. Add a button in parts/scenes/lang.lua;
|
-- 3. Add a button in parts/scenes/lang.lua;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
block=BLOCK_NAMES
|
block=BLOCK_NAMES,
|
||||||
},
|
},
|
||||||
(function()
|
(function()
|
||||||
local tipMeta={__call=function(L) return L[math.random(#L)] end}
|
local tipMeta={__call=function(L) return L[math.random(#L)] end}
|
||||||
return function(L)
|
return function(L)
|
||||||
if type(rawget(L,'getTip'))=='table' then setmetatable(L.getTip,tipMeta) end
|
if type(rawget(L,'getTip'))=='table' then setmetatable(L.getTip,tipMeta) end
|
||||||
setmetatable(L,{__index=function(self,k)
|
setmetatable(L,{
|
||||||
local mes="No Text ("..SETTING.locale.."): "..k
|
__index=function(self,k)
|
||||||
LOG(mes)
|
local mes="No Text ("..SETTING.locale.."): "..k
|
||||||
MES.new('warn',mes)
|
LOG(mes)
|
||||||
self[k]="["..k.."]"
|
MES.new('warn',mes)
|
||||||
return self[k]
|
self[k]="["..k.."]"
|
||||||
end})
|
return self[k]
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end)()
|
end)()
|
||||||
)
|
)
|
||||||
@@ -533,7 +536,9 @@ for _,v in next,fs.getDirectoryItems('parts/backgrounds') do
|
|||||||
BG.add(name,require('parts.backgrounds.'..name))
|
BG.add(name,require('parts.backgrounds.'..name))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
BG.remList('none')BG.remList('gray')BG.remList('custom')
|
BG.remList('none')
|
||||||
|
BG.remList('gray')
|
||||||
|
BG.remList('custom')
|
||||||
|
|
||||||
-- Load scene files from SOURCE ONLY
|
-- Load scene files from SOURCE ONLY
|
||||||
for _,v in next,fs.getDirectoryItems('parts/scenes') do
|
for _,v in next,fs.getDirectoryItems('parts/scenes') do
|
||||||
@@ -559,43 +564,52 @@ applySettings()
|
|||||||
|
|
||||||
-- Load replays
|
-- Load replays
|
||||||
for _,fileName in next,fs.getDirectoryItems('replay') do
|
for _,fileName in next,fs.getDirectoryItems('replay') do
|
||||||
if fileName:sub(12,12):match("[a-zA-Z]") then repeat
|
if fileName:sub(12,12):match("[a-zA-Z]") then
|
||||||
local date,mode,version,player,seed,setting,mod
|
repeat
|
||||||
local success,fileData=true,fs.read('replay/'..fileName)
|
local date,mode,version,player,seed,setting,mod
|
||||||
date, fileData=STRING.readLine(fileData)date=date:gsub("[a-zA-Z]","")
|
local success,fileData=true,fs.read('replay/'..fileName)
|
||||||
mode, fileData=STRING.readLine(fileData)mode=MODE_UPDATE_MAP[mode] or mode
|
date,fileData=STRING.readLine(fileData)
|
||||||
version,fileData=STRING.readLine(fileData)
|
date=date:gsub("[a-zA-Z]","")
|
||||||
player, fileData=STRING.readLine(fileData) if player=="Local Player" then player="Stacker" end
|
mode,fileData=STRING.readLine(fileData)
|
||||||
success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
|
mode=MODE_UPDATE_MAP[mode] or mode
|
||||||
if not success then break end
|
version,fileData=STRING.readLine(fileData)
|
||||||
seed, fileData=STRING.readLine(fileData)
|
player,fileData=STRING.readLine(fileData)
|
||||||
setting,fileData=STRING.readLine(fileData)setting=JSON.decode(setting)
|
if player=="Local Player" then player="Stacker" end
|
||||||
mod, fileData=STRING.readLine(fileData)mod=JSON.decode(mod)
|
success,fileData=pcall(love.data.decompress,'string','zlib',fileData)
|
||||||
if
|
if not success then break end
|
||||||
not setting or
|
seed,fileData=STRING.readLine(fileData)
|
||||||
not mod or
|
setting,fileData=STRING.readLine(fileData)
|
||||||
not mode or
|
setting=JSON.decode(setting)
|
||||||
#mode==0
|
mod,fileData=STRING.readLine(fileData)
|
||||||
then break end
|
mod=JSON.decode(mod)
|
||||||
|
if
|
||||||
|
not setting or
|
||||||
|
not mod or
|
||||||
|
not mode or
|
||||||
|
#mode==0
|
||||||
|
then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
fs.remove('replay/'..fileName)
|
fs.remove('replay/'..fileName)
|
||||||
local newName=fileName:sub(1,10)..fileName:sub(15)
|
local newName=fileName:sub(1,10)..fileName:sub(15)
|
||||||
fs.write('replay/'..newName,
|
fs.write('replay/'..newName,
|
||||||
love.data.compress('string','zlib',
|
love.data.compress('string','zlib',
|
||||||
JSON.encode{
|
JSON.encode{
|
||||||
date=date,
|
date=date,
|
||||||
mode=mode,
|
mode=mode,
|
||||||
version=version,
|
version=version,
|
||||||
player=player,
|
player=player,
|
||||||
seed=seed,
|
seed=seed,
|
||||||
setting=setting,
|
setting=setting,
|
||||||
mod=mod,
|
mod=mod,
|
||||||
}.."\n"..
|
}.."\n"..
|
||||||
fileData
|
fileData
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
fileName=newName
|
||||||
fileName=newName
|
until true
|
||||||
until true end
|
end
|
||||||
local rep=DATA.parseReplay('replay/'..fileName)
|
local rep=DATA.parseReplay('replay/'..fileName)
|
||||||
table.insert(REPLAY,rep)
|
table.insert(REPLAY,rep)
|
||||||
end
|
end
|
||||||
@@ -617,7 +631,8 @@ if TABLE.find(arg,'-- test') then
|
|||||||
while not LOADED do coroutine.yield() end
|
while not LOADED do coroutine.yield() end
|
||||||
|
|
||||||
LOG("\27[92m\27[1mAutomatic Test Started\27[0m")
|
LOG("\27[92m\27[1mAutomatic Test Started\27[0m")
|
||||||
BGM.setVol(0)SFX.setVol(0)
|
BGM.setVol(0)
|
||||||
|
SFX.setVol(0)
|
||||||
love.keypressed('space')
|
love.keypressed('space')
|
||||||
TEST.yieldUntilNextScene()
|
TEST.yieldUntilNextScene()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user