整理代码,表示键盘按键的字符串使用单引号

This commit is contained in:
MrZ626
2021-11-27 18:57:23 +08:00
parent 841faeede4
commit f6b4c1b109
48 changed files with 499 additions and 499 deletions

View File

@@ -218,31 +218,31 @@ end
local fnKey={NULL,NULL,NULL,NULL,NULL,NULL,NULL} local fnKey={NULL,NULL,NULL,NULL,NULL,NULL,NULL}
local function noDevkeyPressed(key) local function noDevkeyPressed(key)
if key=="f1"then fnKey[1]() if key=='f1'then fnKey[1]()
elseif key=="f2"then fnKey[2]() elseif key=='f2'then fnKey[2]()
elseif key=="f3"then fnKey[3]() elseif key=='f3'then fnKey[3]()
elseif key=="f4"then fnKey[4]() elseif key=='f4'then fnKey[4]()
elseif key=="f5"then fnKey[5]() elseif key=='f5'then fnKey[5]()
elseif key=="f6"then fnKey[6]() elseif key=='f6'then fnKey[6]()
elseif key=="f7"then fnKey[7]() elseif key=='f7'then fnKey[7]()
elseif key=="f8"then devMode=nil MES.new('info',"DEBUG OFF",.2) elseif key=='f8'then devMode=nil MES.new('info',"DEBUG OFF",.2)
elseif key=="f9"then devMode=1 MES.new('info',"DEBUG 1") elseif key=='f9'then devMode=1 MES.new('info',"DEBUG 1")
elseif key=="f10"then devMode=2 MES.new('info',"DEBUG 2") elseif key=='f10'then devMode=2 MES.new('info',"DEBUG 2")
elseif key=="f11"then devMode=3 MES.new('info',"DEBUG 3") elseif key=='f11'then devMode=3 MES.new('info',"DEBUG 3")
elseif key=="f12"then devMode=4 MES.new('info',"DEBUG 4") elseif key=='f12'then devMode=4 MES.new('info',"DEBUG 4")
elseif devMode==2 then elseif devMode==2 then
local W=WIDGET.sel local W=WIDGET.sel
if W then if W then
if key=="left"then W.x=W.x-10 if key=='left'then W.x=W.x-10
elseif key=="right"then W.x=W.x+10 elseif key=='right'then W.x=W.x+10
elseif key=="up"then W.y=W.y-10 elseif key=='up'then W.y=W.y-10
elseif key=="down"then W.y=W.y+10 elseif key=='down'then W.y=W.y+10
elseif key==","then W.w=W.w-10 elseif key==','then W.w=W.w-10
elseif key=="."then W.w=W.w+10 elseif key=='.'then W.w=W.w+10
elseif key=="/"then W.h=W.h-10 elseif key=='/'then W.h=W.h-10
elseif key=="'"then W.h=W.h+10 elseif key=='\''then W.h=W.h+10
elseif key=="["then W.font=W.font-5 elseif key=='['then W.font=W.font-5
elseif key=="]"then W.font=W.font+5 elseif key==']'then W.font=W.font+5
else return true else return true
end end
else else
@@ -256,10 +256,10 @@ function love.keypressed(key,_,isRep)
mouseShow=false mouseShow=false
if devMode and not noDevkeyPressed(key)then if devMode and not noDevkeyPressed(key)then
return return
elseif key=="f8"then elseif key=='f8'then
devMode=1 devMode=1
MES.new('info',"DEBUG ON",.2) MES.new('info',"DEBUG ON",.2)
elseif key=="f11"then elseif key=='f11'then
SETTING.fullscreen=not SETTING.fullscreen SETTING.fullscreen=not SETTING.fullscreen
applyFullscreen() applyFullscreen()
saveSettings() saveSettings()
@@ -268,7 +268,7 @@ function love.keypressed(key,_,isRep)
if EDITING==""then if EDITING==""then
SCN.keyDown(key,isRep) SCN.keyDown(key,isRep)
end end
elseif key=="escape"and not isRep then elseif key=='escape'and not isRep then
SCN.back() SCN.back()
else else
WIDGET.keyPressed(key,isRep) WIDGET.keyPressed(key,isRep)

View File

@@ -9,11 +9,11 @@ return function(y,key1,key2)
trigDist=min(trigDist,0)-(-y)^1.2 trigDist=min(trigDist,0)-(-y)^1.2
end end
while trigDist>=1 do while trigDist>=1 do
love.keypressed(key1 or"up") love.keypressed(key1 or'up')
trigDist=trigDist-1 trigDist=trigDist-1
end end
while trigDist<=-1 do while trigDist<=-1 do
love.keypressed(key2 or"down") love.keypressed(key2 or'down')
trigDist=trigDist+1 trigDist=trigDist+1
end end
end end

View File

@@ -597,7 +597,7 @@ function slider:scroll(n)
end end
end end
function slider:arrowKey(k) function slider:arrowKey(k)
self:scroll((k=="left"or k=="up")and -1 or 1) self:scroll((k=='left'or k=='up')and -1 or 1)
end end
function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,font=30][,fType][,change],disp[,show],code,hide function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,font=30][,fType][,change],disp[,show],code,hide
local _={ local _={
@@ -773,7 +773,7 @@ function selector:scroll(n)
end end
end end
function selector:arrowKey(k) function selector:arrowKey(k)
self:scroll((k=="left"or k=="up")and -1 or 1) self:scroll((k=='left'or k=='up')and -1 or 1)
end end
function WIDGET.newSelector(D)--name,x,y,w[,fText][,color][,sound=true],list,disp,code,hide function WIDGET.newSelector(D)--name,x,y,w[,fText][,color][,sound=true],list,disp,code,hide
@@ -897,14 +897,14 @@ end
function inputBox:keypress(k) function inputBox:keypress(k)
local t=self.value local t=self.value
if #t>0 and EDITING==""then if #t>0 and EDITING==""then
if k=="backspace"then if k=='backspace'then
local p=#t local p=#t
while t:byte(p)>=128 and t:byte(p)<192 do while t:byte(p)>=128 and t:byte(p)<192 do
p=p-1 p=p-1
end end
t=sub(t,1,p-1) t=sub(t,1,p-1)
SFX.play('lock') SFX.play('lock')
elseif k=="delete"then elseif k=='delete'then
t="" t=""
SFX.play('hold') SFX.play('hold')
end end
@@ -1005,9 +1005,9 @@ function textBox:scroll(dir)
self:drag(nil,nil,nil,-dir*self.lineH) self:drag(nil,nil,nil,-dir*self.lineH)
end end
function textBox:arrowKey(k) function textBox:arrowKey(k)
if k=="up"then if k=='up'then
self:scroll(-1) self:scroll(-1)
elseif k=="down"then elseif k=='down'then
self:scroll(-1) self:scroll(-1)
end end
end end
@@ -1382,12 +1382,12 @@ function WIDGET.release(x,y)
end end
function WIDGET.keyPressed(k,isRep) function WIDGET.keyPressed(k,isRep)
local W=WIDGET.sel local W=WIDGET.sel
if k=="space"or k=="return"then if k=='space'or k=='return'then
if not isRep then if not isRep then
WIDGET.press() WIDGET.press()
end end
elseif k=="up"or k=="down"or k=="left"or k=="right"then elseif k=='up'or k=='down'or k=='left'or k=='right'then
if kb.isDown("lshift","lalt","lctrl","rshift","ralt","rctrl")then if kb.isDown('lshift','lalt','lctrl','rshift','ralt','rctrl')then
--Control some widgets with arrowkeys when hold shift/ctrl/alt --Control some widgets with arrowkeys when hold shift/ctrl/alt
if W and W.arrowKey then W:arrowKey(k)end if W and W.arrowKey then W:arrowKey(k)end
else else
@@ -1400,10 +1400,10 @@ function WIDGET.keyPressed(k,isRep)
end end
elseif W.getCenter then elseif W.getCenter then
local WX,WY=W:getCenter() local WX,WY=W:getCenter()
local dir=(k=="right"or k=="down")and 1 or -1 local dir=(k=='right'or k=='down')and 1 or -1
local tar local tar
local minDist=1e99 local minDist=1e99
local swap_xy=k=="up"or k=="down" local swap_xy=k=='up'or k=='down'
if swap_xy then WX,WY=WY,WX end--note that we do not swap them back later if swap_xy then WX,WY=WY,WX end--note that we do not swap them back later
for _,W1 in ipairs(WIDGET.active)do for _,W1 in ipairs(WIDGET.active)do
if W~=W1 and W1.resCtr and not W1.hide then if W~=W1 and W1.resCtr and not W1.hide then
@@ -1445,24 +1445,24 @@ function WIDGET.textinput(texts)
end end
end end
local keyMirror={ local keyMirror={
dpup="up", dpup='up',
dpdown="down", dpdown='down',
dpleft="left", dpleft='left',
dpright="right", dpright='right',
start="return", start='return',
back="escape", back='escape',
} }
function WIDGET.gamepadPressed(i) function WIDGET.gamepadPressed(i)
if i=="start"then if i=='start'then
WIDGET.press() WIDGET.press()
elseif i=="a"or i=="b"then elseif i=='a'or i=='b'then
local W=WIDGET.sel local W=WIDGET.sel
if W then if W then
if W.type=='button'or W.type=='key'then if W.type=='button'or W.type=='key'then
WIDGET.press() WIDGET.press()
elseif W.type=='slider'then elseif W.type=='slider'then
local p=W.disp() local p=W.disp()
local P=i=="left"and(p>0 and p-1)or p<W.unit and p+1 local P=i=='left'and(p>0 and p-1)or p<W.unit and p+1
if p==P or not P then return end if p==P or not P then return end
W.code(P) W.code(P)
if W.change and timer()-W.lastTime>.18 then if W.change and timer()-W.lastTime>.18 then
@@ -1471,7 +1471,7 @@ function WIDGET.gamepadPressed(i)
end end
end end
end end
elseif i=="dpup"or i=="dpdown"or i=="dpleft"or i=="dpright"then elseif i=='dpup'or i=='dpdown'or i=='dpleft'or i=='dpright'then
WIDGET.keyPressed(keyMirror[i]) WIDGET.keyPressed(keyMirror[i])
end end
end end

View File

@@ -16,9 +16,9 @@ end
scene.touchDown=scene.mouseDown scene.touchDown=scene.mouseDown
function scene.keyDown(key) function scene.keyDown(key)
if key=="escape"then if key=='escape'then
SCN.back() SCN.back()
elseif key=="space"then elseif key=='space'then
loadGame('stack_e',true) loadGame('stack_e',true)
end end
end end

View File

@@ -130,43 +130,43 @@ local function tapBoard(x,y,key)
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="up"then if key=='up'then
tapBoard(cx,cy-(revKB and 1 or -1),true) tapBoard(cx,cy-(revKB and 1 or -1),true)
elseif key=="down"then elseif key=='down'then
tapBoard(cx,cy+(revKB and 1 or -1),true) tapBoard(cx,cy+(revKB and 1 or -1),true)
elseif key=="left"then elseif key=='left'then
tapBoard(cx-(revKB and 1 or -1),cy,true) tapBoard(cx-(revKB and 1 or -1),cy,true)
elseif key=="right"then elseif key=='right'then
tapBoard(cx+(revKB and 1 or -1),cy,true) tapBoard(cx+(revKB and 1 or -1),cy,true)
elseif key=="space"then elseif key=='space'then
shuffleBoard() shuffleBoard()
state=0 state=0
time=0 time=0
move,push=0,0 move,push=0,0
elseif key=="q"then elseif key=='q'then
if state~=1 then if state~=1 then
colorSelector:scroll(love.keyboard.isDown("lshift","rshift")and -1 or 1) colorSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
end end
elseif key=="w"then elseif key=='w'then
if state==0 then if state==0 then
invis=not invis invis=not invis
end end
elseif key=="e"then elseif key=='e'then
if state==0 then if state==0 then
slide=not slide slide=not slide
if not slide then if not slide then
pathVis=false pathVis=false
end end
end end
elseif key=="r"then elseif key=='r'then
if state==0 and slide then if state==0 and slide then
pathVis=not pathVis pathVis=not pathVis
end end
elseif key=="t"then elseif key=='t'then
if state==0 then if state==0 then
revKB=not revKB revKB=not revKB
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
@@ -309,12 +309,12 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='reset', x=160, y=100,w=180,h=100,color='lG',font=40,code=pressKey"space"}, WIDGET.newButton{name='reset', x=160, y=100,w=180,h=100,color='lG',font=40,code=pressKey'space'},
colorSelector, colorSelector,
WIDGET.newSwitch{name='invis', x=240, y=330,lim=200,font=40,disp=function()return invis end, code=pressKey"w",hideF=ifGaming}, WIDGET.newSwitch{name='invis', x=240, y=330,lim=200,font=40,disp=function()return invis end, code=pressKey'w',hideF=ifGaming},
WIDGET.newSwitch{name='slide', x=240, y=420,lim=200,font=40,disp=function()return slide end, code=pressKey"e",hideF=ifGaming}, WIDGET.newSwitch{name='slide', x=240, y=420,lim=200,font=40,disp=function()return slide end, code=pressKey'e',hideF=ifGaming},
WIDGET.newSwitch{name='pathVis',x=240, y=510,lim=200,font=40,disp=function()return pathVis end,code=pressKey"r",hideF=function()return state==1 or not slide end}, WIDGET.newSwitch{name='pathVis',x=240, y=510,lim=200,font=40,disp=function()return pathVis end,code=pressKey'r',hideF=function()return state==1 or not slide end},
WIDGET.newSwitch{name='revKB', x=240, y=600,lim=200,font=40,disp=function()return revKB end, code=pressKey"t",hideF=ifGaming}, WIDGET.newSwitch{name='revKB', x=240, y=600,lim=200,font=40,disp=function()return revKB end, code=pressKey't',hideF=ifGaming},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -245,8 +245,8 @@ function scene.mouseDown(x,y,k)
local dx,dy=x-640,y-360 local dx,dy=x-640,y-360
if abs(dx)<320 and abs(dy)<320 and(abs(dx)>60 or abs(dy)>60)then if abs(dx)<320 and abs(dy)<320 and(abs(dx)>60 or abs(dy)>60)then
scene.keyDown(abs(dx)-abs(dy)>0 and scene.keyDown(abs(dx)-abs(dy)>0 and
(dx>0 and"right"or"left")or (dx>0 and'right'or'left')or
(dy>0 and"down"or"up") (dy>0 and'down'or'up')
) )
end end
end end
@@ -291,7 +291,7 @@ local function playRep(n)
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="up"or key=="down"or key=="left"or key=="right"then if key=='up'or key=='down'or key=='left'or key=='right'then
if repeater.focus then if repeater.focus then
local f=repeater.focus local f=repeater.focus
if #repeater.seq[f]<24 then if #repeater.seq[f]<24 then
@@ -317,18 +317,18 @@ function scene.keyDown(key,isRep)
end end
end end
end end
elseif key=="space"then skip() elseif key=='space'then skip()
elseif key=="r"then reset() elseif key=='r'then reset()
elseif key=="q"then if state==0 then invis=not invis end elseif key=='q'then if state==0 then invis=not invis end
elseif key=="w"then if state==0 then tapControl=not tapControl end elseif key=='w'then if state==0 then tapControl=not tapControl end
elseif key=="1"or key=="2"then(kb.isDown("lshift","lctrl","lalt")and playRep or setFocus)(key=="1"and 1 or 2) elseif key=='1'or key=='2'then(kb.isDown('lshift','lctrl','lalt')and playRep or setFocus)(key=='1'and 1 or 2)
elseif key=="c1"then playRep(1) elseif key=='c1'then playRep(1)
elseif key=="c2"then playRep(2) elseif key=='c2'then playRep(2)
elseif key=="return"then elseif key=='return'then
if repeater.focus then if repeater.focus then
repeater.focus=false repeater.focus=false
end end
elseif key=="escape"then elseif key=='escape'then
if repeater.focus then if repeater.focus then
repeater.focus=false repeater.focus=false
else else
@@ -480,19 +480,19 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='reset', x=155, y=100,w=180,h=100,color='lG',font=40,code=pressKey"r"}, WIDGET.newButton{name='reset', x=155, y=100,w=180,h=100,color='lG',font=40,code=pressKey'r'},
WIDGET.newSwitch{name='invis', x=240, y=300,lim=200,font=40,disp=function()return invis end,code=pressKey"q",hideF=function()return state==1 end}, WIDGET.newSwitch{name='invis', x=240, y=300,lim=200,font=40,disp=function()return invis end,code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newSwitch{name='tapControl',x=240, y=370,lim=200,font=40,disp=function()return tapControl end,code=pressKey"w",hideF=function()return state==1 end}, WIDGET.newSwitch{name='tapControl',x=240, y=370,lim=200,font=40,disp=function()return tapControl end,code=pressKey'w',hideF=function()return state==1 end},
WIDGET.newKey{name='up', x=155, y=460,w=100,fText="",font=50, color='Y',code=pressKey"up", hideF=function()return tapControl end}, WIDGET.newKey{name='up', x=155, y=460,w=100,fText="",font=50, color='Y',code=pressKey'up', hideF=function()return tapControl end},
WIDGET.newKey{name='down', x=155, y=660,w=100,fText="",font=50, color='Y',code=pressKey"down", hideF=function()return tapControl end}, WIDGET.newKey{name='down', x=155, y=660,w=100,fText="",font=50, color='Y',code=pressKey'down', hideF=function()return tapControl end},
WIDGET.newKey{name='left', x=55, y=560,w=100,fText="",font=50, color='Y',code=pressKey"left", hideF=function()return tapControl end}, WIDGET.newKey{name='left', x=55, y=560,w=100,fText="",font=50, color='Y',code=pressKey'left', hideF=function()return tapControl end},
WIDGET.newKey{name='right', x=255, y=560,w=100,fText="",font=50,color='Y',code=pressKey"right", hideF=function()return tapControl end}, WIDGET.newKey{name='right', x=255, y=560,w=100,fText="",font=50,color='Y',code=pressKey'right', hideF=function()return tapControl end},
WIDGET.newKey{name='skip', x=155, y=400,w=100,font=20, color='Y',code=pressKey"space", hideF=function()return state~=1 or not skipper.cd or skipper.cd>0 end}, WIDGET.newKey{name='skip', x=155, y=400,w=100,font=20, color='Y',code=pressKey'space', hideF=function()return state~=1 or not skipper.cd or skipper.cd>0 end},
WIDGET.newKey{name='record1', x=1100,y=390,w=220,h=50,fText="", color='H',code=pressKey"1", hideF=function()return state==2 end}, WIDGET.newKey{name='record1', x=1100,y=390,w=220,h=50,fText="", color='H',code=pressKey'1', hideF=function()return state==2 end},
WIDGET.newKey{name='record2', x=1100,y=450,w=220,h=50,fText="", color='H',code=pressKey"2", hideF=function()return state==2 end}, WIDGET.newKey{name='record2', x=1100,y=450,w=220,h=50,fText="", color='H',code=pressKey'2', hideF=function()return state==2 end},
WIDGET.newKey{name='replay1', x=1245,y=390,w=50,fText="!", color='G',code=pressKey"c1", hideF=function()return state==2 or #repeater.seq[1]==0 end}, WIDGET.newKey{name='replay1', x=1245,y=390,w=50,fText="!", color='G',code=pressKey'c1', hideF=function()return state==2 or #repeater.seq[1]==0 end},
WIDGET.newKey{name='replay2', x=1245,y=450,w=50,fText="!", color='G',code=pressKey"c2", hideF=function()return state==2 or #repeater.seq[2]==0 end}, WIDGET.newKey{name='replay2', x=1245,y=450,w=50,fText="!", color='G',code=pressKey'c2', hideF=function()return state==2 or #repeater.seq[2]==0 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -64,16 +64,16 @@ function scene.keyDown(key,isRep)
SFX.play('finesseError') SFX.play('finesseError')
end end
end end
elseif key=="left"or key=="right"then elseif key=='left'or key=='right'then
if state==0 then if state==0 then
scene.widgetList.level:scroll(key=="left"and -1 or 1) scene.widgetList.level:scroll(key=='left'and -1 or 1)
end end
elseif key=="space"then elseif key=='space'then
progress=1 progress=1
mistake=0 mistake=0
time=0 time=0
state=0 state=0
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
@@ -117,7 +117,7 @@ end
scene.widgetList={ scene.widgetList={
WIDGET.newSelector{name='level', x=640,y=640,w=200,list={'A_Z','Z_A','Tech1','Tech2','KeyTest1','KeyTest2','Hello','Roll1','Roll2','Roll3','ZZZ','ZXZX','ZMZM','Stair','Stair2','Stair3','BPW'},disp=function()return levelName end,code=function(i)levelName=i;targetString=levels[i]end,hideF=function()return state>0 end}, WIDGET.newSelector{name='level', x=640,y=640,w=200,list={'A_Z','Z_A','Tech1','Tech2','KeyTest1','KeyTest2','Hello','Roll1','Roll2','Roll3','ZZZ','ZXZX','ZMZM','Stair','Stair2','Stair3','BPW'},disp=function()return levelName end,code=function(i)levelName=i;targetString=levels[i]end,hideF=function()return state>0 end},
WIDGET.newButton{name='reset', x=160,y=100,w=180,h=100,color='lG',font=40,code=pressKey"space"}, WIDGET.newButton{name='reset', x=160,y=100,w=180,h=100,color='lG',font=40,code=pressKey'space'},
WIDGET.newButton{name='keyboard',x=160,y=210,w=180,h=100,code=function()love.keyboard.setTextInput(true,0,select(2,SCR.xOy:transformPoint(0,500)),1,1)end,hide=not MOBILE}, WIDGET.newButton{name='keyboard',x=160,y=210,w=180,h=100,code=function()love.keyboard.setTextInput(true,0,select(2,SCR.xOy:transformPoint(0,500)),1,1)end,hide=not MOBILE},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -168,7 +168,7 @@ function scene.keyDown(key,isRep)
check(tonumber(input)) check(tonumber(input))
SFX.play('touch') SFX.play('touch')
end end
elseif key=="-"then elseif key=='-'then
if #input<8 then if #input<8 then
if input:find("-")then if input:find("-")then
input=input:sub(2) input=input:sub(2)
@@ -179,12 +179,12 @@ function scene.keyDown(key,isRep)
check(tonumber(input)) check(tonumber(input))
SFX.play('hold') SFX.play('hold')
end end
elseif key=="backspace"then elseif key=='backspace'then
input="" input=""
inputTime=0 inputTime=0
elseif key=="r"then elseif key=='r'then
reset() reset()
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
@@ -216,20 +216,20 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='reset',x=155,y=100,w=180,h=100,color='lG',font=40,code=pressKey"r"}, WIDGET.newButton{name='reset',x=155,y=100,w=180,h=100,color='lG',font=40,code=pressKey'r'},
WIDGET.newKey{name='X',x=540,y=620,w=90,font=60,fText="X",code=pressKey"backspace"}, WIDGET.newKey{name='X',x=540,y=620,w=90,font=60,fText="X",code=pressKey'backspace'},
WIDGET.newKey{name='0',x=640,y=620,w=90,font=60,fText="0",code=pressKey"0"}, WIDGET.newKey{name='0',x=640,y=620,w=90,font=60,fText="0",code=pressKey'0'},
WIDGET.newKey{name='-',x=740,y=620,w=90,font=60,fText="-",code=pressKey"-"}, WIDGET.newKey{name='-',x=740,y=620,w=90,font=60,fText="-",code=pressKey'-'},
WIDGET.newKey{name='1',x=540,y=520,w=90,font=60,fText="1",code=pressKey"1"}, WIDGET.newKey{name='1',x=540,y=520,w=90,font=60,fText="1",code=pressKey'1'},
WIDGET.newKey{name='2',x=640,y=520,w=90,font=60,fText="2",code=pressKey"2"}, WIDGET.newKey{name='2',x=640,y=520,w=90,font=60,fText="2",code=pressKey'2'},
WIDGET.newKey{name='3',x=740,y=520,w=90,font=60,fText="3",code=pressKey"3"}, WIDGET.newKey{name='3',x=740,y=520,w=90,font=60,fText="3",code=pressKey'3'},
WIDGET.newKey{name='4',x=540,y=420,w=90,font=60,fText="4",code=pressKey"4"}, WIDGET.newKey{name='4',x=540,y=420,w=90,font=60,fText="4",code=pressKey'4'},
WIDGET.newKey{name='5',x=640,y=420,w=90,font=60,fText="5",code=pressKey"5"}, WIDGET.newKey{name='5',x=640,y=420,w=90,font=60,fText="5",code=pressKey'5'},
WIDGET.newKey{name='6',x=740,y=420,w=90,font=60,fText="6",code=pressKey"6"}, WIDGET.newKey{name='6',x=740,y=420,w=90,font=60,fText="6",code=pressKey'6'},
WIDGET.newKey{name='7',x=540,y=320,w=90,font=60,fText="7",code=pressKey"7"}, WIDGET.newKey{name='7',x=540,y=320,w=90,font=60,fText="7",code=pressKey'7'},
WIDGET.newKey{name='8',x=640,y=320,w=90,font=60,fText="8",code=pressKey"8"}, WIDGET.newKey{name='8',x=640,y=320,w=90,font=60,fText="8",code=pressKey'8'},
WIDGET.newKey{name='9',x=740,y=320,w=90,font=60,fText="9",code=pressKey"9"}, WIDGET.newKey{name='9',x=740,y=320,w=90,font=60,fText="9",code=pressKey'9'},
WIDGET.newButton{name='back',x=1200,y=660,w=110,h=60,font=60,fText=CHAR.icon.back,code=pressKey"escape"}, WIDGET.newButton{name='back',x=1200,y=660,w=110,h=60,font=60,fText=CHAR.icon.back,code=pressKey'escape'},
} }
return scene return scene

View File

@@ -18,7 +18,7 @@ local sym--symbol
local function _autoReturn() local function _autoReturn()
if reg and sym then if reg and sym then
scene.keyDown("calculate") scene.keyDown('calculate')
else else
reg=false reg=false
end end
@@ -35,22 +35,22 @@ end
scene.mouseDown=NULL scene.mouseDown=NULL
function scene.keyDown(key) function scene.keyDown(key)
if kb.isDown("lshift","rshift")then if kb.isDown('lshift','rshift')then
if key=="="then if key=='='then
scene.keyDown("+") scene.keyDown('+')
return return
elseif kb.isDown("lshift","rshift")and key=="8"then elseif kb.isDown('lshift','rshift')and key=='8'then
scene.keyDown("*") scene.keyDown('*')
return return
end end
elseif key:sub(1,2)=="kp"then elseif key:sub(1,2)=='kp'then
scene.keyDown(key:sub(3)) scene.keyDown(key:sub(3))
return return
end end
if keySounds[key]then if keySounds[key]then
Snd('bell',keySounds[key]) Snd('bell',keySounds[key])
end end
if key=="."then if key=='.'then
if sym=="="then if sym=="="then
sym,reg=false,false sym,reg=false,false
val="0." val="0."
@@ -62,14 +62,14 @@ function scene.keyDown(key)
val=val.."." val=val.."."
end end
end end
elseif key=="e"then elseif key=='e'then
if sym=="="then if sym=="="then
sym,reg=false sym,reg=false
val="0e" val="0e"
elseif not val:find("e")then elseif not val:find("e")then
val=val.."e" val=val.."e"
end end
elseif key=="backspace"then elseif key=='backspace'then
if sym=="="then if sym=="="then
val="" val=""
elseif sym then elseif sym then
@@ -80,16 +80,16 @@ function scene.keyDown(key)
if val==""then if val==""then
val="0" val="0"
end end
elseif key=="+"then elseif key=='+'then
_autoReturn() _autoReturn()
sym="+" sym="+"
elseif key=="*"then elseif key=='*'then
_autoReturn() _autoReturn()
sym="*" sym="*"
elseif key=="-"then elseif key=='-'then
_autoReturn() _autoReturn()
sym="-" sym="-"
elseif key=="/"then elseif key=='/'then
_autoReturn() _autoReturn()
sym="/" sym="/"
elseif key:byte()>=48 and key:byte()<=57 then elseif key:byte()>=48 and key:byte()<=57 then
@@ -107,9 +107,9 @@ function scene.keyDown(key)
val=val..key val=val..key
end end
end end
elseif key=="return"then elseif key=='return'then
scene.keyDown("calculate") scene.keyDown('calculate')
elseif key=="calculate"then elseif key=='calculate'then
val=val:gsub("e$","") val=val:gsub("e$","")
if sym and reg then if sym and reg then
reg=reg:gsub("e$","") reg=reg:gsub("e$","")
@@ -122,14 +122,14 @@ function scene.keyDown(key)
end end
sym="=" sym="="
reg=false reg=false
elseif key=="escape"then elseif key=='escape'then
if val~="0"then if val~="0"then
reg,sym=false,false reg,sym=false,false
val="0" val="0"
else else
SCN.back() SCN.back()
end end
elseif key=="delete"then elseif key=='delete'then
val="0" val="0"
end end
end end
@@ -145,24 +145,24 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newKey{name='_1',x=145,y=300,w=90,sound=false,fText="1",font=50,code=pressKey"1"}, WIDGET.newKey{name='_1',x=145,y=300,w=90,sound=false,fText="1",font=50,code=pressKey'1'},
WIDGET.newKey{name='_2',x=245,y=300,w=90,sound=false,fText="2",font=50,code=pressKey"2"}, WIDGET.newKey{name='_2',x=245,y=300,w=90,sound=false,fText="2",font=50,code=pressKey'2'},
WIDGET.newKey{name='_3',x=345,y=300,w=90,sound=false,fText="3",font=50,code=pressKey"3"}, WIDGET.newKey{name='_3',x=345,y=300,w=90,sound=false,fText="3",font=50,code=pressKey'3'},
WIDGET.newKey{name='_4',x=145,y=400,w=90,sound=false,fText="4",font=50,code=pressKey"4"}, WIDGET.newKey{name='_4',x=145,y=400,w=90,sound=false,fText="4",font=50,code=pressKey'4'},
WIDGET.newKey{name='_5',x=245,y=400,w=90,sound=false,fText="5",font=50,code=pressKey"5"}, WIDGET.newKey{name='_5',x=245,y=400,w=90,sound=false,fText="5",font=50,code=pressKey'5'},
WIDGET.newKey{name='_6',x=345,y=400,w=90,sound=false,fText="6",font=50,code=pressKey"6"}, WIDGET.newKey{name='_6',x=345,y=400,w=90,sound=false,fText="6",font=50,code=pressKey'6'},
WIDGET.newKey{name='_7',x=145,y=500,w=90,sound=false,fText="7",font=50,code=pressKey"7"}, WIDGET.newKey{name='_7',x=145,y=500,w=90,sound=false,fText="7",font=50,code=pressKey'7'},
WIDGET.newKey{name='_8',x=245,y=500,w=90,sound=false,fText="8",font=50,code=pressKey"8"}, WIDGET.newKey{name='_8',x=245,y=500,w=90,sound=false,fText="8",font=50,code=pressKey'8'},
WIDGET.newKey{name='_9',x=345,y=500,w=90,sound=false,fText="9",font=50,code=pressKey"9"}, WIDGET.newKey{name='_9',x=345,y=500,w=90,sound=false,fText="9",font=50,code=pressKey'9'},
WIDGET.newKey{name='_0',x=145,y=600,w=90,sound=false,fText="0",font=50,code=pressKey"0"}, WIDGET.newKey{name='_0',x=145,y=600,w=90,sound=false,fText="0",font=50,code=pressKey'0'},
WIDGET.newKey{name='.',x=245,y=600,w=90,sound=false,fText=".",color='lM',font=50,code=pressKey"."}, WIDGET.newKey{name='.',x=245,y=600,w=90,sound=false,fText=".",color='lM',font=50,code=pressKey'.'},
WIDGET.newKey{name='e',x=345,y=600,w=90,sound=false,fText="e",color='lM',font=50,code=pressKey"e"}, WIDGET.newKey{name='e',x=345,y=600,w=90,sound=false,fText="e",color='lM',font=50,code=pressKey'e'},
WIDGET.newKey{name='+',x=445,y=300,w=90,sound=false,fText="+",color='lB',font=50,code=pressKey"+"}, WIDGET.newKey{name='+',x=445,y=300,w=90,sound=false,fText="+",color='lB',font=50,code=pressKey'+'},
WIDGET.newKey{name='-',x=445,y=400,w=90,sound=false,fText="-",color='lB',font=50,code=pressKey"-"}, WIDGET.newKey{name='-',x=445,y=400,w=90,sound=false,fText="-",color='lB',font=50,code=pressKey'-'},
WIDGET.newKey{name='*',x=445,y=500,w=90,sound=false,fText="*",color='lB',font=50,code=pressKey"*"}, WIDGET.newKey{name='*',x=445,y=500,w=90,sound=false,fText="*",color='lB',font=50,code=pressKey'*'},
WIDGET.newKey{name='/',x=445,y=600,w=90,sound=false,fText="/",color='lB',font=50,code=pressKey"/"}, WIDGET.newKey{name='/',x=445,y=600,w=90,sound=false,fText="/",color='lB',font=50,code=pressKey'/'},
WIDGET.newKey{name='<',x=545,y=300,w=90,sound=false,fText="<",color='lR',font=50,code=pressKey"backspace"}, WIDGET.newKey{name='<',x=545,y=300,w=90,sound=false,fText="<",color='lR',font=50,code=pressKey'backspace'},
WIDGET.newKey{name='=',x=545,y=400,w=90,sound=false,fText="=",color='lY',font=50,code=pressKey"return"}, WIDGET.newKey{name='=',x=545,y=400,w=90,sound=false,fText="=",color='lY',font=50,code=pressKey'return'},
WIDGET.newKey{name='back',x=1135,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newKey{name='back',x=1135,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -19,7 +19,7 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="space"or key=="return"then if key=='space'or key=='return'then
if state==0 then if state==0 then
state=1 state=1
elseif state==1 then elseif state==1 then
@@ -27,17 +27,17 @@ function scene.keyDown(key,isRep)
vx=pow*cos(ang)/2.6 vx=pow*cos(ang)/2.6
vy=pow*sin(ang)/2.6 vy=pow*sin(ang)/2.6
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
function scene.mouseDown(_,_,k) function scene.mouseDown(_,_,k)
if k==1 then if k==1 then
scene.keyDown("space") scene.keyDown('space')
end end
end end
function scene.touchDown() function scene.touchDown()
scene.keyDown("space") scene.keyDown('space')
end end
function scene.update() function scene.update()

View File

@@ -989,7 +989,7 @@ function scene.wheelMoved(_,y)
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="return" or key=="kpenter"then if key=='return' or key=='kpenter'then
local input=STRING.trim(inputBox:getText()) local input=STRING.trim(inputBox:getText())
if input==""then return end if input==""then return end
@@ -1048,7 +1048,7 @@ function scene.keyDown(key)
--Insert empty line --Insert empty line
log"" log""
elseif key=="up"then elseif key=='up'then
if not hisPtr then if not hisPtr then
hisPtr=#history hisPtr=#history
if hisPtr>0 then if hisPtr>0 then
@@ -1058,7 +1058,7 @@ function scene.keyDown(key)
hisPtr=hisPtr-1 hisPtr=hisPtr-1
inputBox:setText(history[hisPtr]) inputBox:setText(history[hisPtr])
end end
elseif key=="down"then elseif key=='down'then
if hisPtr then if hisPtr then
hisPtr=hisPtr+1 hisPtr=hisPtr+1
if history[hisPtr]then if history[hisPtr]then
@@ -1068,7 +1068,7 @@ function scene.keyDown(key)
inputBox:clear() inputBox:clear()
end end
end end
elseif key=="tab"then elseif key=='tab'then
local str=inputBox:getText() local str=inputBox:getText()
if str~=""and not str:find("%s")then if str~=""and not str:find("%s")then
local res={} local res={}
@@ -1086,14 +1086,14 @@ function scene.keyDown(key)
inputBox:setText(res[1]) inputBox:setText(res[1])
end end
end end
elseif key=="scrollup"then outputBox:scroll(-5) elseif key=='scrollup'then outputBox:scroll(-5)
elseif key=="scrolldown"then outputBox:scroll(5) elseif key=='scrolldown'then outputBox:scroll(5)
elseif key=="pageup"then outputBox:scroll(-20) elseif key=='pageup'then outputBox:scroll(-20)
elseif key=="pagedown"then outputBox:scroll(20) elseif key=='pagedown'then outputBox:scroll(20)
elseif key=="home"then outputBox:scroll(-1e99) elseif key=='home'then outputBox:scroll(-1e99)
elseif key=="end"then outputBox:scroll(1e99) elseif key=='end'then outputBox:scroll(1e99)
elseif combKey[key]and kb.isDown("lctrl","rctrl")then combKey[key]() elseif combKey[key]and kb.isDown('lctrl','rctrl')then combKey[key]()
elseif key=="escape"then elseif key=='escape'then
if not WIDGET.isFocus(inputBox)then if not WIDGET.isFocus(inputBox)then
WIDGET.focus(inputBox) WIDGET.focus(inputBox)
else else

View File

@@ -90,21 +90,21 @@ function scene.touchUp(x)
end end
moveDir=0 moveDir=0
else else
scene.keyDown("space") scene.keyDown('space')
end end
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="escape"then if key=='escape'then
SCN.back() SCN.back()
elseif play then elseif play then
if key=="left"or key=="a"then if key=='left'or key=='a'then
moveDir=-1 moveDir=-1
elseif key=="right"or key=="d"then elseif key=='right'or key=='d'then
moveDir=1 moveDir=1
end end
else else
if key=="space"and ct==60 then if key=='space'and ct==60 then
menu=-1 menu=-1
speed=1 speed=1
level=1 level=1
@@ -113,10 +113,10 @@ function scene.keyDown(key,isRep)
end end
function scene.keyUp(key) function scene.keyUp(key)
if play then if play then
if key=="left"or key=="a"then if key=='left'or key=='a'then
moveDir=kb.isDown("right","d")and 1 or 0 moveDir=kb.isDown('right','d')and 1 or 0
elseif key=="right"or key=="d"then elseif key=='right'or key=='d'then
moveDir=kb.isDown("left","a")and -1 or 0 moveDir=kb.isDown('left','a')and -1 or 0
end end
end end
end end

View File

@@ -42,7 +42,7 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="space"or key=="return"then if key=='space'or key=='return'then
if state=='move'then if state=='move'then
if floor>0 then if floor>0 then
if move.x<base.x then if move.x<base.x then
@@ -61,17 +61,17 @@ function scene.keyDown(key,isRep)
restart() restart()
state='move' state='move'
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
function scene.mouseDown(_,_,k) function scene.mouseDown(_,_,k)
if k==1 then if k==1 then
scene.keyDown("space") scene.keyDown('space')
end end
end end
function scene.touchDown() function scene.touchDown()
scene.keyDown("space") scene.keyDown('space')
end end
function scene.update() function scene.update()
@@ -234,7 +234,7 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='back',x=1140,y=60,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey"escape"}, WIDGET.newButton{name='back',x=1140,y=60,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey'escape'},
} }
return scene return scene

View File

@@ -46,7 +46,7 @@ local colorSelector=WIDGET.newSelector{name='color',x=150,y=360,w=290,
list={"black","dGray","gray","lGray","dRed","red","lRed","dFire","fire","lFire","dOrange","orange","lOrange","dYellow","yellow","lYellow","dLime","lime","lLime","dJade","jade","lJade","dGreen","green","lGreen","dAqua","aqua","lAqua","dCyan","cyan","lCyan","dNavy","navy","lNavy","dSea","sea","lSea","dBlue","blue","lBlue","dViolet","violet","lViolet","dPurple","purple","lPurple","dMagenta","magenta","lMagenta","dWine","wine","lWine"}, list={"black","dGray","gray","lGray","dRed","red","lRed","dFire","fire","lFire","dOrange","orange","lOrange","dYellow","yellow","lYellow","dLime","lime","lLime","dJade","jade","lJade","dGreen","green","lGreen","dAqua","aqua","lAqua","dCyan","cyan","lCyan","dNavy","navy","lNavy","dSea","sea","lSea","dBlue","blue","lBlue","dViolet","violet","lViolet","dPurple","purple","lPurple","dMagenta","magenta","lMagenta","dWine","wine","lWine"},
disp=function()return tileColor end,code=function(m)tileColor=m end disp=function()return tileColor end,code=function(m)tileColor=m end
} }
local arcadeSwitch=WIDGET.newSwitch{name='arcade',x=240,y=430,lim=200,font=40,disp=function()return arcade end,code=pressKey"e"} local arcadeSwitch=WIDGET.newSwitch{name='arcade',x=240,y=430,lim=200,font=40,disp=function()return arcade end,code=pressKey'e'}
local function freshSelectors() local function freshSelectors()
local f=state~=0 local f=state~=0
modeSelector.hide=f modeSelector.hide=f
@@ -247,23 +247,23 @@ local function touch(n)
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="r"or key=="space"then reset() if key=='r'or key=='space'then reset()
elseif key=="escape"then SCN.back() elseif key=='escape'then SCN.back()
elseif state~=2 then elseif state~=2 then
if key=="d"or key=="c"then touch(1) if key=='d'or key=='c'then touch(1)
elseif key=="f"or key=="v"then touch(2) elseif key=='f'or key=='v'then touch(2)
elseif key=="j"or key=="n"then touch(3) elseif key=='j'or key=='n'then touch(3)
elseif key=="k"or key=="m"then touch(4) elseif key=='k'or key=='m'then touch(4)
elseif state==0 then elseif state==0 then
if key=="tab"then if key=='tab'then
local mode1=mode local mode1=mode
modeSelector:scroll(love.keyboard.isDown("lshift","rshift")and -1 or 1) modeSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
if mode1~=mode then reset()end if mode1~=mode then reset()end
elseif key=="q"then elseif key=='q'then
bgmSelector:scroll(love.keyboard.isDown("lshift","rshift")and -1 or 1) bgmSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
elseif key=="w"then elseif key=='w'then
colorSelector:scroll(love.keyboard.isDown("lshift","rshift")and -1 or 1) colorSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
elseif key=="e"then elseif key=='e'then
arcade=not arcade arcade=not arcade
end end
end end
@@ -380,7 +380,7 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='reset',x=155,y=100,w=180,h=100,color='lG',font=40,code=pressKey"r"}, WIDGET.newButton{name='reset',x=155,y=100,w=180,h=100,color='lG',font=40,code=pressKey'r'},
modeSelector,bgmSelector,colorSelector, modeSelector,bgmSelector,colorSelector,
arcadeSwitch, arcadeSwitch,
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},

View File

@@ -252,16 +252,16 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="r"then if key=='r'then
if state~=1 or sure>.2 then if state~=1 or sure>.2 then
newGame() newGame()
else else
sure=1 sure=1
MES.new('info',"Press again") MES.new('info',"Press again")
end end
elseif key=="z"or key=="x"then elseif key=='z'or key=='x'then
love.mousepressed(ms.getPosition()) love.mousepressed(ms.getPosition())
elseif key=="escape"then elseif key=='escape'then
if state~=1 or sure>.2 then if state~=1 or sure>.2 then
SCN.back() SCN.back()
else else
@@ -269,7 +269,7 @@ function scene.keyDown(key,isRep)
MES.new('info',"Press again") MES.new('info',"Press again")
end end
elseif state==0 then elseif state==0 then
if key=="q"then if key=='q'then
invis=not invis invis=not invis
end end
end end
@@ -280,7 +280,7 @@ local function touch(x,y)
tap(x,y) tap(x,y)
end end
function scene.mouseDown(x,y,k)if k==1 or k==2 or not k then touch(x,y)end end function scene.mouseDown(x,y,k)if k==1 or k==2 or not k then touch(x,y)end end
function scene.mouseMove(x,y)if(msIsDown(1)or kbIsDown("z","x"))then touch(x,y)end end function scene.mouseMove(x,y)if(msIsDown(1)or kbIsDown('z','x'))then touch(x,y)end end
function scene.touchDown(x,y)touch(x,y)end function scene.touchDown(x,y)touch(x,y)end
function scene.touchMove(x,y)touch(x,y)end function scene.touchMove(x,y)touch(x,y)end
@@ -399,9 +399,9 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='reset',x=80,y=60,w=110,h=60,color='lG',code=pressKey"r",hideF=function()return state==0 end}, WIDGET.newButton{name='reset',x=80,y=60,w=110,h=60,color='lG',code=pressKey'r',hideF=function()return state==0 end},
WIDGET.newSwitch{name='invis',x=100,y=140,lim=80,disp=function()return invis end,code=pressKey"q",hideF=function()return state==1 end}, WIDGET.newSwitch{name='invis',x=100,y=140,lim=80,disp=function()return invis end,code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newButton{name='back',x=1200,y=660,w=110,font=50,fText=CHAR.icon.back,code=pressKey"escape"}, WIDGET.newButton{name='back',x=1200,y=660,w=110,font=50,fText=CHAR.icon.back,code=pressKey'escape'},
} }
return scene return scene

View File

@@ -44,9 +44,9 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="escape"then if key=='escape'then
SCN.back() SCN.back()
elseif key=="space"then elseif key=='space'then
if state==0 then--main if state==0 then--main
if timer==0 then if timer==0 then
state=1 state=1
@@ -77,11 +77,11 @@ function scene.keyDown(key,isRep)
end end
function scene.mouseDown(_,_,k) function scene.mouseDown(_,_,k)
if k==1 then if k==1 then
scene.keyDown("space") scene.keyDown('space')
end end
end end
function scene.touchDown() function scene.touchDown()
scene.keyDown("space") scene.keyDown('space')
end end
function scene.update() function scene.update()
@@ -163,7 +163,7 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newKey{name='back',x=1140,y=60,w=170,h=80,color='D',font=60,fText=CHAR.icon.back,code=pressKey"escape"}, WIDGET.newKey{name='back',x=1140,y=60,w=170,h=80,color='D',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
} }
return scene return scene

View File

@@ -44,22 +44,22 @@ local function start()
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="space"then if key=='space'then
if state==0 then if state==0 then
start() start()
end end
elseif key=="r"then elseif key=='r'then
state=0 state=0
bx,by=640,360 bx,by=640,360
vx,vy=0,0 vx,vy=0,0
ry=0 ry=0
p1.score,p2.score=0,0 p1.score,p2.score=0,0
SFX.play('hold') SFX.play('hold')
elseif key=="w"or key=="s"then elseif key=='w'or key=='s'then
p1.y0=false p1.y0=false
elseif key=="up"or key=="down"then elseif key=='up'or key=='down'then
p2.y0=false p2.y0=false
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
@@ -86,10 +86,10 @@ function scene.update()
P.vy=P.vy*.5 P.vy=P.vy*.5
end end
else else
if kb.isDown(P==p1 and"w"or"up")then if kb.isDown(P==p1 and'w'or'up')then
P.vy=max(P.vy-1,-8) P.vy=max(P.vy-1,-8)
end end
if kb.isDown(P==p1 and"s"or"down")then if kb.isDown(P==p1 and's'or'down')then
P.vy=min(P.vy+1,8) P.vy=min(P.vy+1,8)
end end
P.y=P.y+P.vy P.y=P.y+P.vy
@@ -176,7 +176,7 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newKey{name='reset',x=640,y=45,w=150,h=50,font=35,code=pressKey"r"}, WIDGET.newKey{name='reset',x=640,y=45,w=150,h=50,font=35,code=pressKey'r'},
WIDGET.newKey{name='back',x=640,y=675,w=150,h=50,font=40,fText=CHAR.icon.back,code=backScene}, WIDGET.newKey{name='back',x=640,y=675,w=150,h=50,font=40,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -23,7 +23,7 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if state==0 then if state==0 then
if key=="space"then if key=='space'then
reset() reset()
state=1 state=1
ct=60 ct=60

View File

@@ -79,9 +79,9 @@ function scene.touchDown(x,y)
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="z"or key=="x"then if key=='z'or key=='x'then
love.mousepressed(ms.getPosition()) love.mousepressed(ms.getPosition())
elseif key=="space"then elseif key=='space'then
if state>0 then if state>0 then
board={} board={}
time=0 time=0
@@ -89,23 +89,23 @@ function scene.keyDown(key,isRep)
state=0 state=0
progress=0 progress=0
end end
elseif key=="q"then elseif key=='q'then
if state==0 then if state==0 then
invis=not invis invis=not invis
end end
elseif key=="w"then elseif key=='w'then
if state==0 then if state==0 then
disappear=not disappear disappear=not disappear
end end
elseif key=="e"then elseif key=='e'then
if state==0 then if state==0 then
tapFX=not tapFX tapFX=not tapFX
end end
elseif key=="3"or key=="4"or key=="5"or key=="6"then elseif key=='3'or key=='4'or key=='5'or key=='6'then
if state==0 then if state==0 then
rank=tonumber(key) rank=tonumber(key)
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
@@ -166,11 +166,11 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='reset', x=160,y=100,w=180,h=100,color='lG',font=40,code=pressKey"space",hideF=function()return state==0 end}, WIDGET.newButton{name='reset', x=160,y=100,w=180,h=100,color='lG',font=40,code=pressKey'space',hideF=function()return state==0 end},
WIDGET.newSlider{name='rank', x=130,y=250,lim=105,w=150,unit=3,show=false,font=40,disp=function()return rank-3 end,code=function(v)rank=v+3 end,hideF=function()return state>0 end}, WIDGET.newSlider{name='rank', x=130,y=250,lim=105,w=150,unit=3,show=false,font=40,disp=function()return rank-3 end,code=function(v)rank=v+3 end,hideF=function()return state>0 end},
WIDGET.newSwitch{name='invis', x=240,y=330,lim=200,font=40,disp=function()return invis end, code=pressKey"q",hideF=function()return state==1 end}, WIDGET.newSwitch{name='invis', x=240,y=330,lim=200,font=40,disp=function()return invis end, code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newSwitch{name='disappear',x=240,y=420,lim=200,font=40,disp=function()return disappear end,code=pressKey"w",hideF=function()return state==1 end}, WIDGET.newSwitch{name='disappear',x=240,y=420,lim=200,font=40,disp=function()return disappear end,code=pressKey'w',hideF=function()return state==1 end},
WIDGET.newSwitch{name='tapFX', x=240,y=510,lim=200,font=40,disp=function()return tapFX end, code=pressKey"e",hideF=function()return state==1 end}, WIDGET.newSwitch{name='tapFX', x=240,y=510,lim=200,font=40,disp=function()return tapFX end, code=pressKey'e',hideF=function()return state==1 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -42,7 +42,7 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name="spin", x=1140,y=360,w=120,font=60,fText=CHAR.icon.retry_spin,code=pressKey"space"}, WIDGET.newButton{name="spin", x=1140,y=360,w=120,font=60,fText=CHAR.icon.retry_spin,code=pressKey'space'},
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }
return scene return scene

View File

@@ -18,7 +18,7 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="escape"then if key=='escape'then
SCN.back() SCN.back()
else else
if lastKey~=key then if lastKey~=key then

View File

@@ -125,38 +125,38 @@ local function merge()
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="up"or key=="down"or key=="left"or key=="right"then if key=='up'or key=='down'or key=='left'or key=='right'then
if state==2 then return end if state==2 then return end
if not cx then if not cx then
cx,cy=3,3 cx,cy=3,3
else else
if key=="up"then if key=='up'then
if cy>1 then cy=cy-1 end if cy>1 then cy=cy-1 end
elseif key=="down"then elseif key=='down'then
if cy<5 then cy=cy+1 end if cy<5 then cy=cy+1 end
elseif key=="left"then elseif key=='left'then
if cx>1 then cx=cx-1 end if cx>1 then cx=cx-1 end
elseif key=="right"then elseif key=='right'then
if cx<5 then cx=cx+1 end if cx<5 then cx=cx+1 end
end end
end end
elseif key=="z"or key=="space"then elseif key=='z'or key=='space'then
merge() merge()
elseif key=="r"then elseif key=='r'then
reset() reset()
elseif key=="q"then elseif key=='q'then
if state==0 then if state==0 then
nexts=not nexts nexts=not nexts
end end
elseif key=="w"then elseif key=='w'then
if state==0 then if state==0 then
invis=not invis invis=not invis
end end
elseif key=="e"then elseif key=='e'then
if state==0 then if state==0 then
fast=not fast fast=not fast
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
@@ -217,7 +217,7 @@ function scene.update()
elseif fast and( elseif fast and(
msIsDown(1)or msIsDown(1)or
#tcTouches()>0 or #tcTouches()>0 or
kbIsDown("space") kbIsDown('space')
)then )then
merge() merge()
end end
@@ -302,10 +302,10 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='reset',x=160,y=100,w=180,h=100,color='lG',font=40,code=pressKey"r"}, WIDGET.newButton{name='reset',x=160,y=100,w=180,h=100,color='lG',font=40,code=pressKey'r'},
WIDGET.newSwitch{name='next', x=240,y=235,lim=200,font=40,disp=function()return nexts end,code=pressKey"q",hideF=function()return state==1 end}, WIDGET.newSwitch{name='next', x=240,y=235,lim=200,font=40,disp=function()return nexts end,code=pressKey'q',hideF=function()return state==1 end},
WIDGET.newSwitch{name='invis',x=240,y=305,lim=200,font=40,disp=function()return invis end,code=pressKey"w",hideF=function()return state==1 end}, WIDGET.newSwitch{name='invis',x=240,y=305,lim=200,font=40,disp=function()return invis end,code=pressKey'w',hideF=function()return state==1 end},
WIDGET.newSwitch{name='fast', x=240,y=375,lim=200,font=30,disp=function()return fast end,code=pressKey"e",hideF=function()return state==1 end}, WIDGET.newSwitch{name='fast', x=240,y=375,lim=200,font=30,disp=function()return fast end,code=pressKey'e',hideF=function()return state==1 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -37,7 +37,7 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="return"or key=="return2"then if key=='return'or key=='return2'then
if CUSTOMENV.opponent~="X"then if CUSTOMENV.opponent~="X"then
if CUSTOMENV.opponent:sub(1,2)=='CC'then if CUSTOMENV.opponent:sub(1,2)=='CC'then
if CUSTOMENV.sequence=='fixed'then if CUSTOMENV.sequence=='fixed'then
@@ -62,7 +62,7 @@ function scene.keyDown(key,isRep)
return return
end end
end end
if key=="return2"or kb.isDown("lalt","lctrl","lshift")then if key=='return2'or kb.isDown('lalt','lctrl','lshift')then
if #FIELD[1]>0 then if #FIELD[1]>0 then
saveFile(CUSTOMENV,'conf/customEnv') saveFile(CUSTOMENV,'conf/customEnv')
loadGame('custom_puzzle',true) loadGame('custom_puzzle',true)
@@ -71,13 +71,13 @@ function scene.keyDown(key,isRep)
saveFile(CUSTOMENV,'conf/customEnv') saveFile(CUSTOMENV,'conf/customEnv')
loadGame('custom_clear',true) loadGame('custom_clear',true)
end end
elseif key=="f"then elseif key=='f'then
SCN.go('custom_field','swipeD') SCN.go('custom_field','swipeD')
elseif key=="s"then elseif key=='s'then
SCN.go('custom_sequence','swipeD') SCN.go('custom_sequence','swipeD')
elseif key=="m"then elseif key=='m'then
SCN.go('custom_mission','swipeD') SCN.go('custom_mission','swipeD')
elseif key=="delete"then elseif key=='delete'then
if sure>.3 then if sure>.3 then
TABLE.cut(FIELD)TABLE.cut(BAG)TABLE.cut(MISSION) TABLE.cut(FIELD)TABLE.cut(BAG)TABLE.cut(MISSION)
FIELD[1]=DATA.newBoard() FIELD[1]=DATA.newBoard()
@@ -96,16 +96,16 @@ function scene.keyDown(key,isRep)
sure=1 sure=1
MES.new('info',text.sureReset) MES.new('info',text.sureReset)
end end
elseif key=="f1"then elseif key=='f1'then
SCN.go('mod','swipeD') SCN.go('mod','swipeD')
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:"..DATA.copyQuestArgs().."!" local str="Techmino Quest:"..DATA.copyQuestArgs().."!"
if #BAG>0 then str=str..DATA.copySequence()end if #BAG>0 then str=str..DATA.copySequence()end
str=str.."!" str=str.."!"
if #MISSION>0 then str=str..DATA.copyMission()end if #MISSION>0 then str=str..DATA.copyMission()end
sys.setClipboardText(str.."!"..DATA.copyBoards().."!") sys.setClipboardText(str.."!"..DATA.copyBoards().."!")
MES.new('check',text.exportSuccess) MES.new('check',text.exportSuccess)
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 args=STRING.split(str:sub((str:find(":")or 0)+1),"!") local args=STRING.split(str:sub((str:find(":")or 0)+1),"!")
if #args<4 then goto THROW_fail end if #args<4 then goto THROW_fail end
@@ -122,7 +122,7 @@ function scene.keyDown(key,isRep)
MES.new('check',text.importSuccess) MES.new('check',text.importSuccess)
do return end do return end
::THROW_fail::MES.new('error',text.dataCorrupted) ::THROW_fail::MES.new('error',text.dataCorrupted)
elseif key=="escape"then elseif key=='escape'then
saveFile(CUSTOMENV,'conf/customEnv') saveFile(CUSTOMENV,'conf/customEnv')
SCN.back() SCN.back()
else else
@@ -186,13 +186,13 @@ scene.widgetScrollHeight=450
scene.widgetList={ scene.widgetList={
WIDGET.newText{name='title', x=520,y=15,font=70,align='R'}, WIDGET.newText{name='title', x=520,y=15,font=70,align='R'},
WIDGET.newKey{name='reset', x=1110,y=90,w=230,h=90,color='R',code=pressKey"delete"}, WIDGET.newKey{name='reset', x=1110,y=90,w=230,h=90,color='R',code=pressKey'delete'},
WIDGET.newKey{name='mod', x=1110,y=200,w=230,h=90,color='Z',code=pressKey"f1"}, WIDGET.newKey{name='mod', x=1110,y=200,w=230,h=90,color='Z',code=pressKey'f1'},
--Mission / Field / Sequence --Mission / Field / Sequence
WIDGET.newKey{name='mission', x=170,y=180,w=240,h=80,color='N',font=25,code=pressKey"m"}, WIDGET.newKey{name='mission', x=170,y=180,w=240,h=80,color='N',font=25,code=pressKey'm'},
WIDGET.newKey{name='field', x=450,y=180,w=240,h=80,color='A',font=25,code=pressKey"f"}, WIDGET.newKey{name='field', x=450,y=180,w=240,h=80,color='A',font=25,code=pressKey'f'},
WIDGET.newKey{name='sequence', x=730,y=180,w=240,h=80,color='W',font=25,code=pressKey"s"}, WIDGET.newKey{name='sequence', x=730,y=180,w=240,h=80,color='W',font=25,code=pressKey's'},
WIDGET.newText{name='noMsn', x=50, y=220,align='L',color='H',hideF=function()return MISSION[1]end}, WIDGET.newText{name='noMsn', x=50, y=220,align='L',color='H',hideF=function()return MISSION[1]end},
WIDGET.newText{name='defSeq', x=610,y=220,align='L',color='H',hideF=function()return BAG[1]end}, WIDGET.newText{name='defSeq', x=610,y=220,align='L',color='H',hideF=function()return BAG[1]end},
@@ -217,11 +217,11 @@ scene.widgetList={
WIDGET.newSelector{name='hang', x=730,y=760,w=260,color='G',list=sList.hang,disp=CUSval('hang'),code=CUSsto('hang')}, WIDGET.newSelector{name='hang', x=730,y=760,w=260,color='G',list=sList.hang,disp=CUSval('hang'),code=CUSsto('hang')},
--Copy / Paste / Start --Copy / Paste / Start
WIDGET.newButton{name='copy', x=1070,y=300,w=310,h=70,color='lR',font=25,code=pressKey"cC"}, WIDGET.newButton{name='copy', x=1070,y=300,w=310,h=70,color='lR',font=25,code=pressKey'cC'},
WIDGET.newButton{name='paste', x=1070,y=380,w=310,h=70,color='lB',font=25,code=pressKey"cV"}, WIDGET.newButton{name='paste', x=1070,y=380,w=310,h=70,color='lB',font=25,code=pressKey'cV'},
WIDGET.newButton{name='clear', x=1070,y=460,w=310,h=70,color='lY',font=35,code=pressKey"return"}, WIDGET.newButton{name='clear', x=1070,y=460,w=310,h=70,color='lY',font=35,code=pressKey'return'},
WIDGET.newButton{name='puzzle', x=1070,y=540,w=310,h=70,color='lM',font=35,code=pressKey"return2",hideF=function()return #FIELD[1]==0 end}, WIDGET.newButton{name='puzzle', x=1070,y=540,w=310,h=70,color='lM',font=35,code=pressKey'return2',hideF=function()return #FIELD[1]==0 end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey"escape"}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey'escape'},
--Rule set --Rule set
WIDGET.newSelector{name='eventSet', x=1050,y=760,w=340,color='H',list=sList.eventSet,disp=CUSval('eventSet'),code=CUSsto('eventSet')}, WIDGET.newSelector{name='eventSet', x=1050,y=760,w=340,color='H',list=sList.eventSet,disp=CUSval('eventSet'),code=CUSsto('eventSet')},

View File

@@ -162,26 +162,26 @@ function scene.touchUp(x,y)scene.mouseUp(x,y,1)end
scene.touchMove=scene.mouseMove scene.touchMove=scene.mouseMove
function scene.keyDown(key) function scene.keyDown(key)
if key=="up"or key=="down"or key=="left"or key=="right"then if key=='up'or key=='down'or key=='left'or key=='right'then
if not penX or not penY then penX,penY=1,1 end if not penX or not penY then penX,penY=1,1 end
if key=="up"then if key=='up'then
if penY<20 then penY=penY+1 end if penY<20 then penY=penY+1 end
elseif key=="down"then elseif key=='down'then
if penY>1 then penY=penY-1 end if penY>1 then penY=penY-1 end
elseif key=="left"then elseif key=='left'then
if penX>1 then penX=penX-1 end if penX>1 then penX=penX-1 end
elseif key=="right"then elseif key=='right'then
if penX<10 then penX=penX+1 end if penX<10 then penX=penX+1 end
end end
if kb.isDown("space")then if kb.isDown('space')then
scene.keyDown("space") scene.keyDown('space')
end end
elseif key=="space"then elseif key=='space'then
if penX and penY then if penX and penY then
curPen=1 curPen=1
_pTouch(penX,penY) _pTouch(penX,penY)
end end
elseif key=="delete"then elseif key=='delete'then
if sure>.3 then if sure>.3 then
FIELD[page]=DATA.newBoard() FIELD[page]=DATA.newBoard()
sure=0 sure=0
@@ -190,12 +190,12 @@ function scene.keyDown(key)
sure=1 sure=1
MES.new('info',text.sureReset) MES.new('info',text.sureReset)
end end
elseif key=="j"then elseif key=='j'then
demo=not demo demo=not demo
elseif key=="k"then elseif key=='k'then
ins(FIELD[page],1,{21,21,21,21,21,21,21,21,21,21}) ins(FIELD[page],1,{21,21,21,21,21,21,21,21,21,21})
SFX.play('blip') SFX.play('blip')
elseif key=="l"then elseif key=='l'then
local F=FIELD[page] local F=FIELD[page]
local cleared=false local cleared=false
for i=#F,1,-1 do for i=#F,1,-1 do
@@ -212,12 +212,12 @@ function scene.keyDown(key)
SFX.play('clear_3',.8) SFX.play('clear_3',.8)
SFX.play('fall',.8) SFX.play('fall',.8)
end end
elseif key=="n"then elseif key=='n'then
ins(FIELD,page+1,DATA.newBoard(FIELD[page])) ins(FIELD,page+1,DATA.newBoard(FIELD[page]))
page=page+1 page=page+1
SFX.play('blip_1',.8) SFX.play('blip_1',.8)
SYSFX.newShade(3,200,60,300,600,.5,1,.5) SYSFX.newShade(3,200,60,300,600,.5,1,.5)
elseif key=="m"then elseif key=='m'then
rem(FIELD,page) rem(FIELD,page)
page=max(page-1,1) page=max(page-1,1)
if not FIELD[1]then if not FIELD[1]then
@@ -226,10 +226,10 @@ function scene.keyDown(key)
SYSFX.newShade(3,200,60,300,600,1,.5,.5) SYSFX.newShade(3,200,60,300,600,1,.5,.5)
SFX.play('clear_4',.8) SFX.play('clear_4',.8)
SFX.play('fall',.8) SFX.play('fall',.8)
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
sys.setClipboardText("Techmino Field:"..DATA.copyBoard(page)) sys.setClipboardText("Techmino Field:"..DATA.copyBoard(page))
MES.new('check',text.exportSuccess) MES.new('check',text.exportSuccess)
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 p=str:find(":")--ptr* local p=str:find(":")--ptr*
if p then if p then
@@ -243,11 +243,11 @@ function scene.keyDown(key)
else else
MES.new('error',text.dataCorrupted) MES.new('error',text.dataCorrupted)
end end
elseif key=="pageup"then elseif key=='pageup'then
page=max(page-1,1) page=max(page-1,1)
elseif key=="pagedown"then elseif key=='pagedown'then
page=min(page+1,#FIELD) page=min(page+1,#FIELD)
elseif key=="escape"then elseif key=='escape'then
if curPen then if curPen then
curPen=false curPen=false
penPath={} penPath={}
@@ -259,7 +259,7 @@ function scene.keyDown(key)
end end
end end
function scene.keyUp(key) function scene.keyUp(key)
if key=="space"then if key=='space'then
_pDraw() _pDraw()
curPen=false curPen=false
end end
@@ -480,18 +480,18 @@ scene.widgetList={
WIDGET.newButton{name='any', x=600, y=400,w=120,color='lH', font=40,code=_setPen(0)}, WIDGET.newButton{name='any', x=600, y=400,w=120,color='lH', font=40,code=_setPen(0)},
WIDGET.newButton{name='space', x=730, y=400,w=120,color='H', font=55,code=_setPen(-1),fText=CHAR.icon.cross_thick}, WIDGET.newButton{name='space', x=730, y=400,w=120,color='H', font=55,code=_setPen(-1),fText=CHAR.icon.cross_thick},
WIDGET.newButton{name='smart', x=860, y=400,w=120,color='lG', font=30,code=_setPen(-2)}, WIDGET.newButton{name='smart', x=860, y=400,w=120,color='lG', font=30,code=_setPen(-2)},
WIDGET.newButton{name='push', x=990, y=400,w=120,h=120,color='lY',font=20,code=pressKey"k"}, WIDGET.newButton{name='push', x=990, y=400,w=120,h=120,color='lY',font=20,code=pressKey'k'},
WIDGET.newButton{name='del', x=1120,y=400,w=120,h=120,color='lY',font=20,code=pressKey"l"}, WIDGET.newButton{name='del', x=1120,y=400,w=120,h=120,color='lY',font=20,code=pressKey'l'},
WIDGET.newButton{name='copy', x=730, y=530,w=120,color='lR',font=60,fText=CHAR.icon.export,code=pressKey"cC"}, WIDGET.newButton{name='copy', x=730, y=530,w=120,color='lR',font=60,fText=CHAR.icon.export,code=pressKey'cC'},
WIDGET.newButton{name='paste', x=860, y=530,w=120,color='lB',font=60,fText=CHAR.icon.import,code=pressKey"cV"}, WIDGET.newButton{name='paste', x=860, y=530,w=120,color='lB',font=60,fText=CHAR.icon.import,code=pressKey'cV'},
WIDGET.newButton{name='clear', x=990, y=530,w=120,color='Z', font=70,fText=CHAR.icon.trash,code=pressKey"delete"}, WIDGET.newButton{name='clear', x=990, y=530,w=120,color='Z', font=70,fText=CHAR.icon.trash,code=pressKey'delete'},
WIDGET.newSwitch{name='demo', x=755, y=640,lim=220,disp=function()return demo end,code=function()demo=not demo end}, WIDGET.newSwitch{name='demo', x=755, y=640,lim=220,disp=function()return demo end,code=function()demo=not demo end},
WIDGET.newButton{name='newPg', x=100, y=110,w=160,h=110,color='N', font=20,code=pressKey"n"}, WIDGET.newButton{name='newPg', x=100, y=110,w=160,h=110,color='N', font=20,code=pressKey'n'},
WIDGET.newButton{name='delPg', x=100, y=230,w=160,h=110,color='lR',font=20,code=pressKey"m"}, WIDGET.newButton{name='delPg', x=100, y=230,w=160,h=110,color='lR',font=20,code=pressKey'm'},
WIDGET.newButton{name='prevPg', x=100, y=350,w=160,h=110,color='lG',font=20,code=pressKey"pageup",hideF=function()return page==1 end}, WIDGET.newButton{name='prevPg', x=100, y=350,w=160,h=110,color='lG',font=20,code=pressKey'pageup',hideF=function()return page==1 end},
WIDGET.newButton{name='nextPg', x=100, y=470,w=160,h=110,color='lG',font=20,code=pressKey"pagedown",hideF=function()return page==#FIELD end}, WIDGET.newButton{name='nextPg', x=100, y=470,w=160,h=110,color='lG',font=20,code=pressKey'pagedown',hideF=function()return page==#FIELD end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -22,7 +22,7 @@ end
local ENUM_MISSION=ENUM_MISSION local ENUM_MISSION=ENUM_MISSION
local legalInput={Z=true,S=true,J=true,L=true,T=true,O=true,I=true,A=true,_=true,P=true} local legalInput={Z=true,S=true,J=true,L=true,T=true,O=true,I=true,A=true,_=true,P=true}
function scene.keyDown(key) function scene.keyDown(key)
if key=="left"then if key=='left'then
local p=cur local p=cur
if p==0 then if p==0 then
cur=#MISSION cur=#MISSION
@@ -32,7 +32,7 @@ function scene.keyDown(key)
until MISSION[p]~=MISSION[cur] until MISSION[p]~=MISSION[cur]
cur=p cur=p
end end
elseif key=="right"then elseif key=='right'then
local p=cur local p=cur
if p==#MISSION then if p==#MISSION then
cur=0 cur=0
@@ -42,7 +42,7 @@ function scene.keyDown(key)
until MISSION[p+1]~=MISSION[cur+1] until MISSION[p+1]~=MISSION[cur+1]
cur=p cur=p
end end
elseif key=="ten"then elseif key=='ten'then
for _=1,10 do for _=1,10 do
local p=cur local p=cur
if p==#MISSION then break end if p==#MISSION then break end
@@ -51,17 +51,17 @@ function scene.keyDown(key)
until MISSION[p+1]~=MISSION[cur+1] until MISSION[p+1]~=MISSION[cur+1]
cur=p cur=p
end end
elseif key=="backspace"then elseif key=='backspace'then
if #input>0 then if #input>0 then
input="" input=""
elseif cur>0 then elseif cur>0 then
rem(MISSION,cur) rem(MISSION,cur)
cur=cur-1 cur=cur-1
if cur>0 and MISSION[cur]==MISSION[cur+1]then if cur>0 and MISSION[cur]==MISSION[cur+1]then
scene.keyDown("right") scene.keyDown('right')
end end
end end
elseif key=="delete"then elseif key=='delete'then
if sure>.3 then if sure>.3 then
TABLE.cut(MISSION) TABLE.cut(MISSION)
cur=0 cur=0
@@ -71,12 +71,12 @@ function scene.keyDown(key)
sure=1 sure=1
MES.new('info',text.sureReset) MES.new('info',text.sureReset)
end end
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
if #MISSION>0 then if #MISSION>0 then
sys.setClipboardText("Techmino Target:"..DATA.copyMission()) sys.setClipboardText("Techmino Target:"..DATA.copyMission())
MES.new('check',text.exportSuccess) MES.new('check',text.exportSuccess)
end end
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 p=str:find(":")--ptr* local p=str:find(":")--ptr*
if p then if p then
@@ -91,7 +91,7 @@ function scene.keyDown(key)
else else
MES.new('error',text.dataCorrupted) MES.new('error',text.dataCorrupted)
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
elseif type(key)=='number'then elseif type(key)=='number'then
local p=cur+1 local p=cur+1
@@ -99,7 +99,7 @@ function scene.keyDown(key)
ins(MISSION,p,key) ins(MISSION,p,key)
cur=p cur=p
else else
if key=="space"then if key=='space'then
key="_" key="_"
else else
key=string.upper(key) key=string.upper(key)
@@ -227,13 +227,13 @@ scene.widgetList={
WIDGET.newKey{name='O4', x=600,y=640,w=90,font=50,code=pressKey(64)}, WIDGET.newKey{name='O4', x=600,y=640,w=90,font=50,code=pressKey(64)},
WIDGET.newKey{name='I4', x=700,y=640,w=90,font=50,code=pressKey(74)}, WIDGET.newKey{name='I4', x=700,y=640,w=90,font=50,code=pressKey(74)},
WIDGET.newKey{name='left', x=800, y=440,w=90, color='lG',font=55,code=pressKey"left", fText=CHAR.key.left}, WIDGET.newKey{name='left', x=800, y=440,w=90, color='lG',font=55,code=pressKey'left', fText=CHAR.key.left},
WIDGET.newKey{name='right', x=900, y=440,w=90, color='lG',font=55,code=pressKey"right", fText=CHAR.key.right}, WIDGET.newKey{name='right', x=900, y=440,w=90, color='lG',font=55,code=pressKey'right', fText=CHAR.key.right},
WIDGET.newKey{name='ten', x=1000,y=440,w=90, color='lG',font=55,code=pressKey"ten", fText=CHAR.key.macTab}, WIDGET.newKey{name='ten', x=1000,y=440,w=90, color='lG',font=55,code=pressKey'ten', fText=CHAR.key.macTab},
WIDGET.newKey{name='backsp', x=1000,y=540,w=90, color='lY',font=55,code=pressKey"backspace",fText=CHAR.key.backspace}, WIDGET.newKey{name='backsp', x=1000,y=540,w=90, color='lY',font=55,code=pressKey'backspace',fText=CHAR.key.backspace},
WIDGET.newKey{name='reset', x=1000,y=640,w=90, color='lY',font=50,code=pressKey"delete", fText=CHAR.icon.trash}, WIDGET.newKey{name='reset', x=1000,y=640,w=90, color='lY',font=50,code=pressKey'delete', fText=CHAR.icon.trash},
WIDGET.newButton{name='copy', x=1140,y=440,w=170,h=80,color='lR',font=50,code=pressKey"cC", fText=CHAR.icon.export,hideF=function()return #MISSION==0 end}, WIDGET.newButton{name='copy', x=1140,y=440,w=170,h=80,color='lR',font=50,code=pressKey'cC', fText=CHAR.icon.export,hideF=function()return #MISSION==0 end},
WIDGET.newButton{name='paste', x=1140,y=540,w=170,h=80,color='lB',font=50,code=pressKey"cV", fText=CHAR.icon.import}, WIDGET.newButton{name='paste', x=1140,y=540,w=170,h=80,color='lB',font=50,code=pressKey'cV', fText=CHAR.icon.import},
WIDGET.newSwitch{name='mission',x=1150,y=340,lim=280,disp=CUSval('missionKill'),code=CUSrev('missionKill')}, WIDGET.newSwitch{name='mission',x=1150,y=340,lim=280,disp=CUSval('missionKill'),code=CUSrev('missionKill')},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},

View File

@@ -31,7 +31,7 @@ local minoKey2={
z=8,s=9,t=14,j=19,l=20,i=25,['-']=26,o=29, z=8,s=9,t=14,j=19,l=20,i=25,['-']=26,o=29,
} }
function scene.keyDown(key) function scene.keyDown(key)
if key=="left"then if key=='left'then
local p=cur local p=cur
if p==0 then if p==0 then
cur=#BAG cur=#BAG
@@ -41,7 +41,7 @@ function scene.keyDown(key)
until BAG[p]~=BAG[cur] until BAG[p]~=BAG[cur]
cur=p cur=p
end end
elseif key=="right"then elseif key=='right'then
local p=cur local p=cur
if p==#BAG then if p==#BAG then
cur=0 cur=0
@@ -51,7 +51,7 @@ function scene.keyDown(key)
until BAG[p+1]~=BAG[cur+1] until BAG[p+1]~=BAG[cur+1]
cur=p cur=p
end end
elseif key=="ten"then elseif key=='ten'then
for _=1,10 do for _=1,10 do
local p=cur local p=cur
if p==#BAG then break end if p==#BAG then break end
@@ -60,12 +60,12 @@ function scene.keyDown(key)
until BAG[p+1]~=BAG[cur+1] until BAG[p+1]~=BAG[cur+1]
cur=p cur=p
end end
elseif key=="backspace"then elseif key=='backspace'then
if cur>0 then if cur>0 then
rem(BAG,cur) rem(BAG,cur)
cur=cur-1 cur=cur-1
end end
elseif key=="delete"then elseif key=='delete'then
if sure>.3 then if sure>.3 then
TABLE.cut(BAG) TABLE.cut(BAG)
cur=0 cur=0
@@ -75,17 +75,17 @@ function scene.keyDown(key)
sure=1 sure=1
MES.new('info',text.sureReset) MES.new('info',text.sureReset)
end end
elseif key=="="then elseif key=='='then
local l={1,2,3,4,5,6,7} local l={1,2,3,4,5,6,7}
repeat scene.keyDown(rem(l,math.random(#l)))until not l[1] repeat scene.keyDown(rem(l,math.random(#l)))until not l[1]
elseif key=="tab"then elseif key=='tab'then
WIDGET.active.sequence:scroll(kb.isDown("lshift","rshift")and -1 or 1) WIDGET.active.sequence:scroll(kb.isDown('lshift','rshift')and -1 or 1)
elseif key=="c"and kb.isDown("lctrl","rctrl")or key=="cC"then elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
if #BAG>0 then if #BAG>0 then
sys.setClipboardText("Techmino SEQ:"..DATA.copySequence()) sys.setClipboardText("Techmino SEQ:"..DATA.copySequence())
MES.new('check',text.exportSuccess) MES.new('check',text.exportSuccess)
end end
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 p=str:find(":")--ptr* local p=str:find(":")--ptr*
if p then if p then
@@ -102,13 +102,13 @@ function scene.keyDown(key)
cur=0 cur=0
MES.new('error',text.dataCorrupted) MES.new('error',text.dataCorrupted)
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
elseif type(key)=='number'then elseif type(key)=='number'then
cur=cur+1 cur=cur+1
ins(BAG,cur,key) ins(BAG,cur,key)
elseif #key==1 then elseif #key==1 then
key=(kb.isDown("lshift","lalt","rshift","ralt")and minoKey2 or minoKey)[key] key=(kb.isDown('lshift','lalt','rshift','ralt')and minoKey2 or minoKey)[key]
if key then if key then
local p=cur+1 local p=cur+1
while BAG[p]==key do p=p+1 end while BAG[p]==key do p=p+1 end
@@ -198,11 +198,11 @@ scene.widgetList={
WIDGET.newKey{name='T', x=440,y=460,w=80,font=90,fText=CHAR.mino.T,code=pressKey(5)}, WIDGET.newKey{name='T', x=440,y=460,w=80,font=90,fText=CHAR.mino.T,code=pressKey(5)},
WIDGET.newKey{name='O', x=520,y=460,w=80,font=90,fText=CHAR.mino.O,code=pressKey(6)}, WIDGET.newKey{name='O', x=520,y=460,w=80,font=90,fText=CHAR.mino.O,code=pressKey(6)},
WIDGET.newKey{name='I', x=600,y=460,w=80,font=90,fText=CHAR.mino.I,code=pressKey(7)}, WIDGET.newKey{name='I', x=600,y=460,w=80,font=90,fText=CHAR.mino.I,code=pressKey(7)},
WIDGET.newKey{name='left', x=680,y=460,w=80,color='lG',font=55,fText=CHAR.key.left, code=pressKey"left"}, WIDGET.newKey{name='left', x=680,y=460,w=80,color='lG',font=55,fText=CHAR.key.left, code=pressKey'left'},
WIDGET.newKey{name='right', x=760,y=460,w=80,color='lG',font=55,fText=CHAR.key.right, code=pressKey"right"}, WIDGET.newKey{name='right', x=760,y=460,w=80,color='lG',font=55,fText=CHAR.key.right, code=pressKey'right'},
WIDGET.newKey{name='ten', x=840,y=460,w=80,color='lG',font=55,fText=CHAR.key.macTab, code=pressKey"ten"}, WIDGET.newKey{name='ten', x=840,y=460,w=80,color='lG',font=55,fText=CHAR.key.macTab, code=pressKey'ten'},
WIDGET.newKey{name='backsp',x=920,y=460,w=80,color='lY',font=55,fText=CHAR.key.backspace,code=pressKey"backspace"}, WIDGET.newKey{name='backsp',x=920,y=460,w=80,color='lY',font=55,fText=CHAR.key.backspace,code=pressKey'backspace'},
WIDGET.newKey{name='reset', x=1000,y=460,w=80,color='lY',font=50,fText=CHAR.icon.trash, code=pressKey"delete"}, WIDGET.newKey{name='reset', x=1000,y=460,w=80,color='lY',font=50,fText=CHAR.icon.trash, code=pressKey'delete'},
WIDGET.newKey{name='Z5', x=120,y=550,w=80,color='lH',font=65,fText=CHAR.mino.Z5, code=pressKey(8)}, WIDGET.newKey{name='Z5', x=120,y=550,w=80,color='lH',font=65,fText=CHAR.mino.Z5, code=pressKey(8)},
WIDGET.newKey{name='S5', x=200,y=550,w=80,color='lH',font=65,fText=CHAR.mino.S5, code=pressKey(9)}, WIDGET.newKey{name='S5', x=200,y=550,w=80,color='lH',font=65,fText=CHAR.mino.S5, code=pressKey(9)},
@@ -215,7 +215,7 @@ scene.widgetList={
WIDGET.newKey{name='V', x=760,y=550,w=80,color='lH',font=65,fText=CHAR.mino.V, code=pressKey(16)}, WIDGET.newKey{name='V', x=760,y=550,w=80,color='lH',font=65,fText=CHAR.mino.V, code=pressKey(16)},
WIDGET.newKey{name='I3', x=840,y=550,w=80,color='H',font=90,fText=CHAR.mino.I3, code=pressKey(26)}, WIDGET.newKey{name='I3', x=840,y=550,w=80,color='H',font=90,fText=CHAR.mino.I3, code=pressKey(26)},
WIDGET.newKey{name='C', x=920,y=550,w=80,color='H',font=90,fText=CHAR.mino.C, code=pressKey(27)}, WIDGET.newKey{name='C', x=920,y=550,w=80,color='H',font=90,fText=CHAR.mino.C, code=pressKey(27)},
WIDGET.newKey{name='rnd', x=1000,y=550,w=80,color='R',font=70,fText=CHAR.icon.onebag, code=pressKey"="}, WIDGET.newKey{name='rnd', x=1000,y=550,w=80,color='R',font=70,fText=CHAR.icon.onebag, code=pressKey'='},
WIDGET.newKey{name='W', x=120,y=640,w=80,color='lH',font=65,fText=CHAR.mino.W, code=pressKey(17)}, WIDGET.newKey{name='W', x=120,y=640,w=80,color='lH',font=65,fText=CHAR.mino.W, code=pressKey(17)},
WIDGET.newKey{name='X', x=200,y=640,w=80,color='lH',font=65,fText=CHAR.mino.X, code=pressKey(18)}, WIDGET.newKey{name='X', x=200,y=640,w=80,color='lH',font=65,fText=CHAR.mino.X, code=pressKey(18)},
@@ -230,8 +230,8 @@ scene.widgetList={
WIDGET.newKey{name='O1', x=920,y=640,w=80,color='dH',font=100,fText=CHAR.mino.O1, code=pressKey(29)}, WIDGET.newKey{name='O1', x=920,y=640,w=80,color='dH',font=100,fText=CHAR.mino.O1, code=pressKey(29)},
WIDGET.newButton{name='copy', x=1140,y=460,w=170,h=80,color='lR',font=50,fText=CHAR.icon.export,code=pressKey"cC",hideF=function()return #BAG==0 end}, WIDGET.newButton{name='copy', x=1140,y=460,w=170,h=80,color='lR',font=50,fText=CHAR.icon.export,code=pressKey'cC',hideF=function()return #BAG==0 end},
WIDGET.newButton{name='paste',x=1140,y=550,w=170,h=80,color='lB',font=50,fText=CHAR.icon.import,code=pressKey"cV"}, WIDGET.newButton{name='paste',x=1140,y=550,w=170,h=80,color='lB',font=50,fText=CHAR.icon.import,code=pressKey'cV'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -13,7 +13,7 @@ function scene.sceneInit()
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="escape"then if key=='escape'then
pauseGame() pauseGame()
end end
end end

View File

@@ -95,7 +95,7 @@ function scene.wheelMoved(_,y)
WHEELMOV(y) WHEELMOV(y)
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="up"then if key=='up'then
if selected and selected>1 then if selected and selected>1 then
selected=selected-1 selected=selected-1
if selected<scrollPos+1 then if selected<scrollPos+1 then
@@ -103,7 +103,7 @@ function scene.keyDown(key)
end end
scene.widgetList.copy.hide=false scene.widgetList.copy.hide=false
end end
elseif key=="down"then elseif key=='down'then
if selected and selected<#_getList()then if selected and selected<#_getList()then
selected=selected+1 selected=selected+1
if selected>scrollPos+15 then if selected>scrollPos+15 then
@@ -111,28 +111,28 @@ function scene.keyDown(key)
end end
scene.widgetList.copy.hide=false scene.widgetList.copy.hide=false
end end
elseif key=="left"or key=="pageup"then elseif key=='left'or key=='pageup'then
for _=1,12 do scene.keyDown("up")end for _=1,12 do scene.keyDown('up')end
elseif key=="right"or key=="pagedown"then elseif key=='right'or key=='pagedown'then
for _=1,12 do scene.keyDown("down")end for _=1,12 do scene.keyDown('down')end
elseif key=="application"then elseif key=='application'then
local url=_getList()[selected].url local url=_getList()[selected].url
if url then love.system.openURL(url)end if url then love.system.openURL(url)end
elseif key=="delete"then elseif key=='delete'then
if inputBox:hasText()then if inputBox:hasText()then
_clearResult() _clearResult()
inputBox:clear() inputBox:clear()
SFX.play('hold') SFX.play('hold')
end end
elseif key=="backspace"then elseif key=='backspace'then
WIDGET.keyPressed("backspace") WIDGET.keyPressed("backspace")
elseif key=="escape"then elseif key=='escape'then
if inputBox:hasText()then if inputBox:hasText()then
scene.keyDown("delete") scene.keyDown('delete')
else else
SCN.back() SCN.back()
end end
elseif key=="c"and love.keyboard.isDown("lctrl","rctrl")or key=="cC"then elseif key=='c'and love.keyboard.isDown('lctrl','rctrl')or key=='cC'then
local t=_getList()[selected] local t=_getList()[selected]
t=t.title_Org..":\n"..t.content_Org..(t.url and"\n[ "..t.url.." ]\n"or"\n")..text.dictNote t=t.title_Org..":\n"..t.content_Org..(t.url and"\n[ "..t.url.." ]\n"or"\n")..text.dictNote
love.system.setClipboardText(t) love.system.setClipboardText(t)
@@ -214,12 +214,12 @@ scene.widgetList={
WIDGET.newText{name='book', x=20,y=15,font=70,align='L',fText=CHAR.icon.zBook}, WIDGET.newText{name='book', x=20,y=15,font=70,align='L',fText=CHAR.icon.zBook},
WIDGET.newText{name='title', x=100,y=15,font=70,align='L'}, WIDGET.newText{name='title', x=100,y=15,font=70,align='L'},
inputBox, inputBox,
WIDGET.newKey{name='link', x=1120,y=655,w=80,font=55,fText=CHAR.icon.globe, code=pressKey"application",hideF=function()return not _getList()[selected].url end}, WIDGET.newKey{name='link', x=1120,y=655,w=80,font=55,fText=CHAR.icon.globe, code=pressKey'application',hideF=function()return not _getList()[selected].url end},
WIDGET.newKey{name='copy', x=1210,y=655,w=80,font=50,fText=CHAR.icon.copy, code=pressKey"cC"}, WIDGET.newKey{name='copy', x=1210,y=655,w=80,font=50,fText=CHAR.icon.copy, code=pressKey'cC'},
WIDGET.newKey{name='up', x=1120,y=475,w=80,font=50,fText=CHAR.key.up, code=pressKey"up",hide=not MOBILE}, WIDGET.newKey{name='up', x=1120,y=475,w=80,font=50,fText=CHAR.key.up, code=pressKey'up',hide=not MOBILE},
WIDGET.newKey{name='down', x=1120,y=565,w=80,font=50,fText=CHAR.key.down, code=pressKey"down",hide=not MOBILE}, WIDGET.newKey{name='down', x=1120,y=565,w=80,font=50,fText=CHAR.key.down, code=pressKey'down',hide=not MOBILE},
WIDGET.newKey{name='pageup', x=1210,y=475,w=80,font=50,fText=CHAR.icon.toUp, code=pressKey"pageup",hide=not MOBILE}, WIDGET.newKey{name='pageup', x=1210,y=475,w=80,font=50,fText=CHAR.icon.toUp, code=pressKey'pageup',hide=not MOBILE},
WIDGET.newKey{name='pagedown',x=1210,y=565,w=80,font=50,fText=CHAR.icon.toDown,code=pressKey"pagedown",hide=not MOBILE}, WIDGET.newKey{name='pagedown',x=1210,y=565,w=80,font=50,fText=CHAR.icon.toDown,code=pressKey'pagedown',hide=not MOBILE},
WIDGET.newButton{name='back', x=1165,y=60,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1165,y=60,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -203,22 +203,22 @@ function scene.touchMove()
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if replaying then if replaying then
if key=="space"then if key=='space'then
if not isRep then if not isRep then
gameRate=gameRate==0 and 1 or 0 gameRate=gameRate==0 and 1 or 0
end end
_updateRepButtons() _updateRepButtons()
elseif key=="left"then elseif key=='left'then
if not isRep then if not isRep then
_speedDown() _speedDown()
end end
elseif key=="right"then elseif key=='right'then
if gameRate==0 then if gameRate==0 then
_step() _step()
elseif not isRep then elseif not isRep then
_speedUp() _speedUp()
end end
elseif key=="escape"then elseif key=='escape'then
pauseGame() pauseGame()
end end
else else
@@ -226,16 +226,16 @@ function scene.keyDown(key,isRep)
return return
elseif _checkGameKeyDown(key)then elseif _checkGameKeyDown(key)then
if GAME.tasUsed then if GAME.tasUsed then
if key=="f1"then if key=='f1'then
if not isRep then if not isRep then
gameRate=gameRate==0 and .125 or 0 gameRate=gameRate==0 and .125 or 0
end end
_updateRepButtons() _updateRepButtons()
elseif key=="f2"then elseif key=='f2'then
if not isRep then if not isRep then
_speedDown() _speedDown()
end end
elseif key=="f3"then elseif key=='f3'then
if gameRate==0 then if gameRate==0 then
_step() _step()
elseif not isRep then elseif not isRep then
@@ -243,7 +243,7 @@ function scene.keyDown(key,isRep)
end end
end end
end end
if key=="escape"then if key=='escape'then
pauseGame() pauseGame()
end end
end end
@@ -269,7 +269,7 @@ function scene.gamepadDown(key)
else else
_restart() _restart()
end end
elseif key=="back"then elseif key=='back'then
pauseGame() pauseGame()
end end
end end

View File

@@ -9,15 +9,15 @@ function scene.wheelMoved(_,y)
WHEELMOV(y) WHEELMOV(y)
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="up"then if key=='up'then
WIDGET.active.texts:scroll(-5) WIDGET.active.texts:scroll(-5)
elseif key=="down"then elseif key=='down'then
WIDGET.active.texts:scroll(5) WIDGET.active.texts:scroll(5)
elseif key=="pageup"then elseif key=='pageup'then
WIDGET.active.texts:scroll(-20) WIDGET.active.texts:scroll(-20)
elseif key=="pagedown"then elseif key=='pagedown'then
WIDGET.active.texts:scroll(20) WIDGET.active.texts:scroll(20)
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end

View File

@@ -179,7 +179,7 @@ scene.mouseDown=scene.touchDown
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="z"or key=="x"then if key=='z'or key=='x'then
love.mousepressed(love.mouse.getPosition()) love.mousepressed(love.mouse.getPosition())
elseif #key==1 then elseif #key==1 then
if("12345678"):find(key,nil,true)then if("12345678"):find(key,nil,true)then
@@ -187,21 +187,21 @@ function scene.keyDown(key,isRep)
else else
key=("hjkluiop"):find(key,nil,true) key=("hjkluiop"):find(key,nil,true)
if key then if key then
if isDown("q")then press(key,1)end if isDown('q')then press(key,1)end
if isDown("w")then press(key,2)end if isDown('w')then press(key,2)end
if isDown("e")then press(key,3)end if isDown('e')then press(key,3)end
if isDown("r")then press(key,4)end if isDown('r')then press(key,4)end
if isDown("a")then press(key,5)end if isDown('a')then press(key,5)end
if isDown("s")then press(key,6)end if isDown('s')then press(key,6)end
if isDown("d")then press(key,7)end if isDown('d')then press(key,7)end
if isDown("f")then press(key,8)end if isDown('f')then press(key,8)end
end end
end end
elseif key=="tab"then elseif key=='tab'then
SCN.swapTo('music','none') SCN.swapTo('music','none')
elseif key=="space"then elseif key=='space'then
showLabel=not showLabel showLabel=not showLabel
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
@@ -277,8 +277,8 @@ scene.widgetList={
WIDGET.newSlider{name='bgm', x=1000,y=80, lim=130,w=250,disp=SETval('bgm'),code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end}, WIDGET.newSlider{name='bgm', x=1000,y=80, lim=130,w=250,disp=SETval('bgm'),code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end},
WIDGET.newSlider{name='sfx', x=1000,y=150,lim=130,w=250,disp=SETval('sfx'),code=function(v)SETTING.sfx=v SFX.setVol(SETTING.sfx)end}, WIDGET.newSlider{name='sfx', x=1000,y=150,lim=130,w=250,disp=SETval('sfx'),code=function(v)SETTING.sfx=v SFX.setVol(SETTING.sfx)end},
WIDGET.newSlider{name='voc', x=1000,y=220,lim=130,w=250,disp=SETval('voc'),code=function(v)SETTING.voc=v VOC.setVol(SETTING.voc)end}, WIDGET.newSlider{name='voc', x=1000,y=220,lim=130,w=250,disp=SETval('voc'),code=function(v)SETTING.voc=v VOC.setVol(SETTING.voc)end},
WIDGET.newSwitch{name='label',x=1200,y=290,lim=160,disp=function()return showLabel end,code=pressKey"space",}, WIDGET.newSwitch{name='label',x=1200,y=290,lim=160,disp=function()return showLabel end,code=pressKey'space',},
WIDGET.newButton{name='music',x=1140,y=540,w=170,h=80,font=40,code=pressKey"tab"}, WIDGET.newButton{name='music',x=1140,y=540,w=170,h=80,font=40,code=pressKey'tab'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -13,15 +13,15 @@ function scene.wheelMoved(_,y)
WHEELMOV(y) WHEELMOV(y)
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="up"then if key=='up'then
WIDGET.active.texts:scroll(-5) WIDGET.active.texts:scroll(-5)
elseif key=="down"then elseif key=='down'then
WIDGET.active.texts:scroll(5) WIDGET.active.texts:scroll(5)
elseif key=="pageup"then elseif key=='pageup'then
WIDGET.active.texts:scroll(-20) WIDGET.active.texts:scroll(-20)
elseif key=="pagedown"then elseif key=='pagedown'then
WIDGET.active.texts:scroll(20) WIDGET.active.texts:scroll(20)
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end

View File

@@ -139,7 +139,7 @@ function scene.mouseDown()
end end
scene.touchDown=scene.mouseDown scene.touchDown=scene.mouseDown
function scene.keyDown(key) function scene.keyDown(key)
if key=="escape"then if key=='escape'then
love.event.quit() love.event.quit()
else else
scene.mouseDown() scene.mouseDown()

View File

@@ -59,15 +59,15 @@ local function _testButton(n)
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="1"then if key=='1'then
if _testButton(1)then if _testButton(1)then
SCN.go('mode') SCN.go('mode')
end end
elseif key=="q"then elseif key=='q'then
if _testButton(2)then if _testButton(2)then
loadGame(STAT.lastPlay,true) loadGame(STAT.lastPlay,true)
end end
elseif key=="a"then elseif key=='a'then
if _testButton(3)then if _testButton(3)then
if WS.status('app')=='running'then if WS.status('app')=='running'then
NET.tryLogin(false) NET.tryLogin(false)
@@ -77,45 +77,45 @@ function scene.keyDown(key,isRep)
MES.new('info',text.wsConnecting) MES.new('info',text.wsConnecting)
end end
end end
elseif key=="z"then elseif key=='z'then
if _testButton(4)then if _testButton(4)then
SCN.go('customGame') SCN.go('customGame')
end end
elseif key=="-"then elseif key=='-'then
if _testButton(5)then if _testButton(5)then
SCN.go('setting_game') SCN.go('setting_game')
end end
elseif key=="p"then elseif key=='p'then
if _testButton(6)then if _testButton(6)then
SCN.go('stat') SCN.go('stat')
end end
elseif key=="l"then elseif key=='l'then
if _testButton(7)then if _testButton(7)then
SCN.go('dict') SCN.go('dict')
end end
elseif key==","then elseif key==','then
if _testButton(8)then if _testButton(8)then
SCN.go('replays') SCN.go('replays')
end end
elseif key=="2"then elseif key=='2'then
if _testButton(9)then if _testButton(9)then
SCN.go('music') SCN.go('music')
end end
elseif key=="3"then elseif key=='3'then
if _testButton(10)then if _testButton(10)then
SCN.go('lang') SCN.go('lang')
end end
elseif key=="x"then elseif key=='x'then
if _testButton(11)then if _testButton(11)then
SCN.go('about') SCN.go('about')
end end
elseif key=="m"then elseif key=='m'then
if _testButton(12)then if _testButton(12)then
SCN.go('manual') SCN.go('manual')
end end
elseif key=="c"then elseif key=='c'then
enterConsole() enterConsole()
elseif key=="escape"then elseif key=='escape'then
if TIME()-lastQuitTime<1 then if TIME()-lastQuitTime<1 then
VOC.play('bye') VOC.play('bye')
SCN.swapTo('quit','slowFade') SCN.swapTo('quit','slowFade')
@@ -184,20 +184,20 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newButton{name='offline',x=-1200,y=210,w=800,h=100,color='lR',font=45,align='R',edge=30,code=pressKey"1"}, WIDGET.newButton{name='offline',x=-1200,y=210,w=800,h=100,color='lR',font=45,align='R',edge=30,code=pressKey'1'},
WIDGET.newButton{name='qplay', x=-1200,y=330,w=800,h=100,color='lM',font=40,align='R',edge=30,code=pressKey"q"}, WIDGET.newButton{name='qplay', x=-1200,y=330,w=800,h=100,color='lM',font=40,align='R',edge=30,code=pressKey'q'},
WIDGET.newButton{name='online', x=-1200,y=450,w=800,h=100,color='lV',font=45,align='R',edge=30,code=pressKey"a"}, WIDGET.newButton{name='online', x=-1200,y=450,w=800,h=100,color='lV',font=45,align='R',edge=30,code=pressKey'a'},
WIDGET.newButton{name='custom', x=-1200,y=570,w=800,h=100,color='lS',font=45,align='R',edge=30,code=pressKey"z"}, WIDGET.newButton{name='custom', x=-1200,y=570,w=800,h=100,color='lS',font=45,align='R',edge=30,code=pressKey'z'},
WIDGET.newButton{name='setting',x=2480,y=210,w=800,h=100, color='lO',font=40,align='L',edge=30,code=pressKey"-"}, WIDGET.newButton{name='setting',x=2480,y=210,w=800,h=100, color='lO',font=40,align='L',edge=30,code=pressKey'-'},
WIDGET.newButton{name='stat', x=2480,y=330,w=800,h=100, color='lL',font=40,align='L',edge=30,code=pressKey"p"}, WIDGET.newButton{name='stat', x=2480,y=330,w=800,h=100, color='lL',font=40,align='L',edge=30,code=pressKey'p'},
WIDGET.newButton{name='dict', x=2480,y=450,w=800,h=100, color='lG',font=40,align='L',edge=30,code=pressKey"l"}, WIDGET.newButton{name='dict', x=2480,y=450,w=800,h=100, color='lG',font=40,align='L',edge=30,code=pressKey'l'},
WIDGET.newButton{name='replays',x=2480,y=570,w=800,h=100, color='lC',font=40,align='L',edge=30,code=pressKey","}, WIDGET.newButton{name='replays',x=2480,y=570,w=800,h=100, color='lC',font=40,align='L',edge=30,code=pressKey','},
WIDGET.newButton{name='music', x=120,y=80,w=100, color='lO',code=pressKey"2",font=70,fText=CHAR.icon.music}, WIDGET.newButton{name='music', x=120,y=80,w=100, color='lO',code=pressKey'2',font=70,fText=CHAR.icon.music},
WIDGET.newButton{name='lang', x=280,y=80,w=100, color='lN',code=pressKey"3",font=70,fText=CHAR.icon.language}, WIDGET.newButton{name='lang', x=280,y=80,w=100, color='lN',code=pressKey'3',font=70,fText=CHAR.icon.language},
WIDGET.newButton{name='about', x=-110,y=670,w=600,h=70, color='lB',align='R',edge=20,code=pressKey"x",font=50,fText=CHAR.icon.info}, WIDGET.newButton{name='about', x=-110,y=670,w=600,h=70, color='lB',align='R',edge=20,code=pressKey'x',font=50,fText=CHAR.icon.info},
WIDGET.newButton{name='manual', x=1390,y=670,w=600,h=70, color='lR',align='L',edge=20,code=pressKey"m",font=50,fText=CHAR.icon.help}, WIDGET.newButton{name='manual', x=1390,y=670,w=600,h=70, color='lR',align='L',edge=20,code=pressKey'm',font=50,fText=CHAR.icon.help},
} }
return scene return scene

View File

@@ -15,15 +15,15 @@ function scene.wheelMoved(_,y)
WHEELMOV(y) WHEELMOV(y)
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="up"then if key=='up'then
WIDGET.active.texts:scroll(-5) WIDGET.active.texts:scroll(-5)
elseif key=="down"then elseif key=='down'then
WIDGET.active.texts:scroll(5) WIDGET.active.texts:scroll(5)
elseif key=="pageup"then elseif key=='pageup'then
WIDGET.active.texts:scroll(-20) WIDGET.active.texts:scroll(-20)
elseif key=="pagedown"then elseif key=='pagedown'then
WIDGET.active.texts:scroll(20) WIDGET.active.texts:scroll(20)
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end

View File

@@ -60,7 +60,7 @@ end
function scene.mouseDown(x,y,k) function scene.mouseDown(x,y,k)
for _,M in next,MODOPT do for _,M in next,MODOPT do
if(x-M.x)^2+(y-M.y)^2<2000 then if(x-M.x)^2+(y-M.y)^2<2000 then
_toggleMod(M,k==2 or kb.isDown("lshift","rshift")) _toggleMod(M,k==2 or kb.isDown('lshift','rshift'))
break break
end end
end end
@@ -73,7 +73,7 @@ function scene.touchDown(x,y)
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="tab"or key=="delete"then if key=='tab'or key=='delete'then
if GAME.mod[1]then if GAME.mod[1]then
while GAME.mod[1]do while GAME.mod[1]do
rem(GAME.mod).sel=0 rem(GAME.mod).sel=0
@@ -84,12 +84,12 @@ function scene.keyDown(key)
elseif #key==1 then elseif #key==1 then
for _,M in next,MODOPT do for _,M in next,MODOPT do
if key==M.key then if key==M.key then
_toggleMod(M,kb.isDown("lshift","rshift")) _toggleMod(M,kb.isDown('lshift','rshift'))
selected=M selected=M
break break
end end
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
end end
end end
@@ -157,7 +157,7 @@ end
scene.widgetList={ scene.widgetList={
WIDGET.newText{name='title', x=80,y=50,font=70,align='L'}, WIDGET.newText{name='title', x=80,y=50,font=70,align='L'},
WIDGET.newText{name='unranked',x=1200,y=60,color='Y',font=50,align='R'}, WIDGET.newText{name='unranked',x=1200,y=60,color='Y',font=50,align='R'},
WIDGET.newButton{name='reset', x=1140,y=540,w=170,h=80,font=25,code=pressKey"tab"}, WIDGET.newButton{name='reset', x=1140,y=540,w=170,h=80,font=25,code=pressKey'tab'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -103,7 +103,7 @@ function scene.mouseClick(x,y)
mapCam.sel=false mapCam.sel=false
end end
elseif _ then elseif _ then
scene.keyDown("return") scene.keyDown('return')
end end
end end
mapCam.keyCtrl=false mapCam.keyCtrl=false
@@ -134,7 +134,7 @@ function scene.touchClick(x,y)
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="return"then if key=='return'then
if mapCam.sel then if mapCam.sel then
if visibleModes[mapCam.sel]==2 then if visibleModes[mapCam.sel]==2 then
MES.new('info',text.unlockHint) MES.new('info',text.unlockHint)
@@ -143,9 +143,9 @@ function scene.keyDown(key,isRep)
loadGame(mapCam.sel) loadGame(mapCam.sel)
end end
end end
elseif key=="f1"then elseif key=='f1'then
SCN.go('mod') SCN.go('mod')
elseif key=="escape"then elseif key=='escape'then
if mapCam.sel then if mapCam.sel then
mapCam.sel=false mapCam.sel=false
else else
@@ -158,10 +158,10 @@ function scene.update()
local dx,dy=0,0 local dx,dy=0,0
local F local F
if not SCN.swapping then if not SCN.swapping then
if kb.isDown("up", "w")then dy=dy+10 F=true end if kb.isDown('up', 'w')then dy=dy+10 F=true end
if kb.isDown("down","s")then dy=dy-10 F=true end if kb.isDown('down', 's')then dy=dy-10 F=true end
if kb.isDown("left","a")then dx=dx+10 F=true end if kb.isDown('left', 'a')then dx=dx+10 F=true end
if kb.isDown("right","d")then dx=dx-10 F=true end if kb.isDown('right','d')then dx=dx-10 F=true end
local js1=Z.js[1] local js1=Z.js[1]
if js1 then if js1 then
local dir=js1:getAxis(1) local dir=js1:getAxis(1)
@@ -175,7 +175,7 @@ function scene.update()
end end
if F then if F then
mapCam.keyCtrl=true mapCam.keyCtrl=true
if kb.isDown("lctrl","rctrl","lalt","ralt")then if kb.isDown('lctrl','rctrl','lalt','ralt')then
scene.wheelMoved(nil,(dy-dx)*.026) scene.wheelMoved(nil,(dy-dx)*.026)
else else
_moveMap(dx,dy) _moveMap(dx,dy)
@@ -329,7 +329,7 @@ end
scene.widgetList={ scene.widgetList={
WIDGET.newKey{name='mod', x=140,y=655,w=220,h=80,font=35,code=goScene'mod'}, WIDGET.newKey{name='mod', x=140,y=655,w=220,h=80,font=35,code=goScene'mod'},
WIDGET.newButton{name='start',x=1040,y=655,w=180,h=80,font=40,code=pressKey"return",hideF=function()return not mapCam.sel end}, WIDGET.newButton{name='start',x=1040,y=655,w=180,h=80,font=40,code=pressKey'return',hideF=function()return not mapCam.sel end},
WIDGET.newButton{name='back', x=1200,y=655,w=120,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1200,y=655,w=120,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -40,18 +40,18 @@ function scene.wheelMoved(_,y)
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
local S=selected local S=selected
if key=="down"then if key=='down'then
if S<#bgmList then if S<#bgmList then
selected=S+1 selected=S+1
SFX.play('move',.7) SFX.play('move',.7)
end end
elseif key=="up"then elseif key=='up'then
if S>1 then if S>1 then
selected=S-1 selected=S-1
SFX.play('move',.7) SFX.play('move',.7)
end end
elseif not isRep then elseif not isRep then
if key=="return"or key=="space"then if key=='return'or key=='space'then
if BGM.nowPlay~=bgmList[S]then if BGM.nowPlay~=bgmList[S]then
BGM.play(bgmList[S]) BGM.play(bgmList[S])
if SETTING.bgm>0 then if SETTING.bgm>0 then
@@ -60,9 +60,9 @@ function scene.keyDown(key,isRep)
else else
BGM.stop() BGM.stop()
end end
elseif key=="tab"then elseif key=='tab'then
SCN.swapTo('launchpad','none') SCN.swapTo('launchpad','none')
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
elseif #key==1 and key:find'[0-9a-z]'then elseif #key==1 and key:find'[0-9a-z]'then
for _=1,#bgmList do for _=1,#bgmList do
@@ -124,10 +124,10 @@ scene.widgetList={
hideF=function()return not BGM.nowPlay end hideF=function()return not BGM.nowPlay end
}, },
WIDGET.newSlider{name='bgm', x=760,y=80,w=400,disp=SETval('bgm'),code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end}, WIDGET.newSlider{name='bgm', x=760,y=80,w=400,disp=SETval('bgm'),code=function(v)SETTING.bgm=v BGM.setVol(SETTING.bgm)end},
WIDGET.newButton{name='up', x=200,y=250,w=120,code=pressKey"up",hideF=function()return selected==1 end,font=60,fText=CHAR.key.up}, WIDGET.newButton{name='up', x=200,y=250,w=120,code=pressKey'up',hideF=function()return selected==1 end,font=60,fText=CHAR.key.up},
WIDGET.newButton{name='play', x=200,y=390,w=120,code=pressKey"space",font=65,fText=CHAR.icon.play_pause}, WIDGET.newButton{name='play', x=200,y=390,w=120,code=pressKey'space',font=65,fText=CHAR.icon.play_pause},
WIDGET.newButton{name='down', x=200,y=530,w=120,code=pressKey"down",hideF=function()return selected==#bgmList end,font=60,fText=CHAR.key.down}, WIDGET.newButton{name='down', x=200,y=530,w=120,code=pressKey'down',hideF=function()return selected==#bgmList end,font=60,fText=CHAR.key.down},
WIDGET.newButton{name='sound',x=1140,y=540,w=170,h=80,font=40,code=pressKey"tab"}, WIDGET.newButton{name='sound',x=1140,y=540,w=170,h=80,font=40,code=pressKey'tab'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -132,13 +132,13 @@ function scene.touchMove()
end end
end end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if key=="escape"then if key=='escape'then
if not inputBox.hide then if not inputBox.hide then
_switchChat() _switchChat()
else else
_quit() _quit()
end end
elseif key=="return"then elseif key=='return'then
local mes=STRING.trim(inputBox:getText()) local mes=STRING.trim(inputBox:getText())
if not inputBox.hide and #mes>0 then if not inputBox.hide and #mes>0 then
NET.sendMessage(mes) NET.sendMessage(mes)
@@ -157,13 +157,13 @@ function scene.keyDown(key,isRep)
VK.press(k) VK.press(k)
end end
elseif not _hideReadyUI()then elseif not _hideReadyUI()then
if key=="space"then if key=='space'then
if NETPLY.getSelfJoinMode()==0 then if NETPLY.getSelfJoinMode()==0 then
(kb.isDown("lctrl","rctrl","lalt","ralt")and _setSpectate or _setReady)() (kb.isDown('lctrl','rctrl','lalt','ralt')and _setSpectate or _setReady)()
else else
_setCancel() _setCancel()
end end
elseif key=="s"then elseif key=='s'then
_gotoSetting() _gotoSetting()
end end
end end
@@ -177,8 +177,8 @@ function scene.keyUp(key)
end end
end end
function scene.gamepadDown(key) function scene.gamepadDown(key)
if key=="back"then if key=='back'then
scene.keyDown("escape") scene.keyDown('escape')
else else
if not playing then return end if not playing then return end
local k=KEY_MAP.joystick[key] local k=KEY_MAP.joystick[key]

View File

@@ -54,9 +54,9 @@ function scene.sceneBack()
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="return"then if key=='return'then
_createRoom() _createRoom()
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
else else
WIDGET.keyPressed(key) WIDGET.keyPressed(key)
@@ -95,7 +95,7 @@ scene.widgetList={
--Capacity & Create & Back --Capacity & Create & Back
WIDGET.newSelector{name='capacity', x=1070,y=330,w=310,color='lY',list={2,3,4,5,7,10,17,31,49,99},disp=ROOMval('capacity'),code=ROOMsto('capacity')}, WIDGET.newSelector{name='capacity', x=1070,y=330,w=310,color='lY',list={2,3,4,5,7,10,17,31,49,99},disp=ROOMval('capacity'),code=ROOMsto('capacity')},
WIDGET.newButton{name='create', x=1070,y=480,w=310,h=140,color='lN',font=40,code=pressKey"return"}, WIDGET.newButton{name='create', x=1070,y=480,w=310,h=140,color='lN',font=40,code=pressKey'return'},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
--Special rules --Special rules

View File

@@ -63,17 +63,17 @@ end
function scene.keyDown(key) function scene.keyDown(key)
if NET.getlock('enterRoom')then return end if NET.getlock('enterRoom')then return end
if WIDGET.sel~=passwordBox then if WIDGET.sel~=passwordBox then
if key=="r"then if key=='r'then
if fetchTimer<=7 then if fetchTimer<=7 then
_fetchRoom() _fetchRoom()
end end
elseif key=="s"then elseif key=='s'then
SCN.go('setting_game') SCN.go('setting_game')
elseif key=="n"then elseif key=='n'then
SCN.go('net_newRoom') SCN.go('net_newRoom')
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
elseif roomList:getLen()>0 and key=="return"then elseif roomList:getLen()>0 and key=='return'then
local R=roomList:getSel() local R=roomList:getSel()
if NET.getlock('fetchRoom')or not R then return end if NET.getlock('fetchRoom')or not R then return end
if R.roomInfo.version==VERSION.room then if R.roomInfo.version==VERSION.room then
@@ -144,13 +144,13 @@ end
scene.widgetList={ scene.widgetList={
roomList, roomList,
passwordBox, passwordBox,
WIDGET.newKey{name='setting', x=1200,y=160,w=90,h=90,font=60,fText=CHAR.icon.settings,code=pressKey"s"}, WIDGET.newKey{name='setting', x=1200,y=160,w=90,h=90,font=60,fText=CHAR.icon.settings,code=pressKey's'},
WIDGET.newText{name='refreshing',x=450,y=240,font=45,hideF=function()return not NET.getlock('fetchRoom')end}, WIDGET.newText{name='refreshing',x=450,y=240,font=45,hideF=function()return not NET.getlock('fetchRoom')end},
WIDGET.newText{name='noRoom', x=450,y=245,font=40,hideF=function()return roomList:getLen()>0 or NET.getlock('fetchRoom')end}, WIDGET.newText{name='noRoom', x=450,y=245,font=40,hideF=function()return roomList:getLen()>0 or NET.getlock('fetchRoom')end},
WIDGET.newKey{name='refresh', x=250,y=630,w=140,h=120,code=_fetchRoom,hideF=function()return fetchTimer>7 end}, WIDGET.newKey{name='refresh', x=250,y=630,w=140,h=120,code=_fetchRoom,hideF=function()return fetchTimer>7 end},
WIDGET.newKey{name='new', x=510,y=630,w=260,h=120,code=pressKey"n"}, WIDGET.newKey{name='new', x=510,y=630,w=260,h=120,code=pressKey'n'},
WIDGET.newKey{name='join', x=780,y=630,w=140,h=120,code=pressKey"return",hideF=function()return roomList:getLen()==0 or NET.getlock('enterRoom')end}, WIDGET.newKey{name='join', x=780,y=630,w=140,h=120,code=pressKey'return',hideF=function()return roomList:getLen()==0 or NET.getlock('enterRoom')end},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey"escape"}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey'escape'},
} }
return scene return scene

View File

@@ -122,42 +122,42 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="q"then if key=='q'then
SCN.back() SCN.back()
GAME.playing=false GAME.playing=false
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
if not GAME.fromRepMenu then if not GAME.fromRepMenu then
GAME.prevBG=BG.cur GAME.prevBG=BG.cur
SCN.go('setting_sound') SCN.go('setting_sound')
end end
elseif key=="r"then elseif key=='r'then
if not GAME.fromRepMenu then if not GAME.fromRepMenu then
resetGameData() resetGameData()
SCN.swapTo('game','none') SCN.swapTo('game','none')
end 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')
PLAYERS[1]:startStreaming(GAME.rep) PLAYERS[1]:startStreaming(GAME.rep)
SCN.swapTo('game','none') SCN.swapTo('game','none')
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.saveReplay()then if DATA.saveReplay()then
GAME.saved=true GAME.saved=true
SFX.play('connected') SFX.play('connected')
end end
end end
elseif key=="tab"or key=="Stab"then elseif key=='tab'or key=='Stab'then
if love.keyboard.isDown("lshift","rshift")or key=="Stab"then if love.keyboard.isDown('lshift','rshift')or key=='Stab'then
page=(page-1)%2 page=(page-1)%2
else else
page=(page+1)%2 page=(page+1)%2
end end
timer2=0 timer2=0
elseif key=="t"then elseif key=='t'then
if SETTING.allowTAS and not(GAME.result or GAME.replaying)then if SETTING.allowTAS and not(GAME.result or GAME.replaying)then
GAME.tasUsed=true GAME.tasUsed=true
SFX.play('ren_mega') SFX.play('ren_mega')
@@ -344,23 +344,23 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
WIDGET.newKey{name='resume', x=290,y=240,w=300,h=70,code=pressKey"escape"}, WIDGET.newKey{name='resume', x=290,y=240,w=300,h=70,code=pressKey'escape'},
WIDGET.newKey{name='restart', x=290,y=340,w=300,h=70,code=pressKey"r",hideF=function()return GAME.fromRepMenu end}, WIDGET.newKey{name='restart', x=290,y=340,w=300,h=70,code=pressKey'r',hideF=function()return GAME.fromRepMenu end},
WIDGET.newKey{name='setting', x=290,y=440,w=300,h=70,code=pressKey"s",hideF=function()return GAME.fromRepMenu end}, WIDGET.newKey{name='setting', x=290,y=440,w=300,h=70,code=pressKey's',hideF=function()return GAME.fromRepMenu end},
WIDGET.newKey{name='quit', x=290,y=540,w=300,h=70,code=pressKey"q"}, WIDGET.newKey{name='quit', x=290,y=540,w=300,h=70,code=pressKey'q'},
WIDGET.newKey{name='tas', x=290,y=620,w=240,h=50,code=pressKey"t",hideF=function()return not SETTING.allowTAS or GAME.tasUsed or GAME.result or GAME.replaying end}, WIDGET.newKey{name='tas', x=290,y=620,w=240,h=50,code=pressKey't',hideF=function()return not SETTING.allowTAS or GAME.tasUsed or GAME.result or GAME.replaying end},
WIDGET.newKey{name='page_prev',x=500,y=390,w=70,code=pressKey"tab",noFrame=true, WIDGET.newKey{name='page_prev',x=500,y=390,w=70,code=pressKey'tab',noFrame=true,
fText=GC.DO{70,70,{'setLW',2}, {'dRPol',33,35,32,3,6,3.142},{'dRPol',45,35,32,3,6,3.142}}, fText=GC.DO{70,70,{'setLW',2}, {'dRPol',33,35,32,3,6,3.142},{'dRPol',45,35,32,3,6,3.142}},
fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRPol',33,35,32,3,6,3.142},{'fRPol',45,35,32,3,6,3.142}}}}, fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRPol',33,35,32,3,6,3.142},{'fRPol',45,35,32,3,6,3.142}}}},
hideF=function()return PLAYERS[1].frameRun<=180 end, hideF=function()return PLAYERS[1].frameRun<=180 end,
}, },
WIDGET.newKey{name='page_next',x=1230,y=390,w=70,code=pressKey"Stab",noFrame=true, WIDGET.newKey{name='page_next',x=1230,y=390,w=70,code=pressKey'Stab',noFrame=true,
fText=GC.DO{70,70,{'setLW',2}, {'dRPol',37,35,32,3,6},{'dRPol',25,35,32,3,6}}, fText=GC.DO{70,70,{'setLW',2}, {'dRPol',37,35,32,3,6},{'dRPol',25,35,32,3,6}},
fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRPol',37,35,32,3,6},{'fRPol',25,35,32,3,6}}}}, fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRPol',37,35,32,3,6},{'fRPol',25,35,32,3,6}}}},
hideF=function()return PLAYERS[1].frameRun<=180 end, hideF=function()return PLAYERS[1].frameRun<=180 end,
}, },
WIDGET.newKey{name='replay', x=865,y=165,w=200,h=40,font=25,code=pressKey"p",hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end}, WIDGET.newKey{name='replay', x=865,y=165,w=200,h=40,font=25,code=pressKey'p',hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
WIDGET.newKey{name='save', x=1075,y=165,w=200,h=40,font=25,code=pressKey"o",hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end}, WIDGET.newKey{name='save', x=1075,y=165,w=200,h=40,font=25,code=pressKey'o',hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
} }
return scene return scene

View File

@@ -81,12 +81,12 @@ function scene.sceneInit()
end end
function scene.keyDown(key) function scene.keyDown(key)
if key=="return"then if key=='return'then
local rep=listBox:getSel() local rep=listBox:getSel()
if rep then if rep then
_playRep(rep.fileName) _playRep(rep.fileName)
end end
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 rep=listBox:getSel() local rep=listBox:getSel()
if rep then if rep then
if rep.available and rep.fileName then if rep.available and rep.fileName then
@@ -101,7 +101,7 @@ function scene.keyDown(key)
MES.new('error',text.replayBroken) MES.new('error',text.replayBroken)
end end
end end
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 repStr=love.system.getClipboardText() local repStr=love.system.getClipboardText()
local res,fileData=pcall(love.data.decode,'string','base64',repStr) local res,fileData=pcall(love.data.decode,'string','base64',repStr)
if res then if res then
@@ -118,7 +118,7 @@ function scene.keyDown(key)
else else
MES.new('error',text.dataCorrupted) MES.new('error',text.dataCorrupted)
end end
elseif key=="delete"then elseif key=='delete'then
local rep=listBox:getSel() local rep=listBox:getSel()
if rep then if rep then
if sure>.3 then if sure>.3 then
@@ -137,7 +137,7 @@ function scene.keyDown(key)
MES.new('info',text.sureReset) MES.new('info',text.sureReset)
end end
end end
elseif key=="escape"then elseif key=='escape'then
SCN.back() SCN.back()
else else
WIDGET.keyPressed(key) WIDGET.keyPressed(key)
@@ -152,10 +152,10 @@ end
scene.widgetList={ scene.widgetList={
listBox, listBox,
WIDGET.newButton{name='export',x=180,y=640,w=140,h=80,color='lG',code=pressKey"cC",font=50,fText=CHAR.icon.export}, WIDGET.newButton{name='export',x=180,y=640,w=140,h=80,color='lG',code=pressKey'cC',font=50,fText=CHAR.icon.export},
WIDGET.newButton{name='import',x=350,y=640,w=140,h=80,color='lN',code=pressKey"cV",font=50,fText=CHAR.icon.import}, WIDGET.newButton{name='import',x=350,y=640,w=140,h=80,color='lN',code=pressKey'cV',font=50,fText=CHAR.icon.import},
WIDGET.newButton{name='play', x=700,y=640,w=170,h=80,color='lY',code=pressKey"return",font=65,fText=CHAR.icon.play}, WIDGET.newButton{name='play', x=700,y=640,w=170,h=80,color='lY',code=pressKey'return',font=65,fText=CHAR.icon.play},
WIDGET.newButton{name='delete',x=850,y=640,w=80,h=80,color='lR',code=pressKey"delete",font=50,fText=CHAR.icon.trash}, WIDGET.newButton{name='delete',x=850,y=640,w=80,h=80,color='lR',code=pressKey'delete',font=50,fText=CHAR.icon.trash},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
} }

View File

@@ -32,13 +32,13 @@ local forbbidenKeys={
} }
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
if key=="escape"then if key=='escape'then
if selected then if selected then
selected=false selected=false
else else
SCN.back() SCN.back()
end end
elseif key=="backspace"then elseif key=='backspace'then
if selected then if selected then
for k,v in next,KEY_MAP.keyboard do for k,v in next,KEY_MAP.keyboard do
if v==selected then if v==selected then
@@ -61,7 +61,7 @@ function scene.keyDown(key,isRep)
end end
end end
function scene.gamepadDown(key) function scene.gamepadDown(key)
if key=="back"then if key=='back'then
if selected then if selected then
for k,v in next,KEY_MAP.joystick do for k,v in next,KEY_MAP.joystick do
if v==selected then if v==selected then

View File

@@ -38,9 +38,9 @@ end
scene.touchDown=scene.mouseDown scene.touchDown=scene.mouseDown
function scene.keyDown(key) function scene.keyDown(key)
if key=="escape"then if key=='escape'then
SCN.back() SCN.back()
elseif key=="space"then elseif key=='space'then
scene.mouseDown(942,626) scene.mouseDown(942,626)
end end
end end

View File

@@ -31,17 +31,17 @@ end
scene.touchDown=scene.mouseDown scene.touchDown=scene.mouseDown
function scene.keyDown(key) function scene.keyDown(key)
if key=="escape"then if key=='escape'then
SCN.back() SCN.back()
elseif key=="l"then elseif key=='l'then
loadGame('sprintLock',true) loadGame('sprintLock',true)
elseif key=="f"then elseif key=='f'then
loadGame('sprintFix',true) loadGame('sprintFix',true)
end end
end end
function scene.update(dt) function scene.update(dt)
if(kb.isDown("space","return")or tc.getTouches()[1])and v<6.26 then if(kb.isDown('space','return')or tc.getTouches()[1])and v<6.26 then
v=v+.26 v=v+.26
elseif v>1 then elseif v>1 then
v=v-.16 v=v-.16

View File

@@ -55,9 +55,9 @@ function scene.mouseDown(x,y)
end end
scene.touchDown=scene.mouseDown scene.touchDown=scene.mouseDown
function scene.keyDown(key) function scene.keyDown(key)
if key=="escape"then if key=='escape'then
SCN.back() SCN.back()
elseif love.keyboard.isDown("m")and love.keyboard.isDown("d")then elseif love.keyboard.isDown('m')and love.keyboard.isDown('d')then
loadGame('sprintMD',true) loadGame('sprintMD',true)
end end
end end

View File

@@ -25,7 +25,7 @@ end
function scene.keyDown(key,isRep) function scene.keyDown(key,isRep)
if isRep then return end if isRep then return end
_push("[keyDown] <"..key..">") _push("[keyDown] <"..key..">")
if key=="escape"then if key=='escape'then
backCounter=backCounter-1 backCounter=backCounter-1
if backCounter==0 then if backCounter==0 then
SCN.back() SCN.back()