添加房主和队伍状态的显示方式
添加转交房主提示
This commit is contained in:
@@ -6,6 +6,16 @@ local gc_stencil,gc_setStencilTest=gc.stencil,gc.setStencilTest
|
||||
local ins,rem=table.insert,table.remove
|
||||
local setFont=FONT.set
|
||||
|
||||
local groupColor={
|
||||
[0]=COLOR.Z,
|
||||
[1]=COLOR.R,
|
||||
[2]=COLOR.G,
|
||||
[3]=COLOR.B,
|
||||
[4]=COLOR.Y,
|
||||
[5]=COLOR.M,
|
||||
[6]=COLOR.C,
|
||||
}
|
||||
|
||||
local posLists={
|
||||
-- 1~5
|
||||
(function()
|
||||
@@ -71,9 +81,13 @@ local nullIndex={
|
||||
MES.new('error',"User not loaded: "..k)
|
||||
NETPLY.add{
|
||||
uid=k,
|
||||
group=-1,
|
||||
role='Normal',-- 'Normal'|'Admin'
|
||||
playMode='Spectator',
|
||||
readyMode='Standby',
|
||||
config="",
|
||||
place=1e99,
|
||||
stat=false,
|
||||
}
|
||||
return self[k]
|
||||
end
|
||||
@@ -106,10 +120,14 @@ end
|
||||
function NETPLY.add(d)
|
||||
local p={
|
||||
uid=d.uid,
|
||||
|
||||
group=d.group,
|
||||
role=d.role,-- 'Normal'|'Admin'
|
||||
|
||||
playMode=d.playMode,-- 'Gamer'|'Spectator'
|
||||
readyMode=d.readyMode,-- 'Standby'|'Ready'|'Playing'|'Finished'
|
||||
config=d.config,-- A long string generated by dumpBasicConfig()
|
||||
|
||||
config=d.config,-- A long string generated by dumpBasicConfig()
|
||||
place=1e99,
|
||||
stat=false,
|
||||
}
|
||||
@@ -189,7 +207,7 @@ function NETPLY.draw()
|
||||
gc_rectangle('fill',0,0,p.w,p.h)
|
||||
gc_setColor(COLOR.dH)
|
||||
end
|
||||
gc_setLineWidth(2)
|
||||
gc_setLineWidth(p.role=='Admin' and 4 or 2)
|
||||
gc_rectangle('line',0,0,p.w,p.h)
|
||||
|
||||
-- Stencil
|
||||
@@ -202,18 +220,6 @@ function NETPLY.draw()
|
||||
local avatarSize=math.min(p.h,50)/128*.9
|
||||
gc_draw(USERS.getAvatar(p.uid),2,2,nil,avatarSize)
|
||||
|
||||
-- UID & Username
|
||||
if p.h>=47 then
|
||||
setFont(40)
|
||||
gc_print("#"..p.uid,50,-5)
|
||||
gc_print(USERS.getUsername(p.uid),210,-5)
|
||||
else
|
||||
setFont(15)
|
||||
gc_print("#"..p.uid,46,-1)
|
||||
setFont(30)
|
||||
gc_print(USERS.getUsername(p.uid),p.h,8)
|
||||
end
|
||||
|
||||
-- Stat
|
||||
local S=p.stat
|
||||
if S and (p.h>=55 or p.w>=180) then
|
||||
@@ -228,6 +234,19 @@ function NETPLY.draw()
|
||||
gc_printf(S.lpm,x,19,150,'right')
|
||||
end
|
||||
end
|
||||
|
||||
-- UID & Username
|
||||
gc_setColor(groupColor[p.group] or COLOR.dH)
|
||||
if p.h>=47 then
|
||||
setFont(40)
|
||||
gc_print("#"..p.uid,50,-5)
|
||||
gc_print(USERS.getUsername(p.uid),210,-5)
|
||||
else
|
||||
setFont(15)
|
||||
gc_print("#"..p.uid,46,-1)
|
||||
setFont(30)
|
||||
gc_print(USERS.getUsername(p.uid),p.h,8)
|
||||
end
|
||||
gc_setStencilTest()
|
||||
gc_translate(-p.x,-p.y)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user