Merge branch 'wstest_3_28' into main

This commit is contained in:
MrZ626
2021-04-07 09:39:21 +08:00
72 changed files with 2179 additions and 1772 deletions

View File

@@ -52,6 +52,7 @@ local function reset()
end end
board[rnd(5)][rnd(5)]=2
fallingTimer=false
failPos=false
end
function scene.sceneInit()
BG.set("rainbow2")
@@ -76,7 +77,8 @@ local function merge()
local connected={{cy,cx}}
local count=1
repeat
local y,x=unpack(rem(connected))
local c=rem(connected)
local y,x=c[1],c[2]
if board[y][x]~=0 then
board[y][x]=0
SYSFX.newShade(2,320+x*128-128,40+y*128-128,128,128)

View File

@@ -149,14 +149,14 @@ scene.widgetList={
WIDGET.newText{name="noMsn", x=610, y=550,align="L",color="grey",hide=function()return MISSION[1]end},
--Basic
WIDGET.newSelector{name="drop", x=170, y=150,w=220,color="orange", list={0,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},disp=lnk_CUSval("drop"),code=lnk_CUSsto("drop")},
WIDGET.newSelector{name="lock", x=170, y=230,w=220,color="red", list={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99}, disp=lnk_CUSval("lock"),code=lnk_CUSsto("lock")},
WIDGET.newSelector{name="wait", x=410, y=150,w=220,color="green", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=lnk_CUSval("wait"),code=lnk_CUSsto("wait")},
WIDGET.newSelector{name="fall", x=410, y=230,w=220,color="yellow", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=lnk_CUSval("fall"),code=lnk_CUSsto("fall")},
WIDGET.newSelector{name="drop", x=170, y=150,w=220,color="orange", list={0,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},disp=CUSval("drop"),code=CUSsto("drop")},
WIDGET.newSelector{name="lock", x=170, y=230,w=220,color="red", list={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99}, disp=CUSval("lock"),code=CUSsto("lock")},
WIDGET.newSelector{name="wait", x=410, y=150,w=220,color="green", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=CUSval("wait"),code=CUSsto("wait")},
WIDGET.newSelector{name="fall", x=410, y=230,w=220,color="yellow", list={0,1,2,3,4,5,6,7,8,10,15,20,30,60}, disp=CUSval("fall"),code=CUSsto("fall")},
--Else
WIDGET.newSelector{name="bg", x=1070, y=150,w=250,color="yellow",list=BG.getList(),disp=lnk_CUSval("bg"), code=function(i)CUSTOMENV.bg=i BG.set(i)end},
WIDGET.newSelector{name="bgm", x=1070, y=230,w=250,color="yellow", list=BGM.getList(), disp=lnk_CUSval("bgm"), code=function(i)CUSTOMENV.bgm=i BGM.play(i)end},
WIDGET.newSelector{name="bg", x=1070, y=150,w=250,color="yellow",list=BG.getList(),disp=CUSval("bg"), code=function(i)CUSTOMENV.bg=i BG.set(i)end},
WIDGET.newSelector{name="bgm", x=1070, y=230,w=250,color="yellow", list=BGM.getList(), disp=CUSval("bgm"), code=function(i)CUSTOMENV.bgm=i BGM.play(i)end},
--Copy/Paste/Start
WIDGET.newButton{name="copy", x=1070, y=310,w=310,h=70,color="lRed", font=25,code=pressKey"cC"},

View File

@@ -15,26 +15,26 @@ scene.widgetList={
WIDGET.newText{name="subTitle", x=530,y=50,font=35,align="L",color="grey"},
--Control
WIDGET.newSlider{name="nextCount", x=200, y=150, w=200,unit=6,disp=lnk_CUSval("nextCount"),code=lnk_CUSsto("nextCount")},
WIDGET.newSlider{name="holdCount", x=200, y=240, w=200,unit=6,disp=lnk_CUSval("holdCount"),code=lnk_CUSsto("holdCount")},
WIDGET.newSwitch{name="infHold", x=350, y=340, disp=lnk_CUSval("infHold"), code=lnk_CUSrev("infHold"),hide=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSwitch{name="phyHold", x=350, y=430, disp=lnk_CUSval("phyHold"), code=lnk_CUSrev("phyHold"),hide=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSlider{name="nextCount", x=200, y=150, w=200,unit=6,disp=CUSval("nextCount"),code=CUSsto("nextCount")},
WIDGET.newSlider{name="holdCount", x=200, y=240, w=200,unit=6,disp=CUSval("holdCount"),code=CUSsto("holdCount")},
WIDGET.newSwitch{name="infHold", x=350, y=340, disp=CUSval("infHold"), code=CUSrev("infHold"),hide=function()return CUSTOMENV.holdCount==0 end},
WIDGET.newSwitch{name="phyHold", x=350, y=430, disp=CUSval("phyHold"), code=CUSrev("phyHold"),hide=function()return CUSTOMENV.holdCount==0 end},
--Rule
WIDGET.newSelector{name="fieldH", x=270, y=520, w=260,color="sky", list=sList.fieldH, disp=lnk_CUSval("fieldH"),code=lnk_CUSsto("fieldH")},
WIDGET.newSelector{name="visible", x=840, y=60, w=260,color="lBlue",list=sList.visible, disp=lnk_CUSval("visible"),code=lnk_CUSsto("visible")},
WIDGET.newSelector{name="target", x=840, y=160, w=260,color="green",list=sList.target, disp=lnk_CUSval("target"),code=lnk_CUSsto("target")},
WIDGET.newSelector{name="freshLimit",x=840, y=260, w=260,color="purple",list=sList.freshLimit, disp=lnk_CUSval("freshLimit"),code=lnk_CUSsto("freshLimit")},
WIDGET.newSelector{name="opponent", x=1120, y=60, w=260,color="red", list=sList.opponent, disp=lnk_CUSval("opponent"),code=lnk_CUSsto("opponent")},
WIDGET.newSelector{name="life", x=1120, y=160, w=260,color="red", list=sList.life, disp=lnk_CUSval("life"),code=lnk_CUSsto("life")},
WIDGET.newSelector{name="pushSpeed",x=1120, y=260, w=260,color="red", list=sList.pushSpeed, disp=lnk_CUSval("pushSpeed"),code=lnk_CUSsto("pushSpeed")},
WIDGET.newSelector{name="fieldH", x=270, y=520, w=260,color="sky", list=sList.fieldH, disp=CUSval("fieldH"),code=CUSsto("fieldH")},
WIDGET.newSelector{name="visible", x=840, y=60, w=260,color="lBlue",list=sList.visible, disp=CUSval("visible"),code=CUSsto("visible")},
WIDGET.newSelector{name="target", x=840, y=160, w=260,color="green",list=sList.target, disp=CUSval("target"),code=CUSsto("target")},
WIDGET.newSelector{name="freshLimit",x=840, y=260, w=260,color="purple",list=sList.freshLimit, disp=CUSval("freshLimit"),code=CUSsto("freshLimit")},
WIDGET.newSelector{name="opponent", x=1120, y=60, w=260,color="red", list=sList.opponent, disp=CUSval("opponent"),code=CUSsto("opponent")},
WIDGET.newSelector{name="life", x=1120, y=160, w=260,color="red", list=sList.life, disp=CUSval("life"),code=CUSsto("life")},
WIDGET.newSelector{name="pushSpeed",x=1120, y=260, w=260,color="red", list=sList.pushSpeed, disp=CUSval("pushSpeed"),code=CUSsto("pushSpeed")},
WIDGET.newSwitch{name="ospin", x=870, y=350, font=30,disp=lnk_CUSval("ospin"), code=lnk_CUSrev("ospin")},
WIDGET.newSwitch{name="fineKill", x=870, y=530, font=20,disp=lnk_CUSval("fineKill"),code=lnk_CUSrev("fineKill")},
WIDGET.newSwitch{name="b2bKill", x=870, y=620, font=20,disp=lnk_CUSval("b2bKill"), code=lnk_CUSrev("b2bKill")},
WIDGET.newSwitch{name="easyFresh", x=1160, y=350, font=20,disp=lnk_CUSval("easyFresh"),code=lnk_CUSrev("easyFresh")},
WIDGET.newSwitch{name="deepDrop", x=1160, y=440, font=30,disp=lnk_CUSval("deepDrop"),code=lnk_CUSrev("deepDrop")},
WIDGET.newSwitch{name="bone", x=1160, y=530, disp=lnk_CUSval("bone"), code=lnk_CUSrev("bone")},
WIDGET.newSwitch{name="ospin", x=870, y=350, font=30,disp=CUSval("ospin"), code=CUSrev("ospin")},
WIDGET.newSwitch{name="fineKill", x=870, y=530, font=20,disp=CUSval("fineKill"),code=CUSrev("fineKill")},
WIDGET.newSwitch{name="b2bKill", x=870, y=620, font=20,disp=CUSval("b2bKill"), code=CUSrev("b2bKill")},
WIDGET.newSwitch{name="easyFresh", x=1160, y=350, font=20,disp=CUSval("easyFresh"),code=CUSrev("easyFresh")},
WIDGET.newSwitch{name="deepDrop", x=1160, y=440, font=30,disp=CUSval("deepDrop"),code=CUSrev("deepDrop")},
WIDGET.newSwitch{name="bone", x=1160, y=530, disp=CUSval("bone"), code=CUSrev("bone")},
WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80, font=40,code=backScene},
}

View File

@@ -1,5 +1,5 @@
local gc,sys=love.graphics,love.system
local ms,kb=love.mouse,love.keyboard
local kb=love.keyboard
local max,min,int=math.max,math.min,math.floor
local ins,rem=table.insert,table.remove
@@ -9,7 +9,8 @@ local FIELD=FIELD
local scene={}
local sure
local pen--Pen type
local penColor--Pen color
local penMode--Pen mode (false=unavailable, else=mouse button)
local penX,penY--Pen position
local demo--If show x
local page
@@ -54,6 +55,7 @@ local minoPosCode={
local SPmode
local SPlist={}--Smart pen path list
local function SPpath(x,y)
if not penMode then return end
for i=1,#SPlist do
if x==SPlist[i][1]and y==SPlist[i][2]then
return
@@ -61,8 +63,7 @@ local function SPpath(x,y)
end
ins(SPlist,{x,y})
if #SPlist==1 then
local start=FIELD[page][y][x]
SPmode=start==0 and 0 or 1
SPmode=FIELD[page][y][x]==0 and 0 or 1
end
end
local function SPdraw()
@@ -98,99 +99,88 @@ local function SPdraw()
end
end
SPlist={}
SPmode=0
end
function scene.sceneInit()
sure=0
pen=1
penColor=1
penMode=false
penX,penY=1,1
demo=false
page=1
love.keyboard.setKeyRepeat(false)
end
function scene.sceneBack()
love.keyboard.setKeyRepeat(true)
end
function scene.mouseMove(x,y)
local sx,sy=int((x-200)/30)+1,20-int((y-60)/30)
if sx<1 or sx>10 then sx=nil end
if sy<1 or sy>20 then sy=nil end
penX,penY=sx,sy
if ms.isDown(1,2,3)then
if sx and sy then
if pen==-2 then
if ms.isDown(1)then
SPpath(sx,sy)
else
FIELD[page][sy][sx]=-1
end
if sx>=1 and sx<=10 and sy>=1 and sy<=20 then
penX,penY=sx,sy
if penMode then
if penColor==-2 and penMode==1 then
SPpath(sx,sy)
else
FIELD[page][sy][sx]=
ms.isDown(1)and pen or
ms.isDown(2)and -1
or 0
penMode==1 and penColor or
penMode==2 and -1 or
-- penMode==3 and 0
0
end
end
else
penX,penY=nil
end
end
function scene.mouseDown(x,y,k)
if k==2 and pen==-2 then
SPlist={}
else
scene.mouseMove(x,y)
if not penMode then
penMode=k
elseif penMode~=k then
penMode=false
if penColor==-2 then
SPlist={}
end
end
end
function scene.mouseUp()
if pen==-2 then SPdraw()end
end
function scene.wheelMoved(_,y)
if y<0 then
pen=pen+1
if pen==25 then pen=1 end
else
pen=pen-1
if pen==0 then pen=24 end
end
end
function scene.touchDown(x,y)
scene.mouseMove(x,y)
end
function scene.touchMove(x,y)
local sx,sy=int((x-200)/30)+1,20-int((y-60)/30)
if sx<1 or sx>10 then sx=nil end
if sy<1 or sy>20 then sy=nil end
penX,penY=sx,sy
if sx and sy then
if pen==-2 then
SPpath(sx,sy)
else
FIELD[page][sy][sx]=pen
function scene.mouseUp(_,_,k)
if penMode==k then
penMode=false
if penColor==-2 then
SPdraw()
end
end
end
scene.touchUp=scene.mouseUp
function scene.wheelMoved(_,y)
if penColor>0 then
penColor=(penColor+(y<0 and 1 or -1)-1)%24+1
end
end
function scene.touchDown(x,y)scene.mouseDown(x,y,1)end
function scene.touchMove(x,y)scene.mouseMove(x,y)end
function scene.touchUp(x,y)scene.mouseUp(x,y,1)end
function scene.keyDown(key)
local sx,sy=penX,penY
if key=="up"or key=="down"or key=="left"or key=="right"then
if not sx then sx=1 end
if not sy then sy=1 end
if key=="up"and sy<20 then sy=sy+1
elseif key=="down"and sy>1 then sy=sy-1
elseif key=="left"and sx>1 then sx=sx-1
elseif key=="right"and sx<10 then sx=sx+1
if not penX or not penY then penX,penY=1,1 end
if key=="up"then
if penY<20 then penY=penY+1 end
elseif key=="down"then
if penY>1 then penY=penY-1 end
elseif key=="left"then
if penX>1 then penX=penX-1 end
elseif key=="right"then
if penX<10 then penX=penX+1 end
end
if kb.isDown("space")then
scene.keyDown("space")
end
elseif key=="space"then
if sx and sy then
if pen==-2 then
SPpath(sx,sy)
if penX and penY then
penMode=1
if penColor==-2 then
SPpath(penX,penY)
else
FIELD[page][sy][sx]=pen
FIELD[page][penY][penX]=penColor
end
end
elseif key=="delete"then
@@ -260,13 +250,15 @@ function scene.keyDown(key)
elseif key=="escape"then
SCN.back()
else
pen=penKey[key]or pen
penColor=penKey[key]or penColor
end
penX,penY,pen=sx,sy,pen
end
function scene.keyUp(key)
if key=="space"and pen==-2 then
SPdraw()
if key=="space"then
if penColor==-2 then
SPdraw()
end
penMode=false
end
end
@@ -303,20 +295,19 @@ function scene.draw()
--Draw pen
if penX and penY then
local x,y=30*penX,600-30*penY
if kb.isDown("space")or ms.isDown(1)then
if penMode==1 or penMode==2 then
gc.setLineWidth(5)
gc.rectangle("line",x-30,y,30,30,4)
elseif ms.isDown(3)then
elseif penMode==3 then
gc.setLineWidth(3)
gc.line(x-15,y,x-30,y+15)
gc.line(x,y,x-30,y+30)
gc.line(x,y+15,x-15,y+30)
else
gc.setLineWidth(2)
gc.rectangle("line",x-30,y,30,30,3)
gc.setColor(1,1,1,.2)
gc.rectangle("fill",x-30,y,30,30,3)
end
gc.setLineWidth(2)
gc.rectangle("line",x-30,y,30,30,3)
gc.setColor(1,1,1,.2)
gc.rectangle("fill",x-30,y,30,30,3)
end
--Draw smart pen path
@@ -326,14 +317,15 @@ function scene.draw()
if #SPlist<=5 then
gc.setColor(COLOR.rainbow_light(TIME()*6.2))
else
gc.setColor(COLOR.grey)
gc.setColor(.9,.9,.9,.7+.2*math.sin(TIME()*12.6))
end
for i=1,#SPlist do
gc.rectangle("line",30*SPlist[i][1]-30+2,600-30*SPlist[i][2]+2,30-4,30-4,3)
end
elseif SPmode==1 then
else
gc.setColor(1,0,0)
for i=1,#SPlist do
gc.rectangle("line",30*SPlist[i][1]-30+2,600-30*SPlist[i][2]+2,30-4,30-4,3)
gc.draw(cross,30*SPlist[i][1]-30+math.random(-1,1),600-30*SPlist[i][2]+math.random(-1,1))
end
end
end
@@ -347,20 +339,38 @@ function scene.draw()
gc.rectangle("fill",50,600,100,6)
--Draw pen color
if pen>0 then
gc.setLineWidth(13)
gc.setColor(minoColor[pen])
gc.rectangle("line",565,495,70,70)
elseif pen==-1 then
gc.setLineWidth(5)
gc.setColor(.9,.9,.9)
gc.line(575,505,625,555)
gc.line(575,555,625,505)
elseif pen==-2 then
gc.setLineWidth(13)
gc.setColor(COLOR.rainbow(TIME()*6.2))
gc.rectangle("line",565,495,70,70)
end
gc.translate(560,475)
--Right mouse button
gc.setLineWidth(3)
gc.setColor(1,1,1,.9)
gc.line(52,5,75,35)
gc.line(75,5,52,35)
--Left mouse button
if penColor>0 then
gc.setColor(minoColor[penColor])
gc.rectangle("fill",5,5,23,30)
elseif penColor==-1 then
gc.line(5,5,28,35)
gc.line(28,5,5,35)
elseif penColor==-2 then
if SPmode==1 then
gc.setColor(1,0,0)
gc.line(5,5,28,35)
gc.line(28,5,5,35)
else
gc.setLineWidth(13)
gc.setColor(COLOR.rainbow(TIME()*12.6))
gc.rectangle("fill",5,5,23,30)
end
end
--Draw mouse
gc.setLineWidth(2)
gc.setColor(1,1,1)
gc.rectangle("line",0,0,80,110,5)
gc.line(0,40,80,40)
gc.line(33,0,33,40)
gc.line(47,0,47,40)
gc.translate(-560,-475)
--Confirm reset
if sure>0 then
@@ -382,7 +392,7 @@ function scene.draw()
end
end
local function setPen(i)return function()pen=i end end
local function setPen(i)return function()penColor=i end end
scene.widgetList={
WIDGET.newText{name="title", x=1020,y=5,font=70,align="R"},
WIDGET.newText{name="subTitle", x=1030,y=50,font=35,align="L",color="grey"},

View File

@@ -231,7 +231,7 @@ scene.widgetList={
WIDGET.newKey{name="reset", x=1000, y=640, w=90, color="lYellow",font=50,code=pressKey"delete"},
WIDGET.newButton{name="copy", x=1140, y=440, w=170,h=80, color="lRed", font=40,code=pressKey"cC",hide=function()return #MISSION==0 end},
WIDGET.newButton{name="paste", x=1140, y=540, w=170,h=80, color="lBlue", font=40,code=pressKey"cV"},
WIDGET.newSwitch{name="mission",x=1150, y=350, disp=lnk_CUSval("missionKill"),code=lnk_CUSrev("missionKill")},
WIDGET.newSwitch{name="mission",x=1150, y=350, disp=CUSval("missionKill"),code=CUSrev("missionKill")},
WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80, font=40,code=backScene},
}

View File

@@ -191,8 +191,8 @@ scene.widgetList={
WIDGET.newSelector{name="sequence",
x=1080,y=60,w=200,color="yellow",
list={"bag","his4","c2","rnd","mess","reverb","loop","fixed"},
disp=lnk_CUSval("sequence"),
code=lnk_CUSsto("sequence")
disp=CUSval("sequence"),
code=CUSsto("sequence")
},
WIDGET.newKey{name="Z", x=120,y=460,w=80,font=50,code=pressKey(1)},

View File

@@ -36,7 +36,7 @@ function scene.sceneInit()
end
local function clearResult()
for _=1,#result do rem(result)end
TABLE.clear(result)
selected,scrollPos=1,0
waiting,lastSearch=0,false
end
@@ -60,6 +60,9 @@ local function search()
lastSearch=input
end
function scene.wheelMoved(_,y)
WHEELMOV(y)
end
function scene.keyDown(key)
if key=="up"then
if selected and selected>1 then
@@ -75,6 +78,10 @@ function scene.keyDown(key)
scrollPos=selected-15
end
end
elseif key=="pageup"then
for _=1,12 do scene.keyDown("up")end
elseif key=="pagedown"then
for _=1,12 do scene.keyDown("down")end
elseif key=="link"then
love.system.openURL(url)
elseif key=="delete"then

View File

@@ -36,7 +36,7 @@ local function upFloor()
SFX.play("click",.3)
end
end
local loadingThread=coroutine.create(function()
local loadingThread=coroutine.wrap(function()
for i=1,SFX.getCount()do
SFX.loadOne()
if i%3==0 then YIELD()end
@@ -175,15 +175,15 @@ local loadingThread=coroutine.create(function()
logoColor2={COLOR.rainbow_light(r)}
end
STAT.run=STAT.run+1
LOADED=true
--Connect to server
TASK.new(TICK_WS_app)
TASK.new(TICK_WS_user)
TASK.new(NET.updateWS_app)
TASK.new(NET.updateWS_user)
TASK.new(NET.updateWS_play)
WS.connect("app","/app")
if USER.authToken then
WS.connect("user","/user",JSON.encode{
id=USER.id,
uid=USER.uid,
authToken=USER.authToken,
})
end
@@ -193,10 +193,10 @@ local loadingThread=coroutine.create(function()
upFloor()
end
if progress==25 then
loadingThread=false
SFX.play("welcome_sfx")
VOC.play("welcome_voc")
THEME.fresh()
LOADED=true
return
end
YIELD()
@@ -255,8 +255,8 @@ function scene.update(dt)
if progress<25 then
local p=progress
repeat
assert(coroutine.resume(loadingThread))
until not loadingThread or skip<=0 or progress~=p
loadingThread()
until LOADED or skip<=0 or progress~=p
if skip>0 then skip=skip-1 end
else
openTime=openTime+dt

View File

@@ -6,7 +6,6 @@ local function login()
elseif #password==0 then
LOG.print(text.noPassword)return
end
USER.email=email
WS.connect("user","/user",JSON.encode{
email=email,
password=password,

View File

@@ -12,15 +12,13 @@ local widgetX0={
1290,1290,1290,1290,
}
local cmdEntryThread=coroutine.create(function()
local cmdEntryThread=coroutine.wrap(function()
while true do
while true do
if YIELD()~="c"then break end
SFX.play("ren_6")
if YIELD()~="m"then break end
SFX.play("ren_9")
if YIELD()~="d"then break end
SFX.play("ren_11")
if
YIELD()=="c"and(SFX.play("ren_6")or 1)and
YIELD()=="m"and(SFX.play("ren_9")or 1)and
YIELD()=="d"and(SFX.play("ren_11")or 1)
then
SCN.go("app_cmd")
end
end
@@ -30,7 +28,7 @@ function scene.sceneInit()
scrollX=tipLength
BG.set()
coroutine.resume(cmdEntryThread)
cmdEntryThread()
--Set quick-play-button text
scene.widgetList[2].text=text.WidgetText.main.qplay..": "..text.modes[STAT.lastPlay][1]
@@ -43,15 +41,11 @@ function scene.sceneInit()
GAME.seed=math.random(2e6)
PLY.newDemoPlayer(1)
PLAYERS[1]:setPosition(520,140,.8)
love.keyboard.setKeyRepeat(false)
end
function scene.sceneBack()
love.keyboard.setKeyRepeat(true)
end
function scene.mouseDown(x,y)
if x>=520 and x<=760 and y>=140 and y<=620 then
coroutine.resume(cmdEntryThread,
cmdEntryThread(
x<520+80 and y>620-80 and"c"or
x>760-80 and y>620-80 and"m"or
x<520+80 and y<140+80 and"d"
@@ -77,12 +71,12 @@ function scene.keyDown(key)
end
elseif key=="a"then
if testButton(3)then
if LOGIN then
if NET.login then
if not NET.allow_online then
TEXT.show(text.needUpdate,640,450,60,"flicker")
SFX.play("finesseError")
else
WS.send("user",JSON.encode{action=0})
NET.getAccessToken()
end
else
SCN.go("login")
@@ -125,7 +119,7 @@ function scene.keyDown(key)
SCN.back()
end
else
coroutine.resume(cmdEntryThread,key)
cmdEntryThread(key)
end
end
@@ -183,9 +177,9 @@ scene.widgetList={
WIDGET.newButton{name="dict", x=2480,y=450,w=800,h=100, color="lGreen", font=40,align="L",edge=30, code=pressKey"l"},
WIDGET.newButton{name="manual", x=2480,y=570,w=800,h=100, color="lC", font=40,align="L",edge=30, code=pressKey","},
WIDGET.newButton{name="music", x=160,y=80,w=200,h=90, color="lOrange",font=35, code=pressKey"f2"},
WIDGET.newButton{name="lang", x=1120,y=80,w=200,h=90, color="lY", font=40, code=pressKey"f3"},
WIDGET.newButton{name="about", x=-110,y=670,w=600,h=70, color="lB", font=35,align="R",edge=30, code=pressKey"f1"},
WIDGET.newButton{name="music", x=160,y=80,w=200,h=90, color="lOrange",font=35, code=pressKey"2"},
WIDGET.newButton{name="lang", x=1120,y=80,w=200,h=90, color="lY", font=40, code=pressKey"0"},
WIDGET.newButton{name="about", x=-110,y=670,w=600,h=70, color="lB", font=35,align="R",edge=30, code=pressKey"x"},
WIDGET.newButton{name="quit", x=1390,y=670,w=600,h=70, color="lR", font=40,align="L",edge=30, code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end},
}

View File

@@ -88,7 +88,7 @@ scene.widgetList={
WIDGET.newText{name="title", x=30, y=30,font=80,align="L"},
WIDGET.newText{name="arrow", x=270, y=360,font=45,align="L"},
WIDGET.newText{name="now", x=700, y=500,font=50,align="R",hide=function()return not BGM.nowPlay end},
WIDGET.newSlider{name="bgm", x=760, y=80,w=400, font=35,disp=lnk_SETval("bgm"),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
WIDGET.newSlider{name="bgm", x=760, y=80,w=400, font=35,disp=SETval("bgm"),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
WIDGET.newButton{name="up", x=200, y=250,w=120, font=55,code=pressKey"up",hide=function()return selected==1 end},
WIDGET.newButton{name="play", x=200, y=390,w=120, font=35,code=pressKey"space"},
WIDGET.newButton{name="down", x=200, y=530,w=120, font=55,code=pressKey"down",hide=function()return selected==#bgmList end},

View File

@@ -3,12 +3,12 @@ local data=love.data
local textBox=WIDGET.newTextBox{name="texts",x=40,y=50,w=1200,h=430}
local remain--People in chat room
local heartBeatTimer
local escapeTimer=0
local function sendMessage()
local W=WIDGET.active.input
if #W.value>0 and WS.send("chat","T"..data.encode("string","base64",W.value))then
if #W.value>0 then
NET.sendChatMes(W.value)
W.value=""
end
end
@@ -16,7 +16,6 @@ end
local scene={}
function scene.sceneInit()
heartBeatTimer=0
remain=false
local texts=textBox.texts
@@ -30,8 +29,7 @@ function scene.sceneInit()
BG.set("none")
end
function scene.sceneBack()
WS.send("chat","Q")
LOG.print(text.wsDisconnected,"warn")
NET.quitChat()
end
function scene.wheelMoved(_,y)
@@ -80,13 +78,6 @@ function scene.socketRead(mes)
end
end
function scene.update(dt)
heartBeatTimer=heartBeatTimer+dt
if heartBeatTimer>42 then
heartBeatTimer=0
WS.send("chat","P")
end
end
function scene.draw()
setFont(25)
gc.setColor(1,1,1)

View File

@@ -1,9 +1,7 @@
local data=love.data
local gc=love.graphics
local tc=love.touch
local playerData
local ins,rem=table.insert,table.remove
local ins=table.insert
local SCR=SCR
local VK=virtualkey
@@ -13,14 +11,8 @@ local updateVirtualkey=updateVirtualkey
local hideChatBox
local textBox=WIDGET.newTextBox{name="texts",x=340,y=80,w=600,h=550,hide=function()return hideChatBox end}
local function switchChat()
hideChatBox=not hideChatBox
end
local playerInitialized
local playing
local heartBeatTimer
local lastUpstreamTime
local upstreamProgress
local lastBackTime=0
@@ -30,23 +22,19 @@ local touchMoveLastFrame=false
local scene={}
function scene.sceneBack()
WS.send("play","Q")
LOG.print(text.wsDisconnected,"warn")
NET.signal_quit()
love.keyboard.setKeyRepeat(true)
end
function scene.sceneInit()
love.keyboard.setKeyRepeat(false)
hideChatBox=true
playerInitialized=false
textBox:clear()
playerData={}
resetGameData("n",playerData)
resetGameData("n")
noTouch=not SETTING.VKSwitch
playing=false
lastUpstreamTime=0
upstreamProgress=1
heartBeatTimer=0
end
function scene.touchDown(x,y)
@@ -96,7 +84,7 @@ function scene.keyDown(key)
LOG.print(text.sureQuit,COLOR.orange)
end
elseif key=="\\"then
switchChat()
hideChatBox=not hideChatBox
elseif playing then
if noKey then return end
local k=keyMap.keyboard[key]
@@ -106,8 +94,8 @@ function scene.keyDown(key)
VK[k].pressTime=10
end
elseif key=="space"then
if not PLAYERS[1].ready then
WS.send("play","R")
if not NET.getLock("ready")then
NET.signal_ready()
end
end
end
@@ -147,77 +135,85 @@ function scene.gamepadUp(key)
end
end
function scene.socketRead(mes)
local cmd=mes:sub(1,1)
local args=SPLITSTR(mes:sub(2),";")
if cmd=="J"then
if playerInitialized then
local L=SPLITSTR(args[1],",")
textBox:push{
COLOR.lR,L[1],
COLOR.dY,"#"..L[2].." ",
COLOR.Y,text.joinRoom,
}
end
for i=1,#args do
local L=SPLITSTR(args[i],",")
ins(playerData,{name=L[1],id=L[2],sid=L[3],conf=L[4],ready=L[5]=="1"})
end
playerInitialized=true
function scene.socketRead(cmd,data)
if cmd=="Join"then
textBox:push{
COLOR.lR,data.username,
COLOR.dY,"#"..data.uid.." ",
COLOR.Y,text.joinRoom,
}
SFX.play("click")
if not playing then
resetGameData("qn",playerData)
resetGameData("qn")
end
elseif cmd=="L"then
elseif cmd=="Leave"then
textBox:push{
COLOR.lR,args[1],
COLOR.dY,"#"..args[2].." ",
COLOR.lR,data.username,
COLOR.dY,"#"..data.uid.." ",
COLOR.Y,text.leaveRoom,
}
for i=1,#playerData do
if playerData[i].id==args[2]then
rem(playerData,i)
break
end
if not playing then
initPlayerPosition(true)
end
for i=1,#PLAYERS do
if PLAYERS[i].userID==args[2]then
rem(PLAYERS,i)
break
end
end
for i=1,#PLAYERS.alive do
if PLAYERS.alive[i].userID==args[2]then
rem(PLAYERS.alive,i)
break
end
end
initPlayerPosition(true)
elseif cmd=="T"then
local _,text=pcall(data.decode,"string","base64",args[3])
if not _ then text=args[3]end
elseif cmd=="Talk"then
textBox:push{
COLOR.W,args[1],
COLOR.dY,"#"..args[2].." ",
COLOR.sky,text
COLOR.W,data.username,
COLOR.dY,"#"..data.uid.." ",
COLOR.sky,data.message or"[_]",
}
elseif cmd=="C"then
if tostring(USER.id)~=args[2]then
for i=1,#playerData do
if playerData[i].id==args[2]then
playerData[i].conf=args[4]
playerData[i].p:setConf(args[4])
elseif cmd=="Config"then
if tostring(USER.uid)~=data.uid then
for i=1,#PLY_NET do
if PLY_NET[i].uid==data.uid then
PLY_NET[i].conf=data.config
PLY_NET[i].p:setConf(data.config)
return
end
end
resetGameData("qn",playerData)
resetGameData("qn")
end
elseif cmd=="S"then
if playing and args[1]~=PLAYERS[1].subID then
elseif cmd=="Ready"then
if data.uid==USER.uid then
PLAYERS[1].ready=true
SFX.play("reach",.6)
else
for i=1,#PLAYERS do
if PLAYERS[i].userID==data.uid then
PLAYERS[i].ready=true
SFX.play("reach",.6)
break
end
end
end
elseif cmd=="Set"then
NET.rsid=data.rid
NET.wsConnectStream()
TASK.new(NET.updateWS_stream)
elseif cmd=="Begin"then
if not playing then
playing=true
lastUpstreamTime=0
upstreamProgress=1
resetGameData("n",data.seed)
else
LOG.print("Redundant signal: B(begin)",30,COLOR.green)
end
elseif cmd=="Finish"then
playing=false
resetGameData("n")
TEXT.show(text.champion:gsub("$1","SOMEBODY"),640,260,80,"zoomout",.26)
elseif cmd=="Die"then
LOG.print("One player failed",COLOR.sky)
elseif cmd=="Stream"then
if data.uid==USER.uid then
LOG.print("SELF STREAM")
return
end
if playing then
for _,P in next,PLAYERS do
if P.subID==args[1]then
local _,stream=pcall(data.decode,"string","base64",args[2])
if _ then
if P.userID==data.uid then
local res,stream=pcall(love.data.decode,"string","base64",data.stream)
if res then
pumpRecording(stream,P.stream)
else
LOG.print("Bad stream from "..P.userName.."#"..P.userID)
@@ -225,35 +221,6 @@ function scene.socketRead(mes)
end
end
end
elseif cmd=="R"then
local L=PLAYERS.alive
for i=1,#L do
if L[i].subID==args[1]then
L[i].ready=true
SFX.play("reach",.6)
break
end
end
elseif cmd=="B"then
if not playing then
playing=true
lastUpstreamTime=0
upstreamProgress=1
resetGameData("n",playerData,tonumber(args[1]))
else
LOG.print("Redundant signal: B(begin)",30,COLOR.green)
end
elseif cmd=="F"then
playing=false
resetGameData("n",playerData)
for i=1,#playerData do
if playerData[i].sid==args[1]then
TEXT.show(text.champion:gsub("$1",playerData[i].name.."#"..playerData[i].id),640,260,80,"zoomout",.26)
break
end
end
else
LOG.print("Illegal message: ["..mes.."]",30,COLOR.green)
end
end
@@ -261,15 +228,8 @@ function scene.update(dt)
local _
local GAME=GAME
if WS.status("play")~="running"and not SCN.swapping then SCN.back()end
if not playing then
heartBeatTimer=heartBeatTimer+dt
if heartBeatTimer>42 then
heartBeatTimer=0
WS.send("play","P")
end
return
end
if WS.status("play")~="running"then SCN.back()end
if not playing then return end
touchMoveLastFrame=false
updateVirtualkey()
@@ -289,7 +249,7 @@ function scene.update(dt)
local stream
stream,upstreamProgress=dumpRecording(GAME.rep,upstreamProgress)
if #stream>0 then
WS.send("stream",data.encode("string","base64",stream))
NET.uploadRecStream(stream)
else
ins(GAME.rep,GAME.frame)
ins(GAME.rep,0)
@@ -322,7 +282,7 @@ end
scene.widgetList={
textBox,
WIDGET.newKey{name="ready",x=640,y=440,w=200,h=80,color="yellow",font=40,code=pressKey"space",hide=function()return playing or not hideChatBox or PLAYERS[1].ready end},
WIDGET.newKey{name="hideChat",fText="...",x=380,y=35,w=60,font=35,code=switchChat},
WIDGET.newKey{name="hideChat",fText="...",x=380,y=35,w=60,font=35,code=pressKey"\\"},
WIDGET.newKey{name="quit",fText="X",x=900,y=35,w=60,font=40,code=pressKey"escape"},
}

View File

@@ -1,13 +1,13 @@
local scene={}
function scene.sceneInit()
BG.set("matrix")
BG.set("space")
end
scene.widgetList={
WIDGET.newButton{name="ffa", x=640, y=200,w=350,h=120,font=40,code=NULL},
-- WIDGET.newButton{name="ffa", x=640, y=200,w=350,h=120,font=40,code=NULL},
WIDGET.newButton{name="rooms", x=640, y=360,w=350,h=120,font=40,code=goScene"net_rooms"},
WIDGET.newButton{name="chat", x=640, y=540,w=350,h=120,font=40,code=goScene"net_chat",hide=function()return WS.status("chat")~="running"end},
-- WIDGET.newButton{name="chat", x=640, y=540,w=350,h=120,font=40,code=goScene"net_chat"},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene},
}

View File

@@ -1,40 +1,23 @@
local gc=love.graphics
local min=math.min
local rooms
local NET=NET
local scrollPos,selected
local lastfreshTime
local fetchTimer
local lastCreateRoomTime=0
local function enterRoom(roomID)
--[[TODO
WS.connect("play","/play",JSON.encode{
email=USER.email,
token=USER.accessToken,
id=roomID,
conf=dumpBasicConfig(),
-- password=password,
})
]]
end
local function fresh()
lastfreshTime=TIME()
rooms=nil
--[[TODO
WS.connect("play","/play",JSON.encode{
email=USER.email,
accessToken=USER.accessToken,
})
]]
local function fetchRoom()
fetchTimer=5
NET.fetchRoom()
end
local scene={}
function scene.sceneInit()
BG.set("bg1")
BG.set("space")
scrollPos=0
selected=1
fresh()
fetchRoom()
end
function scene.wheelMoved(_,y)
@@ -42,28 +25,21 @@ function scene.wheelMoved(_,y)
end
function scene.keyDown(k)
if k=="r"then
if TIME()-lastfreshTime>1 then
fresh()
if fetchTimer<=3.26 then
fetchRoom()
end
elseif k=="n"then
if TIME()-lastCreateRoomTime>26 then
--[[TODO
WS.send("room",JSON.encode{
email=USER.email,
accessToken=USER.accessToken,
room_name=(USER.name or"???").."'s room",
room_password=nil,
})
]]
NET.createRoom()
lastCreateRoomTime=TIME()
else
LOG.print(text.createRoomTooFast,"warn")
end
elseif k=="escape"then
SCN.back()
elseif rooms and #rooms>0 then
elseif #NET.roomList>0 then
if k=="down"then
if selected<#rooms then
if selected<#NET.roomList then
selected=selected+1
if selected>scrollPos+10 then
scrollPos=scrollPos+1
@@ -77,59 +53,63 @@ function scene.keyDown(k)
end
end
elseif k=="return"then
if rooms[selected].private then
if NET.getLock("fetchRoom")then return end
if NET.roomList[selected].private then
LOG.print("Can't enter private room now")
return
end
enterRoom(rooms[selected].id)
NET.enterRoom(NET.roomList[selected].rid)--,password
end
end
end
function scene.update()
if TIME()-lastfreshTime>5 then
fresh()
function scene.update(dt)
if not NET.getLock("fetchRoom")then
fetchTimer=fetchTimer-dt
if fetchTimer<=0 then
fetchRoom()
end
end
end
function scene.draw()
--Fetching timer
gc.setColor(1,1,1,.26)
gc.arc("fill","pie",240,620,60,-1.5708,-1.5708+1.2566*(TIME()-lastfreshTime))
if rooms then
gc.setColor(1,1,1)
if #rooms>0 then
gc.setLineWidth(2)
gc.rectangle("line",55,110,1100,400)
gc.setColor(1,1,1,.3)
gc.rectangle("fill",55,40*(1+selected-scrollPos)+30,1100,40)
setFont(35)
for i=1,min(10,#rooms-scrollPos)do
local R=rooms[scrollPos+i]
if R.private then
gc.setColor(1,1,1)
gc.draw(IMG.lock,64,75+40*i)
end
gc.setColor(.9,.9,1)
gc.print(scrollPos+i,100,66+40*i)
gc.setColor(1,1,.7)
gc.print(R.name,200,66+40*i)
gc.arc("fill","pie",240,620,60,-1.5708,-1.5708-1.2566*fetchTimer)
--Room list
gc.setColor(1,1,1)
gc.setLineWidth(2)
gc.rectangle("line",50,110,1180,400)
if #NET.roomList>0 then
gc.setColor(1,1,1,.3)
gc.rectangle("fill",50,40*(1+selected-scrollPos)+30,1180,40)
setFont(35)
for i=1,min(10,#NET.roomList-scrollPos)do
local R=NET.roomList[scrollPos+i]
if R.private then
gc.setColor(1,1,1)
gc.printf(R.type,500,66+40*i,500,"right")
gc.print(R.count.."/"..R.capacity,1050,66+40*i)
gc.draw(IMG.lock,59,75+40*i)
end
else
setFont(60)
mStr(text.noRooms,640,315)
gc.setColor(.9,.9,1)
gc.print(scrollPos+i,95,66+40*i)
gc.setColor(1,1,.7)
gc.print(R.name,250,66+40*i)
gc.setColor(1,1,1)
gc.printf(R.type,550,66+40*i,500,"right")
gc.print(R.count.."/"..R.capacity,1100,66+40*i)
end
end
end
scene.widgetList={
WIDGET.newKey{name="fresh", x=240,y=620,w=140,h=140,font=40,code=fresh,hide=function()return TIME()-lastfreshTime<1.26 end},
WIDGET.newText{name="refreshing",x=640,y=260,font=65,hide=function()return not NET.getLock("fetchRoom")end},
WIDGET.newText{name="noRoom", x=640,y=260,font=40,hide=function()return #NET.roomList>0 or NET.getLock("fetchRoom")end},
WIDGET.newKey{name="refresh", x=240,y=620,w=140,h=140,font=40,code=fetchRoom, hide=function()return fetchTimer>3.26 end},
WIDGET.newKey{name="new", x=440,y=620,w=140,h=140,font=25,code=pressKey"n"},
WIDGET.newKey{name="join", x=640,y=620,w=140,h=140,font=40,code=pressKey"return",hide=function()return not rooms end},
WIDGET.newKey{name="up", x=840,y=585,w=140,h=70,font=40,code=pressKey"up",hide=function()return not rooms end},
WIDGET.newKey{name="down", x=840,y=655,w=140,h=70,font=40,code=pressKey"down",hide=function()return not rooms end},
WIDGET.newKey{name="join", x=640,y=620,w=140,h=140,font=40,code=pressKey"return", hide=function()return #NET.roomList==0 end},
WIDGET.newKey{name="up", x=840,y=585,w=140,h=70,font=40,code=pressKey"up", hide=function()return #NET.roomList==0 end},
WIDGET.newKey{name="down", x=840,y=655,w=140,h=70,font=40,code=pressKey"down", hide=function()return #NET.roomList==0 end},
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene},
}

View File

@@ -49,7 +49,7 @@ scene.widgetList={
WIDGET.newButton{name="importUnlock", x=190,y=300,w=280,h=100,color="lBlue",font=25,code=function()
local D=parseCB()
if D then
TABLE.add(D,RANKS)
TABLE.update(D,RANKS)
FILE.save(RANKS,"conf/unlock")
LOG.print(text.importSuccess,"message")
else
@@ -59,7 +59,7 @@ scene.widgetList={
WIDGET.newButton{name="importData", x=490,y=300,w=280,h=100,color="lBlue",font=25,code=function()
local D=parseCB()
if D and D.version==STAT.version then
TABLE.add(D,STAT)
TABLE.update(D,STAT)
FILE.save(STAT,"conf/data")
LOG.print(text.importSuccess,"message")
else
@@ -69,7 +69,7 @@ scene.widgetList={
WIDGET.newButton{name="importSetting", x=790,y=300,w=280,h=100,color="lBlue",font=25,code=function()
local D=parseCB()
if D then
TABLE.add(D,SETTING)
TABLE.update(D,SETTING)
FILE.save(SETTING,"conf/settings")
LOG.print(text.importSuccess,"message")
else
@@ -79,7 +79,7 @@ scene.widgetList={
WIDGET.newButton{name="importVK", x=1090,y=300,w=280,h=100,color="lBlue",font=25,code=function()
local D=parseCB()
if D then
TABLE.add(D,VK_org)
TABLE.update(D,VK_org)
FILE.save(VK_org,"conf/virtualkey")
LOG.print(text.importSuccess,"message")
else

View File

@@ -81,14 +81,14 @@ scene.widgetList={
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
WIDGET.newText{name="preview", x=520, y=540,font=40,align="R"},
WIDGET.newSlider{name="das", x=250, y=190,w=600,unit=20,disp=lnk_SETval("das"), show=sliderShow,code=lnk_SETsto("das")},
WIDGET.newSlider{name="arr", x=250, y=260,w=525,unit=15,disp=lnk_SETval("arr"), show=sliderShow,code=lnk_SETsto("arr")},
WIDGET.newSlider{name="sddas", x=250, y=330,w=350,unit=10,disp=lnk_SETval("sddas"),show=sliderShow,code=lnk_SETsto("sddas")},
WIDGET.newSlider{name="sdarr", x=250, y=400,w=140,unit=4, disp=lnk_SETval("sdarr"),show=sliderShow,code=lnk_SETsto("sdarr")},
WIDGET.newSlider{name="dascut", x=250, y=470,w=600,unit=20,disp=lnk_SETval("dascut"),show=sliderShow,code=lnk_SETsto("dascut")},
WIDGET.newSwitch{name="ihs", x=1100, y=260, disp=lnk_SETval("ihs"), code=lnk_SETrev("ihs")},
WIDGET.newSwitch{name="irs", x=1100, y=330, disp=lnk_SETval("irs"), code=lnk_SETrev("irs")},
WIDGET.newSwitch{name="ims", x=1100, y=400, disp=lnk_SETval("ims"), code=lnk_SETrev("ims")},
WIDGET.newSlider{name="das", x=250, y=190,w=600,unit=20,disp=SETval("das"), show=sliderShow,code=SETsto("das")},
WIDGET.newSlider{name="arr", x=250, y=260,w=525,unit=15,disp=SETval("arr"), show=sliderShow,code=SETsto("arr")},
WIDGET.newSlider{name="sddas", x=250, y=330,w=350,unit=10,disp=SETval("sddas"),show=sliderShow,code=SETsto("sddas")},
WIDGET.newSlider{name="sdarr", x=250, y=400,w=140,unit=4, disp=SETval("sdarr"),show=sliderShow,code=SETsto("sdarr")},
WIDGET.newSlider{name="dascut", x=250, y=470,w=600,unit=20,disp=SETval("dascut"),show=sliderShow,code=SETsto("dascut")},
WIDGET.newSwitch{name="ihs", x=1100, y=260, disp=SETval("ihs"), code=SETrev("ihs")},
WIDGET.newSwitch{name="irs", x=1100, y=330, disp=SETval("irs"), code=SETrev("irs")},
WIDGET.newSwitch{name="ims", x=1100, y=400, disp=SETval("ims"), code=SETrev("ims")},
WIDGET.newButton{name="reset", x=160, y=580,w=200,h=100,color="lRed",font=40,
code=function()
local _=SETTING

View File

@@ -27,14 +27,14 @@ scene.widgetList={
WIDGET.newButton{name="ctrl", x=290, y=220, w=320,h=80, color="lYellow",font=35,code=goScene"setting_control"},
WIDGET.newButton{name="key", x=640, y=220, w=320,h=80, color="lGreen", font=35,code=goScene"setting_key"},
WIDGET.newButton{name="touch", x=990, y=220, w=320,h=80, color="lBlue", font=35,code=goScene"setting_touch"},
WIDGET.newSlider{name="reTime", x=350, y=340, w=300,unit=10,disp=lnk_SETval("reTime"),code=lnk_SETsto("reTime"),show=function(S)return(.5+S.disp()*.25).."s"end},
WIDGET.newSelector{name="RS", x=500, y=420, w=300,color="sea",list={"TRS","SRS","C2","C2sym","Classic","None"},disp=lnk_SETval("RS"),code=lnk_SETsto("RS")},
WIDGET.newSlider{name="reTime", x=350, y=340, w=300,unit=10,disp=SETval("reTime"),code=SETsto("reTime"),show=function(S)return(.5+S.disp()*.25).."s"end},
WIDGET.newSelector{name="RS", x=500, y=420, w=300,color="sea",list={"TRS","SRS","C2","C2sym","Classic","None"},disp=SETval("RS"),code=SETsto("RS")},
WIDGET.newButton{name="layout", x=550, y=540, w=200,h=70, font=35,code=goScene"setting_skin"},
WIDGET.newSwitch{name="autoPause", x=1060, y=310, font=20,disp=lnk_SETval("autoPause"),code=lnk_SETrev("autoPause")},
WIDGET.newSwitch{name="swap", x=1060, y=370, font=20,disp=lnk_SETval("swap"), code=lnk_SETrev("swap")},
WIDGET.newSwitch{name="fine", x=1060, y=430, font=20,disp=lnk_SETval("fine"), code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play("finesseError",.6) end end},
WIDGET.newSwitch{name="appLock", x=1060, y=490, font=20,disp=lnk_SETval("appLock"), code=lnk_SETrev("appLock")},
WIDGET.newSwitch{name="simpMode", x=1060, y=550, font=25,disp=lnk_SETval("simpMode"),code=function()
WIDGET.newSwitch{name="autoPause", x=1060, y=310, font=20,disp=SETval("autoPause"),code=SETrev("autoPause")},
WIDGET.newSwitch{name="swap", x=1060, y=370, font=20,disp=SETval("swap"), code=SETrev("swap")},
WIDGET.newSwitch{name="fine", x=1060, y=430, font=20,disp=SETval("fine"), code=function()SETTING.fine=not SETTING.fine if SETTING.fine then SFX.play("finesseError",.6) end end},
WIDGET.newSwitch{name="appLock", x=1060, y=490, font=20,disp=SETval("appLock"), code=SETrev("appLock")},
WIDGET.newSwitch{name="simpMode", x=1060, y=550, font=25,disp=SETval("simpMode"),code=function()
SETTING.simpMode=not SETTING.simpMode
for i=1,#SCN.stack,2 do
if SCN.stack[i]=="main"or SCN.stack[i]=="main_simple"then

View File

@@ -10,8 +10,7 @@ local jump--Animation timer(10 to 0)
local cv=SETTING.cv
function scene.sceneInit()
last=0
jump=0
last,jump=0,0
cv=SETTING.cv
BG.set()
end
@@ -34,24 +33,24 @@ function scene.touchDown(x,y)
end
function scene.update()
local t=jump
if t>0 then
jump=t-1
end
if jump>0 then jump=jump-1 end
end
function scene.draw()
gc.setColor(1,1,1)
local t=TIME()
local _=jump
local x,y=800,340+10*sin(t*.5)+(_-10)*_*.3
local x,y=800,340+10*sin(t*.5)+(jump-10)*jump*.3
gc.translate(x,y)
gc.draw(IMG.miyaCH,0,0)
gc.setColor(1,1,1,.7)
gc.draw(IMG.miyaF1,4,47+4*sin(t*.9))
gc.draw(IMG.miyaF2,42,107+5*sin(t))
gc.draw(IMG.miyaF3,93,126+3*sin(t*.7))
gc.draw(IMG.miyaF4,129,98+3*sin(t*.7))
if cv=="miya"then
gc.draw(IMG.miyaCH)
gc.setColor(1,1,1,.7)
gc.draw(IMG.miyaF1,4,47+4*sin(t*.9))
gc.draw(IMG.miyaF2,42,107+5*sin(t))
gc.draw(IMG.miyaF3,93,126+3*sin(t*.7))
gc.draw(IMG.miyaF4,129,98+3*sin(t*.5))
elseif cv=="naki"then
gc.draw(IMG.nakiCH)
end
gc.translate(-x,-y)
end
@@ -61,13 +60,13 @@ scene.widgetList={
WIDGET.newButton{name="game", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_game","swipeR"},
WIDGET.newButton{name="graphic",x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_video","swipeL"},
WIDGET.newSlider{name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=lnk_SETval("sfx"),code=lnk_SETsto("sfx")},
WIDGET.newSlider{name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..math.random(7),SETTING.sfx_spawn)end,disp=lnk_SETval("sfx_spawn"),code=lnk_SETsto("sfx_spawn")},
WIDGET.newSlider{name="warn", x=180, y=400,w=400, font=30,change=function()SFX.fplay("warning",SETTING.sfx_warn)end,disp=lnk_SETval("sfx_warn"),code=lnk_SETsto("sfx_warn")},
WIDGET.newSlider{name="bgm", x=180, y=500,w=400, font=35, disp=lnk_SETval("bgm"),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
WIDGET.newSlider{name="stereo", x=180, y=600,w=400, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end,disp=lnk_SETval("stereo"),code=lnk_SETsto("stereo"),hide=function()return SETTING.sx==0 end},
WIDGET.newSlider{name="vib", x=750, y=200,w=400,unit=5, font=25,change=function()VIB(2)end, disp=lnk_SETval("vib"),code=lnk_SETsto("vib")},
WIDGET.newSlider{name="voc", x=750, y=300,w=400, font=35,change=function()VOC.play("test")end, disp=lnk_SETval("voc"),code=lnk_SETsto("voc")},
WIDGET.newSlider{name="sfx", x=180, y=200,w=400, font=35,change=function()SFX.play("blip_1")end, disp=SETval("sfx"),code=SETsto("sfx")},
WIDGET.newSlider{name="spawn", x=180, y=300,w=400, font=30,change=function()SFX.fplay("spawn_"..math.random(7),SETTING.sfx_spawn)end,disp=SETval("sfx_spawn"),code=SETsto("sfx_spawn")},
WIDGET.newSlider{name="warn", x=180, y=400,w=400, font=30,change=function()SFX.fplay("warning",SETTING.sfx_warn)end,disp=SETval("sfx_warn"),code=SETsto("sfx_warn")},
WIDGET.newSlider{name="bgm", x=180, y=500,w=400, font=35, disp=SETval("bgm"),code=function(v)SETTING.bgm=v BGM.freshVolume()end},
WIDGET.newSlider{name="stereo", x=180, y=600,w=400, font=35,change=function()SFX.play("move",1,-1)SFX.play("lock",1,1)end,disp=SETval("stereo"),code=SETsto("stereo"),hide=function()return SETTING.sx==0 end},
WIDGET.newSlider{name="vib", x=750, y=200,w=400,unit=5, font=25,change=function()VIB(2)end, disp=SETval("vib"),code=SETsto("vib")},
WIDGET.newSlider{name="voc", x=750, y=300,w=400, font=35,change=function()VOC.play("test")end, disp=SETval("voc"),code=SETsto("voc")},
WIDGET.newSelector{name="cv", x=1100, y=380,w=200, list={"miya","naki"}, disp=function()return cv end,code=function(i)cv=i end},
WIDGET.newButton{name="apply", x=1100, y=460,w=180,h=80, code=function()SETTING.cv=cv VOC.loadAll()end,hide=function()return SETTING.cv==cv end},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80, font=40,code=backScene},

View File

@@ -30,11 +30,11 @@ scene.widgetList={
WIDGET.newSwitch{name="b20", x=580, y=620, font=35,disp=VKAdisp(20),code=VKAcode(20)},
WIDGET.newButton{name="norm", x=840, y=100, w=240,h=80, font=35,code=function()for i=1,20 do VK_org[i].ava=i<11 end end},
WIDGET.newButton{name="pro", x=1120, y=100, w=240,h=80, font=35,code=function()for i=1,20 do VK_org[i].ava=true end end},
WIDGET.newSwitch{name="hide", x=1170, y=200, font=40,disp=lnk_SETval("VKSwitch"),code=lnk_SETrev("VKSwitch")},
WIDGET.newSwitch{name="track", x=1170, y=300, font=35,disp=lnk_SETval("VKTrack"),code=lnk_SETrev("VKTrack")},
WIDGET.newSlider{name="sfx", x=800, y=380, w=180, font=35,change=function()SFX.play("virtualKey",SETTING.VKSFX)end,disp=lnk_SETval("VKSFX"),code=lnk_SETsto("VKSFX")},
WIDGET.newSlider{name="vib", x=800, y=460, w=180,unit=2, font=35,change=function()VIB(SETTING.VKVIB)end,disp=lnk_SETval("VKVIB"),code=lnk_SETsto("VKVIB")},
WIDGET.newSwitch{name="icon", x=850, y=300, font=40,disp=lnk_SETval("VKIcon"),code=lnk_SETrev("VKIcon")},
WIDGET.newSwitch{name="hide", x=1170, y=200, font=40,disp=SETval("VKSwitch"),code=SETrev("VKSwitch")},
WIDGET.newSwitch{name="track", x=1170, y=300, font=35,disp=SETval("VKTrack"),code=SETrev("VKTrack")},
WIDGET.newSlider{name="sfx", x=800, y=380, w=180, font=35,change=function()SFX.play("virtualKey",SETTING.VKSFX)end,disp=SETval("VKSFX"),code=SETsto("VKSFX")},
WIDGET.newSlider{name="vib", x=800, y=460, w=180,unit=2, font=35,change=function()VIB(SETTING.VKVIB)end,disp=SETval("VKVIB"),code=SETsto("VKVIB")},
WIDGET.newSwitch{name="icon", x=850, y=300, font=40,disp=SETval("VKIcon"),code=SETrev("VKIcon")},
WIDGET.newButton{name="tkset", x=1120, y=420, w=240,h=80,
code=function()
SCN.go("setting_trackSetting")
@@ -42,7 +42,7 @@ scene.widgetList={
hide=function()
return not SETTING.VKTrack
end},
WIDGET.newSlider{name="alpha", x=840, y=540, w=400,font=40,disp=lnk_SETval("VKAlpha"),code=lnk_SETsto("VKAlpha")},
WIDGET.newSlider{name="alpha", x=840, y=540, w=400,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")},
WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80,font=40,code=backScene},
}

View File

@@ -11,9 +11,9 @@ function scene.draw()
end
scene.widgetList={
WIDGET.newSwitch{name="VKDodge",x=400, y=530, font=35,disp=lnk_SETval("VKDodge"),code=lnk_SETrev("VKDodge")},
WIDGET.newSlider{name="VKTchW", x=140, y=320,w=1000, font=35,disp=lnk_SETval("VKTchW"),code=function(i)SETTING.VKTchW=i SETTING.VKCurW=math.max(SETTING.VKCurW,i)end},
WIDGET.newSlider{name="VKCurW", x=140, y=390,w=1000, font=35,disp=lnk_SETval("VKCurW"),code=function(i)SETTING.VKCurW=i SETTING.VKTchW=math.min(SETTING.VKTchW,i)end},
WIDGET.newSwitch{name="VKDodge",x=400, y=530, font=35,disp=SETval("VKDodge"),code=SETrev("VKDodge")},
WIDGET.newSlider{name="VKTchW", x=140, y=320,w=1000, font=35,disp=SETval("VKTchW"),code=function(i)SETTING.VKTchW=i SETTING.VKCurW=math.max(SETTING.VKCurW,i)end},
WIDGET.newSlider{name="VKCurW", x=140, y=390,w=1000, font=35,disp=SETval("VKCurW"),code=function(i)SETTING.VKCurW=i SETTING.VKTchW=math.min(SETTING.VKTchW,i)end},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene},
}

View File

@@ -13,22 +13,22 @@ scene.widgetList={
WIDGET.newButton{name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_sound","swipeR"},
WIDGET.newButton{name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_game","swipeL"},
WIDGET.newSwitch{name="block", x=340, y=150, disp=lnk_SETval("block"), code=lnk_SETrev("block")},
WIDGET.newSwitch{name="smooth", x=340, y=210, disp=lnk_SETval("smooth"), code=lnk_SETrev("smooth")},
WIDGET.newSwitch{name="upEdge", x=340, y=270, disp=lnk_SETval("upEdge"), code=lnk_SETrev("upEdge")},
WIDGET.newSwitch{name="bagLine", x=340, y=330, disp=lnk_SETval("bagLine"), code=lnk_SETrev("bagLine")},
WIDGET.newSwitch{name="block", x=340, y=150, disp=SETval("block"), code=SETrev("block")},
WIDGET.newSwitch{name="smooth", x=340, y=210, disp=SETval("smooth"), code=SETrev("smooth")},
WIDGET.newSwitch{name="upEdge", x=340, y=270, disp=SETval("upEdge"), code=SETrev("upEdge")},
WIDGET.newSwitch{name="bagLine", x=340, y=330, disp=SETval("bagLine"), code=SETrev("bagLine")},
WIDGET.newSlider{name="ghost", x=630, y=180,w=200,unit=.6,disp=lnk_SETval("ghost"),show="percent",code=lnk_SETsto("ghost")},
WIDGET.newSlider{name="grid", x=630, y=240,w=200,unit=.4,disp=lnk_SETval("grid"),show="percent", code=lnk_SETsto("grid")},
WIDGET.newSlider{name="center", x=630, y=300,w=200,unit=1, disp=lnk_SETval("center"), code=lnk_SETsto("center")},
WIDGET.newSlider{name="ghost", x=630, y=180,w=200,unit=.6,disp=SETval("ghost"),show="percent",code=SETsto("ghost")},
WIDGET.newSlider{name="grid", x=630, y=240,w=200,unit=.4,disp=SETval("grid"),show="percent", code=SETsto("grid")},
WIDGET.newSlider{name="center", x=630, y=300,w=200,unit=1, disp=SETval("center"), code=SETsto("center")},
WIDGET.newSlider{name="lockFX", x=350, y=375,w=373,unit=5, disp=lnk_SETval("lockFX"), code=lnk_SETsto("lockFX")},
WIDGET.newSlider{name="dropFX", x=350, y=420,w=373,unit=5, disp=lnk_SETval("dropFX"), code=lnk_SETsto("dropFX")},
WIDGET.newSlider{name="moveFX", x=350, y=465,w=373,unit=5, disp=lnk_SETval("moveFX"), code=lnk_SETsto("moveFX")},
WIDGET.newSlider{name="clearFX", x=350, y=510,w=373,unit=5, disp=lnk_SETval("clearFX"), code=lnk_SETsto("clearFX")},
WIDGET.newSlider{name="splashFX", x=350, y=555,w=373,unit=5, disp=lnk_SETval("splashFX"),code=lnk_SETsto("splashFX")},
WIDGET.newSlider{name="shakeFX", x=350, y=600,w=373,unit=5, disp=lnk_SETval("shakeFX"), code=lnk_SETsto("shakeFX")},
WIDGET.newSlider{name="atkFX", x=350, y=645,w=373,unit=5, disp=lnk_SETval("atkFX"), code=lnk_SETsto("atkFX")},
WIDGET.newSlider{name="lockFX", x=350, y=375,w=373,unit=5, disp=SETval("lockFX"), code=SETsto("lockFX")},
WIDGET.newSlider{name="dropFX", x=350, y=420,w=373,unit=5, disp=SETval("dropFX"), code=SETsto("dropFX")},
WIDGET.newSlider{name="moveFX", x=350, y=465,w=373,unit=5, disp=SETval("moveFX"), code=SETsto("moveFX")},
WIDGET.newSlider{name="clearFX", x=350, y=510,w=373,unit=5, disp=SETval("clearFX"), code=SETsto("clearFX")},
WIDGET.newSlider{name="splashFX", x=350, y=555,w=373,unit=5, disp=SETval("splashFX"),code=SETsto("splashFX")},
WIDGET.newSlider{name="shakeFX", x=350, y=600,w=373,unit=5, disp=SETval("shakeFX"), code=SETsto("shakeFX")},
WIDGET.newSlider{name="atkFX", x=350, y=645,w=373,unit=5, disp=SETval("atkFX"), code=SETsto("atkFX")},
WIDGET.newSlider{name="frame", x=350, y=690,w=373,unit=10,
disp=function()
return SETTING.frameMul>35 and SETTING.frameMul/10 or SETTING.frameMul/5-4
@@ -37,20 +37,20 @@ scene.widgetList={
SETTING.frameMul=i<5 and 5*i+20 or 10*i
end},
WIDGET.newSwitch{name="text", x=1100, y=180,font=35,disp=lnk_SETval("text"), code=lnk_SETrev("text")},
WIDGET.newSwitch{name="score", x=1100, y=240,font=35,disp=lnk_SETval("score"), code=lnk_SETrev("score")},
WIDGET.newSwitch{name="warn", x=1100, y=300,font=35,disp=lnk_SETval("warn"), code=lnk_SETrev("warn")},
WIDGET.newSwitch{name="highCam", x=1100, y=360,font=35,disp=lnk_SETval("highCam"),code=lnk_SETrev("highCam")},
WIDGET.newSwitch{name="nextPos", x=1100, y=420,font=35,disp=lnk_SETval("nextPos"),code=lnk_SETrev("nextPos")},
WIDGET.newSwitch{name="fullscreen",x=1100, y=480,disp=lnk_SETval("fullscreen"), code=switchFullscreen},
WIDGET.newSwitch{name="bg", x=1100, y=540,font=35,disp=lnk_SETval("bg"),
WIDGET.newSwitch{name="text", x=1100, y=180,font=35,disp=SETval("text"), code=SETrev("text")},
WIDGET.newSwitch{name="score", x=1100, y=240,font=35,disp=SETval("score"), code=SETrev("score")},
WIDGET.newSwitch{name="warn", x=1100, y=300,font=35,disp=SETval("warn"), code=SETrev("warn")},
WIDGET.newSwitch{name="highCam", x=1100, y=360,font=35,disp=SETval("highCam"),code=SETrev("highCam")},
WIDGET.newSwitch{name="nextPos", x=1100, y=420,font=35,disp=SETval("nextPos"),code=SETrev("nextPos")},
WIDGET.newSwitch{name="fullscreen",x=1100, y=480,disp=SETval("fullscreen"), code=switchFullscreen},
WIDGET.newSwitch{name="bg", x=1100, y=540,font=35,disp=SETval("bg"),
code=function()
BG.set("none")
SETTING.bg=not SETTING.bg
BG.set()
end},
WIDGET.newSwitch{name="power", x=990, y=610,font=35,disp=lnk_SETval("powerInfo"),code=lnk_SETrev("powerInfo")},
WIDGET.newSwitch{name="clean", x=990, y=670,font=35,disp=lnk_SETval("cleanCanvas"),code=lnk_SETrev("cleanCanvas")},
WIDGET.newSwitch{name="power", x=990, y=610,font=35,disp=SETval("powerInfo"),code=SETrev("powerInfo")},
WIDGET.newSwitch{name="clean", x=990, y=670,font=35,disp=SETval("cleanCanvas"),code=SETrev("cleanCanvas")},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene},
}

View File

@@ -39,8 +39,8 @@ end
scene.widgetList={
WIDGET.newText{name="title", x=30, y=15,font=70,align="L"},
WIDGET.newSlider{name="sfx", x=510, y=60,w=330,font=35,change=function()SFX.play("blip_1")end,disp=lnk_SETval("sfx"),code=lnk_SETsto("sfx")},
WIDGET.newSlider{name="voc", x=510, y=120,w=330,font=35,change=function()VOC.play("test")end,disp=lnk_SETval("voc"),code=lnk_SETsto("voc")},
WIDGET.newSlider{name="sfx", x=510, y=60,w=330,font=35,change=function()SFX.play("blip_1")end,disp=SETval("sfx"),code=SETsto("sfx")},
WIDGET.newSlider{name="voc", x=510, y=120,w=330,font=35,change=function()VOC.play("test")end,disp=SETval("voc"),code=SETsto("voc")},
WIDGET.newKey{name="move", x=110, y=140,w=160,h=50,font=20,code=function()SFX.play("move")end},
WIDGET.newKey{name="lock", x=110, y=205,w=160,h=50,font=20,code=function()SFX.play("lock")end},