新增自定义房间参数(需要测试)(暂时只能创建时选择)
This commit is contained in:
3
main.lua
3
main.lua
@@ -241,13 +241,10 @@ do
|
||||
end
|
||||
if STAT.version<1302 then
|
||||
FILE.clear_s("")
|
||||
autoRestart=true
|
||||
end
|
||||
if STAT.version<1405 then
|
||||
fs.remove('conf/user')
|
||||
fs.remove('conf/key')
|
||||
needSave=true
|
||||
autoRestart=true
|
||||
end
|
||||
if STAT.version~=VERSION.code then
|
||||
STAT.version=VERSION.code
|
||||
|
||||
@@ -224,6 +224,11 @@ function applyCustomGame()--Apply CUSTOMENV, BAG, MISSION
|
||||
GAME.modeEnv.mission=nil
|
||||
end
|
||||
end
|
||||
function applyRoomConf()--Apply room configs
|
||||
for k,v in next,NET.roomState.roomData do
|
||||
GAME.modeEnv[k]=v
|
||||
end
|
||||
end
|
||||
function loadGame(M,ifQuickPlay,ifNet)--Load a mode and go to game scene
|
||||
freshDate()
|
||||
if legalGameTime()then
|
||||
@@ -668,9 +673,12 @@ end
|
||||
do--CUS/SETXXX(k)
|
||||
local CUSTOMENV=CUSTOMENV
|
||||
function CUSval(k)return function()return CUSTOMENV[k]end end
|
||||
function ROOMval(k)return function()return ROOMENV[k]end end
|
||||
function SETval(k)return function()return SETTING[k]end end
|
||||
function CUSrev(k)return function()CUSTOMENV[k]=not CUSTOMENV[k]end end
|
||||
function ROOMrev(k)return function()ROOMENV[k]=not ROOMENV[k]end end
|
||||
function SETrev(k)return function()SETTING[k]=not SETTING[k]end end
|
||||
function CUSsto(k)return function(i)CUSTOMENV[k]=i end end
|
||||
function ROOMsto(k)return function(i)ROOMENV[k]=i end end
|
||||
function SETsto(k)return function(i)SETTING[k]=i end end
|
||||
end
|
||||
@@ -243,6 +243,46 @@ if not CUSTOMENV or CUSTOMENV.version~=VERSION.code then
|
||||
else
|
||||
TABLE.complete(customEnv0,CUSTOMENV)
|
||||
end
|
||||
ROOMENV={
|
||||
--Room config
|
||||
capacity=5,
|
||||
|
||||
--Basic
|
||||
drop=30,
|
||||
lock=60,
|
||||
wait=0,
|
||||
fall=0,
|
||||
|
||||
--Control
|
||||
nextCount=6,
|
||||
holdCount=1,
|
||||
infHold=true,
|
||||
phyHold=false,
|
||||
|
||||
--Visual
|
||||
bone=false,
|
||||
|
||||
--Rule
|
||||
life=0,
|
||||
pushSpeed=5,
|
||||
garbageSpeed=2,
|
||||
visible='show',
|
||||
freshLimit=15,
|
||||
|
||||
fieldH=20,
|
||||
heightLimit=1e99,
|
||||
bufferLimit=1e99,
|
||||
|
||||
ospin=true,
|
||||
fineKill=false,
|
||||
b2bKill=false,
|
||||
easyFresh=true,
|
||||
deepDrop=false,
|
||||
|
||||
--Else
|
||||
bg='blockfall',
|
||||
bgm='hang out',
|
||||
}
|
||||
SETTING={--Settings
|
||||
--Tuning
|
||||
das=10,arr=2,dascut=0,
|
||||
|
||||
@@ -97,7 +97,6 @@ return{
|
||||
|
||||
onlinePlayerCount="Online",
|
||||
|
||||
createRoomTooFast="You are creating a room too fast!",
|
||||
createRoomSuccessed="Room successfully created!",
|
||||
started="Playing",
|
||||
joinRoom="has joined the room.",
|
||||
@@ -253,10 +252,46 @@ return{
|
||||
refreshing="Refreshing rooms",
|
||||
noRoom="There aren't any rooms right now...",
|
||||
refresh="Refresh",
|
||||
new="New Room(2)",
|
||||
new2="New Room(5)",
|
||||
new="New Room",
|
||||
join="Join",
|
||||
},
|
||||
net_newRoom={
|
||||
title="Custom room config",
|
||||
roomName="Room name(default to username's room)",
|
||||
|
||||
life="Lives",
|
||||
pushSpeed="Push Speed",
|
||||
garbageSpeed="Garbage Speed",
|
||||
visible="Visibility",
|
||||
freshLimit="Lock Reset Limit",
|
||||
|
||||
fieldH="Field Height",
|
||||
bufferLimit="Buffer Limit",
|
||||
heightLimit="Height Limit",
|
||||
|
||||
drop="Drop Delay",
|
||||
lock="Lock Delay",
|
||||
wait="Entry Delay",
|
||||
fall="Line Delay",
|
||||
|
||||
capacity="Capacity",
|
||||
create="Create",
|
||||
|
||||
ospin="O-spin",
|
||||
fineKill="100% Finesse",
|
||||
b2bKill="No B2B break",
|
||||
easyFresh="Normal Lock Reset",
|
||||
deepDrop="Deep Drop",
|
||||
bone="Bone Blocks",
|
||||
|
||||
nextCount="Next",
|
||||
holdCount="Hold",
|
||||
infHold="Infinite Hold",
|
||||
phyHold="In-place Hold",
|
||||
|
||||
bg="Background",
|
||||
bgm="Music",
|
||||
},
|
||||
net_game={
|
||||
ready="Ready",
|
||||
spectate="Spectate",
|
||||
|
||||
@@ -96,7 +96,6 @@ return{
|
||||
|
||||
-- onlinePlayerCount="Online",
|
||||
|
||||
createRoomTooFast="Vous avez créé un salon trop rapidement !",
|
||||
createRoomSuccessed="Salon créé avec succès !",
|
||||
-- started="Playing",
|
||||
joinRoom="a rejoint le salon.",
|
||||
@@ -224,8 +223,46 @@ return{
|
||||
-- refreshing="Refreshing Rooms",
|
||||
noRoom="Aucun salon actuellement",
|
||||
-- refresh="Refresh",
|
||||
-- new="New Room",
|
||||
join="Rejoindre",
|
||||
},
|
||||
net_newRoom={
|
||||
-- title="Custom room config",
|
||||
-- roomName="Room name(default to username's room)",
|
||||
|
||||
life="Vie",
|
||||
-- pushSpeed="Push Speed",
|
||||
garbageSpeed="Vitesse des lignes indésirables",
|
||||
visible="Visibilité",
|
||||
freshLimit="Limite de réinit. du délai de verrouillage",
|
||||
|
||||
-- fieldH="Field height",
|
||||
-- bufferLimit="Buffer Limit",
|
||||
-- heightLimit="Height Limit",
|
||||
|
||||
drop="Délai de chute",
|
||||
lock="Délai de verrouillage",
|
||||
wait="Délai d'apparition",
|
||||
fall="Délai de ligne",
|
||||
|
||||
-- capacity="Capacity",
|
||||
-- create="Create",
|
||||
|
||||
ospin="O-spin",
|
||||
fineKill="100% Finesse",
|
||||
b2bKill="Sans perte de B2B",
|
||||
easyFresh="Réinit. de verrouillage normale",
|
||||
-- deepDrop="Deep Drop",
|
||||
bone="Crochets",
|
||||
|
||||
nextCount="Prévisualisations de pièces",
|
||||
holdCount="Réserve",
|
||||
infHold="Réserver une fois",
|
||||
-- phyHold="Physical Hold",
|
||||
|
||||
bg="Arrière-plan",
|
||||
bgm="Musique",
|
||||
},
|
||||
net_game={
|
||||
-- ready="Ready",
|
||||
-- spectate="Spectate",
|
||||
|
||||
@@ -96,7 +96,6 @@ return{
|
||||
|
||||
-- onlinePlayerCount="Online",
|
||||
|
||||
-- createRoomTooFast="Create room too fast!",
|
||||
-- createRoomSuccessed="Room successfully created!",
|
||||
-- started="Playing",
|
||||
joinRoom="Entrou a sala.",
|
||||
@@ -252,10 +251,46 @@ return{
|
||||
-- refreshing="Refreshing Rooms",
|
||||
noRoom="Nenhuma sala agora",
|
||||
-- refresh="Refresh",
|
||||
-- new="New Room(2)",
|
||||
-- new2="New Room(5)",
|
||||
-- new="New Room",
|
||||
-- join="Join",
|
||||
},
|
||||
net_newRoom={
|
||||
-- title="Custom room config",
|
||||
-- roomName="Room name(default to username's room)",
|
||||
|
||||
life="Vidas",
|
||||
pushSpeed="Garbage Speed",
|
||||
-- garbageSpeed="Velocidade De Lixo",
|
||||
visible="Visibilidade",
|
||||
freshLimit="Limite Reset de Trava",
|
||||
|
||||
-- fieldH="Field height",
|
||||
-- bufferLimit="Buffer Limit",
|
||||
-- heightLimit="Height Limit",
|
||||
|
||||
drop="Delay Queda",
|
||||
lock="Delay Trava",
|
||||
wait="Delay Entrada",
|
||||
fall="Delay Linha",
|
||||
|
||||
-- capacity="Capacity",
|
||||
-- create="Create",
|
||||
|
||||
ospin="O-Spin",
|
||||
fineKill="100% Finesse",
|
||||
b2bKill="Sem Quebrar B2B",
|
||||
easyFresh="Reset De Trava Normal",
|
||||
-- deepDrop="Deep Drop",
|
||||
bone="Bone Blocks",
|
||||
|
||||
nextCount="Prox.",
|
||||
holdCount="Segurar",
|
||||
infHold="Segurar Infinito",
|
||||
-- phyHold="Physical Hold",
|
||||
|
||||
bg="Fundo",
|
||||
bgm="Música",
|
||||
},
|
||||
net_game={
|
||||
-- ready="Ready",
|
||||
-- spectate="Spectate",
|
||||
|
||||
@@ -95,7 +95,6 @@ return{
|
||||
|
||||
-- onlinePlayerCount="Online",
|
||||
|
||||
createRoomTooFast="¡Creas salas muy rápido, párale we!",
|
||||
createRoomSuccessed="¡Sala creada con éxito!",
|
||||
-- started="Playing",
|
||||
joinRoom="entró a la sala.",
|
||||
@@ -228,10 +227,46 @@ return{
|
||||
-- refreshing="Refreshing Rooms",
|
||||
noRoom="No Hay Salas Actualmente",
|
||||
refresh="Refrescar",
|
||||
new="Sala Nueva(2)",
|
||||
new2="Sala Nueva(5)",
|
||||
-- new="New Room",
|
||||
join="Unirse",
|
||||
},
|
||||
net_newRoom={
|
||||
-- title="Custom room config",
|
||||
-- roomName="Room name(default to username's room)",
|
||||
|
||||
life="Vida",
|
||||
-- pushSpeed="Garbage Speed",
|
||||
garbageSpeed="Velocidad de Basura",
|
||||
visible="Visibilidad",
|
||||
freshLimit="Límite de Reinicio LD",
|
||||
|
||||
fieldH="Altura del tablero",
|
||||
-- bufferLimit="Buffer Limit",
|
||||
-- heightLimit="Height Limit",
|
||||
|
||||
drop="Retraso de Caída",
|
||||
lock="Retraso de Bloqueo",
|
||||
wait="Retraso de Spawneo",
|
||||
fall="Retraso de Línea",
|
||||
|
||||
-- capacity="Capacity",
|
||||
-- create="Create",
|
||||
|
||||
ospin="O-Spin",
|
||||
fineKill="100% Finesse",
|
||||
b2bKill="No Romper B2B ",
|
||||
easyFresh="Reinicio de Bloqueo Normal",
|
||||
deepDrop="Deep Drop",
|
||||
bone="Bone Block",
|
||||
|
||||
nextCount="Siguiente",
|
||||
holdCount="Reserva",
|
||||
infHold="Reserva Inft.",
|
||||
phyHold="Reserva Limit.",
|
||||
|
||||
bg="Fundo",
|
||||
bgm="Música",
|
||||
},
|
||||
net_game={
|
||||
ready="Estoy Listo",
|
||||
-- spectate="Spectate",
|
||||
|
||||
@@ -42,7 +42,6 @@ return{
|
||||
|
||||
ranks={"菜","可","好","强","您"},
|
||||
|
||||
createRoomTooFast="手痒要开这么多房间?",
|
||||
createRoomSuccessed="创好了",
|
||||
started="开了",
|
||||
spectating="看戏中",
|
||||
@@ -109,12 +108,12 @@ return{
|
||||
pro="阴间",
|
||||
},
|
||||
about={
|
||||
staff="游戏谁做的",
|
||||
staff="游戏谁写的",
|
||||
his="黑历史",
|
||||
qq="QQ对线",
|
||||
},
|
||||
register={
|
||||
password2="你猜该填啥",
|
||||
password2="你懂的",
|
||||
},
|
||||
sound={
|
||||
title="音效室",
|
||||
@@ -271,9 +270,9 @@ return{
|
||||
['backfire_h']= {"自攻自受", "困难", "你在害怕什么"},
|
||||
['backfire_l']= {"自攻自受", "疯狂", "别怂啊,打攻击呀"},
|
||||
['backfire_u']= {"自攻自受", "极限", "能把自己玩死,不会吧"},
|
||||
['zen']= {"禅", "200", "不限时200行"},
|
||||
['zen']= {"禅", "200", "不限时200行"},
|
||||
['ultra']= {"限时打分", "挑战", "2分钟刷分"},
|
||||
['infinite']= {"无尽", "", "真的有人会玩这个?"},
|
||||
['infinite']= {"无尽", "", "真的有人会玩这个?"},
|
||||
['infinite_dig']= {"无尽:挖掘", "", "闲得慌就来挖"},
|
||||
['sprintFix']= {"竞速", "无移动"},
|
||||
['sprintLock']= {"竞速", "无旋转"},
|
||||
|
||||
@@ -97,7 +97,6 @@ return{
|
||||
|
||||
onlinePlayerCount="在线人数",
|
||||
|
||||
createRoomTooFast="创建房间太快啦,等等吧",
|
||||
createRoomSuccessed="创建房间成功!",
|
||||
started="游戏中",
|
||||
joinRoom="进入房间",
|
||||
@@ -253,10 +252,46 @@ return{
|
||||
refreshing="刷新房间列表中",
|
||||
noRoom="一个房间都没有哎...",
|
||||
refresh="刷新",
|
||||
new="创建房间(2)",
|
||||
new2="创建房间(5)",
|
||||
new="创建房间",
|
||||
join="加入",
|
||||
},
|
||||
net_newRoom={
|
||||
title="自定义房间参数",
|
||||
roomName="房间名(留空默认 用户名's room)",
|
||||
|
||||
life="命数",
|
||||
pushSpeed="上涨速度",
|
||||
garbageSpeed="垃圾行速度",
|
||||
visible="能见度",
|
||||
freshLimit="锁延刷新限制",
|
||||
|
||||
fieldH="场地高度",
|
||||
bufferLimit="缓冲上限",
|
||||
heightLimit="高度上限",
|
||||
|
||||
drop="下落延迟",
|
||||
lock="锁定延迟",
|
||||
wait="出块等待",
|
||||
fall="消行延迟",
|
||||
|
||||
capacity="房间容量",
|
||||
create="创建房间",
|
||||
|
||||
ospin="O-spin",
|
||||
fineKill="强制极简",
|
||||
b2bKill="强制B2B",
|
||||
easyFresh="普通刷新锁延",
|
||||
deepDrop="深降",
|
||||
bone="骨块",
|
||||
|
||||
nextCount="Next",
|
||||
holdCount="Hold",
|
||||
infHold="无限Hold",
|
||||
phyHold="物理Hold",
|
||||
|
||||
bg="背景",
|
||||
bgm="音乐",
|
||||
},
|
||||
net_game={
|
||||
ready="准备",
|
||||
spectate="观战",
|
||||
|
||||
@@ -17,6 +17,7 @@ return{
|
||||
bgm={'battle','cruelty','distortion','far','final','hope','magicblock','new era','push','race','rockblock','secret7th','secret8th','shining terminal','storm','super7th','warped','waterfall','moonbeam'},
|
||||
},
|
||||
load=function()
|
||||
applyRoomConf()
|
||||
local L=TABLE.copy(netPLY.list)
|
||||
local N=1
|
||||
for i,p in next,L do
|
||||
|
||||
@@ -309,7 +309,7 @@ function NET.fetchRoom()
|
||||
})
|
||||
end
|
||||
end
|
||||
function NET.createRoom(roomName,capacity,roomType,password)
|
||||
function NET.createRoom(roomName,capacity,roomType,roomData,password)
|
||||
if NET.lock('enterRoom',1.26)then
|
||||
NET.roomState.private=not not password
|
||||
NET.roomState.capacity=capacity
|
||||
@@ -323,7 +323,7 @@ function NET.createRoom(roomName,capacity,roomType,password)
|
||||
type=roomType,
|
||||
version=VERSION.short,
|
||||
},
|
||||
roomData={_=0},
|
||||
roomData=roomData,
|
||||
|
||||
config=dumpBasicConfig(),
|
||||
}
|
||||
@@ -563,6 +563,7 @@ function NET.updateWS_play()
|
||||
if not d.uid then
|
||||
NET.wsclose_stream()
|
||||
NET.unlock('quit')
|
||||
if SCN.stack[#SCN.stack-1]=='net_newRoom'then SCN.pop()end
|
||||
SCN.back()
|
||||
else
|
||||
removePlayer(netPLY.list,d.sid)
|
||||
|
||||
@@ -181,8 +181,8 @@ end
|
||||
|
||||
scene.widgetScrollHeight=400
|
||||
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="title", x=520, y=15,font=70,align='R'},
|
||||
WIDGET.newText{name="subTitle", x=530, y=60,font=35,align='L',color='H'},
|
||||
|
||||
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"},
|
||||
@@ -207,10 +207,10 @@ scene.widgetList={
|
||||
WIDGET.newSelector{name="heightLimit", x=450,y=710,w=260,color='S',list=sList.heightLimit, disp=CUSval("heightLimit"), code=CUSsto("heightLimit")},
|
||||
WIDGET.newSelector{name="bufferLimit", x=450,y=790,w=260,color='B',list=sList.bufferLimit, disp=CUSval("bufferLimit"), code=CUSsto("bufferLimit")},
|
||||
|
||||
WIDGET.newSelector{name="drop", x=730,y=330,w=260,color='O',list=sList.drop,disp=CUSval("drop"),code=CUSsto("drop")},
|
||||
WIDGET.newSelector{name="lock", x=730,y=410,w=260,color='O',list=sList.lock,disp=CUSval("lock"),code=CUSsto("lock")},
|
||||
WIDGET.newSelector{name="wait", x=730,y=520,w=260,color='G',list=sList.wait,disp=CUSval("wait"),code=CUSsto("wait")},
|
||||
WIDGET.newSelector{name="fall", x=730,y=600,w=260,color='G',list=sList.fall,disp=CUSval("fall"),code=CUSsto("fall")},
|
||||
WIDGET.newSelector{name="drop",x=730,y=330,w=260,color='O',list=sList.drop,disp=CUSval("drop"),code=CUSsto("drop")},
|
||||
WIDGET.newSelector{name="lock",x=730,y=410,w=260,color='O',list=sList.lock,disp=CUSval("lock"),code=CUSsto("lock")},
|
||||
WIDGET.newSelector{name="wait",x=730,y=520,w=260,color='G',list=sList.wait,disp=CUSval("wait"),code=CUSsto("wait")},
|
||||
WIDGET.newSelector{name="fall",x=730,y=600,w=260,color='G',list=sList.fall,disp=CUSval("fall"),code=CUSsto("fall")},
|
||||
|
||||
--Copy / Paste / Start
|
||||
WIDGET.newButton{name="copy", x=1070, y=300,w=310,h=70,color='lR',font=25,code=pressKey"cC"},
|
||||
|
||||
102
parts/scenes/net_newRoom.lua
Normal file
102
parts/scenes/net_newRoom.lua
Normal file
@@ -0,0 +1,102 @@
|
||||
local ROOMENV=ROOMENV
|
||||
|
||||
local roomName=WIDGET.newInputBox{name="roomNameBox",x=40,y=170,w=1200,h=80}
|
||||
|
||||
local sList={
|
||||
visible={"show","easy","slow","medium","fast","none"},
|
||||
freshLimit={0,1,2,4,6,8,10,12,15,30,1e99},
|
||||
life={0,1,2,3,5,10,15,26,42,87,500},
|
||||
pushSpeed={1,2,3,5,15},
|
||||
fieldH={1,2,3,4,6,8,10,15,20,30,50,100},
|
||||
heightLimit={2,3,4,6,8,10,15,20,30,40,70,100,150,200,1e99},
|
||||
bufferLimit={4,6,10,15,20,40,100,1e99},
|
||||
|
||||
drop={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},
|
||||
lock={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},
|
||||
wait={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
|
||||
fall={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
|
||||
}
|
||||
|
||||
local scene={}
|
||||
|
||||
local function createRoom()
|
||||
local roomname=STRING.trim(roomName.value)
|
||||
if #roomname==0 then roomname=(USERS.getUsername(USER.uid)or"Anonymous").."'s room"end
|
||||
NET.createRoom(
|
||||
roomname,
|
||||
ROOMENV.capacity,"normal",ROOMENV
|
||||
)
|
||||
end
|
||||
|
||||
function scene.sceneInit()
|
||||
sure=0
|
||||
destroyPlayers()
|
||||
BG.set(ROOMENV.bg)
|
||||
BGM.play(ROOMENV.bgm)
|
||||
end
|
||||
function scene.sceneBack()
|
||||
BGM.play()
|
||||
end
|
||||
|
||||
function scene.keyDown(k)
|
||||
if k=="return"then
|
||||
createRoom()
|
||||
elseif k=="escape"then
|
||||
SCN.go('net_rooms')
|
||||
end
|
||||
end
|
||||
|
||||
scene.widgetScrollHeight=400
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name="title",x=40,y=15,font=70,align='L'},
|
||||
|
||||
--Room name
|
||||
WIDGET.newText{name="roomName",x=40,y=120,align='L'},
|
||||
roomName,
|
||||
|
||||
--Selectors
|
||||
WIDGET.newSelector{name="life", x=170,y=410,w=260,color='R',list=sList.life, disp=ROOMval("life"), code=ROOMsto("life")},
|
||||
WIDGET.newSelector{name="pushSpeed", x=170,y=520,w=260,color='V',list=sList.pushSpeed, disp=ROOMval("pushSpeed"), code=ROOMsto("pushSpeed")},
|
||||
WIDGET.newSelector{name="garbageSpeed", x=170,y=600,w=260,color='V',list=sList.pushSpeed, disp=ROOMval("garbageSpeed"),code=ROOMsto("garbageSpeed")},
|
||||
WIDGET.newSelector{name="visible", x=170,y=710,w=260,color='lB',list=sList.visible, disp=ROOMval("visible"), code=ROOMsto("visible")},
|
||||
WIDGET.newSelector{name="freshLimit", x=170,y=790,w=260,color='lB',list=sList.freshLimit, disp=ROOMval("freshLimit"), code=ROOMsto("freshLimit")},
|
||||
|
||||
WIDGET.newSelector{name="fieldH", x=450,y=600,w=260,color='N',list=sList.fieldH, disp=ROOMval("fieldH"), code=ROOMsto("fieldH")},
|
||||
WIDGET.newSelector{name="heightLimit", x=450,y=710,w=260,color='S',list=sList.heightLimit, disp=ROOMval("heightLimit"),code=ROOMsto("heightLimit")},
|
||||
WIDGET.newSelector{name="bufferLimit", x=450,y=790,w=260,color='B',list=sList.bufferLimit, disp=ROOMval("bufferLimit"),code=ROOMsto("bufferLimit")},
|
||||
|
||||
WIDGET.newSelector{name="drop",x=730,y=330,w=260,color='O',list=sList.drop,disp=ROOMval("drop"),code=ROOMsto("drop")},
|
||||
WIDGET.newSelector{name="lock",x=730,y=410,w=260,color='O',list=sList.lock,disp=ROOMval("lock"),code=ROOMsto("lock")},
|
||||
WIDGET.newSelector{name="wait",x=730,y=520,w=260,color='G',list=sList.wait,disp=ROOMval("wait"),code=ROOMsto("wait")},
|
||||
WIDGET.newSelector{name="fall",x=730,y=600,w=260,color='G',list=sList.fall,disp=ROOMval("fall"),code=ROOMsto("fall")},
|
||||
|
||||
--Capcity & Create & Back
|
||||
WIDGET.newSelector{name="capacity",x=170,y=330,w=260,color='R',list={2,3,4,5,7,10,17,31,49,99},disp=function()return ROOMENV.capacity end,
|
||||
code=function(i)
|
||||
if USER.uid<100 or i<=10 then
|
||||
ROOMENV.capacity=i
|
||||
end
|
||||
end},
|
||||
WIDGET.newButton{name="create",x=1070,y=495,w=310,h=140,color='lY',font=40,code=pressKey"return"},
|
||||
WIDGET.newButton{name="back",x=1140,y=640,w=170,h=80,fText=TEXTURE.back,code=backScene},
|
||||
|
||||
--Special rules
|
||||
WIDGET.newSwitch{name="ospin", x=830, y=750,disp=ROOMval("ospin"), code=ROOMrev("ospin")},
|
||||
WIDGET.newSwitch{name="fineKill", x=830, y=840,disp=ROOMval("fineKill"), code=ROOMrev("fineKill")},
|
||||
WIDGET.newSwitch{name="b2bKill", x=830, y=930,disp=ROOMval("b2bKill"), code=ROOMrev("b2bKill")},
|
||||
WIDGET.newSwitch{name="easyFresh", x=1170, y=750,disp=ROOMval("easyFresh"),code=ROOMrev("easyFresh")},
|
||||
WIDGET.newSwitch{name="deepDrop", x=1170, y=840,disp=ROOMval("deepDrop"), code=ROOMrev("deepDrop")},
|
||||
WIDGET.newSwitch{name="bone", x=1170, y=930,disp=ROOMval("bone"), code=ROOMrev("bone")},
|
||||
|
||||
--Next & Hold
|
||||
WIDGET.newSlider{name="nextCount", x=120,y=940,w=200,unit=6, disp=ROOMval("nextCount"),code=ROOMsto("nextCount")},
|
||||
WIDGET.newSlider{name="holdCount", x=120,y=1030,w=200,unit=6, disp=ROOMval("holdCount"),code=ROOMsto("holdCount")},
|
||||
WIDGET.newSwitch{name="infHold", x=560,y=940, disp=ROOMval("infHold"),code=ROOMrev("infHold"),hideF=function()return ROOMENV.holdCount==0 end},
|
||||
WIDGET.newSwitch{name="phyHold", x=560,y=1030, disp=ROOMval("phyHold"),code=ROOMrev("phyHold"),hideF=function()return ROOMENV.holdCount==0 end},
|
||||
|
||||
--BG & BGM
|
||||
WIDGET.newSelector{name="bg", x=840, y=1030,w=250,color='Y',list=BG.getList(),disp=ROOMval("bg"),code=function(i)ROOMENV.bg=i BG.set(i)end},
|
||||
WIDGET.newSelector{name="bgm", x=1120, y=1030,w=250,color='Y',list=BGM.getList(),disp=ROOMval("bgm"),code=function(i)ROOMENV.bgm=i BGM.play(i)end},
|
||||
}
|
||||
|
||||
return scene
|
||||
@@ -1,15 +1,14 @@
|
||||
local gc=love.graphics
|
||||
local ms,kb=love.mouse,love.keyboard
|
||||
local ms=love.mouse
|
||||
|
||||
local int,max,min=math.floor,math.max,math.min
|
||||
|
||||
local NET=NET
|
||||
local scrollPos,selected
|
||||
local fetchTimer
|
||||
local lastCreateRoomTime=0
|
||||
|
||||
--[[room={
|
||||
rid="qwe",
|
||||
--[[NET.roomList[n]={
|
||||
rid="qwerty",
|
||||
roomInfo={
|
||||
name="MrZ's room",
|
||||
type="classic",
|
||||
@@ -44,30 +43,8 @@ function scene.keyDown(k)
|
||||
end
|
||||
elseif k=="s"then
|
||||
SCN.go('setting_game')
|
||||
elseif k=="m"or k=="n"then
|
||||
if TIME()-lastCreateRoomTime>6.26 then
|
||||
local cap,roomType
|
||||
if k=="n"then
|
||||
cap,roomType=2,"solo"
|
||||
elseif kb.isDown("q")and tonumber(USER.uid)<100 then
|
||||
cap,roomType=17,"big"
|
||||
elseif kb.isDown("w")and tonumber(USER.uid)<100 then
|
||||
cap,roomType=31,"huge"
|
||||
elseif kb.isDown("e")and tonumber(USER.uid)<100 then
|
||||
cap,roomType=49,"T49"
|
||||
elseif kb.isDown("r")and tonumber(USER.uid)<100 then
|
||||
cap,roomType=99,"T99"
|
||||
else
|
||||
cap,roomType=5,"normal"
|
||||
end
|
||||
NET.createRoom(
|
||||
(USERS.getUsername(USER.uid)or"???").."'s room",
|
||||
cap,roomType
|
||||
)
|
||||
lastCreateRoomTime=TIME()
|
||||
else
|
||||
LOG.print(text.createRoomTooFast,'warn')
|
||||
end
|
||||
elseif k=="n"then
|
||||
SCN.go('net_newRoom')
|
||||
elseif k=="escape"then
|
||||
SCN.back()
|
||||
elseif #NET.roomList>0 then
|
||||
@@ -137,7 +114,7 @@ end
|
||||
function scene.draw()
|
||||
--Fetching timer
|
||||
gc.setColor(1,1,1,.12)
|
||||
gc.arc('fill','pie',300,620,60,-1.5708,-1.5708-.6283*fetchTimer)
|
||||
gc.arc('fill','pie',250,620,60,-1.5708,-1.5708-.6283*fetchTimer)
|
||||
|
||||
--Room list
|
||||
gc.setColor(1,1,1)
|
||||
@@ -209,10 +186,9 @@ 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=450,y=255,font=45,hideF=function()return not NET.getlock('fetchRoom')end},
|
||||
WIDGET.newText{name="noRoom", x=450,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>7 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",hideF=function()return #NET.roomList==0 or NET.getlock('enterRoom')end},
|
||||
WIDGET.newKey{name="refresh", x=250,y=620,w=140,h=140,font=35,code=fetchRoom,hideF=function()return fetchTimer>7 end},
|
||||
WIDGET.newKey{name="new", x=550,y=620,w=260,h=140,font=30,code=pressKey"n"},
|
||||
WIDGET.newKey{name="join", x=850,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,fText=TEXTURE.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user