From 8d3137a7eed8663bf4e013bb5a81b1f361cc50d0 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 1 Jan 2016 19:08:31 -0500 Subject: Fixes for scoreboard menu --- gamemode/hud/draw_scoreboard.lua | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/gamemode/hud/draw_scoreboard.lua b/gamemode/hud/draw_scoreboard.lua index 3cb5825..6941e59 100644 --- a/gamemode/hud/draw_scoreboard.lua +++ b/gamemode/hud/draw_scoreboard.lua @@ -25,6 +25,7 @@ function GM:ScoreboardShow() local playerlabel = vgui.Create("MBLabel") playerlabel:SetParent(scoreboard) playerlabel:SetPos(2, ypos) + playerlabel:SetSize(SCOREBOARD_WIDTH/4,20) local ptext = v:Nick() if(v:IsPigeon()) then ptext = ptext .. " (Dead)" @@ -44,18 +45,24 @@ function GM:ScoreboardShow() mutebutton:SetParent(scoreboard) mutebutton:SetPos(SCOREBOARD_X,ypos) if(v:IsMuted()) then - mutebutton.Text = "Mute" - mutebutton.OnClick = function() - self.Text = "Unmute" - print("Muteing " .. v:Nick()) + print("This player is muted!") + mutebutton.Text = "Unmute" + mutebutton.DoClick = function() + mutebutton.Text = "Unmute" + print("Unmuteing " .. v:Nick()) v:SetMuted(true) + scoreboard:Remove() + self:ScoreboardShow() end else - mutebutton.Text = "Unmute" - mutebutton.OnClick = function() - self.Text = "Mute" - print("Unmuteing " .. v:Nick()) + print("This player is not muted!") + mutebutton.Text = "Mute" + mutebutton.DoClick = function() + mutebutton.Text = "Mute" + print("Muteing " .. v:Nick()) v:SetMuted(false) + scoreboard:Remove() + self:ScoreboardShow() end end @@ -67,7 +74,7 @@ end function GM:ScoreboardHide() if(scoreboard) then - scoreboard:SetVisible(false) + scoreboard:Remove() end --self.ShowSB = false end -- cgit v1.2.3-70-g09d2