quest包含多场地,原格式失效(可手动修复),修复粘贴quest后左下小场地画面状态错误
This commit is contained in:
@@ -81,6 +81,7 @@ function copyQuestArgs()
|
|||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
function pasteQuestArgs(str)
|
function pasteQuestArgs(str)
|
||||||
|
if #str<4 then return end
|
||||||
local ENV=CUSTOMENV
|
local ENV=CUSTOMENV
|
||||||
ENV.holdCount= byte(str,1)-48
|
ENV.holdCount= byte(str,1)-48
|
||||||
ENV.ospin= byte(str,2)~=90
|
ENV.ospin= byte(str,2)~=90
|
||||||
@@ -184,8 +185,17 @@ function copyBoard(page)--Copy the [page] board
|
|||||||
end
|
end
|
||||||
return data.encode("string","base64",data.compress("string","zlib",str))
|
return data.encode("string","base64",data.compress("string","zlib",str))
|
||||||
end
|
end
|
||||||
|
function copyBoards()
|
||||||
|
local out={}
|
||||||
|
for i=1,#FIELD do
|
||||||
|
out[i]=copyBoard(i)
|
||||||
|
end
|
||||||
|
return table.concat(out,"!")
|
||||||
|
end
|
||||||
function pasteBoard(str,page)--Paste [str] data to [page] board
|
function pasteBoard(str,page)--Paste [str] data to [page] board
|
||||||
local F=FIELD[page or 1]
|
if not page then page=1 end
|
||||||
|
if not FIELD[page]then FIELD[page]=newBoard()end
|
||||||
|
local F=FIELD[page]
|
||||||
local _,__
|
local _,__
|
||||||
|
|
||||||
--Decode
|
--Decode
|
||||||
|
|||||||
@@ -2,31 +2,32 @@ local gc,sys=love.graphics,love.system
|
|||||||
local kb=love.keyboard
|
local kb=love.keyboard
|
||||||
|
|
||||||
local int=math.floor
|
local int=math.floor
|
||||||
local find,sub=string.find,string.sub
|
|
||||||
|
|
||||||
local function notAir(L)
|
local function notAir(L)
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
if L[i]>0 then return true end
|
if L[i]>0 then return true end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local CUSTOMENV=CUSTOMENV
|
local CUSTOMENV=CUSTOMENV
|
||||||
|
|
||||||
local scene={}
|
local scene={}
|
||||||
|
|
||||||
local initField
|
local initField
|
||||||
|
local function freshMiniFieldVisible()
|
||||||
function scene.sceneInit()
|
|
||||||
destroyPlayers()
|
|
||||||
BG.set(CUSTOMENV.bg)
|
|
||||||
BGM.play(CUSTOMENV.bgm)
|
|
||||||
initField=false
|
initField=false
|
||||||
for y=1,20 do
|
for y=1,20 do
|
||||||
if notAir(FIELD[1][y])then
|
if notAir(FIELD[1][y])then
|
||||||
initField=true
|
initField=true
|
||||||
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function scene.sceneInit()
|
||||||
|
destroyPlayers()
|
||||||
|
BG.set(CUSTOMENV.bg)
|
||||||
|
BGM.play(CUSTOMENV.bgm)
|
||||||
|
freshMiniFieldVisible()
|
||||||
|
end
|
||||||
function scene.sceneBack()
|
function scene.sceneBack()
|
||||||
BGM.play()
|
BGM.play()
|
||||||
end
|
end
|
||||||
@@ -63,41 +64,26 @@ function scene.keyDown(key)
|
|||||||
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
|
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then
|
||||||
local str="Techmino Quest:"..copyQuestArgs().."!"
|
local str="Techmino Quest:"..copyQuestArgs().."!"
|
||||||
if #BAG>0 then str=str..copySequence()end
|
if #BAG>0 then str=str..copySequence()end
|
||||||
str=str.."!"..copyBoard().."!"
|
str=str.."!"
|
||||||
if #MISSION>0 then str=str..copyMission()end
|
if #MISSION>0 then str=str..copyMission()end
|
||||||
sys.setClipboardText(str.."!")
|
sys.setClipboardText(str.."!"..copyBoards().."!")
|
||||||
LOG.print(text.exportSuccess,COLOR.green)
|
LOG.print(text.exportSuccess,COLOR.green)
|
||||||
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
|
elseif key=="v"and kb.isDown("lctrl","rctrl")or key=="cV"then
|
||||||
local str=sys.getClipboardText()
|
local str=sys.getClipboardText()
|
||||||
local p1,p2,p3,p4,p5--ptr*
|
local args=splitStr(str:sub((str:find(":")or 0)+1),"!")
|
||||||
while true do
|
if #args<4 then goto fail end
|
||||||
p1=find(str,":")or 0
|
if not pasteQuestArgs(args[1])then goto fail end
|
||||||
p2=find(str,"!",p1+1)
|
if not pasteSequence(args[2])then goto fail end
|
||||||
if not p2 then break end
|
if not pasteMission(args[3])then goto fail end
|
||||||
p3=find(str,"!",p2+1)
|
repeat table.remove(FIELD)until #FIELD==0
|
||||||
if not p3 then break end
|
FIELD[1]=newBoard()
|
||||||
p4=find(str,"!",p3+1)
|
for i=4,#args do
|
||||||
if not p4 then break end
|
if not pasteBoard(args[i],i-3)and i<#args then goto fail end
|
||||||
p5=find(str,"!",p4+1)or #str+1
|
|
||||||
|
|
||||||
pasteQuestArgs(sub(str,p1+1,p2-1))
|
|
||||||
if p2+1~=p3 then
|
|
||||||
if not pasteSequence(sub(str,p2+1,p3-1))then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if not pasteBoard(sub(str,p3+1,p4-1))then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
if p4+1~=p5 then
|
|
||||||
if not pasteMission(sub(str,p4+1,p5-1))then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
LOG.print(text.importSuccess,COLOR.green)
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
LOG.print(text.dataCorrupted,COLOR.red)
|
freshMiniFieldVisible()
|
||||||
|
LOG.print(text.importSuccess,COLOR.green)
|
||||||
|
do return end
|
||||||
|
::fail::LOG.print(text.dataCorrupted,COLOR.red)
|
||||||
elseif key=="escape"then
|
elseif key=="escape"then
|
||||||
SCN.back()
|
SCN.back()
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user