升级录像格式,完善录像回放菜单
This commit is contained in:
@@ -81,6 +81,11 @@ do--function STRING.urlEncode(s)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function STRING.readLine(str)
|
||||||
|
local p=str:find("\n")
|
||||||
|
return str:sub(1,p-1),str:sub(p+1)
|
||||||
|
end
|
||||||
|
|
||||||
function STRING.packBin(s)
|
function STRING.packBin(s)
|
||||||
return data.encode('string','base64',data.compress('string','zlib',s))
|
return data.encode('string','base64',data.compress('string','zlib',s))
|
||||||
end
|
end
|
||||||
|
|||||||
46
main.lua
46
main.lua
@@ -229,9 +229,7 @@ for _,v in next,fs.getDirectoryItems("parts/scenes")do
|
|||||||
LANG.addScene(sceneName)
|
LANG.addScene(sceneName)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
LANG.set(SETTING.lang)
|
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"}
|
||||||
VK.setShape(SETTING.VKSkin)
|
|
||||||
|
|
||||||
--Update data
|
--Update data
|
||||||
do
|
do
|
||||||
local needSave,autoRestart
|
local needSave,autoRestart
|
||||||
@@ -249,6 +247,7 @@ do
|
|||||||
end
|
end
|
||||||
if STAT.version<1505 then
|
if STAT.version<1505 then
|
||||||
fs.remove('record/bigbang.rec')
|
fs.remove('record/bigbang.rec')
|
||||||
|
fs.remove('conf/replay')
|
||||||
end
|
end
|
||||||
if STAT.version~=VERSION.code then
|
if STAT.version~=VERSION.code then
|
||||||
STAT.version=VERSION.code
|
STAT.version=VERSION.code
|
||||||
@@ -271,7 +270,6 @@ do
|
|||||||
needSave=true
|
needSave=true
|
||||||
end
|
end
|
||||||
end
|
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"}
|
|
||||||
for k,v in next,modeTable do
|
for k,v in next,modeTable do
|
||||||
if RANKS[v]then
|
if RANKS[v]then
|
||||||
RANKS[k]=RANKS[v]
|
RANKS[k]=RANKS[v]
|
||||||
@@ -300,4 +298,42 @@ do
|
|||||||
if autoRestart then
|
if autoRestart then
|
||||||
love.event.quit('restart')
|
love.event.quit('restart')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
LANG.set(SETTING.lang)
|
||||||
|
VK.setShape(SETTING.VKSkin)
|
||||||
|
--Load replays
|
||||||
|
for _,fileName in next,fs.getDirectoryItems("replay")do
|
||||||
|
if fileName:sub(12,12):match("[a-zA-Z]")then
|
||||||
|
local date,mode,version,player,seed,setting,mod
|
||||||
|
local fileData=fs.read('replay/'..fileName)
|
||||||
|
fs.remove('replay/'..fileName)
|
||||||
|
date, fileData=STRING.readLine(fileData)date=date:gsub("[a-zA-Z]","")
|
||||||
|
mode, fileData=STRING.readLine(fileData)mode=modeTable[mode]or mode
|
||||||
|
version,fileData=STRING.readLine(fileData)
|
||||||
|
player, fileData=STRING.readLine(fileData)if player=="Local Player"then player="Stacker"end
|
||||||
|
fileData=love.data.decompress('string','zlib',fileData)
|
||||||
|
seed, fileData=STRING.readLine(fileData)
|
||||||
|
setting,fileData=STRING.readLine(fileData)setting=JSON.decode(setting)
|
||||||
|
mod, fileData=STRING.readLine(fileData)mod=JSON.decode(mod)
|
||||||
|
|
||||||
|
local newName=fileName:sub(1,10)..fileName:sub(15)
|
||||||
|
fs.write('replay/'..newName,
|
||||||
|
love.data.compress('string','zlib',
|
||||||
|
JSON.encode{
|
||||||
|
date=date,
|
||||||
|
mode=mode,
|
||||||
|
version=version,
|
||||||
|
player=player,
|
||||||
|
seed=seed,
|
||||||
|
setting=setting,
|
||||||
|
mod=mod,
|
||||||
|
}.."\n"..
|
||||||
|
fileData
|
||||||
|
)
|
||||||
|
)
|
||||||
|
fileName=newName
|
||||||
|
end
|
||||||
|
local rep=DATA.parseReplay('replay/'..fileName)
|
||||||
|
table.insert(REPLAY,rep)
|
||||||
|
end
|
||||||
|
table.sort(REPLAY,function(a,b)return a.fileName>b.fileName end)
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
local loveCompress=love.data.compress
|
local loveCompress=love.data.compress
|
||||||
|
local loveDecompress=love.data.decompress
|
||||||
|
|
||||||
local int=math.floor
|
local int=math.floor
|
||||||
local char,byte=string.char,string.byte
|
local char,byte=string.char,string.byte
|
||||||
@@ -336,7 +337,7 @@ function DATA.pumpRecording(str,L)
|
|||||||
p=p+1
|
p=p+1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function DATA.saveRecording()
|
do--function DATA.saveReplay()
|
||||||
local noRecList={"custom","solo","round","techmino"}
|
local noRecList={"custom","solo","round","techmino"}
|
||||||
local function getModList()
|
local function getModList()
|
||||||
local res={}
|
local res={}
|
||||||
@@ -347,7 +348,7 @@ do--function DATA.saveRecording()
|
|||||||
end
|
end
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
function DATA.saveRecording()
|
function DATA.saveReplay()
|
||||||
--Filtering modes that cannot be saved
|
--Filtering modes that cannot be saved
|
||||||
for _,v in next,noRecList do
|
for _,v in next,noRecList do
|
||||||
if GAME.curModeName:find(v)then
|
if GAME.curModeName:find(v)then
|
||||||
@@ -357,27 +358,59 @@ do--function DATA.saveRecording()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--Write file
|
--Write file
|
||||||
local fileName=os.date("replay/%Y_%m_%d_%a_%H%M%S.rep")
|
local fileName=os.date("replay/%Y_%m_%d_%H%M%S.rep")
|
||||||
if not love.filesystem.getInfo(fileName)then
|
if not love.filesystem.getInfo(fileName)then
|
||||||
local fileHead=
|
love.filesystem.write(fileName,
|
||||||
os.date("%Y/%m/%d %A %H:%M:%S\n")..
|
loveCompress('string','zlib',
|
||||||
GAME.curModeName.."\n"..
|
JSON.encode{
|
||||||
VERSION.string.."\n"..
|
date=os.date("%Y/%m/%d %H:%M:%S"),
|
||||||
USERS.getUsername(USER.uid).."\n"
|
mode=GAME.curModeName,
|
||||||
local fileBody=
|
version=VERSION.string,
|
||||||
GAME.seed.."\n"..
|
player=USERS.getUsername(USER.uid),
|
||||||
JSON.encode(GAME.setting).."\n"..
|
seed=GAME.seed,
|
||||||
JSON.encode(getModList()).."\n"..
|
setting=GAME.setting,
|
||||||
DATA.dumpRecording(GAME.rep)
|
mod=getModList(),
|
||||||
|
}.."\n"..
|
||||||
love.filesystem.write(fileName,fileHead..loveCompress('string','zlib',fileBody))
|
DATA.dumpRecording(GAME.rep)
|
||||||
ins(REPLAY,fileName)
|
)
|
||||||
FILE.save(REPLAY,'conf/replay')
|
)
|
||||||
|
ins(REPLAY,1,DATA.parseReplay(fileName))
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
MES.new('error',"Save failed: File already exists")
|
MES.new('error',"Save failed: File already exists")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function DATA.parseReplay(fileName,ifFull)
|
||||||
|
local fileData=love.filesystem.read(fileName)
|
||||||
|
if fileData and #fileData>0 then
|
||||||
|
fileData=loveDecompress('string','zlib',fileData)
|
||||||
|
local metaData
|
||||||
|
metaData,fileData=STRING.readLine(fileData)
|
||||||
|
metaData=JSON.decode(metaData)
|
||||||
|
local rep={
|
||||||
|
fileName=fileName,
|
||||||
|
available=true,
|
||||||
|
|
||||||
|
date=metaData.date,
|
||||||
|
mode=metaData.mode,
|
||||||
|
version=metaData.version,
|
||||||
|
player=metaData.player,
|
||||||
|
|
||||||
|
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
|
||||||
|
return rep
|
||||||
|
else
|
||||||
|
return{
|
||||||
|
fileName=fileName,
|
||||||
|
available=false,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return DATA
|
return DATA
|
||||||
@@ -228,10 +228,11 @@ function loadGame(mode,ifQuickPlay,ifNet)--Load a mode and go to game scene
|
|||||||
freshDate()
|
freshDate()
|
||||||
if legalGameTime()then
|
if legalGameTime()then
|
||||||
if MODES[mode].score then STAT.lastPlay=mode end
|
if MODES[mode].score then STAT.lastPlay=mode end
|
||||||
|
GAME.init=true
|
||||||
|
GAME.fromRepMenu=false
|
||||||
GAME.curModeName=mode
|
GAME.curModeName=mode
|
||||||
GAME.curMode=MODES[mode]
|
GAME.curMode=MODES[mode]
|
||||||
GAME.modeEnv=GAME.curMode.env
|
GAME.modeEnv=GAME.curMode.env
|
||||||
GAME.init=true
|
|
||||||
GAME.net=ifNet
|
GAME.net=ifNet
|
||||||
if ifNet then
|
if ifNet then
|
||||||
SCN.go('net_game','swipeD')
|
SCN.go('net_game','swipeD')
|
||||||
|
|||||||
@@ -417,4 +417,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=900, y=50, r=80},--addToLeft
|
||||||
{ava=false, x=1000, y=50, r=80},--addToRight
|
{ava=false, x=1000, y=50, r=80},--addToRight
|
||||||
}
|
}
|
||||||
REPLAY=FILE.load('conf/replay')or{}
|
REPLAY={}--Replay objects (not include stream data)
|
||||||
@@ -130,11 +130,15 @@ function scene.keyDown(key,isRep)
|
|||||||
elseif key=="escape"then
|
elseif key=="escape"then
|
||||||
SCN.swapTo(GAME.result and'game'or'depause','none')
|
SCN.swapTo(GAME.result and'game'or'depause','none')
|
||||||
elseif key=="s"then
|
elseif key=="s"then
|
||||||
GAME.prevBG=BG.cur
|
if not GAME.fromRepMenu then
|
||||||
SCN.go('setting_sound')
|
GAME.prevBG=BG.cur
|
||||||
|
SCN.go('setting_sound')
|
||||||
|
end
|
||||||
elseif key=="r"then
|
elseif key=="r"then
|
||||||
resetGameData()
|
if not GAME.fromRepMenu then
|
||||||
SCN.swapTo('game','none')
|
resetGameData()
|
||||||
|
SCN.swapTo('game','none')
|
||||||
|
end
|
||||||
elseif key=="p"then
|
elseif key=="p"then
|
||||||
if(GAME.result or GAME.replaying)and #PLAYERS==1 then
|
if(GAME.result or GAME.replaying)and #PLAYERS==1 then
|
||||||
resetGameData('r')
|
resetGameData('r')
|
||||||
@@ -142,8 +146,9 @@ function scene.keyDown(key,isRep)
|
|||||||
end
|
end
|
||||||
elseif key=="o"then
|
elseif key=="o"then
|
||||||
if(GAME.result or GAME.replaying)and #PLAYERS==1 and not GAME.saved then
|
if(GAME.result or GAME.replaying)and #PLAYERS==1 and not GAME.saved then
|
||||||
if DATA.saveRecording()then
|
if DATA.saveReplay()then
|
||||||
GAME.saved=true
|
GAME.saved=true
|
||||||
|
SFX.play('connected')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -308,11 +313,11 @@ function scene.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
WIDGET.newButton{name="setting", x=1120,y=70,w=240,h=90, color='lB',code=pressKey"s"},
|
WIDGET.newButton{name="setting", x=1120,y=70,w=240,h=90, color='lB',code=pressKey"s",hideF=function()return GAME.fromRepMenu end},
|
||||||
WIDGET.newButton{name="replay", x=535,y=250,w=200,h=100,color='lY',code=pressKey"p",hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
|
WIDGET.newButton{name="replay", x=535,y=250,w=200,h=100,color='lY',code=pressKey"p",hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
|
||||||
WIDGET.newButton{name="save", x=745,y=250,w=200,h=100,color='lP',code=pressKey"o",hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
|
WIDGET.newButton{name="save", x=745,y=250,w=200,h=100,color='lP',code=pressKey"o",hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
|
||||||
WIDGET.newButton{name="resume", x=640,y=367,w=240,h=100,color='lG',code=pressKey"escape"},
|
WIDGET.newButton{name="resume", x=640,y=367,w=240,h=100,color='lG',code=pressKey"escape"},
|
||||||
WIDGET.newButton{name="restart", x=640,y=483,w=240,h=100,color='lR',code=pressKey"r"},
|
WIDGET.newButton{name="restart", x=640,y=483,w=240,h=100,color='lR',code=pressKey"r",hideF=function()return GAME.fromRepMenu end},
|
||||||
WIDGET.newButton{name="quit", x=640,y=600,w=240,h=100,font=35,code=backScene},
|
WIDGET.newButton{name="quit", x=640,y=600,w=240,h=100,font=35,code=backScene},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ local listBox=WIDGET.newListBox{name="list",x=50,y=50,w=1200,h=520,lineH=40,draw
|
|||||||
|
|
||||||
if rep.available then
|
if rep.available then
|
||||||
gc_setColor(.9,.9,1)
|
gc_setColor(.9,.9,1)
|
||||||
gc_print(rep.modeName,405,-2)
|
gc_print(rep.modeName,310,-2)
|
||||||
setFont(20)
|
setFont(20)
|
||||||
gc_setColor(1,1,.8)
|
gc_setColor(1,1,.8)
|
||||||
gc_print(rep.date,80,6)
|
gc_print(rep.date,80,6)
|
||||||
@@ -35,33 +35,22 @@ local scene={}
|
|||||||
|
|
||||||
local sure
|
local sure
|
||||||
|
|
||||||
local function readLine(str)
|
local function replay(fileName)
|
||||||
local p=str:find("\n")
|
local rep=DATA.parseReplay(fileName,true)
|
||||||
return str:sub(1,p-1),str:sub(p+1)
|
|
||||||
end
|
|
||||||
local function replay(rep)
|
|
||||||
if not rep.available then
|
if not rep.available then
|
||||||
MES.new('error',text.replayBroken)
|
MES.new('error',text.replayBroken)
|
||||||
elseif MODES[rep.mode]then
|
elseif MODES[rep.mode]then
|
||||||
local data=love.data.decompress('string','zlib',rep.data)
|
GAME.seed=rep.seed
|
||||||
local seed,setting,mod
|
GAME.setting=rep.setting
|
||||||
|
GAME.mod=rep.mod
|
||||||
seed,data=readLine(data)
|
|
||||||
GAME.seed=tonumber(seed)
|
|
||||||
|
|
||||||
setting,data=readLine(data)
|
|
||||||
GAME.setting=JSON.decode(setting)
|
|
||||||
|
|
||||||
mod,data=readLine(data)
|
|
||||||
GAME.mod=JSON.decode(mod)
|
|
||||||
|
|
||||||
GAME.rep={}
|
GAME.rep={}
|
||||||
DATA.pumpRecording(data,GAME.rep)
|
DATA.pumpRecording(rep.data,GAME.rep)
|
||||||
|
|
||||||
loadGame(rep.mode,true)
|
loadGame(rep.mode,true)
|
||||||
resetGameData('r')
|
resetGameData('r')
|
||||||
GAME.init=false
|
GAME.init=false
|
||||||
GAME.saved=true
|
GAME.saved=true
|
||||||
|
GAME.fromRepMenu=true
|
||||||
else
|
else
|
||||||
MES.new('error',("No mode id: [%s]"):format(rep.mode))
|
MES.new('error',("No mode id: [%s]"):format(rep.mode))
|
||||||
end
|
end
|
||||||
@@ -69,73 +58,34 @@ end
|
|||||||
|
|
||||||
function scene.sceneInit()
|
function scene.sceneInit()
|
||||||
sure=0
|
sure=0
|
||||||
local repList={}
|
listBox:setList(REPLAY)
|
||||||
for i=#REPLAY,1,-1 do
|
|
||||||
local file=love.filesystem.newFile(REPLAY[i])
|
|
||||||
if file:open('r')then
|
|
||||||
local metadata=""
|
|
||||||
local enter=0
|
|
||||||
while true do
|
|
||||||
local b,len=file:read(1)
|
|
||||||
if len==0 then
|
|
||||||
repList[i]={
|
|
||||||
fileName=REPLAY[i],
|
|
||||||
available=false,
|
|
||||||
}
|
|
||||||
break
|
|
||||||
end
|
|
||||||
metadata=metadata..b
|
|
||||||
if b=="\n"then
|
|
||||||
enter=enter+1
|
|
||||||
if enter==4 then
|
|
||||||
metadata=STRING.split(metadata,'\n')
|
|
||||||
local mode=text.modes[metadata[2]]or{"["..metadata[2].."]",""}
|
|
||||||
repList[i]={
|
|
||||||
fileName=REPLAY[i],
|
|
||||||
available=true,
|
|
||||||
date=metadata[1],
|
|
||||||
mode=metadata[2],
|
|
||||||
modeName=("%s %s"):format(mode[1],mode[2]),
|
|
||||||
version=metadata[3],
|
|
||||||
player=metadata[4],
|
|
||||||
data=file:read(),
|
|
||||||
}
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
file:close()
|
|
||||||
else
|
|
||||||
repList[i]={
|
|
||||||
fileName=REPLAY[i],
|
|
||||||
available=false,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
listBox:setList(repList)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function scene.keyDown(key)
|
function scene.keyDown(key)
|
||||||
if key=="return"then
|
if key=="return"then
|
||||||
replay(listBox:getSel())
|
local rep=listBox:getSel()
|
||||||
|
if rep then
|
||||||
|
replay(rep.fileName)
|
||||||
|
end
|
||||||
elseif key=="escape"then
|
elseif key=="escape"then
|
||||||
SCN.back()
|
SCN.back()
|
||||||
elseif key=="delete"then
|
elseif key=="delete"then
|
||||||
if sure>20 then
|
local rep=listBox:getSel()
|
||||||
local rep=listBox:getSel()
|
if rep then
|
||||||
if rep then
|
if sure>20 then
|
||||||
sure=0
|
sure=0
|
||||||
listBox:remove()
|
listBox:remove()
|
||||||
love.filesystem.remove(rep.fileName)
|
love.filesystem.remove(rep.fileName)
|
||||||
|
for i=1,#REPLAY do
|
||||||
local i=TABLE.find(REPLAY,rep.fileName)
|
if REPLAY[i].fileName==rep.fileName then
|
||||||
if i then table.remove(REPLAY,i)end
|
table.remove(REPLAY,i)
|
||||||
FILE.save(REPLAY,'conf/replay')
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
SFX.play('finesseError',.7)
|
SFX.play('finesseError',.7)
|
||||||
|
else
|
||||||
|
sure=50
|
||||||
end
|
end
|
||||||
else
|
|
||||||
sure=50
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
WIDGET.keyPressed(key)
|
WIDGET.keyPressed(key)
|
||||||
@@ -159,6 +109,7 @@ scene.widgetList={
|
|||||||
WIDGET.newButton{name="play",x=700,y=640,w=170,h=80,color='lY',code=pressKey"return",hideF=function()return listBox:getLen()==0 end,fText=DOGC{50,50,{'fPoly',10,0,49,24,10,49}}},
|
WIDGET.newButton{name="play",x=700,y=640,w=170,h=80,color='lY',code=pressKey"return",hideF=function()return listBox:getLen()==0 end,fText=DOGC{50,50,{'fPoly',10,0,49,24,10,49}}},
|
||||||
WIDGET.newButton{name="delete",x=850,y=640,w=80,h=80,color='lR',code=pressKey"delete",hideF=function()return listBox:getLen()==0 end,fText=DOGC{50,50,{'setLW',8},{'line',5,5,45,45},{'line',5,45,45,5}}},
|
WIDGET.newButton{name="delete",x=850,y=640,w=80,h=80,color='lR',code=pressKey"delete",hideF=function()return listBox:getLen()==0 end,fText=DOGC{50,50,{'setLW',8},{'line',5,5,45,45},{'line',5,45,45,5}}},
|
||||||
WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
|
WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
|
||||||
|
WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
|
||||||
}
|
}
|
||||||
|
|
||||||
return scene
|
return scene
|
||||||
Reference in New Issue
Block a user