diff --git a/scripts/gameplay.lua b/scripts/gameplay.lua index df84628..0fb25a6 100644 --- a/scripts/gameplay.lua +++ b/scripts/gameplay.lua @@ -42,7 +42,7 @@ function render(deltaTime) resetLayoutInformation(); gfx.Scale(scale, scale); - Banner.render(deltaTime, users); + Banner.render(deltaTime, users, gameplay.user_id); UserPanel.render(deltaTime, score, gameplay.scoreReplays[1]); SongPanel.render(deltaTime, diff --git a/scripts/gameplay/banner.lua b/scripts/gameplay/banner.lua index 400c5c9..23e367e 100644 --- a/scripts/gameplay/banner.lua +++ b/scripts/gameplay/banner.lua @@ -4,7 +4,7 @@ local bannerBaseImage = gfx.CreateSkinImage("gameplay/banner/base.png", 0) local BANNER_W = 1080; local BANNER_H = 368; -local drawScoreboard = function (users) +local drawScoreboard = function (users, currentUserId) if (users == nil) then return end @@ -13,27 +13,33 @@ local drawScoreboard = function (users) gfx.FontSize(32) local x = 16; - local y = 500; + local basey = 510; gfx.LoadSkinFont("Digital-Serial-Bold.ttf") for i, u in ipairs(users) do - local y = y + 40; + local y = basey + i*28; + + if (u.id == currentUserId) then + gfx.FillColor(128,192,255); + else + gfx.FillColor(255,255,255); + end gfx.FontSize(26) - gfx.Text(u.name, x, y) + gfx.Text('#' .. i .. ' ' .. u.name, x, y) gfx.FontSize(26) gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE) - gfx.Text(string.format("%04d", math.floor(u.score/10000)), x+128, y) + gfx.Text(string.format("%04d", math.floor(u.score/10000)), x+128+32, y) local lastFourDigits = ((u.score / 10000) - math.floor(u.score / 10000))*10000 gfx.FontSize(22) - gfx.Text(string.format("%04d", math.floor(lastFourDigits)), x+186, y+1) + gfx.Text(string.format("%04d", math.floor(lastFourDigits)), x+186+32, y+1) end end -local render = function (deltaTime, users) +local render = function (deltaTime, users, currentUserId) local resx, resy = game.GetResolution(); if (resx > resy) then return @@ -54,7 +60,7 @@ local render = function (deltaTime, users) 0 ); - drawScoreboard(users); + drawScoreboard(users, currentUserId); end return {