Skip to content

Commit

Permalink
client/hud: If the lenght is > 10 we add ... at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
xescugc committed Feb 4, 2024
1 parent 7cf7975 commit 8650e5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/hud.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,16 @@ func (hs *HUDStore) Draw(screen *ebiten.Image) {
}

func fillIn(s string, l int) string {
tl := len(s) > l
ss := make([]string, l, l)
for i, v := range s {
ss[i] = string(v)
if i >= l {
break
} else if i > 6 && tl {
ss[i] = "."
} else {
ss[i] = string(v)
}
}
for i, v := range ss {
if string(v) == "" {
Expand Down
Binary file modified server/assets/wasm/maze-wars.wasm
Binary file not shown.

0 comments on commit 8650e5e

Please sign in to comment.