diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 0c93cfb2..3d61b145 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -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") diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 744dcc57..32f87288 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -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 diff --git a/parts/scenes/net_menu.lua b/parts/scenes/net_menu.lua index 5cb229d9..fe3bb6a4 100644 --- a/parts/scenes/net_menu.lua +++ b/parts/scenes/net_menu.lua @@ -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 diff --git a/parts/scenes/net_rooms.lua b/parts/scenes/net_rooms.lua index dcaf454a..11b6a5c8 100644 --- a/parts/scenes/net_rooms.lua +++ b/parts/scenes/net_rooms.lua @@ -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