- Unify clipboard

This commit is contained in:
ParticleG
2024-11-01 08:00:01 +08:00
parent eb3b8c9e9d
commit b50147cace
19 changed files with 137 additions and 69 deletions

View File

@@ -97,7 +97,7 @@ function scene.keyDown(key)
if rep.available and rep.fileName then
local repStr=loadFile(rep.fileName,'-string')
if repStr then
love.system.setClipboardText(love.data.encode('string','base64',repStr))
CLIPBOARD.set(love.data.encode('string','base64',repStr))
MES.new('info',text.exportSuccess)
else
MES.new('error',text.replayBroken)
@@ -107,7 +107,7 @@ function scene.keyDown(key)
end
end
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
local repStr=love.system.getClipboardText()
local repStr=CLIPBOARD.get()
local res,fileData=pcall(love.data.decode,'string','base64',repStr)
if res then
local fileName=os.date("replay/%Y_%m_%d_%H%M%S_import.rep")