From f8f7483f4c2bfafb7e92a073fce6694928ff1f70 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 18 Jan 2016 20:34:47 -0500 Subject: Fixed scoreboard to not bug out with long player names --- gamemode/hud/draw_scoreboard.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gamemode') diff --git a/gamemode/hud/draw_scoreboard.lua b/gamemode/hud/draw_scoreboard.lua index 6941e59..5b6f9a5 100644 --- a/gamemode/hud/draw_scoreboard.lua +++ b/gamemode/hud/draw_scoreboard.lua @@ -20,13 +20,17 @@ function GM:ScoreboardShow() scoreboard:ShowCloseButton(false) for i,v in pairs(player.GetAll()) do - print("Makeing label for " .. v:Nick()) + --print("Makeing label for " .. v:Nick()) local ypos = (20*(i-1))+24 local playerlabel = vgui.Create("MBLabel") playerlabel:SetParent(scoreboard) playerlabel:SetPos(2, ypos) playerlabel:SetSize(SCOREBOARD_WIDTH/4,20) local ptext = v:Nick() + if(string.len(ptext) > 13) then + ptext = string.Left(ptext,10) + ptext = ptext .. "..." + end if(v:IsPigeon()) then ptext = ptext .. " (Dead)" end @@ -45,7 +49,7 @@ function GM:ScoreboardShow() mutebutton:SetParent(scoreboard) mutebutton:SetPos(SCOREBOARD_X,ypos) if(v:IsMuted()) then - print("This player is muted!") + --print("This player is muted!") mutebutton.Text = "Unmute" mutebutton.DoClick = function() mutebutton.Text = "Unmute" @@ -55,11 +59,11 @@ function GM:ScoreboardShow() self:ScoreboardShow() end else - print("This player is not muted!") + --print("This player is not muted!") mutebutton.Text = "Mute" mutebutton.DoClick = function() mutebutton.Text = "Mute" - print("Muteing " .. v:Nick()) + --print("Muteing " .. v:Nick()) v:SetMuted(false) scoreboard:Remove() self:ScoreboardShow() -- cgit v1.2.3-70-g09d2