Wanted 7411101e22
All checks were successful
test / Test on Linux (push) Successful in 6s
maint(ui_scripts): remove whitespaces and reorganize files (#5)
Co-authored-by: Wanted <wanted@no-reply@alterware.dev>
Co-committed-by: Wanted <wanted@no-reply@alterware.dev>
2024-02-12 10:31:37 +00:00

31 lines
738 B
Lua

if (game:issingleplayer() or Engine.InFrontend()) then
return
end
function GetPartyMaxPlayers()
return Engine.GetDvarInt("sv_maxclients")
end
local scoreboard = LUI.mp_hud.Scoreboard
scoreboard.maxPlayersOnTeam = GetTeamLimitForMaxPlayers(GetPartyMaxPlayers())
scoreboard.scoreColumns.ping = {
width = Engine.IsZombiesMode() and 90 or 60,
title = "LUA_MENU_PING",
getter = function(scoreinfo)
return scoreinfo.ping == 0 and "BOT" or tostring(scoreinfo.ping)
end
}
local getcolumns = scoreboard.getColumnsForCurrentGameMode
scoreboard.getColumnsForCurrentGameMode = function(a1)
local columns = getcolumns(a1)
if (Engine.IsZombiesMode()) then
table.insert(columns, scoreboard.scoreColumns.ping)
end
return columns
end