整理代码,表示键盘按键的字符串使用单引号
This commit is contained in:
@@ -218,31 +218,31 @@ end
|
||||
|
||||
local fnKey={NULL,NULL,NULL,NULL,NULL,NULL,NULL}
|
||||
local function noDevkeyPressed(key)
|
||||
if key=="f1"then fnKey[1]()
|
||||
elseif key=="f2"then fnKey[2]()
|
||||
elseif key=="f3"then fnKey[3]()
|
||||
elseif key=="f4"then fnKey[4]()
|
||||
elseif key=="f5"then fnKey[5]()
|
||||
elseif key=="f6"then fnKey[6]()
|
||||
elseif key=="f7"then fnKey[7]()
|
||||
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=="f10"then devMode=2 MES.new('info',"DEBUG 2")
|
||||
elseif key=="f11"then devMode=3 MES.new('info',"DEBUG 3")
|
||||
elseif key=="f12"then devMode=4 MES.new('info',"DEBUG 4")
|
||||
if key=='f1'then fnKey[1]()
|
||||
elseif key=='f2'then fnKey[2]()
|
||||
elseif key=='f3'then fnKey[3]()
|
||||
elseif key=='f4'then fnKey[4]()
|
||||
elseif key=='f5'then fnKey[5]()
|
||||
elseif key=='f6'then fnKey[6]()
|
||||
elseif key=='f7'then fnKey[7]()
|
||||
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=='f10'then devMode=2 MES.new('info',"DEBUG 2")
|
||||
elseif key=='f11'then devMode=3 MES.new('info',"DEBUG 3")
|
||||
elseif key=='f12'then devMode=4 MES.new('info',"DEBUG 4")
|
||||
elseif devMode==2 then
|
||||
local W=WIDGET.sel
|
||||
if W then
|
||||
if key=="left"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=="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.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
|
||||
if key=='left'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=='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.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
|
||||
else return true
|
||||
end
|
||||
else
|
||||
@@ -256,10 +256,10 @@ function love.keypressed(key,_,isRep)
|
||||
mouseShow=false
|
||||
if devMode and not noDevkeyPressed(key)then
|
||||
return
|
||||
elseif key=="f8"then
|
||||
elseif key=='f8'then
|
||||
devMode=1
|
||||
MES.new('info',"DEBUG ON",.2)
|
||||
elseif key=="f11"then
|
||||
elseif key=='f11'then
|
||||
SETTING.fullscreen=not SETTING.fullscreen
|
||||
applyFullscreen()
|
||||
saveSettings()
|
||||
@@ -268,7 +268,7 @@ function love.keypressed(key,_,isRep)
|
||||
if EDITING==""then
|
||||
SCN.keyDown(key,isRep)
|
||||
end
|
||||
elseif key=="escape"and not isRep then
|
||||
elseif key=='escape'and not isRep then
|
||||
SCN.back()
|
||||
else
|
||||
WIDGET.keyPressed(key,isRep)
|
||||
|
||||
@@ -9,11 +9,11 @@ return function(y,key1,key2)
|
||||
trigDist=min(trigDist,0)-(-y)^1.2
|
||||
end
|
||||
while trigDist>=1 do
|
||||
love.keypressed(key1 or"up")
|
||||
love.keypressed(key1 or'up')
|
||||
trigDist=trigDist-1
|
||||
end
|
||||
while trigDist<=-1 do
|
||||
love.keypressed(key2 or"down")
|
||||
love.keypressed(key2 or'down')
|
||||
trigDist=trigDist+1
|
||||
end
|
||||
end
|
||||
|
||||
@@ -597,7 +597,7 @@ function slider:scroll(n)
|
||||
end
|
||||
end
|
||||
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
|
||||
function WIDGET.newSlider(D)--name,x,y,w[,lim][,fText][,color][,unit][,smooth][,font=30][,fType][,change],disp[,show],code,hide
|
||||
local _={
|
||||
@@ -773,7 +773,7 @@ function selector:scroll(n)
|
||||
end
|
||||
end
|
||||
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
|
||||
|
||||
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)
|
||||
local t=self.value
|
||||
if #t>0 and EDITING==""then
|
||||
if k=="backspace"then
|
||||
if k=='backspace'then
|
||||
local p=#t
|
||||
while t:byte(p)>=128 and t:byte(p)<192 do
|
||||
p=p-1
|
||||
end
|
||||
t=sub(t,1,p-1)
|
||||
SFX.play('lock')
|
||||
elseif k=="delete"then
|
||||
elseif k=='delete'then
|
||||
t=""
|
||||
SFX.play('hold')
|
||||
end
|
||||
@@ -1005,9 +1005,9 @@ function textBox:scroll(dir)
|
||||
self:drag(nil,nil,nil,-dir*self.lineH)
|
||||
end
|
||||
function textBox:arrowKey(k)
|
||||
if k=="up"then
|
||||
if k=='up'then
|
||||
self:scroll(-1)
|
||||
elseif k=="down"then
|
||||
elseif k=='down'then
|
||||
self:scroll(-1)
|
||||
end
|
||||
end
|
||||
@@ -1382,12 +1382,12 @@ function WIDGET.release(x,y)
|
||||
end
|
||||
function WIDGET.keyPressed(k,isRep)
|
||||
local W=WIDGET.sel
|
||||
if k=="space"or k=="return"then
|
||||
if k=='space'or k=='return'then
|
||||
if not isRep then
|
||||
WIDGET.press()
|
||||
end
|
||||
elseif k=="up"or k=="down"or k=="left"or k=="right"then
|
||||
if kb.isDown("lshift","lalt","lctrl","rshift","ralt","rctrl")then
|
||||
elseif k=='up'or k=='down'or k=='left'or k=='right'then
|
||||
if kb.isDown('lshift','lalt','lctrl','rshift','ralt','rctrl')then
|
||||
--Control some widgets with arrowkeys when hold shift/ctrl/alt
|
||||
if W and W.arrowKey then W:arrowKey(k)end
|
||||
else
|
||||
@@ -1400,10 +1400,10 @@ function WIDGET.keyPressed(k,isRep)
|
||||
end
|
||||
elseif W.getCenter then
|
||||
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 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
|
||||
for _,W1 in ipairs(WIDGET.active)do
|
||||
if W~=W1 and W1.resCtr and not W1.hide then
|
||||
@@ -1445,24 +1445,24 @@ function WIDGET.textinput(texts)
|
||||
end
|
||||
end
|
||||
local keyMirror={
|
||||
dpup="up",
|
||||
dpdown="down",
|
||||
dpleft="left",
|
||||
dpright="right",
|
||||
start="return",
|
||||
back="escape",
|
||||
dpup='up',
|
||||
dpdown='down',
|
||||
dpleft='left',
|
||||
dpright='right',
|
||||
start='return',
|
||||
back='escape',
|
||||
}
|
||||
function WIDGET.gamepadPressed(i)
|
||||
if i=="start"then
|
||||
if i=='start'then
|
||||
WIDGET.press()
|
||||
elseif i=="a"or i=="b"then
|
||||
elseif i=='a'or i=='b'then
|
||||
local W=WIDGET.sel
|
||||
if W then
|
||||
if W.type=='button'or W.type=='key'then
|
||||
WIDGET.press()
|
||||
elseif W.type=='slider'then
|
||||
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
|
||||
W.code(P)
|
||||
if W.change and timer()-W.lastTime>.18 then
|
||||
@@ -1471,7 +1471,7 @@ function WIDGET.gamepadPressed(i)
|
||||
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])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,9 +16,9 @@ end
|
||||
scene.touchDown=scene.mouseDown
|
||||
|
||||
function scene.keyDown(key)
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
SCN.back()
|
||||
elseif key=="space"then
|
||||
elseif key=='space'then
|
||||
loadGame('stack_e',true)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -130,43 +130,43 @@ local function tapBoard(x,y,key)
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="up"then
|
||||
if key=='up'then
|
||||
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)
|
||||
elseif key=="left"then
|
||||
elseif key=='left'then
|
||||
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)
|
||||
elseif key=="space"then
|
||||
elseif key=='space'then
|
||||
shuffleBoard()
|
||||
state=0
|
||||
time=0
|
||||
move,push=0,0
|
||||
elseif key=="q"then
|
||||
elseif key=='q'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
|
||||
elseif key=="w"then
|
||||
elseif key=='w'then
|
||||
if state==0 then
|
||||
invis=not invis
|
||||
end
|
||||
elseif key=="e"then
|
||||
elseif key=='e'then
|
||||
if state==0 then
|
||||
slide=not slide
|
||||
if not slide then
|
||||
pathVis=false
|
||||
end
|
||||
end
|
||||
elseif key=="r"then
|
||||
elseif key=='r'then
|
||||
if state==0 and slide then
|
||||
pathVis=not pathVis
|
||||
end
|
||||
elseif key=="t"then
|
||||
elseif key=='t'then
|
||||
if state==0 then
|
||||
revKB=not revKB
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
@@ -309,12 +309,12 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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,
|
||||
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='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='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='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.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -245,8 +245,8 @@ function scene.mouseDown(x,y,k)
|
||||
local dx,dy=x-640,y-360
|
||||
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
|
||||
(dx>0 and"right"or"left")or
|
||||
(dy>0 and"down"or"up")
|
||||
(dx>0 and'right'or'left')or
|
||||
(dy>0 and'down'or'up')
|
||||
)
|
||||
end
|
||||
end
|
||||
@@ -291,7 +291,7 @@ local function playRep(n)
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
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
|
||||
local f=repeater.focus
|
||||
if #repeater.seq[f]<24 then
|
||||
@@ -317,18 +317,18 @@ function scene.keyDown(key,isRep)
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif key=="space"then skip()
|
||||
elseif key=="r"then reset()
|
||||
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=="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=="c2"then playRep(2)
|
||||
elseif key=="return"then
|
||||
elseif key=='space'then skip()
|
||||
elseif key=='r'then reset()
|
||||
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=='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=='c2'then playRep(2)
|
||||
elseif key=='return'then
|
||||
if repeater.focus then
|
||||
repeater.focus=false
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
if repeater.focus then
|
||||
repeater.focus=false
|
||||
else
|
||||
@@ -480,19 +480,19 @@ function scene.draw()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
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='tapControl',x=240, y=370,lim=200,font=40,disp=function()return tapControl end,code=pressKey"w",hideF=function()return state==1 end},
|
||||
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='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='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='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='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='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='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='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='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='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='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},
|
||||
}
|
||||
|
||||
|
||||
@@ -64,16 +64,16 @@ function scene.keyDown(key,isRep)
|
||||
SFX.play('finesseError')
|
||||
end
|
||||
end
|
||||
elseif key=="left"or key=="right"then
|
||||
elseif key=='left'or key=='right'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
|
||||
elseif key=="space"then
|
||||
elseif key=='space'then
|
||||
progress=1
|
||||
mistake=0
|
||||
time=0
|
||||
state=0
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
@@ -117,7 +117,7 @@ end
|
||||
|
||||
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.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='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ function scene.keyDown(key,isRep)
|
||||
check(tonumber(input))
|
||||
SFX.play('touch')
|
||||
end
|
||||
elseif key=="-"then
|
||||
elseif key=='-'then
|
||||
if #input<8 then
|
||||
if input:find("-")then
|
||||
input=input:sub(2)
|
||||
@@ -179,12 +179,12 @@ function scene.keyDown(key,isRep)
|
||||
check(tonumber(input))
|
||||
SFX.play('hold')
|
||||
end
|
||||
elseif key=="backspace"then
|
||||
elseif key=='backspace'then
|
||||
input=""
|
||||
inputTime=0
|
||||
elseif key=="r"then
|
||||
elseif key=='r'then
|
||||
reset()
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
@@ -216,20 +216,20 @@ function scene.draw()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
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='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='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='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='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='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='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='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='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='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='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='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='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='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'},
|
||||
}
|
||||
|
||||
return scene
|
||||
|
||||
@@ -18,7 +18,7 @@ local sym--symbol
|
||||
|
||||
local function _autoReturn()
|
||||
if reg and sym then
|
||||
scene.keyDown("calculate")
|
||||
scene.keyDown('calculate')
|
||||
else
|
||||
reg=false
|
||||
end
|
||||
@@ -35,22 +35,22 @@ end
|
||||
|
||||
scene.mouseDown=NULL
|
||||
function scene.keyDown(key)
|
||||
if kb.isDown("lshift","rshift")then
|
||||
if key=="="then
|
||||
scene.keyDown("+")
|
||||
if kb.isDown('lshift','rshift')then
|
||||
if key=='='then
|
||||
scene.keyDown('+')
|
||||
return
|
||||
elseif kb.isDown("lshift","rshift")and key=="8"then
|
||||
scene.keyDown("*")
|
||||
elseif kb.isDown('lshift','rshift')and key=='8'then
|
||||
scene.keyDown('*')
|
||||
return
|
||||
end
|
||||
elseif key:sub(1,2)=="kp"then
|
||||
elseif key:sub(1,2)=='kp'then
|
||||
scene.keyDown(key:sub(3))
|
||||
return
|
||||
end
|
||||
if keySounds[key]then
|
||||
Snd('bell',keySounds[key])
|
||||
end
|
||||
if key=="."then
|
||||
if key=='.'then
|
||||
if sym=="="then
|
||||
sym,reg=false,false
|
||||
val="0."
|
||||
@@ -62,14 +62,14 @@ function scene.keyDown(key)
|
||||
val=val.."."
|
||||
end
|
||||
end
|
||||
elseif key=="e"then
|
||||
elseif key=='e'then
|
||||
if sym=="="then
|
||||
sym,reg=false
|
||||
val="0e"
|
||||
elseif not val:find("e")then
|
||||
val=val.."e"
|
||||
end
|
||||
elseif key=="backspace"then
|
||||
elseif key=='backspace'then
|
||||
if sym=="="then
|
||||
val=""
|
||||
elseif sym then
|
||||
@@ -80,16 +80,16 @@ function scene.keyDown(key)
|
||||
if val==""then
|
||||
val="0"
|
||||
end
|
||||
elseif key=="+"then
|
||||
elseif key=='+'then
|
||||
_autoReturn()
|
||||
sym="+"
|
||||
elseif key=="*"then
|
||||
elseif key=='*'then
|
||||
_autoReturn()
|
||||
sym="*"
|
||||
elseif key=="-"then
|
||||
elseif key=='-'then
|
||||
_autoReturn()
|
||||
sym="-"
|
||||
elseif key=="/"then
|
||||
elseif key=='/'then
|
||||
_autoReturn()
|
||||
sym="/"
|
||||
elseif key:byte()>=48 and key:byte()<=57 then
|
||||
@@ -107,9 +107,9 @@ function scene.keyDown(key)
|
||||
val=val..key
|
||||
end
|
||||
end
|
||||
elseif key=="return"then
|
||||
scene.keyDown("calculate")
|
||||
elseif key=="calculate"then
|
||||
elseif key=='return'then
|
||||
scene.keyDown('calculate')
|
||||
elseif key=='calculate'then
|
||||
val=val:gsub("e$","")
|
||||
if sym and reg then
|
||||
reg=reg:gsub("e$","")
|
||||
@@ -122,14 +122,14 @@ function scene.keyDown(key)
|
||||
end
|
||||
sym="="
|
||||
reg=false
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
if val~="0"then
|
||||
reg,sym=false,false
|
||||
val="0"
|
||||
else
|
||||
SCN.back()
|
||||
end
|
||||
elseif key=="delete"then
|
||||
elseif key=='delete'then
|
||||
val="0"
|
||||
end
|
||||
end
|
||||
@@ -145,24 +145,24 @@ function scene.draw()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
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='_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='_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='_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='_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='.',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='+',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=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=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='_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='_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='_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='_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='_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='.',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='+',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=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=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='back',x=1135,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ end
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="space"or key=="return"then
|
||||
if key=='space'or key=='return'then
|
||||
if state==0 then
|
||||
state=1
|
||||
elseif state==1 then
|
||||
@@ -27,17 +27,17 @@ function scene.keyDown(key,isRep)
|
||||
vx=pow*cos(ang)/2.6
|
||||
vy=pow*sin(ang)/2.6
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
function scene.mouseDown(_,_,k)
|
||||
if k==1 then
|
||||
scene.keyDown("space")
|
||||
scene.keyDown('space')
|
||||
end
|
||||
end
|
||||
function scene.touchDown()
|
||||
scene.keyDown("space")
|
||||
scene.keyDown('space')
|
||||
end
|
||||
|
||||
function scene.update()
|
||||
|
||||
@@ -989,7 +989,7 @@ function scene.wheelMoved(_,y)
|
||||
end
|
||||
|
||||
function scene.keyDown(key)
|
||||
if key=="return" or key=="kpenter"then
|
||||
if key=='return' or key=='kpenter'then
|
||||
local input=STRING.trim(inputBox:getText())
|
||||
if input==""then return end
|
||||
|
||||
@@ -1048,7 +1048,7 @@ function scene.keyDown(key)
|
||||
|
||||
--Insert empty line
|
||||
log""
|
||||
elseif key=="up"then
|
||||
elseif key=='up'then
|
||||
if not hisPtr then
|
||||
hisPtr=#history
|
||||
if hisPtr>0 then
|
||||
@@ -1058,7 +1058,7 @@ function scene.keyDown(key)
|
||||
hisPtr=hisPtr-1
|
||||
inputBox:setText(history[hisPtr])
|
||||
end
|
||||
elseif key=="down"then
|
||||
elseif key=='down'then
|
||||
if hisPtr then
|
||||
hisPtr=hisPtr+1
|
||||
if history[hisPtr]then
|
||||
@@ -1068,7 +1068,7 @@ function scene.keyDown(key)
|
||||
inputBox:clear()
|
||||
end
|
||||
end
|
||||
elseif key=="tab"then
|
||||
elseif key=='tab'then
|
||||
local str=inputBox:getText()
|
||||
if str~=""and not str:find("%s")then
|
||||
local res={}
|
||||
@@ -1086,14 +1086,14 @@ function scene.keyDown(key)
|
||||
inputBox:setText(res[1])
|
||||
end
|
||||
end
|
||||
elseif key=="scrollup"then outputBox:scroll(-5)
|
||||
elseif key=="scrolldown"then outputBox:scroll(5)
|
||||
elseif key=="pageup"then outputBox:scroll(-20)
|
||||
elseif key=="pagedown"then outputBox:scroll(20)
|
||||
elseif key=="home"then outputBox:scroll(-1e99)
|
||||
elseif key=="end"then outputBox:scroll(1e99)
|
||||
elseif combKey[key]and kb.isDown("lctrl","rctrl")then combKey[key]()
|
||||
elseif key=="escape"then
|
||||
elseif key=='scrollup'then outputBox:scroll(-5)
|
||||
elseif key=='scrolldown'then outputBox:scroll(5)
|
||||
elseif key=='pageup'then outputBox:scroll(-20)
|
||||
elseif key=='pagedown'then outputBox:scroll(20)
|
||||
elseif key=='home'then outputBox:scroll(-1e99)
|
||||
elseif key=='end'then outputBox:scroll(1e99)
|
||||
elseif combKey[key]and kb.isDown('lctrl','rctrl')then combKey[key]()
|
||||
elseif key=='escape'then
|
||||
if not WIDGET.isFocus(inputBox)then
|
||||
WIDGET.focus(inputBox)
|
||||
else
|
||||
|
||||
@@ -90,21 +90,21 @@ function scene.touchUp(x)
|
||||
end
|
||||
moveDir=0
|
||||
else
|
||||
scene.keyDown("space")
|
||||
scene.keyDown('space')
|
||||
end
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
SCN.back()
|
||||
elseif play then
|
||||
if key=="left"or key=="a"then
|
||||
if key=='left'or key=='a'then
|
||||
moveDir=-1
|
||||
elseif key=="right"or key=="d"then
|
||||
elseif key=='right'or key=='d'then
|
||||
moveDir=1
|
||||
end
|
||||
else
|
||||
if key=="space"and ct==60 then
|
||||
if key=='space'and ct==60 then
|
||||
menu=-1
|
||||
speed=1
|
||||
level=1
|
||||
@@ -113,10 +113,10 @@ function scene.keyDown(key,isRep)
|
||||
end
|
||||
function scene.keyUp(key)
|
||||
if play then
|
||||
if key=="left"or key=="a"then
|
||||
moveDir=kb.isDown("right","d")and 1 or 0
|
||||
elseif key=="right"or key=="d"then
|
||||
moveDir=kb.isDown("left","a")and -1 or 0
|
||||
if key=='left'or key=='a'then
|
||||
moveDir=kb.isDown('right','d')and 1 or 0
|
||||
elseif key=='right'or key=='d'then
|
||||
moveDir=kb.isDown('left','a')and -1 or 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -42,7 +42,7 @@ end
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="space"or key=="return"then
|
||||
if key=='space'or key=='return'then
|
||||
if state=='move'then
|
||||
if floor>0 then
|
||||
if move.x<base.x then
|
||||
@@ -61,17 +61,17 @@ function scene.keyDown(key,isRep)
|
||||
restart()
|
||||
state='move'
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
function scene.mouseDown(_,_,k)
|
||||
if k==1 then
|
||||
scene.keyDown("space")
|
||||
scene.keyDown('space')
|
||||
end
|
||||
end
|
||||
function scene.touchDown()
|
||||
scene.keyDown("space")
|
||||
scene.keyDown('space')
|
||||
end
|
||||
|
||||
function scene.update()
|
||||
@@ -234,7 +234,7 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
@@ -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"},
|
||||
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 f=state~=0
|
||||
modeSelector.hide=f
|
||||
@@ -247,23 +247,23 @@ local function touch(n)
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="r"or key=="space"then reset()
|
||||
elseif key=="escape"then SCN.back()
|
||||
if key=='r'or key=='space'then reset()
|
||||
elseif key=='escape'then SCN.back()
|
||||
elseif state~=2 then
|
||||
if key=="d"or key=="c"then touch(1)
|
||||
elseif key=="f"or key=="v"then touch(2)
|
||||
elseif key=="j"or key=="n"then touch(3)
|
||||
elseif key=="k"or key=="m"then touch(4)
|
||||
if key=='d'or key=='c'then touch(1)
|
||||
elseif key=='f'or key=='v'then touch(2)
|
||||
elseif key=='j'or key=='n'then touch(3)
|
||||
elseif key=='k'or key=='m'then touch(4)
|
||||
elseif state==0 then
|
||||
if key=="tab"then
|
||||
if key=='tab'then
|
||||
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
|
||||
elseif key=="q"then
|
||||
bgmSelector:scroll(love.keyboard.isDown("lshift","rshift")and -1 or 1)
|
||||
elseif key=="w"then
|
||||
colorSelector:scroll(love.keyboard.isDown("lshift","rshift")and -1 or 1)
|
||||
elseif key=="e"then
|
||||
elseif key=='q'then
|
||||
bgmSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
|
||||
elseif key=='w'then
|
||||
colorSelector:scroll(love.keyboard.isDown('lshift','rshift')and -1 or 1)
|
||||
elseif key=='e'then
|
||||
arcade=not arcade
|
||||
end
|
||||
end
|
||||
@@ -380,7 +380,7 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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,
|
||||
arcadeSwitch,
|
||||
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
|
||||
@@ -252,16 +252,16 @@ end
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="r"then
|
||||
if key=='r'then
|
||||
if state~=1 or sure>.2 then
|
||||
newGame()
|
||||
else
|
||||
sure=1
|
||||
MES.new('info',"Press again")
|
||||
end
|
||||
elseif key=="z"or key=="x"then
|
||||
elseif key=='z'or key=='x'then
|
||||
love.mousepressed(ms.getPosition())
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
if state~=1 or sure>.2 then
|
||||
SCN.back()
|
||||
else
|
||||
@@ -269,7 +269,7 @@ function scene.keyDown(key,isRep)
|
||||
MES.new('info',"Press again")
|
||||
end
|
||||
elseif state==0 then
|
||||
if key=="q"then
|
||||
if key=='q'then
|
||||
invis=not invis
|
||||
end
|
||||
end
|
||||
@@ -280,7 +280,7 @@ local function touch(x,y)
|
||||
tap(x,y)
|
||||
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.touchMove(x,y)touch(x,y)end
|
||||
|
||||
@@ -399,9 +399,9 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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.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='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.newButton{name='back',x=1200,y=660,w=110,font=50,fText=CHAR.icon.back,code=pressKey'escape'},
|
||||
}
|
||||
|
||||
return scene
|
||||
|
||||
@@ -44,9 +44,9 @@ end
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
SCN.back()
|
||||
elseif key=="space"then
|
||||
elseif key=='space'then
|
||||
if state==0 then--main
|
||||
if timer==0 then
|
||||
state=1
|
||||
@@ -77,11 +77,11 @@ function scene.keyDown(key,isRep)
|
||||
end
|
||||
function scene.mouseDown(_,_,k)
|
||||
if k==1 then
|
||||
scene.keyDown("space")
|
||||
scene.keyDown('space')
|
||||
end
|
||||
end
|
||||
function scene.touchDown()
|
||||
scene.keyDown("space")
|
||||
scene.keyDown('space')
|
||||
end
|
||||
|
||||
function scene.update()
|
||||
@@ -163,7 +163,7 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
@@ -44,22 +44,22 @@ local function start()
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="space"then
|
||||
if key=='space'then
|
||||
if state==0 then
|
||||
start()
|
||||
end
|
||||
elseif key=="r"then
|
||||
elseif key=='r'then
|
||||
state=0
|
||||
bx,by=640,360
|
||||
vx,vy=0,0
|
||||
ry=0
|
||||
p1.score,p2.score=0,0
|
||||
SFX.play('hold')
|
||||
elseif key=="w"or key=="s"then
|
||||
elseif key=='w'or key=='s'then
|
||||
p1.y0=false
|
||||
elseif key=="up"or key=="down"then
|
||||
elseif key=='up'or key=='down'then
|
||||
p2.y0=false
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
@@ -86,10 +86,10 @@ function scene.update()
|
||||
P.vy=P.vy*.5
|
||||
end
|
||||
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)
|
||||
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)
|
||||
end
|
||||
P.y=P.y+P.vy
|
||||
@@ -176,7 +176,7 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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},
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if state==0 then
|
||||
if key=="space"then
|
||||
if key=='space'then
|
||||
reset()
|
||||
state=1
|
||||
ct=60
|
||||
|
||||
@@ -79,9 +79,9 @@ function scene.touchDown(x,y)
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="z"or key=="x"then
|
||||
if key=='z'or key=='x'then
|
||||
love.mousepressed(ms.getPosition())
|
||||
elseif key=="space"then
|
||||
elseif key=='space'then
|
||||
if state>0 then
|
||||
board={}
|
||||
time=0
|
||||
@@ -89,23 +89,23 @@ function scene.keyDown(key,isRep)
|
||||
state=0
|
||||
progress=0
|
||||
end
|
||||
elseif key=="q"then
|
||||
elseif key=='q'then
|
||||
if state==0 then
|
||||
invis=not invis
|
||||
end
|
||||
elseif key=="w"then
|
||||
elseif key=='w'then
|
||||
if state==0 then
|
||||
disappear=not disappear
|
||||
end
|
||||
elseif key=="e"then
|
||||
elseif key=='e'then
|
||||
if state==0 then
|
||||
tapFX=not tapFX
|
||||
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
|
||||
rank=tonumber(key)
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
@@ -166,11 +166,11 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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.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='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='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='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},
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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},
|
||||
}
|
||||
return scene
|
||||
|
||||
@@ -18,7 +18,7 @@ end
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
SCN.back()
|
||||
else
|
||||
if lastKey~=key then
|
||||
|
||||
@@ -125,38 +125,38 @@ local function merge()
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
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 not cx then
|
||||
cx,cy=3,3
|
||||
else
|
||||
if key=="up"then
|
||||
if key=='up'then
|
||||
if cy>1 then cy=cy-1 end
|
||||
elseif key=="down"then
|
||||
elseif key=='down'then
|
||||
if cy<5 then cy=cy+1 end
|
||||
elseif key=="left"then
|
||||
elseif key=='left'then
|
||||
if cx>1 then cx=cx-1 end
|
||||
elseif key=="right"then
|
||||
elseif key=='right'then
|
||||
if cx<5 then cx=cx+1 end
|
||||
end
|
||||
end
|
||||
elseif key=="z"or key=="space"then
|
||||
elseif key=='z'or key=='space'then
|
||||
merge()
|
||||
elseif key=="r"then
|
||||
elseif key=='r'then
|
||||
reset()
|
||||
elseif key=="q"then
|
||||
elseif key=='q'then
|
||||
if state==0 then
|
||||
nexts=not nexts
|
||||
end
|
||||
elseif key=="w"then
|
||||
elseif key=='w'then
|
||||
if state==0 then
|
||||
invis=not invis
|
||||
end
|
||||
elseif key=="e"then
|
||||
elseif key=='e'then
|
||||
if state==0 then
|
||||
fast=not fast
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
@@ -217,7 +217,7 @@ function scene.update()
|
||||
elseif fast and(
|
||||
msIsDown(1)or
|
||||
#tcTouches()>0 or
|
||||
kbIsDown("space")
|
||||
kbIsDown('space')
|
||||
)then
|
||||
merge()
|
||||
end
|
||||
@@ -302,10 +302,10 @@ function scene.draw()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
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='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.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='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.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ end
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
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:sub(1,2)=='CC'then
|
||||
if CUSTOMENV.sequence=='fixed'then
|
||||
@@ -62,7 +62,7 @@ function scene.keyDown(key,isRep)
|
||||
return
|
||||
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
|
||||
saveFile(CUSTOMENV,'conf/customEnv')
|
||||
loadGame('custom_puzzle',true)
|
||||
@@ -71,13 +71,13 @@ function scene.keyDown(key,isRep)
|
||||
saveFile(CUSTOMENV,'conf/customEnv')
|
||||
loadGame('custom_clear',true)
|
||||
end
|
||||
elseif key=="f"then
|
||||
elseif key=='f'then
|
||||
SCN.go('custom_field','swipeD')
|
||||
elseif key=="s"then
|
||||
elseif key=='s'then
|
||||
SCN.go('custom_sequence','swipeD')
|
||||
elseif key=="m"then
|
||||
elseif key=='m'then
|
||||
SCN.go('custom_mission','swipeD')
|
||||
elseif key=="delete"then
|
||||
elseif key=='delete'then
|
||||
if sure>.3 then
|
||||
TABLE.cut(FIELD)TABLE.cut(BAG)TABLE.cut(MISSION)
|
||||
FIELD[1]=DATA.newBoard()
|
||||
@@ -96,16 +96,16 @@ function scene.keyDown(key,isRep)
|
||||
sure=1
|
||||
MES.new('info',text.sureReset)
|
||||
end
|
||||
elseif key=="f1"then
|
||||
elseif key=='f1'then
|
||||
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().."!"
|
||||
if #BAG>0 then str=str..DATA.copySequence()end
|
||||
str=str.."!"
|
||||
if #MISSION>0 then str=str..DATA.copyMission()end
|
||||
sys.setClipboardText(str.."!"..DATA.copyBoards().."!")
|
||||
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 args=STRING.split(str:sub((str:find(":")or 0)+1),"!")
|
||||
if #args<4 then goto THROW_fail end
|
||||
@@ -122,7 +122,7 @@ function scene.keyDown(key,isRep)
|
||||
MES.new('check',text.importSuccess)
|
||||
do return end
|
||||
::THROW_fail::MES.new('error',text.dataCorrupted)
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
saveFile(CUSTOMENV,'conf/customEnv')
|
||||
SCN.back()
|
||||
else
|
||||
@@ -186,13 +186,13 @@ scene.widgetScrollHeight=450
|
||||
scene.widgetList={
|
||||
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='mod', x=1110,y=200,w=230,h=90,color='Z',code=pressKey"f1"},
|
||||
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'},
|
||||
|
||||
--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='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='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='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='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')},
|
||||
|
||||
--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='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='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='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='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='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey'escape'},
|
||||
|
||||
--Rule set
|
||||
WIDGET.newSelector{name='eventSet', x=1050,y=760,w=340,color='H',list=sList.eventSet,disp=CUSval('eventSet'),code=CUSsto('eventSet')},
|
||||
|
||||
@@ -162,26 +162,26 @@ function scene.touchUp(x,y)scene.mouseUp(x,y,1)end
|
||||
scene.touchMove=scene.mouseMove
|
||||
|
||||
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 key=="up"then
|
||||
if key=='up'then
|
||||
if penY<20 then penY=penY+1 end
|
||||
elseif key=="down"then
|
||||
elseif key=='down'then
|
||||
if penY>1 then penY=penY-1 end
|
||||
elseif key=="left"then
|
||||
elseif key=='left'then
|
||||
if penX>1 then penX=penX-1 end
|
||||
elseif key=="right"then
|
||||
elseif key=='right'then
|
||||
if penX<10 then penX=penX+1 end
|
||||
end
|
||||
if kb.isDown("space")then
|
||||
scene.keyDown("space")
|
||||
if kb.isDown('space')then
|
||||
scene.keyDown('space')
|
||||
end
|
||||
elseif key=="space"then
|
||||
elseif key=='space'then
|
||||
if penX and penY then
|
||||
curPen=1
|
||||
_pTouch(penX,penY)
|
||||
end
|
||||
elseif key=="delete"then
|
||||
elseif key=='delete'then
|
||||
if sure>.3 then
|
||||
FIELD[page]=DATA.newBoard()
|
||||
sure=0
|
||||
@@ -190,12 +190,12 @@ function scene.keyDown(key)
|
||||
sure=1
|
||||
MES.new('info',text.sureReset)
|
||||
end
|
||||
elseif key=="j"then
|
||||
elseif key=='j'then
|
||||
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})
|
||||
SFX.play('blip')
|
||||
elseif key=="l"then
|
||||
elseif key=='l'then
|
||||
local F=FIELD[page]
|
||||
local cleared=false
|
||||
for i=#F,1,-1 do
|
||||
@@ -212,12 +212,12 @@ function scene.keyDown(key)
|
||||
SFX.play('clear_3',.8)
|
||||
SFX.play('fall',.8)
|
||||
end
|
||||
elseif key=="n"then
|
||||
elseif key=='n'then
|
||||
ins(FIELD,page+1,DATA.newBoard(FIELD[page]))
|
||||
page=page+1
|
||||
SFX.play('blip_1',.8)
|
||||
SYSFX.newShade(3,200,60,300,600,.5,1,.5)
|
||||
elseif key=="m"then
|
||||
elseif key=='m'then
|
||||
rem(FIELD,page)
|
||||
page=max(page-1,1)
|
||||
if not FIELD[1]then
|
||||
@@ -226,10 +226,10 @@ function scene.keyDown(key)
|
||||
SYSFX.newShade(3,200,60,300,600,1,.5,.5)
|
||||
SFX.play('clear_4',.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))
|
||||
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 p=str:find(":")--ptr*
|
||||
if p then
|
||||
@@ -243,11 +243,11 @@ function scene.keyDown(key)
|
||||
else
|
||||
MES.new('error',text.dataCorrupted)
|
||||
end
|
||||
elseif key=="pageup"then
|
||||
elseif key=='pageup'then
|
||||
page=max(page-1,1)
|
||||
elseif key=="pagedown"then
|
||||
elseif key=='pagedown'then
|
||||
page=min(page+1,#FIELD)
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
if curPen then
|
||||
curPen=false
|
||||
penPath={}
|
||||
@@ -259,7 +259,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
end
|
||||
function scene.keyUp(key)
|
||||
if key=="space"then
|
||||
if key=='space'then
|
||||
_pDraw()
|
||||
curPen=false
|
||||
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='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='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='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='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='clear', x=990, y=530,w=120,color='Z', font=70,fText=CHAR.icon.trash,code=pressKey"delete"},
|
||||
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='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.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='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='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='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='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ end
|
||||
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}
|
||||
function scene.keyDown(key)
|
||||
if key=="left"then
|
||||
if key=='left'then
|
||||
local p=cur
|
||||
if p==0 then
|
||||
cur=#MISSION
|
||||
@@ -32,7 +32,7 @@ function scene.keyDown(key)
|
||||
until MISSION[p]~=MISSION[cur]
|
||||
cur=p
|
||||
end
|
||||
elseif key=="right"then
|
||||
elseif key=='right'then
|
||||
local p=cur
|
||||
if p==#MISSION then
|
||||
cur=0
|
||||
@@ -42,7 +42,7 @@ function scene.keyDown(key)
|
||||
until MISSION[p+1]~=MISSION[cur+1]
|
||||
cur=p
|
||||
end
|
||||
elseif key=="ten"then
|
||||
elseif key=='ten'then
|
||||
for _=1,10 do
|
||||
local p=cur
|
||||
if p==#MISSION then break end
|
||||
@@ -51,17 +51,17 @@ function scene.keyDown(key)
|
||||
until MISSION[p+1]~=MISSION[cur+1]
|
||||
cur=p
|
||||
end
|
||||
elseif key=="backspace"then
|
||||
elseif key=='backspace'then
|
||||
if #input>0 then
|
||||
input=""
|
||||
elseif cur>0 then
|
||||
rem(MISSION,cur)
|
||||
cur=cur-1
|
||||
if cur>0 and MISSION[cur]==MISSION[cur+1]then
|
||||
scene.keyDown("right")
|
||||
scene.keyDown('right')
|
||||
end
|
||||
end
|
||||
elseif key=="delete"then
|
||||
elseif key=='delete'then
|
||||
if sure>.3 then
|
||||
TABLE.cut(MISSION)
|
||||
cur=0
|
||||
@@ -71,12 +71,12 @@ function scene.keyDown(key)
|
||||
sure=1
|
||||
MES.new('info',text.sureReset)
|
||||
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
|
||||
sys.setClipboardText("Techmino Target:"..DATA.copyMission())
|
||||
MES.new('check',text.exportSuccess)
|
||||
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 p=str:find(":")--ptr*
|
||||
if p then
|
||||
@@ -91,7 +91,7 @@ function scene.keyDown(key)
|
||||
else
|
||||
MES.new('error',text.dataCorrupted)
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
elseif type(key)=='number'then
|
||||
local p=cur+1
|
||||
@@ -99,7 +99,7 @@ function scene.keyDown(key)
|
||||
ins(MISSION,p,key)
|
||||
cur=p
|
||||
else
|
||||
if key=="space"then
|
||||
if key=='space'then
|
||||
key="_"
|
||||
else
|
||||
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='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='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='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.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.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='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='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='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.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
|
||||
@@ -31,7 +31,7 @@ local minoKey2={
|
||||
z=8,s=9,t=14,j=19,l=20,i=25,['-']=26,o=29,
|
||||
}
|
||||
function scene.keyDown(key)
|
||||
if key=="left"then
|
||||
if key=='left'then
|
||||
local p=cur
|
||||
if p==0 then
|
||||
cur=#BAG
|
||||
@@ -41,7 +41,7 @@ function scene.keyDown(key)
|
||||
until BAG[p]~=BAG[cur]
|
||||
cur=p
|
||||
end
|
||||
elseif key=="right"then
|
||||
elseif key=='right'then
|
||||
local p=cur
|
||||
if p==#BAG then
|
||||
cur=0
|
||||
@@ -51,7 +51,7 @@ function scene.keyDown(key)
|
||||
until BAG[p+1]~=BAG[cur+1]
|
||||
cur=p
|
||||
end
|
||||
elseif key=="ten"then
|
||||
elseif key=='ten'then
|
||||
for _=1,10 do
|
||||
local p=cur
|
||||
if p==#BAG then break end
|
||||
@@ -60,12 +60,12 @@ function scene.keyDown(key)
|
||||
until BAG[p+1]~=BAG[cur+1]
|
||||
cur=p
|
||||
end
|
||||
elseif key=="backspace"then
|
||||
elseif key=='backspace'then
|
||||
if cur>0 then
|
||||
rem(BAG,cur)
|
||||
cur=cur-1
|
||||
end
|
||||
elseif key=="delete"then
|
||||
elseif key=='delete'then
|
||||
if sure>.3 then
|
||||
TABLE.cut(BAG)
|
||||
cur=0
|
||||
@@ -75,17 +75,17 @@ function scene.keyDown(key)
|
||||
sure=1
|
||||
MES.new('info',text.sureReset)
|
||||
end
|
||||
elseif key=="="then
|
||||
elseif key=='='then
|
||||
local l={1,2,3,4,5,6,7}
|
||||
repeat scene.keyDown(rem(l,math.random(#l)))until not l[1]
|
||||
elseif key=="tab"then
|
||||
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=='tab'then
|
||||
WIDGET.active.sequence:scroll(kb.isDown('lshift','rshift')and -1 or 1)
|
||||
elseif key=='c'and kb.isDown('lctrl','rctrl')or key=='cC'then
|
||||
if #BAG>0 then
|
||||
sys.setClipboardText("Techmino SEQ:"..DATA.copySequence())
|
||||
MES.new('check',text.exportSuccess)
|
||||
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 p=str:find(":")--ptr*
|
||||
if p then
|
||||
@@ -102,13 +102,13 @@ function scene.keyDown(key)
|
||||
cur=0
|
||||
MES.new('error',text.dataCorrupted)
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
elseif type(key)=='number'then
|
||||
cur=cur+1
|
||||
ins(BAG,cur,key)
|
||||
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
|
||||
local p=cur+1
|
||||
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='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='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='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='reset', x=1000,y=460,w=80,color='lY',font=50,fText=CHAR.icon.trash, code=pressKey"delete"},
|
||||
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='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='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='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='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='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='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.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='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='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ function scene.sceneInit()
|
||||
end
|
||||
|
||||
function scene.keyDown(key)
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
pauseGame()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -95,7 +95,7 @@ function scene.wheelMoved(_,y)
|
||||
WHEELMOV(y)
|
||||
end
|
||||
function scene.keyDown(key)
|
||||
if key=="up"then
|
||||
if key=='up'then
|
||||
if selected and selected>1 then
|
||||
selected=selected-1
|
||||
if selected<scrollPos+1 then
|
||||
@@ -103,7 +103,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
scene.widgetList.copy.hide=false
|
||||
end
|
||||
elseif key=="down"then
|
||||
elseif key=='down'then
|
||||
if selected and selected<#_getList()then
|
||||
selected=selected+1
|
||||
if selected>scrollPos+15 then
|
||||
@@ -111,28 +111,28 @@ function scene.keyDown(key)
|
||||
end
|
||||
scene.widgetList.copy.hide=false
|
||||
end
|
||||
elseif key=="left"or key=="pageup"then
|
||||
for _=1,12 do scene.keyDown("up")end
|
||||
elseif key=="right"or key=="pagedown"then
|
||||
for _=1,12 do scene.keyDown("down")end
|
||||
elseif key=="application"then
|
||||
elseif key=='left'or key=='pageup'then
|
||||
for _=1,12 do scene.keyDown('up')end
|
||||
elseif key=='right'or key=='pagedown'then
|
||||
for _=1,12 do scene.keyDown('down')end
|
||||
elseif key=='application'then
|
||||
local url=_getList()[selected].url
|
||||
if url then love.system.openURL(url)end
|
||||
elseif key=="delete"then
|
||||
elseif key=='delete'then
|
||||
if inputBox:hasText()then
|
||||
_clearResult()
|
||||
inputBox:clear()
|
||||
SFX.play('hold')
|
||||
end
|
||||
elseif key=="backspace"then
|
||||
elseif key=='backspace'then
|
||||
WIDGET.keyPressed("backspace")
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
if inputBox:hasText()then
|
||||
scene.keyDown("delete")
|
||||
scene.keyDown('delete')
|
||||
else
|
||||
SCN.back()
|
||||
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]
|
||||
t=t.title_Org..":\n"..t.content_Org..(t.url and"\n[ "..t.url.." ]\n"or"\n")..text.dictNote
|
||||
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='title', x=100,y=15,font=70,align='L'},
|
||||
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='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='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='pagedown',x=1210,y=565,w=80,font=50,fText=CHAR.icon.toDown,code=pressKey"pagedown",hide=not MOBILE},
|
||||
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='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='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.newButton{name='back', x=1165,y=60,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -203,22 +203,22 @@ function scene.touchMove()
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if replaying then
|
||||
if key=="space"then
|
||||
if key=='space'then
|
||||
if not isRep then
|
||||
gameRate=gameRate==0 and 1 or 0
|
||||
end
|
||||
_updateRepButtons()
|
||||
elseif key=="left"then
|
||||
elseif key=='left'then
|
||||
if not isRep then
|
||||
_speedDown()
|
||||
end
|
||||
elseif key=="right"then
|
||||
elseif key=='right'then
|
||||
if gameRate==0 then
|
||||
_step()
|
||||
elseif not isRep then
|
||||
_speedUp()
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
pauseGame()
|
||||
end
|
||||
else
|
||||
@@ -226,16 +226,16 @@ function scene.keyDown(key,isRep)
|
||||
return
|
||||
elseif _checkGameKeyDown(key)then
|
||||
if GAME.tasUsed then
|
||||
if key=="f1"then
|
||||
if key=='f1'then
|
||||
if not isRep then
|
||||
gameRate=gameRate==0 and .125 or 0
|
||||
end
|
||||
_updateRepButtons()
|
||||
elseif key=="f2"then
|
||||
elseif key=='f2'then
|
||||
if not isRep then
|
||||
_speedDown()
|
||||
end
|
||||
elseif key=="f3"then
|
||||
elseif key=='f3'then
|
||||
if gameRate==0 then
|
||||
_step()
|
||||
elseif not isRep then
|
||||
@@ -243,7 +243,7 @@ function scene.keyDown(key,isRep)
|
||||
end
|
||||
end
|
||||
end
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
pauseGame()
|
||||
end
|
||||
end
|
||||
@@ -269,7 +269,7 @@ function scene.gamepadDown(key)
|
||||
else
|
||||
_restart()
|
||||
end
|
||||
elseif key=="back"then
|
||||
elseif key=='back'then
|
||||
pauseGame()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,15 +9,15 @@ function scene.wheelMoved(_,y)
|
||||
WHEELMOV(y)
|
||||
end
|
||||
function scene.keyDown(key)
|
||||
if key=="up"then
|
||||
if key=='up'then
|
||||
WIDGET.active.texts:scroll(-5)
|
||||
elseif key=="down"then
|
||||
elseif key=='down'then
|
||||
WIDGET.active.texts:scroll(5)
|
||||
elseif key=="pageup"then
|
||||
elseif key=='pageup'then
|
||||
WIDGET.active.texts:scroll(-20)
|
||||
elseif key=="pagedown"then
|
||||
elseif key=='pagedown'then
|
||||
WIDGET.active.texts:scroll(20)
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -179,7 +179,7 @@ scene.mouseDown=scene.touchDown
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="z"or key=="x"then
|
||||
if key=='z'or key=='x'then
|
||||
love.mousepressed(love.mouse.getPosition())
|
||||
elseif #key==1 then
|
||||
if("12345678"):find(key,nil,true)then
|
||||
@@ -187,21 +187,21 @@ function scene.keyDown(key,isRep)
|
||||
else
|
||||
key=("hjkluiop"):find(key,nil,true)
|
||||
if key then
|
||||
if isDown("q")then press(key,1)end
|
||||
if isDown("w")then press(key,2)end
|
||||
if isDown("e")then press(key,3)end
|
||||
if isDown("r")then press(key,4)end
|
||||
if isDown("a")then press(key,5)end
|
||||
if isDown("s")then press(key,6)end
|
||||
if isDown("d")then press(key,7)end
|
||||
if isDown("f")then press(key,8)end
|
||||
if isDown('q')then press(key,1)end
|
||||
if isDown('w')then press(key,2)end
|
||||
if isDown('e')then press(key,3)end
|
||||
if isDown('r')then press(key,4)end
|
||||
if isDown('a')then press(key,5)end
|
||||
if isDown('s')then press(key,6)end
|
||||
if isDown('d')then press(key,7)end
|
||||
if isDown('f')then press(key,8)end
|
||||
end
|
||||
end
|
||||
elseif key=="tab"then
|
||||
elseif key=='tab'then
|
||||
SCN.swapTo('music','none')
|
||||
elseif key=="space"then
|
||||
elseif key=='space'then
|
||||
showLabel=not showLabel
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
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='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.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.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='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -13,15 +13,15 @@ function scene.wheelMoved(_,y)
|
||||
WHEELMOV(y)
|
||||
end
|
||||
function scene.keyDown(key)
|
||||
if key=="up"then
|
||||
if key=='up'then
|
||||
WIDGET.active.texts:scroll(-5)
|
||||
elseif key=="down"then
|
||||
elseif key=='down'then
|
||||
WIDGET.active.texts:scroll(5)
|
||||
elseif key=="pageup"then
|
||||
elseif key=='pageup'then
|
||||
WIDGET.active.texts:scroll(-20)
|
||||
elseif key=="pagedown"then
|
||||
elseif key=='pagedown'then
|
||||
WIDGET.active.texts:scroll(20)
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -139,7 +139,7 @@ function scene.mouseDown()
|
||||
end
|
||||
scene.touchDown=scene.mouseDown
|
||||
function scene.keyDown(key)
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
love.event.quit()
|
||||
else
|
||||
scene.mouseDown()
|
||||
|
||||
@@ -59,15 +59,15 @@ local function _testButton(n)
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="1"then
|
||||
if key=='1'then
|
||||
if _testButton(1)then
|
||||
SCN.go('mode')
|
||||
end
|
||||
elseif key=="q"then
|
||||
elseif key=='q'then
|
||||
if _testButton(2)then
|
||||
loadGame(STAT.lastPlay,true)
|
||||
end
|
||||
elseif key=="a"then
|
||||
elseif key=='a'then
|
||||
if _testButton(3)then
|
||||
if WS.status('app')=='running'then
|
||||
NET.tryLogin(false)
|
||||
@@ -77,45 +77,45 @@ function scene.keyDown(key,isRep)
|
||||
MES.new('info',text.wsConnecting)
|
||||
end
|
||||
end
|
||||
elseif key=="z"then
|
||||
elseif key=='z'then
|
||||
if _testButton(4)then
|
||||
SCN.go('customGame')
|
||||
end
|
||||
elseif key=="-"then
|
||||
elseif key=='-'then
|
||||
if _testButton(5)then
|
||||
SCN.go('setting_game')
|
||||
end
|
||||
elseif key=="p"then
|
||||
elseif key=='p'then
|
||||
if _testButton(6)then
|
||||
SCN.go('stat')
|
||||
end
|
||||
elseif key=="l"then
|
||||
elseif key=='l'then
|
||||
if _testButton(7)then
|
||||
SCN.go('dict')
|
||||
end
|
||||
elseif key==","then
|
||||
elseif key==','then
|
||||
if _testButton(8)then
|
||||
SCN.go('replays')
|
||||
end
|
||||
elseif key=="2"then
|
||||
elseif key=='2'then
|
||||
if _testButton(9)then
|
||||
SCN.go('music')
|
||||
end
|
||||
elseif key=="3"then
|
||||
elseif key=='3'then
|
||||
if _testButton(10)then
|
||||
SCN.go('lang')
|
||||
end
|
||||
elseif key=="x"then
|
||||
elseif key=='x'then
|
||||
if _testButton(11)then
|
||||
SCN.go('about')
|
||||
end
|
||||
elseif key=="m"then
|
||||
elseif key=='m'then
|
||||
if _testButton(12)then
|
||||
SCN.go('manual')
|
||||
end
|
||||
elseif key=="c"then
|
||||
elseif key=='c'then
|
||||
enterConsole()
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
if TIME()-lastQuitTime<1 then
|
||||
VOC.play('bye')
|
||||
SCN.swapTo('quit','slowFade')
|
||||
@@ -184,20 +184,20 @@ function scene.draw()
|
||||
end
|
||||
|
||||
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='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='custom', x=-1200,y=570,w=800,h=100,color='lS',font=45,align='R',edge=30,code=pressKey"z"},
|
||||
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='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='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='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='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='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='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='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='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='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},
|
||||
}
|
||||
|
||||
return scene
|
||||
|
||||
@@ -15,15 +15,15 @@ function scene.wheelMoved(_,y)
|
||||
WHEELMOV(y)
|
||||
end
|
||||
function scene.keyDown(key)
|
||||
if key=="up"then
|
||||
if key=='up'then
|
||||
WIDGET.active.texts:scroll(-5)
|
||||
elseif key=="down"then
|
||||
elseif key=='down'then
|
||||
WIDGET.active.texts:scroll(5)
|
||||
elseif key=="pageup"then
|
||||
elseif key=='pageup'then
|
||||
WIDGET.active.texts:scroll(-20)
|
||||
elseif key=="pagedown"then
|
||||
elseif key=='pagedown'then
|
||||
WIDGET.active.texts:scroll(20)
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -60,7 +60,7 @@ end
|
||||
function scene.mouseDown(x,y,k)
|
||||
for _,M in next,MODOPT do
|
||||
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
|
||||
end
|
||||
end
|
||||
@@ -73,7 +73,7 @@ function scene.touchDown(x,y)
|
||||
end
|
||||
|
||||
function scene.keyDown(key)
|
||||
if key=="tab"or key=="delete"then
|
||||
if key=='tab'or key=='delete'then
|
||||
if GAME.mod[1]then
|
||||
while GAME.mod[1]do
|
||||
rem(GAME.mod).sel=0
|
||||
@@ -84,12 +84,12 @@ function scene.keyDown(key)
|
||||
elseif #key==1 then
|
||||
for _,M in next,MODOPT do
|
||||
if key==M.key then
|
||||
_toggleMod(M,kb.isDown("lshift","rshift"))
|
||||
_toggleMod(M,kb.isDown('lshift','rshift'))
|
||||
selected=M
|
||||
break
|
||||
end
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
end
|
||||
end
|
||||
@@ -157,7 +157,7 @@ end
|
||||
scene.widgetList={
|
||||
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.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},
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ function scene.mouseClick(x,y)
|
||||
mapCam.sel=false
|
||||
end
|
||||
elseif _ then
|
||||
scene.keyDown("return")
|
||||
scene.keyDown('return')
|
||||
end
|
||||
end
|
||||
mapCam.keyCtrl=false
|
||||
@@ -134,7 +134,7 @@ function scene.touchClick(x,y)
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="return"then
|
||||
if key=='return'then
|
||||
if mapCam.sel then
|
||||
if visibleModes[mapCam.sel]==2 then
|
||||
MES.new('info',text.unlockHint)
|
||||
@@ -143,9 +143,9 @@ function scene.keyDown(key,isRep)
|
||||
loadGame(mapCam.sel)
|
||||
end
|
||||
end
|
||||
elseif key=="f1"then
|
||||
elseif key=='f1'then
|
||||
SCN.go('mod')
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
if mapCam.sel then
|
||||
mapCam.sel=false
|
||||
else
|
||||
@@ -158,10 +158,10 @@ function scene.update()
|
||||
local dx,dy=0,0
|
||||
local F
|
||||
if not SCN.swapping then
|
||||
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("left","a")then dx=dx+10 F=true end
|
||||
if kb.isDown("right","d")then dx=dx-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('left', 'a')then dx=dx+10 F=true end
|
||||
if kb.isDown('right','d')then dx=dx-10 F=true end
|
||||
local js1=Z.js[1]
|
||||
if js1 then
|
||||
local dir=js1:getAxis(1)
|
||||
@@ -175,7 +175,7 @@ function scene.update()
|
||||
end
|
||||
if F then
|
||||
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)
|
||||
else
|
||||
_moveMap(dx,dy)
|
||||
@@ -329,7 +329,7 @@ end
|
||||
|
||||
scene.widgetList={
|
||||
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},
|
||||
}
|
||||
|
||||
|
||||
@@ -40,18 +40,18 @@ function scene.wheelMoved(_,y)
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
local S=selected
|
||||
if key=="down"then
|
||||
if key=='down'then
|
||||
if S<#bgmList then
|
||||
selected=S+1
|
||||
SFX.play('move',.7)
|
||||
end
|
||||
elseif key=="up"then
|
||||
elseif key=='up'then
|
||||
if S>1 then
|
||||
selected=S-1
|
||||
SFX.play('move',.7)
|
||||
end
|
||||
elseif not isRep then
|
||||
if key=="return"or key=="space"then
|
||||
if key=='return'or key=='space'then
|
||||
if BGM.nowPlay~=bgmList[S]then
|
||||
BGM.play(bgmList[S])
|
||||
if SETTING.bgm>0 then
|
||||
@@ -60,9 +60,9 @@ function scene.keyDown(key,isRep)
|
||||
else
|
||||
BGM.stop()
|
||||
end
|
||||
elseif key=="tab"then
|
||||
elseif key=='tab'then
|
||||
SCN.swapTo('launchpad','none')
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
elseif #key==1 and key:find'[0-9a-z]'then
|
||||
for _=1,#bgmList do
|
||||
@@ -124,10 +124,10 @@ scene.widgetList={
|
||||
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.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='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='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='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='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -132,13 +132,13 @@ function scene.touchMove()
|
||||
end
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
if not inputBox.hide then
|
||||
_switchChat()
|
||||
else
|
||||
_quit()
|
||||
end
|
||||
elseif key=="return"then
|
||||
elseif key=='return'then
|
||||
local mes=STRING.trim(inputBox:getText())
|
||||
if not inputBox.hide and #mes>0 then
|
||||
NET.sendMessage(mes)
|
||||
@@ -157,13 +157,13 @@ function scene.keyDown(key,isRep)
|
||||
VK.press(k)
|
||||
end
|
||||
elseif not _hideReadyUI()then
|
||||
if key=="space"then
|
||||
if key=='space'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
|
||||
_setCancel()
|
||||
end
|
||||
elseif key=="s"then
|
||||
elseif key=='s'then
|
||||
_gotoSetting()
|
||||
end
|
||||
end
|
||||
@@ -177,8 +177,8 @@ function scene.keyUp(key)
|
||||
end
|
||||
end
|
||||
function scene.gamepadDown(key)
|
||||
if key=="back"then
|
||||
scene.keyDown("escape")
|
||||
if key=='back'then
|
||||
scene.keyDown('escape')
|
||||
else
|
||||
if not playing then return end
|
||||
local k=KEY_MAP.joystick[key]
|
||||
|
||||
@@ -54,9 +54,9 @@ function scene.sceneBack()
|
||||
end
|
||||
|
||||
function scene.keyDown(key)
|
||||
if key=="return"then
|
||||
if key=='return'then
|
||||
_createRoom()
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
else
|
||||
WIDGET.keyPressed(key)
|
||||
@@ -95,7 +95,7 @@ scene.widgetList={
|
||||
|
||||
--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.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},
|
||||
|
||||
--Special rules
|
||||
|
||||
@@ -63,17 +63,17 @@ end
|
||||
function scene.keyDown(key)
|
||||
if NET.getlock('enterRoom')then return end
|
||||
if WIDGET.sel~=passwordBox then
|
||||
if key=="r"then
|
||||
if key=='r'then
|
||||
if fetchTimer<=7 then
|
||||
_fetchRoom()
|
||||
end
|
||||
elseif key=="s"then
|
||||
elseif key=='s'then
|
||||
SCN.go('setting_game')
|
||||
elseif key=="n"then
|
||||
elseif key=='n'then
|
||||
SCN.go('net_newRoom')
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
elseif roomList:getLen()>0 and key=="return"then
|
||||
elseif roomList:getLen()>0 and key=='return'then
|
||||
local R=roomList:getSel()
|
||||
if NET.getlock('fetchRoom')or not R then return end
|
||||
if R.roomInfo.version==VERSION.room then
|
||||
@@ -144,13 +144,13 @@ end
|
||||
scene.widgetList={
|
||||
roomList,
|
||||
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='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='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.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey"escape"},
|
||||
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.newButton{name='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=pressKey'escape'},
|
||||
}
|
||||
|
||||
return scene
|
||||
|
||||
@@ -122,42 +122,42 @@ end
|
||||
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="q"then
|
||||
if key=='q'then
|
||||
SCN.back()
|
||||
GAME.playing=false
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.swapTo(GAME.result and'game'or'depause','none')
|
||||
elseif key=="s"then
|
||||
elseif key=='s'then
|
||||
if not GAME.fromRepMenu then
|
||||
GAME.prevBG=BG.cur
|
||||
SCN.go('setting_sound')
|
||||
end
|
||||
elseif key=="r"then
|
||||
elseif key=='r'then
|
||||
if not GAME.fromRepMenu then
|
||||
resetGameData()
|
||||
SCN.swapTo('game','none')
|
||||
end
|
||||
elseif key=="p"then
|
||||
elseif key=='p'then
|
||||
if(GAME.result or GAME.replaying)and #PLAYERS==1 then
|
||||
resetGameData('r')
|
||||
PLAYERS[1]:startStreaming(GAME.rep)
|
||||
SCN.swapTo('game','none')
|
||||
end
|
||||
elseif key=="o"then
|
||||
elseif key=='o'then
|
||||
if(GAME.result or GAME.replaying)and #PLAYERS==1 and not GAME.saved then
|
||||
if DATA.saveReplay()then
|
||||
GAME.saved=true
|
||||
SFX.play('connected')
|
||||
end
|
||||
end
|
||||
elseif key=="tab"or key=="Stab"then
|
||||
if love.keyboard.isDown("lshift","rshift")or key=="Stab"then
|
||||
elseif key=='tab'or key=='Stab'then
|
||||
if love.keyboard.isDown('lshift','rshift')or key=='Stab'then
|
||||
page=(page-1)%2
|
||||
else
|
||||
page=(page+1)%2
|
||||
end
|
||||
timer2=0
|
||||
elseif key=="t"then
|
||||
elseif key=='t'then
|
||||
if SETTING.allowTAS and not(GAME.result or GAME.replaying)then
|
||||
GAME.tasUsed=true
|
||||
SFX.play('ren_mega')
|
||||
@@ -344,23 +344,23 @@ function scene.draw()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
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='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='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='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='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='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,
|
||||
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}}}},
|
||||
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}},
|
||||
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,
|
||||
},
|
||||
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='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},
|
||||
}
|
||||
|
||||
return scene
|
||||
|
||||
@@ -81,12 +81,12 @@ function scene.sceneInit()
|
||||
end
|
||||
|
||||
function scene.keyDown(key)
|
||||
if key=="return"then
|
||||
if key=='return'then
|
||||
local rep=listBox:getSel()
|
||||
if rep then
|
||||
_playRep(rep.fileName)
|
||||
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()
|
||||
if rep then
|
||||
if rep.available and rep.fileName then
|
||||
@@ -101,7 +101,7 @@ function scene.keyDown(key)
|
||||
MES.new('error',text.replayBroken)
|
||||
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 res,fileData=pcall(love.data.decode,'string','base64',repStr)
|
||||
if res then
|
||||
@@ -118,7 +118,7 @@ function scene.keyDown(key)
|
||||
else
|
||||
MES.new('error',text.dataCorrupted)
|
||||
end
|
||||
elseif key=="delete"then
|
||||
elseif key=='delete'then
|
||||
local rep=listBox:getSel()
|
||||
if rep then
|
||||
if sure>.3 then
|
||||
@@ -137,7 +137,7 @@ function scene.keyDown(key)
|
||||
MES.new('info',text.sureReset)
|
||||
end
|
||||
end
|
||||
elseif key=="escape"then
|
||||
elseif key=='escape'then
|
||||
SCN.back()
|
||||
else
|
||||
WIDGET.keyPressed(key)
|
||||
@@ -152,10 +152,10 @@ end
|
||||
|
||||
scene.widgetList={
|
||||
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='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='delete',x=850,y=640,w=80,h=80,color='lR',code=pressKey"delete",font=50,fText=CHAR.icon.trash},
|
||||
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='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='back', x=1140,y=640,w=170,h=80,font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -32,13 +32,13 @@ local forbbidenKeys={
|
||||
}
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
if selected then
|
||||
selected=false
|
||||
else
|
||||
SCN.back()
|
||||
end
|
||||
elseif key=="backspace"then
|
||||
elseif key=='backspace'then
|
||||
if selected then
|
||||
for k,v in next,KEY_MAP.keyboard do
|
||||
if v==selected then
|
||||
@@ -61,7 +61,7 @@ function scene.keyDown(key,isRep)
|
||||
end
|
||||
end
|
||||
function scene.gamepadDown(key)
|
||||
if key=="back"then
|
||||
if key=='back'then
|
||||
if selected then
|
||||
for k,v in next,KEY_MAP.joystick do
|
||||
if v==selected then
|
||||
|
||||
@@ -38,9 +38,9 @@ end
|
||||
scene.touchDown=scene.mouseDown
|
||||
|
||||
function scene.keyDown(key)
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
SCN.back()
|
||||
elseif key=="space"then
|
||||
elseif key=='space'then
|
||||
scene.mouseDown(942,626)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,17 +31,17 @@ end
|
||||
scene.touchDown=scene.mouseDown
|
||||
|
||||
function scene.keyDown(key)
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
SCN.back()
|
||||
elseif key=="l"then
|
||||
elseif key=='l'then
|
||||
loadGame('sprintLock',true)
|
||||
elseif key=="f"then
|
||||
elseif key=='f'then
|
||||
loadGame('sprintFix',true)
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
elseif v>1 then
|
||||
v=v-.16
|
||||
|
||||
@@ -55,9 +55,9 @@ function scene.mouseDown(x,y)
|
||||
end
|
||||
scene.touchDown=scene.mouseDown
|
||||
function scene.keyDown(key)
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
_push("[keyDown] <"..key..">")
|
||||
if key=="escape"then
|
||||
if key=='escape'then
|
||||
backCounter=backCounter-1
|
||||
if backCounter==0 then
|
||||
SCN.back()
|
||||
|
||||
Reference in New Issue
Block a user