From 6e00ff96ecdfed27d8a290d83627cbaf0c09b1c9 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Fri, 30 Sep 2022 07:23:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=88=BF=E9=97=B4=E5=AF=B9=E8=B1=A1=E6=A0=BC=E5=BC=8F=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D=E4=BC=9A=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E7=88=86=E7=82=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/net_rooms.lua | 39 ++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/parts/scenes/net_rooms.lua b/parts/scenes/net_rooms.lua index 3eb125c2..e5c66412 100644 --- a/parts/scenes/net_rooms.lua +++ b/parts/scenes/net_rooms.lua @@ -15,23 +15,34 @@ local roomList=WIDGET.newListBox{name='roomList',x=50,y=50,w=800,h=440,lineH=40, gc_setColor(1,1,1,.3) gc_rectangle('fill',0,0,800,40) end - gc_setColor(1,1,1) - if item.private then - gc_draw(IMG.lock,10,5) - end - gc_printf(item.count.Spectator>0 and ("$1(+$2)/$3"):repD(item.count.Gamer,item.count.Spectator,item.capacity) or ("$1/$2"):repD(item.count.Gamer,item.capacity),600,-4,180,'right') gc_setColor(.9,.9,1) gc_print(id,45,-4) - if item.state=='Standby' then - gc_setColor(COLOR.Z) - elseif item.state=='Ready' then - gc_setColor(COLOR.lG) - elseif item.state=='Playing' then - gc_setColor(COLOR.G) + if type(item)=='table' then + gc_setColor(1,1,1) + if item.private then + gc_draw(IMG.lock,10,5) + end + if item.count then + gc_printf( + type(item.count.Spectator)=='number'and item.count.Spectator>0 and + ("$1(+$2)/$3"):repD(item.count.Gamer or'?',item.count.Spectator or'?',item.capacity or'?') + or + ("$1/$2"):repD(item.count.Gamer or'?',item.capacity or'?'),600,-4,180,'right') + end + + if item.info and item.state then + if item.state=='Standby' then + gc_setColor(COLOR.Z) + elseif item.state=='Ready' then + gc_setColor(COLOR.lG) + elseif item.state=='Playing' then + gc_setColor(COLOR.G) + end + gc_print(item.info.name,200,-4) + end end - gc_print(item.info.name,200,-4) end} local function _hidePW() local R=roomList:getSel() @@ -41,11 +52,11 @@ local passwordBox=WIDGET.newInputBox{name='password',x=350,y=505,w=500,h=50,secr --[[roomList[n]={ state='Standby', - roomId="qwerty" + roomId="qwerty", count={ Gamer=0, Spectator=1, - } + }, info={ name="MrZ's room", description="123123123",