增加玩家个人信息显示框(暂时只有头像)

This commit is contained in:
MrZ626
2021-04-20 01:40:12 +08:00
parent 6cee129a68
commit ca856cbb35
4 changed files with 28 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ local data=love.data
local gc=love.graphics
local gc_setColor,gc_setLineWidth,gc_setShader=gc.setColor,gc.setLineWidth,gc.setShader
local gc_push,gc_pop,gc_origin=gc.push,gc.pop,gc.origin
local gc_push,gc_pop,gc_origin,gc_translate=gc.push,gc.pop,gc.origin,gc.translate
local gc_draw,gc_rectangle,gc_circle=gc.draw,gc.rectangle,gc.circle
local max,int,rnd=math.max,math.floor,math.random
local sin=math.sin
@@ -995,6 +995,22 @@ do--function drawFWM()
mStr(m[_G["\83\69\84\84\73\78\71"]["\108\97\110\103"]or m[1]],240,60+26*sin(t))
end
end
do--function drawSelfProfile()
function drawSelfProfile()
local selfAvatar=USERS.getAvatar(USER.uid)
gc_push("transform")
gc_translate(1280,0)
--Draw avatar
gc_setLineWidth(2)
gc_setColor(.3,.3,.3,.8)gc_rectangle("fill",-260,0,260,80)
gc_setColor(1,1,1)gc_rectangle("line",-260,0,260,80)
gc_rectangle("line",-73,7,66,66,2)
gc_draw(selfAvatar,-72,8,nil,.5)
gc_pop()
end
end
function drawWarning()
if SETTING.warn and GAME.warnLVL>0 then
gc_push("transform")

View File

@@ -257,6 +257,9 @@ function scene.draw()
gc.setColor(.5,.5,.5)
gc.print("#"..p.uid,50,60+50*i)
end
--Profile
drawSelfProfile()
end
--New message
if textBox.new and textBox.hide then

View File

@@ -10,11 +10,15 @@ function scene.sceneBack()
NET.wsclose_play()
end
function scene.draw()
drawSelfProfile()
end
scene.widgetList={
WIDGET.newButton{name="ffa", x=640, y=200,w=350,h=120,font=40,code=function()NET.enterRoom("ffa")end},
WIDGET.newButton{name="rooms", x=640, y=360,w=350,h=120,font=40,code=goScene"net_rooms"},
WIDGET.newButton{name="chat", x=640, y=540,w=350,h=120,color="black",font=40,code=NULL},
WIDGET.newButton{name="logout", x=1140, y=70,w=180,h=70,color="dR",
WIDGET.newButton{name="logout", x=1180, y=130,w=180,h=70,color="dR",
code=function()
if TIME()-lastLogoutTime<1 then
if USER.uid then

View File

@@ -115,6 +115,9 @@ function scene.draw()
gc.print(R.count.."/"..R.capacity,1100,66+40*i)
end
end
--Profile
drawSelfProfile()
end
local function hide_noRoom()return #NET.roomList==0 end