再次更新录像加载和转换流程

This commit is contained in:
MrZ626
2021-06-28 15:44:50 +08:00
parent a1f32ca333
commit 6f74595305
4 changed files with 16 additions and 16 deletions

View File

@@ -229,6 +229,14 @@ for _,v in next,fs.getDirectoryItems("parts/scenes")do
LANG.addScene(sceneName)
end
end
--Load mode files
for i=1,#MODES do
local m=MODES[i]--Mode template
local M=require("parts.modes."..m.name)--Mode file
for k,v in next,m do M[k]=v end
MODES[m.name],MODES[i]=M
end
local modeTable={attacker_h="attacker_hard",attacker_u="attacker_ultimate",blind_e="blind_easy",blind_h="blind_hard",blind_l="blind_lunatic",blind_n="blind_normal",blind_u="blind_ultimate",c4wtrain_l="c4wtrain_lunatic",c4wtrain_n="c4wtrain_normal",defender_l="defender_lunatic",defender_n="defender_normal",dig_100l="dig_100",dig_10l="dig_10",dig_400l="dig_400",dig_40l="dig_40",dig_h="dig_hard",dig_u="dig_ultimate",drought_l="drought_lunatic",drought_n="drought_normal",marathon_h="marathon_hard",marathon_n="marathon_normal",pc_h="pcchallenge_hard",pc_l="pcchallenge_lunatic",pc_n="pcchallenge_normal",pctrain_l="pctrain_lunatic",pctrain_n="pctrain_normal",round_e="round_1",round_h="round_2",round_l="round_3",round_n="round_4",round_u="round_5",solo_e="solo_1",solo_h="solo_2",solo_l="solo_3",solo_n="solo_4",solo_u="solo_5",sprint_10l="sprint_10",sprint_20l="sprint_20",sprint_40l="sprint_40",sprint_400l="sprint_400",sprint_100l="sprint_100",sprint_1000l="sprint_1000",survivor_e="survivor_easy",survivor_h="survivor_hard",survivor_l="survivor_lunatic",survivor_n="survivor_normal",survivor_u="survivor_ultimate",tech_finesse_f="tech_finesse2",tech_h_plus="tech_hard2",tech_h="tech_hard",tech_l_plus="tech_lunatic2",tech_l="tech_lunatic",tech_n_plus="tech_normal2",tech_n="tech_normal",techmino49_e="techmino49_easy",techmino49_h="techmino49_hard",techmino49_u="techmino49_ultimate",techmino99_e="techmino99_easy",techmino99_h="techmino99_hard",techmino99_u="techmino99_ultimate",tsd_e="tsd_easy",tsd_h="tsd_hard",tsd_u="tsd_ultimate",master_extra="GM"}
--Update data
do

View File

@@ -409,8 +409,6 @@ function DATA.parseReplay(fileName,ifFull)
seed=metaData.seed,
setting=metaData.setting,
mod=metaData.mod,
modeName=("%s %s"):format(text.modes[metaData.mode][1],text.modes[metaData.mode][2]),
}
if ifFull then rep.data=fileData end
do return rep end

View File

@@ -128,21 +128,14 @@ local loadingThread=coroutine.wrap(function()
}YIELD()
upFloor()
for i=1,#MODES do
local m=MODES[i]--Mode template
local M=require("parts.modes."..m.name)--Mode file
MODES[m.name],MODES[i]=M
for k,v in next,m do
M[k]=v
end
M.records=FILE.load("record/"..m.name..".rec")or M.score and{}
if m.icon then
if not modeIcons[m.icon]then
modeIcons[m.icon]=gc.newImage("media/image/modeicon/"..m.icon..".png")
for _,M in next,MODES do
M.records=FILE.load("record/"..M.name..".rec")or M.score and{}
if M.icon then
if not modeIcons[M.icon]then
modeIcons[M.icon]=gc.newImage("media/image/modeicon/"..M.icon..".png")
end
M.icon=modeIcons[m.icon]
M.icon=modeIcons[M.icon]
end
if i%5==0 then YIELD()end
end
upFloor()

View File

@@ -17,7 +17,8 @@ local listBox=WIDGET.newListBox{name="list",x=50,y=50,w=1200,h=520,lineH=40,draw
if rep.available then
gc_setColor(.9,.9,1)
gc_print(rep.modeName,310,-2)
local modeName=text.modes[rep.mode]
gc_print(modeName and modeName[1].." "..modeName[2]or rep.mode,310,-2)
setFont(20)
gc_setColor(1,1,.8)
gc_print(rep.date,80,6)