Skip to content

Commit

Permalink
fix(analyze): show correctly hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
crispgm committed Jul 1, 2024
1 parent 7b189fe commit 5d381eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions internal/operator/double_player_rank.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,13 @@ func (o *DoublePlayerRank) Output() {

header := []string{"#", "Name", "Events", "Games", "Win", "Loss", "Draw", "WR%", "ELO", "KRP", "ATSA", "ITSF"}
table := [][]string{}
for i, d := range sliceData {
index := 1
for _, d := range sliceData {
if !o.options.ShowInactive && d.Inactive {
continue
}
item := []string{
fmt.Sprintf("%d", i+1),
fmt.Sprintf("%d", index),
d.Name,
fmt.Sprintf("%d", d.EventsPlayed),
fmt.Sprintf("%d", d.GamesPlayed),
Expand All @@ -246,6 +250,7 @@ func (o *DoublePlayerRank) Output() {
fmt.Sprintf("%d", d.ITSFPoints),
}
table = append(table, item)
index++
}
// }}}

Expand Down
8 changes: 5 additions & 3 deletions internal/operator/single_player_rank.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,13 @@ func (o *SinglePlayerRank) Output() {

header := []string{"#", "Name", "Events", "Games", "Win", "Loss", "Draw", "WR%", "ELO", "KRP", "ATSA", "ITSF"}
table := [][]string{}
for i, d := range sliceData {
if o.options.ShowInactive && d.Inactive {
index := 1
for _, d := range sliceData {
if !o.options.ShowInactive && d.Inactive {
continue
}
item := []string{
fmt.Sprintf("%d", i+1),
fmt.Sprintf("%d", index),
d.Name,
fmt.Sprintf("%d", d.EventsPlayed),
fmt.Sprintf("%d", d.GamesPlayed),
Expand All @@ -211,6 +212,7 @@ func (o *SinglePlayerRank) Output() {
fmt.Sprintf("%d", d.ITSFPoints),
}
table = append(table, item)
index++
}
// }}}

Expand Down

0 comments on commit 5d381eb

Please sign in to comment.