diff options
| author | Apickx <Apickx@cogarr.org> | 2015-12-28 19:18:30 -0500 |
|---|---|---|
| committer | Apickx <Apickx@cogarr.org> | 2015-12-28 19:18:30 -0500 |
| commit | 868e729d68b5913716bfe5ddb512f4099851e9a2 (patch) | |
| tree | 6441108754145dfd68a6e23bea382b5cb1ab63d5 /gamemode/cl_hud/draw_scoreboard.lua | |
| download | gearfox-master.tar.gz gearfox-master.tar.bz2 gearfox-master.zip | |
Diffstat (limited to 'gamemode/cl_hud/draw_scoreboard.lua')
| -rw-r--r-- | gamemode/cl_hud/draw_scoreboard.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gamemode/cl_hud/draw_scoreboard.lua b/gamemode/cl_hud/draw_scoreboard.lua new file mode 100644 index 0000000..1d1da16 --- /dev/null +++ b/gamemode/cl_hud/draw_scoreboard.lua @@ -0,0 +1,35 @@ +local SCOREBOARD_FADE = Color(20,20,20,70) + +local SCOREBOARD_OFF = 101 +local SCOREBOARD_WIDTH = 700 +local SCOREBOARD_X = ScrW() / 2 - SCOREBOARD_WIDTH / 2 + +function GM:ScoreboardShow() + self.ShowSB = true +end + +function GM:ScoreboardHide() + self.ShowSB = false +end + +function GM:HUDDrawScoreBoard() + if (!self.ShowSB) then return end + + local NPly = #player.GetAll() + local Tall = SCOREBOARD_OFF + 20 * NPly + 20 + local y = ScrH() / 2 - Tall / 2 + local by = y + SCOREBOARD_OFF + + DrawBoxy(SCOREBOARD_X, y, SCOREBOARD_WIDTH, Tall, MAIN_COLOR) + DrawRect(SCOREBOARD_X, by, SCOREBOARD_WIDTH, NPly*20, MAIN_COLORD) + + DrawText(self.Name, "ScoreboardFont", SCOREBOARD_X + 20, y + 20, MAIN_TEXTCOLOR) + + for k,v in pairs( player.GetAll() ) do + local Y = by + 20 * (k-1) + + DrawText(v:Nick(), "Trebuchet18", SCOREBOARD_X + 2, Y, MAIN_TEXTCOLOR) + DrawText(v:Ping(), "Trebuchet18", SCOREBOARD_X + SCOREBOARD_WIDTH - 30, Y, MAIN_TEXTCOLOR) + end +end + |
