diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-18 20:34:47 -0500 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-18 20:34:47 -0500 |
| commit | f8f7483f4c2bfafb7e92a073fce6694928ff1f70 (patch) | |
| tree | 03e31430052b380205e00ae196b4547d18dcf461 /gamemode/hud | |
| parent | 9afec47237a8d2ff5e3fbc95e1a084cba37e35af (diff) | |
| download | wintersurvival2-f8f7483f4c2bfafb7e92a073fce6694928ff1f70.tar.gz wintersurvival2-f8f7483f4c2bfafb7e92a073fce6694928ff1f70.tar.bz2 wintersurvival2-f8f7483f4c2bfafb7e92a073fce6694928ff1f70.zip | |
Fixed scoreboard to not bug out with long player names
Diffstat (limited to 'gamemode/hud')
| -rw-r--r-- | gamemode/hud/draw_scoreboard.lua | 12 |
1 files changed, 8 insertions, 4 deletions
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()
|
