tIgnore placeholder lines when looking up badges - scoreboard - Interactive scoreboard for CTF-like games
(HTM) git clone git://git.z3bra.org/scoreboard.git
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 2657289b937a2c40d111f3692e72e8496d287afa
(DIR) parent 9c55823c4faf89839bc65b1972a36b71debcc42c
(HTM) Author: Willy Goiffon <contact@z3bra.org>
Date: Fri, 27 Sep 2024 20:02:00 +0200
Ignore placeholder lines when looking up badges
Diffstat:
M ui.go | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/ui.go b/ui.go
t@@ -72,8 +72,13 @@ func RankTable(offset, limit, rank int, fill bool) *tview.Table {
t.SetSelectedFunc(func (row, col int) {
var player Player
- col = 1
- player.name = t.GetCell(row, col).Text
+
+ /* ignore placeholder lines */
+ if t.GetCell(row, 2).Text == "....." {
+ return
+ }
+
+ player.name = t.GetCell(row, 1).Text
player.db = scoreboard.db
player.Fetch()
if scoreboard.player.name == player.name {