- Unify clipboard
This commit is contained in:
@@ -949,16 +949,16 @@ end
|
||||
|
||||
local combKey={
|
||||
x=function()
|
||||
love.system.setClipboardText(inputBox:getText())
|
||||
CLIPBOARD.set(inputBox:getText())
|
||||
inputBox:clear()
|
||||
SFX.play('reach')
|
||||
end,
|
||||
c=function()
|
||||
love.system.setClipboardText(inputBox:getText())
|
||||
CLIPBOARD.set(inputBox:getText())
|
||||
SFX.play('reach')
|
||||
end,
|
||||
v=function()
|
||||
inputBox:addText(love.system.getClipboardText())
|
||||
inputBox:addText(CLIPBOARD.get())
|
||||
SFX.play('reach')
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ function scene.update(dt)
|
||||
end
|
||||
ct=ct-1
|
||||
if ct==0 then
|
||||
local t=love.system.getClipboardText()
|
||||
local t=CLIPBOARD.get()
|
||||
if type(t)=='string' then
|
||||
t=t:lower():match("^s=(%d+)$")
|
||||
t=t and tonumber(t) and tonumber(t)>0 and tonumber(t)<=8000 and floor(tonumber(t))
|
||||
|
||||
@@ -181,7 +181,7 @@ function reset()
|
||||
time=0
|
||||
score=0
|
||||
|
||||
local t=love.system.getClipboardText()
|
||||
local t=CLIPBOARD.get()
|
||||
if type(t)=='string' then
|
||||
t=t:lower():match("^s=(.+)")
|
||||
t=t and tonumber(t) and tonumber(t)*2
|
||||
|
||||
@@ -188,10 +188,10 @@ function scene.keyDown(key,isRep)
|
||||
if #CUSTOMGAME_LOCAL.bag>0 then str=str..DATA.copySequence(CUSTOMGAME_LOCAL.bag) end
|
||||
str=str.."!"
|
||||
if #CUSTOMGAME_LOCAL.mission>0 then str=str..DATA.copyMission(CUSTOMGAME_LOCAL.mission) end
|
||||
sys.setClipboardText(str.."!"..DATA.copyBoards(CUSTOMGAME_LOCAL.field).."!")
|
||||
CLIPBOARD.set(str.."!"..DATA.copyBoards(CUSTOMGAME_LOCAL.field).."!")
|
||||
MES.new('check',text.exportSuccess)
|
||||
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
||||
local str=sys.getClipboardText()
|
||||
local str=CLIPBOARD.get()
|
||||
local args=str:sub((str:find(":") or 0)+1):split("!")
|
||||
local hasTooHighField=false
|
||||
repeat
|
||||
|
||||
@@ -226,10 +226,10 @@ function scene.keyDown(key)
|
||||
SFX.play('clear_4',.8)
|
||||
SFX.play('fall',.8)
|
||||
elseif key=='c' and kb.isDown('lctrl','rctrl') or key=='cC' then
|
||||
sys.setClipboardText("Techmino Field:"..DATA.copyBoard(FIELD[page]))
|
||||
CLIPBOARD.set("Techmino Field:"..DATA.copyBoard(FIELD[page]))
|
||||
MES.new('check',text.exportSuccess)
|
||||
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
||||
local str=sys.getClipboardText()
|
||||
local str=CLIPBOARD.get()
|
||||
local p=str:find(":")-- ptr*
|
||||
if p then
|
||||
if not str:sub(1,p-1):find("Field") then
|
||||
|
||||
@@ -68,11 +68,11 @@ function scene.keyDown(key)
|
||||
end
|
||||
elseif key=='c' and kb.isDown('lctrl','rctrl') or key=='cC' then
|
||||
if #MISSION>0 then
|
||||
sys.setClipboardText("Techmino Target:"..DATA.copyMission(MISSION))
|
||||
CLIPBOARD.set("Techmino Target:"..DATA.copyMission(MISSION))
|
||||
MES.new('check',text.exportSuccess)
|
||||
end
|
||||
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
||||
local str=sys.getClipboardText()
|
||||
local str=CLIPBOARD.get()
|
||||
local p=str:find(":")-- ptr*
|
||||
if p then
|
||||
if not str:sub(1,p-1):find("Target") then
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
local sys=love.system
|
||||
local kb=love.keyboard
|
||||
|
||||
local sin=math.sin
|
||||
@@ -76,11 +75,11 @@ function scene.keyDown(key)
|
||||
scene.widgetList.sequence:scroll(kb.isDown('lshift','rshift') and -1 or 1)
|
||||
elseif key=='c' and kb.isDown('lctrl','rctrl') or key=='cC' then
|
||||
if #BAG>0 then
|
||||
sys.setClipboardText("Techmino SEQ:"..DATA.copySequence(BAG))
|
||||
CLIPBOARD.set("Techmino SEQ:"..DATA.copySequence(BAG))
|
||||
MES.new('check',text.exportSuccess)
|
||||
end
|
||||
elseif key=='v' and kb.isDown('lctrl','rctrl') or key=='cV' then
|
||||
local str=sys.getClipboardText()
|
||||
local str=CLIPBOARD.get()
|
||||
local p=str:find(":")-- ptr*
|
||||
if p then
|
||||
if not str:sub(1,p-1):find("SEQ") then
|
||||
|
||||
@@ -124,7 +124,7 @@ end
|
||||
local function _copy()
|
||||
local t=_getList()[listBox.selected]
|
||||
t=t.title_Org..":\n"..t.content_Org..(t.url and "\n[ "..t.url.." ]\n" or "\n")..text.dictNote
|
||||
love.system.setClipboardText(t)
|
||||
CLIPBOARD.set(t)
|
||||
scene.widgetList.copy.hide=true
|
||||
MES.new('info',text.copyDone)
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ local function _submit()
|
||||
end
|
||||
end
|
||||
local function _paste()
|
||||
local t=love.system.getClipboardText()
|
||||
local t=CLIPBOARD.get()
|
||||
if t then
|
||||
t=STRING.trim(t)
|
||||
if #t==128 and t:match("[0-9A-Z]+") then
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -15,7 +15,7 @@ local function _setPW()
|
||||
end
|
||||
end
|
||||
local function _paste()
|
||||
local t=love.system.getClipboardText()
|
||||
local t=CLIPBOARD.get()
|
||||
if t then
|
||||
t=STRING.trim(t)
|
||||
if #t==8 and t:match("[0-9]+") then
|
||||
|
||||
@@ -7,12 +7,12 @@ function scene.enter()
|
||||
end
|
||||
|
||||
local function _dumpCB(T)
|
||||
love.system.setClipboardText(STRING.packText(TABLE.dump(T)))
|
||||
CLIPBOARD.set(STRING.packText(TABLE.dump(T)))
|
||||
MES.new('check',text.exportSuccess)
|
||||
end
|
||||
local function _parseCB()
|
||||
local _
|
||||
local s=love.system.getClipboardText()
|
||||
local s=CLIPBOARD.get()
|
||||
|
||||
-- Decode
|
||||
s=STRING.unpackText(s)
|
||||
|
||||
@@ -136,7 +136,7 @@ scene.widgetList={
|
||||
},
|
||||
WIDGET.newKey{name='bg_custom_base64',x=1010,y=1502.5,w=420,h=135,align='M',
|
||||
code=function()
|
||||
local okay,data=pcall(love.data.decode,"data","base64",love.system.getClipboardText())
|
||||
local okay,data=pcall(love.data.decode,"data","base64",CLIPBOARD.get())
|
||||
if okay and pcall(gc.newImage,data) then
|
||||
love.filesystem.write('conf/customBG',data)
|
||||
SETTING.bg='custom'
|
||||
|
||||
@@ -164,7 +164,7 @@ scene.widgetList={
|
||||
textBox,
|
||||
WIDGET.newButton {name='home',x=1140,y= 90,w=170,h=80,sound='click',font=60,fText=CHAR.key.macHome,code=pressKey('home')},
|
||||
WIDGET.newButton {name='endd',x=1140,y=190,w=170,h=80,sound='click',font=60,fText=CHAR.key.macEnd ,code=pressKey('end')},
|
||||
WIDGET.newButton {name='copy',x=1140,y=290,w=170,h=80,sound='click',font=60,fText=CHAR.icon.copy ,code=function()love.system.setClipboardText(table.concat(textBox.texts,'\n'))end,color='lC'},
|
||||
WIDGET.newButton {name='copy',x=1140,y=290,w=170,h=80,sound='click',font=60,fText=CHAR.icon.copy ,code=function()CLIPBOARD.set(table.concat(textBox.texts,'\n'))end,color='lC'},
|
||||
|
||||
logList,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user