highlight current player
This commit is contained in:
parent
f0cb051564
commit
dbf020e320
13
browser.lua
13
browser.lua
@ -304,7 +304,7 @@ local colorFlags = {
|
|||||||
[0] = V_SKYMAP,
|
[0] = V_SKYMAP,
|
||||||
[1] = 0
|
[1] = 0
|
||||||
}
|
}
|
||||||
local function drawScore(v, i, pos, score)
|
local function drawScore(v, i, pos, score, highlight)
|
||||||
local y = scoresY + i * 18
|
local y = scoresY + i * 18
|
||||||
local textFlag = colorFlags[pos%2]
|
local textFlag = colorFlags[pos%2]
|
||||||
|
|
||||||
@ -316,6 +316,13 @@ local function drawScore(v, i, pos, score)
|
|||||||
local facerank = skin and v.cachePatch(skin.facerank) or v.cachePatch("M_NORANK")
|
local facerank = skin and v.cachePatch(skin.facerank) or v.cachePatch("M_NORANK")
|
||||||
v.draw(column[1], y, facerank, 0, v.getColormap("sonic", score["color"]))
|
v.draw(column[1], y, facerank, 0, v.getColormap("sonic", score["color"]))
|
||||||
|
|
||||||
|
-- chili
|
||||||
|
if highlight then
|
||||||
|
local chilip = v.cachePatch("K_CHILI"..leveltime/4%8+1)
|
||||||
|
v.draw(column[1], y, chilip)
|
||||||
|
textFlag = V_YELLOWMAP
|
||||||
|
end
|
||||||
|
|
||||||
-- stats
|
-- stats
|
||||||
drawStats(v, column[1], y, score["skin"], score["stat"])
|
drawStats(v, column[1], y, score["skin"], score["stat"])
|
||||||
-- name
|
-- name
|
||||||
@ -326,7 +333,7 @@ local function drawScore(v, i, pos, score)
|
|||||||
drawFlags(v, column[4], y, score["flags"])
|
drawFlags(v, column[4], y, score["flags"])
|
||||||
end
|
end
|
||||||
|
|
||||||
local function drawBrowser(v)
|
local function drawBrowser(v, player)
|
||||||
if not leaderboard then return end
|
if not leaderboard then return end
|
||||||
|
|
||||||
v.fadeScreen(0xFF00, 16)
|
v.fadeScreen(0xFF00, 16)
|
||||||
@ -358,7 +365,7 @@ local function drawBrowser(v)
|
|||||||
scrollPos = max(min(scrollPos, scores - 3), 1)
|
scrollPos = max(min(scrollPos, scores - 3), 1)
|
||||||
local endi = min(scrollPos + 7, scores)
|
local endi = min(scrollPos + 7, scores)
|
||||||
for i = scrollPos, endi do
|
for i = scrollPos, endi do
|
||||||
drawScore(v, i - scrollPos + 1, i, scoreTable[i])
|
drawScore(v, i - scrollPos + 1, i, scoreTable[i], scoreTable[i].name == player.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rawset(_G, "DrawBrowser", drawBrowser)
|
rawset(_G, "DrawBrowser", drawBrowser)
|
||||||
|
@ -1122,7 +1122,7 @@ local function drawScrollTo(v, player, scoreTable, gui)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function drawBrowser(v, player)
|
local function drawBrowser(v, player)
|
||||||
DrawBrowser(v, lb)
|
DrawBrowser(v, player)
|
||||||
end
|
end
|
||||||
|
|
||||||
local stateFunctions = {
|
local stateFunctions = {
|
||||||
|
Loading…
Reference in New Issue
Block a user