From 23f43df73741d9b888a0de4f52a9b2184244ed96 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Mon, 24 Oct 2022 00:26:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=8E=A9=E5=AE=B6=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=87=86=E5=A4=87=E7=9A=84=E6=97=B6=E5=80=99=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E6=96=87=E5=AD=97=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/net.lua | 9 +++++---- parts/scenes/net_game.lua | 10 ++-------- parts/scenes/net_rooms.lua | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/parts/net.lua b/parts/net.lua index 434c571c..27ab291e 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -24,7 +24,7 @@ local NET={ spectate=false,-- If player is spectating seed=false, - roomReadyState=false, + roomAllReady=false, onlineCount="_", @@ -44,14 +44,14 @@ function NET.freshRoomState() if NETPLY.list[j].readyMode=='Ready' then readyCount=readyCount+1 end end - if playCount-readyCount==1 then + if playCount>1 and playCount-readyCount==1 then local p=NETPLY.map[USER.uid] if p.playMode=='Gamer' and p.readyMode~='Ready' then SFX.play('warn_2',.5) end end - NET.roomReadyState=playCount>0 and playCount==readyCount + NET.roomAllReady=playCount>0 and playCount==readyCount end -------------------------- @@ -646,7 +646,8 @@ function NET.wsCallBack.room_leave(body) end function NET.wsCallBack.room_fetch(body) TASK.unlock('fetchRoom') - if body.data then SCN.scenes.net_rooms.widgetList.roomList:setList(body.data) end + if not body.data then body.data={} end + SCN.scenes.net_rooms.widgetList.roomList:setList(body.data) end function NET.wsCallBack.room_setPW() MES.new(text.roomPasswordChanged) diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index fc47acf4..fa2ba918 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -274,15 +274,9 @@ function scene.draw() -- Ready & Set mark setFont(50) - if NET.roomReadyState=='allReady' then - gc_setColor(1,.85,.6,.9) - mStr(text.ready,640,15) - elseif NET.roomReadyState=='connecting' then - gc_setColor(.6,1,.9,.9) - mStr(text.connStream,640,15) - elseif NET.roomReadyState=='waitConn' then + if NET.roomAllReady then gc_setColor(.6,.95,1,.9) - mStr(text.waitStream,640,15) + mStr(text.ready,640,15) end -- Room info. diff --git a/parts/scenes/net_rooms.lua b/parts/scenes/net_rooms.lua index dbed9781..40fd2928 100644 --- a/parts/scenes/net_rooms.lua +++ b/parts/scenes/net_rooms.lua @@ -36,7 +36,7 @@ local roomList=WIDGET.newListBox{name='roomList',x=50,y=50,w=800,h=440,lineH=40, if item.state=='Standby' then gc_setColor(COLOR.Z) elseif item.state=='Ready' then - gc_setColor(COLOR.lG) + gc_setColor(COLOR.lB) elseif item.state=='Playing' then gc_setColor(COLOR.G) end