控件系统hide机制大改,实现房间内聊天框功能
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
local kb=love.keyboard
|
||||
local gc=love.graphics
|
||||
local gc_push,gc_pop=gc.push,gc.pop
|
||||
local gc_origin,gc_translate=gc.origin,gc.translate
|
||||
@@ -11,6 +12,7 @@ local SETTING,GAME,SCR=SETTING,GAME,SCR
|
||||
|
||||
|
||||
--System
|
||||
function enableTextInput()if not MOBILE then kb.setTextInput(true)end end
|
||||
function switchFullscreen()
|
||||
SETTING.fullscreen=not SETTING.fullscreen
|
||||
love.window.setFullscreen(SETTING.fullscreen)
|
||||
|
||||
@@ -313,14 +313,14 @@ function scene.draw()
|
||||
gc.rectangle('line',cx*160+173,cy*160-107,134,134,50)
|
||||
end
|
||||
|
||||
local function Gaming()return state==1 end
|
||||
local function ifGaming()return state==1 end
|
||||
scene.widgetList={
|
||||
WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color='lG', font=40,code=pressKey"space"},
|
||||
WIDGET.newSlider{name="color", x=110,y=250,w=170,unit=4,show=false,font=30,disp=function()return color end, code=function(v)if state~=1 then color=v end end,hide=Gaming},
|
||||
WIDGET.newSwitch{name="blind", x=240,y=330,w=60, font=40,disp=function()return blind end, code=pressKey"w", hide=Gaming},
|
||||
WIDGET.newSwitch{name="slide", x=240,y=420,w=60, font=40,disp=function()return slide end, code=pressKey"e", hide=Gaming},
|
||||
WIDGET.newSwitch{name="pathVis",x=240,y=510,w=60, font=40,disp=function()return pathVis end, code=pressKey"r", hide=function()return state==1 or not slide end},
|
||||
WIDGET.newSwitch{name="revKB", x=240,y=600,w=60, font=40,disp=function()return revKB end, code=pressKey"t", hide=Gaming},
|
||||
WIDGET.newSlider{name="color", x=110,y=250,w=170,unit=4,show=false,font=30,disp=function()return color end, code=function(v)if state~=1 then color=v end end,hideFunc=ifGaming},
|
||||
WIDGET.newSwitch{name="blind", x=240,y=330,w=60, font=40,disp=function()return blind end, code=pressKey"w",hideF=ifGaming},
|
||||
WIDGET.newSwitch{name="slide", x=240,y=420,w=60, font=40,disp=function()return slide end, code=pressKey"e",hideF=ifGaming},
|
||||
WIDGET.newSwitch{name="pathVis",x=240,y=510,w=60, 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,w=60, 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=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -480,18 +480,18 @@ 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="blind", x=240,y=300,w=60,font=40,disp=function()return blind end,code=pressKey"q",hide=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="tapControl", x=240,y=370,w=60,font=40,disp=function()return tapControl end,code=pressKey"w",hide=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="blind", x=240,y=300,w=60,font=40,disp=function()return blind end,code=pressKey"q",hideF=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="tapControl", x=240,y=370,w=60,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",hide=function()return tapControl end},
|
||||
WIDGET.newKey{name="down", x=155,y=660,w=100,fText="↓",font=50,color='Y',code=pressKey"down",hide=function()return tapControl end},
|
||||
WIDGET.newKey{name="left", x=55,y=560,w=100,fText="←",font=50,color='Y',code=pressKey"left",hide=function()return tapControl end},
|
||||
WIDGET.newKey{name="right", x=255,y=560,w=100,fText="→",font=50,color='Y',code=pressKey"right",hide=function()return tapControl end},
|
||||
WIDGET.newKey{name="skip", x=155,y=400,w=100,font=20, color='Y',code=pressKey"space",hide=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",hide=function()return state==2 end},
|
||||
WIDGET.newKey{name="record2", x=1100,y=450,w=220,h=50,fText="", color='H',code=pressKey"2",hide=function()return state==2 end},
|
||||
WIDGET.newKey{name="replay1", x=1245,y=390,w=50,fText="!", color='G',code=pressKey"c1",hide=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",hide=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=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ function scene.draw()
|
||||
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,hide=function()return state>0 end},
|
||||
WIDGET.newSelector{name="level", x=640,y=640,w=200,list={'A_Z','Z_A','Tech1','Tech2','KeyTest1','KeyTest2','Hello','Roll1','Roll2','Roll3','ZZZ','ZXZX','ZMZM','Stair','Stair2','Stair3','BPW'},disp=function()return levelName end,code=function(i)levelName=i;targetString=levels[i]end,hideF=function()return state>0 end},
|
||||
WIDGET.newButton{name="reset", x=160,y=100,w=180,h=100,color='lG',font=40,code=pressKey"space"},
|
||||
WIDGET.newButton{name="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=40,code=backScene},
|
||||
|
||||
@@ -678,6 +678,7 @@ local scene={}
|
||||
|
||||
function scene.sceneInit()
|
||||
TASK.new(function()YIELD()WIDGET.sel=inputBox end)
|
||||
enableTextInput()
|
||||
BG.set('none')
|
||||
end
|
||||
|
||||
|
||||
@@ -277,8 +277,8 @@ 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="mode", x=155,y=220,w=180,h=100,font=40,code=pressKey"q",hide=function()return state~=0 end},
|
||||
WIDGET.newSwitch{name="arcade", x=230,y=330,font=40,disp=function()return arcade end,code=pressKey"w",hide=function()return state~=0 end},
|
||||
WIDGET.newButton{name="mode", x=155,y=220,w=180,h=100,font=40,code=pressKey"q",hideF=function()return state~=0 end},
|
||||
WIDGET.newSwitch{name="arcade", x=230,y=330,font=40,disp=function()return arcade end,code=pressKey"w",hideF=function()return state~=0 end},
|
||||
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -168,11 +168,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",hide=function()return state==0 end},
|
||||
WIDGET.newSlider{name="rank", x=130,y=250,w=150,unit=3,show=false,font=40,disp=function()return rank-3 end,code=function(v)rank=v+3 end,hide=function()return state>0 end},
|
||||
WIDGET.newSwitch{name="blind", x=240,y=330,w=60, font=40,disp=function()return blind end, code=pressKey"q",hide=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="disappear", x=240,y=420,w=60, font=40,disp=function()return disappear end,code=pressKey"w",hide=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="tapFX", x=240,y=510,w=60, font=40,disp=function()return tapFX end, code=pressKey"e",hide=function()return state==1 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,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="blind", x=240,y=330,w=60, font=40,disp=function()return blind end, code=pressKey"q",hideF=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="disappear", x=240,y=420,w=60, font=40,disp=function()return disappear end,code=pressKey"w",hideF=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="tapFX", x=240,y=510,w=60, 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=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -299,9 +299,9 @@ 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,font=40,disp=function()return nexts end,code=pressKey"q",hide=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="blind", x=240,y=305,font=40,disp=function()return blind end,code=pressKey"w",hide=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="fast", x=240,y=375,font=30,disp=function()return fast end,code=pressKey"e",hide=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="next", x=240,y=235,font=40,disp=function()return nexts end,code=pressKey"q",hideF=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="blind", x=240,y=305,font=40,disp=function()return blind end,code=pressKey"w",hideF=function()return state==1 end},
|
||||
WIDGET.newSwitch{name="fast", x=240,y=375,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=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -171,8 +171,8 @@ end
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name="title", x=520, y=5,font=70,align='R'},
|
||||
WIDGET.newText{name="subTitle", x=530, y=50,font=35,align='L',color='H'},
|
||||
WIDGET.newText{name="defSeq", x=330, y=550,align='L',color='H',hide=function()return BAG[1]end},
|
||||
WIDGET.newText{name="noMsn", x=610, y=550,align='L',color='H',hide=function()return MISSION[1]end},
|
||||
WIDGET.newText{name="defSeq", x=330, y=550,align='L',color='H',hideF=function()return BAG[1]end},
|
||||
WIDGET.newText{name="noMsn", x=610, y=550,align='L',color='H',hideF=function()return MISSION[1]end},
|
||||
|
||||
--Basic
|
||||
WIDGET.newSelector{name="drop", x=170, y=150,w=220,color='O',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")},
|
||||
@@ -188,7 +188,7 @@ scene.widgetList={
|
||||
WIDGET.newButton{name="copy", x=1070, y=310,w=310,h=70,color='lR',font=25,code=pressKey"cC"},
|
||||
WIDGET.newButton{name="paste", x=1070, y=390,w=310,h=70,color='lB',font=25,code=pressKey"cV"},
|
||||
WIDGET.newButton{name="clear", x=1070, y=470,w=310,h=70,color='lY',font=35,code=pressKey"return"},
|
||||
WIDGET.newButton{name="puzzle", x=1070, y=550,w=310,h=70,color='lM',font=35,code=pressKey"return2",hide=function()return not initField end},
|
||||
WIDGET.newButton{name="puzzle", x=1070, y=550,w=310,h=70,color='lM',font=35,code=pressKey"return2",hideF=function()return not initField end},
|
||||
|
||||
--More
|
||||
WIDGET.newKey{name="reset", x=730, y=150,w=220,h=90,color='R',font=30,code=pressKey"delete"},
|
||||
|
||||
@@ -18,8 +18,8 @@ scene.widgetList={
|
||||
--Control
|
||||
WIDGET.newSlider{name="nextCount", x=180, y=150, w=200,unit=6, disp=CUSval("nextCount"),code=CUSsto("nextCount")},
|
||||
WIDGET.newSlider{name="holdCount", x=180, y=240, w=200,unit=6, disp=CUSval("holdCount"),code=CUSsto("holdCount")},
|
||||
WIDGET.newSwitch{name="infHold", x=330, y=340, disp=CUSval("infHold"),code=CUSrev("infHold"),hide=function()return CUSTOMENV.holdCount==0 end},
|
||||
WIDGET.newSwitch{name="phyHold", x=330, y=430, disp=CUSval("phyHold"),code=CUSrev("phyHold"),hide=function()return CUSTOMENV.holdCount==0 end},
|
||||
WIDGET.newSwitch{name="infHold", x=330, y=340, disp=CUSval("infHold"),code=CUSrev("infHold"),hideF=function()return CUSTOMENV.holdCount==0 end},
|
||||
WIDGET.newSwitch{name="phyHold", x=330, y=430, disp=CUSval("phyHold"),code=CUSrev("phyHold"),hideF=function()return CUSTOMENV.holdCount==0 end},
|
||||
WIDGET.newSwitch{name="initSkip", x=330, y=530, font=25, disp=CUSval("initSkip"),code=CUSrev("initSkip")},
|
||||
|
||||
--Rule
|
||||
|
||||
@@ -482,8 +482,8 @@ scene.widgetList={
|
||||
|
||||
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",hide=function()return page==1 end},
|
||||
WIDGET.newButton{name="nextPg", x=100, y=470,w=160,h=110,color='lG',font=20,code=pressKey"pagedown",hide=function()return page==#FIELD end},
|
||||
WIDGET.newButton{name="prevPg", x=100, y=350,w=160,h=110,color='lG',font=20,code=pressKey"pageup",hideF=function()return page==1 end},
|
||||
WIDGET.newButton{name="nextPg", x=100, y=470,w=160,h=110,color='lG',font=20,code=pressKey"pagedown",hideF=function()return page==#FIELD end},
|
||||
|
||||
WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80,font=40,code=backScene},
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ scene.widgetList={
|
||||
WIDGET.newKey{name="ten", x=1000, y=440,w=90, color='lG',font=40,code=pressKey"ten"},
|
||||
WIDGET.newKey{name="backsp", x=1000, y=540,w=90, color='lY',font=50,code=pressKey"backspace"},
|
||||
WIDGET.newKey{name="reset", x=1000, y=640,w=90, color='lY',font=50,code=pressKey"delete"},
|
||||
WIDGET.newButton{name="copy", x=1140, y=440,w=170,h=80, color='lR',font=40,code=pressKey"cC",hide=function()return #MISSION==0 end},
|
||||
WIDGET.newButton{name="copy", x=1140, y=440,w=170,h=80, color='lR',font=40,code=pressKey"cC",hideF=function()return #MISSION==0 end},
|
||||
WIDGET.newButton{name="paste", x=1140, y=540,w=170,h=80, color='lB',font=40,code=pressKey"cV"},
|
||||
WIDGET.newSwitch{name="mission",x=1150, y=350,disp=CUSval("missionKill"),code=CUSrev("missionKill")},
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ scene.widgetList={
|
||||
WIDGET.newKey{name="O1", x=920,y=620,w=80,color='dH',font=50,code=pressKey(29)},
|
||||
|
||||
|
||||
WIDGET.newButton{name="copy",x=1140,y=460,w=170,h=80,color='lR',font=40,code=pressKey"cC",hide=function()return #BAG==0 end},
|
||||
WIDGET.newButton{name="copy",x=1140,y=460,w=170,h=80,color='lR',font=40,code=pressKey"cC",hideF=function()return #BAG==0 end},
|
||||
WIDGET.newButton{name="paste",x=1140,y=550,w=170,h=80,color='lB',font=40,code=pressKey"cV"},
|
||||
WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,font=40,code=backScene},
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ function scene.sceneInit()
|
||||
|
||||
lastSearch=false
|
||||
TASK.new(function()YIELD()WIDGET.sel=inputBox end)
|
||||
enableTextInput()
|
||||
BG.set('rainbow')
|
||||
end
|
||||
|
||||
@@ -183,7 +184,7 @@ end
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name="title", x=20, y=5,font=70,align='L'},
|
||||
inputBox,
|
||||
WIDGET.newKey{name="link", x=1150, y=655,w=200,h=80,font=35,code=pressKey"link",hide=function()return not url end},
|
||||
WIDGET.newKey{name="link", x=1150, y=655,w=200,h=80,font=35,code=pressKey"link",hideF=function()return not url end},
|
||||
WIDGET.newKey{name="up", x=1130, y=460,w=60,h=90,font=35,code=pressKey"up",hide=not MOBILE},
|
||||
WIDGET.newKey{name="down", x=1130, y=560,w=60,h=90,font=35,code=pressKey"down",hide=not MOBILE},
|
||||
WIDGET.newKey{name="pageup", x=1210, y=460,w=80,h=90,font=35,code=pressKey"pageup",hide=not MOBILE},
|
||||
|
||||
@@ -201,7 +201,7 @@ function scene.draw()
|
||||
|
||||
--Mode info
|
||||
gc.setColor(1,1,1,.8)
|
||||
gc.draw(drawableText.modeName,485,10)
|
||||
gc.draw(drawableText.modeName,940,0)
|
||||
|
||||
--Replaying
|
||||
if GAME.replaying then
|
||||
|
||||
@@ -29,6 +29,7 @@ function scene.sceneInit()
|
||||
emailBox:setText(data[1])
|
||||
passwordBox:setText(data[2])
|
||||
end
|
||||
enableTextInput()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
|
||||
@@ -151,7 +151,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',hide=function()return scoreValid()end},
|
||||
WIDGET.newText{name="unranked", x=1200,y=60,color='Y',font=50,align='R',hideF=function()return scoreValid()end},
|
||||
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=40,code=backScene},
|
||||
}
|
||||
|
||||
@@ -307,7 +307,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",hide=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=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -85,11 +85,11 @@ end
|
||||
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.newText{name="now", x=700, y=500,font=50,align='R',hideF=function()return not BGM.nowPlay 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="up", x=200, y=250,w=120, font=55,code=pressKey"up",hideF=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},
|
||||
WIDGET.newButton{name="down", x=200, y=530,w=120, font=55,code=pressKey"down",hideF=function()return selected==#bgmList end},
|
||||
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=40,code=backScene},
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local gc,tc=love.graphics,love.touch
|
||||
local gc,tc,kb=love.graphics,love.touch,love.keyboard
|
||||
local ins=table.insert
|
||||
local SCR,VK,NET,netPLY=SCR,VK,NET,netPLY
|
||||
local PLAYERS,GAME=PLAYERS,GAME
|
||||
@@ -85,25 +85,27 @@ function scene.keyDown(key)
|
||||
lastBackTime=TIME()
|
||||
LOG.print(text.sureQuit,COLOR.O)
|
||||
end
|
||||
elseif key=="\\"then
|
||||
textBox.hide=not textBox.hide
|
||||
inputBox.hide=not inputBox.hide
|
||||
if textBox.hide then
|
||||
WIDGET.sel=nil
|
||||
else
|
||||
elseif key=="return"then
|
||||
if inputBox.hide then
|
||||
textBox.hide=false
|
||||
inputBox.hide=false
|
||||
TASK.new(function()YIELD()WIDGET.sel=inputBox end)
|
||||
enableTextInput()
|
||||
else
|
||||
local mes=inputBox:getText():match"%S+"
|
||||
if mes and #mes>0 then
|
||||
NET.sendMessage(mes)
|
||||
inputBox:clear()
|
||||
elseif #EDITING==0 then
|
||||
textBox.hide=true
|
||||
inputBox.hide=true
|
||||
WIDGET.sel=nil
|
||||
kb.setTextInput(false)
|
||||
end
|
||||
end
|
||||
elseif not inputBox.hide then
|
||||
if key=="return"then
|
||||
print(EDITING)
|
||||
if inputBox:hasText()then
|
||||
NET.sendMessage(inputBox:getText())
|
||||
inputBox:clear()
|
||||
end
|
||||
else
|
||||
WIDGET.sel=inputBox
|
||||
WIDGET.keyPressed(key)
|
||||
end
|
||||
WIDGET.sel=inputBox
|
||||
WIDGET.keyPressed(key)
|
||||
elseif playing then
|
||||
if noKey then return end
|
||||
local k=keyMap.keyboard[key]
|
||||
@@ -301,9 +303,9 @@ end
|
||||
scene.widgetList={
|
||||
textBox,
|
||||
inputBox,
|
||||
WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=pressKey"s",hide=function()return playing or netPLY.getSelfReady()or NET.getlock('ready')end},
|
||||
WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=pressKey"s",hideF=function()return playing or netPLY.getSelfReady()or NET.getlock('ready')end},
|
||||
WIDGET.newKey{name="ready",x=1060,y=630,w=300,h=80,color='lB',font=40,code=pressKey"space",
|
||||
hide=function()
|
||||
hideF=function()
|
||||
return
|
||||
playing or
|
||||
NET.serverGaming or
|
||||
@@ -311,14 +313,14 @@ scene.widgetList={
|
||||
NET.getlock('ready')
|
||||
end},
|
||||
WIDGET.newKey{name="cancel",x=1060,y=630,w=300,h=80,color='H',font=40,code=pressKey"space",
|
||||
hide=function()
|
||||
hideF=function()
|
||||
return
|
||||
playing or
|
||||
NET.serverGaming or
|
||||
not netPLY.getSelfReady()or
|
||||
NET.getlock('ready')
|
||||
end},
|
||||
WIDGET.newKey{name="hideChat",fText="...",x=380,y=35,w=60,font=35,code=pressKey"\\"},
|
||||
WIDGET.newKey{name="hideChat",fText="...",x=380,y=35,w=60,font=35,code=pressKey"return"},
|
||||
WIDGET.newKey{name="quit",fText="X",x=900,y=35,w=60,font=40,code=pressKey"escape"},
|
||||
}
|
||||
|
||||
|
||||
@@ -171,12 +171,12 @@ end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newKey{name="setting",fText=TEXTURE.setting,x=1200,y=160,w=90,h=90,code=pressKey"s"},
|
||||
WIDGET.newText{name="refreshing",x=580,y=255,font=45,hide=function()return not NET.getlock('fetchRoom')end},
|
||||
WIDGET.newText{name="noRoom", x=580,y=260,font=40,hide=function()return #NET.roomList>0 or NET.getlock('fetchRoom')end},
|
||||
WIDGET.newKey{name="refresh", x=300,y=620,w=140,h=140,font=35,code=fetchRoom,hide=function()return fetchTimer>3.26 end},
|
||||
WIDGET.newText{name="refreshing",x=580,y=255,font=45,hideF=function()return not NET.getlock('fetchRoom')end},
|
||||
WIDGET.newText{name="noRoom", x=580,y=260,font=40,hideF=function()return #NET.roomList>0 or NET.getlock('fetchRoom')end},
|
||||
WIDGET.newKey{name="refresh", x=300,y=620,w=140,h=140,font=35,code=fetchRoom,hideF=function()return fetchTimer>3.26 end},
|
||||
WIDGET.newKey{name="new", x=500,y=620,w=140,h=140,font=20,code=pressKey"n"},
|
||||
WIDGET.newKey{name="new2", x=700,y=620,w=140,h=140,font=20,code=pressKey"m"},
|
||||
WIDGET.newKey{name="join", x=900,y=620,w=140,h=140,font=40,code=pressKey"return",hide=function()return #NET.roomList==0 or NET.getlock('enterRoom')end},
|
||||
WIDGET.newKey{name="join", x=900,y=620,w=140,h=140,font=40,code=pressKey"return",hideF=function()return #NET.roomList==0 or NET.getlock('enterRoom')end},
|
||||
WIDGET.newButton{name="back", x=1140,y=640,w=170,h=80,font=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -312,8 +312,8 @@ end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newButton{name="setting", x=1120,y=70,w=240,h=90, color='lB',font=35,code=pressKey"s"},
|
||||
WIDGET.newButton{name="replay", x=535,y=250,w=200,h=100,color='lY',font=30,code=pressKey"p",hide=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
|
||||
WIDGET.newButton{name="save", x=745,y=250,w=200,h=100,color='G',font=30,code=pressKey"o",hide=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
|
||||
WIDGET.newButton{name="replay", x=535,y=250,w=200,h=100,color='lY',font=30,code=pressKey"p",hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 end},
|
||||
WIDGET.newButton{name="save", x=745,y=250,w=200,h=100,color='G',font=30,code=pressKey"o",hideF=function()return not(GAME.result or GAME.replaying)or #PLAYERS>1 or GAME.saved end},
|
||||
WIDGET.newButton{name="resume", x=640,y=367,w=240,h=100,color='lG',font=30,code=pressKey"escape"},
|
||||
WIDGET.newButton{name="restart", x=640,y=483,w=240,h=100,color='lR',font=35,code=pressKey"r"},
|
||||
WIDGET.newButton{name="quit", x=640,y=600,w=240,h=100,font=35,code=backScene},
|
||||
|
||||
@@ -17,6 +17,10 @@ local function register()
|
||||
NET.register(username,email,password)
|
||||
end
|
||||
|
||||
function scene.sceneInit()
|
||||
enableTextInput()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name="title", x=80, y=50,font=70,align='L'},
|
||||
WIDGET.newButton{name="login", x=1140, y=100,w=170,h=80,color='lY',code=function()SCN.swapTo('login','swipeL')end},
|
||||
|
||||
@@ -26,6 +26,10 @@ function scene.sceneBack()
|
||||
FILE.save(keyMap,'conf/key')
|
||||
end
|
||||
|
||||
local forbbidenKeys={
|
||||
["\\"]=true,
|
||||
["return"]=true,
|
||||
}
|
||||
function scene.keyDown(key)
|
||||
if key=="escape"then
|
||||
if selected then
|
||||
@@ -41,7 +45,7 @@ function scene.keyDown(key)
|
||||
SCN.back()
|
||||
end
|
||||
elseif selected then
|
||||
if key~="\\"then
|
||||
if not forbbidenKeys[key]then
|
||||
keyMap.keyboard[key]=selected
|
||||
freshKeyList()
|
||||
selected=false
|
||||
|
||||
@@ -64,11 +64,11 @@ scene.widgetList={
|
||||
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="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"),hideF=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="apply", x=1100, y=460,w=180,h=80, code=function()SETTING.cv=cv VOC.loadAll()end,hideF=function()return SETTING.cv==cv end},
|
||||
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80, font=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ scene.widgetList={
|
||||
VK_org[selected].r=(v+1)*10
|
||||
end
|
||||
end,
|
||||
hide=function()
|
||||
hideF=function()
|
||||
return not selected
|
||||
end},
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ scene.widgetList={
|
||||
code=function()
|
||||
SCN.go('setting_trackSetting')
|
||||
end,
|
||||
hide=function()
|
||||
hideF=function()
|
||||
return not SETTING.VKTrack
|
||||
end},
|
||||
WIDGET.newSlider{name="alpha", x=840, y=540, w=400,font=40,disp=SETval("VKAlpha"),code=SETsto("VKAlpha")},
|
||||
|
||||
Reference in New Issue
Block a user