增加玩家个人信息显示框(暂时只有头像)
This commit is contained in:
@@ -2,7 +2,7 @@ local data=love.data
|
|||||||
|
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local gc_setColor,gc_setLineWidth,gc_setShader=gc.setColor,gc.setLineWidth,gc.setShader
|
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 gc_draw,gc_rectangle,gc_circle=gc.draw,gc.rectangle,gc.circle
|
||||||
local max,int,rnd=math.max,math.floor,math.random
|
local max,int,rnd=math.max,math.floor,math.random
|
||||||
local sin=math.sin
|
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))
|
mStr(m[_G["\83\69\84\84\73\78\71"]["\108\97\110\103"]or m[1]],240,60+26*sin(t))
|
||||||
end
|
end
|
||||||
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()
|
function drawWarning()
|
||||||
if SETTING.warn and GAME.warnLVL>0 then
|
if SETTING.warn and GAME.warnLVL>0 then
|
||||||
gc_push("transform")
|
gc_push("transform")
|
||||||
|
|||||||
@@ -257,6 +257,9 @@ function scene.draw()
|
|||||||
gc.setColor(.5,.5,.5)
|
gc.setColor(.5,.5,.5)
|
||||||
gc.print("#"..p.uid,50,60+50*i)
|
gc.print("#"..p.uid,50,60+50*i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Profile
|
||||||
|
drawSelfProfile()
|
||||||
end
|
end
|
||||||
--New message
|
--New message
|
||||||
if textBox.new and textBox.hide then
|
if textBox.new and textBox.hide then
|
||||||
|
|||||||
@@ -10,11 +10,15 @@ function scene.sceneBack()
|
|||||||
NET.wsclose_play()
|
NET.wsclose_play()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function scene.draw()
|
||||||
|
drawSelfProfile()
|
||||||
|
end
|
||||||
|
|
||||||
scene.widgetList={
|
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="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="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="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()
|
code=function()
|
||||||
if TIME()-lastLogoutTime<1 then
|
if TIME()-lastLogoutTime<1 then
|
||||||
if USER.uid then
|
if USER.uid then
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ function scene.draw()
|
|||||||
gc.print(R.count.."/"..R.capacity,1100,66+40*i)
|
gc.print(R.count.."/"..R.capacity,1100,66+40*i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Profile
|
||||||
|
drawSelfProfile()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function hide_noRoom()return #NET.roomList==0 end
|
local function hide_noRoom()return #NET.roomList==0 end
|
||||||
|
|||||||
Reference in New Issue
Block a user