tFix alignment bug for flag string < 5 char - scoreboard - Interactive scoreboard for CTF-like games
(HTM) git clone git://git.z3bra.org/scoreboard.git
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 642d95d180de63de3a718e134db1b06739cbbeb8
(DIR) parent e4196b7baff7cd306d9c532e4900eff72c8b8f93
(HTM) Author: Willy Goiffon <contact@z3bra.org>
Date: Tue, 1 Oct 2024 01:23:21 +0200
Fix alignment bug for flag string < 5 char
Diffstat:
M ui.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/ui.go b/ui.go
t@@ -15,7 +15,6 @@ const (
H Display Help
L Log in
-R Register
↲ Show Badges
t@@ -66,9 +65,10 @@ func RankTable(offset, limit, rank int, fill bool) *tview.Table {
p := players[i]
rankstr := fmt.Sprintf("%4s", humanize.Ordinal(rank + i + 1))
scorestr := fmt.Sprintf("%5d", p.score)
+ flagstr := fmt.Sprintf("%5s", p.FlagStr())
t.SetCell(i, 0, newcell(rankstr))
t.SetCell(i, 1, newcell(p.name))
- t.SetCell(i, 2, newcell(p.FlagStr()))
+ t.SetCell(i, 2, newcell(flagstr))
t.SetCell(i, 3, newcell(scorestr))
}