aboutsummaryrefslogtreecommitdiff
path: root/internal/game/render_cash_hunt.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/render_cash_hunt.go')
-rw-r--r--internal/game/render_cash_hunt.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/game/render_cash_hunt.go b/internal/game/render_cash_hunt.go
index 0bb05fc..bdda321 100644
--- a/internal/game/render_cash_hunt.go
+++ b/internal/game/render_cash_hunt.go
@@ -51,7 +51,8 @@ const (
// cashHuntCenter pads text to a fixed tile width, keeping every column aligned
// whether it holds a one- or three-digit square number.
-func cashHuntCenter(text string, width int) string {
+func cashHuntCenter(text string) string {
+ width := cashHuntTileWidth
if len(text) >= width {
return text
}
@@ -175,12 +176,12 @@ func renderCashHunt(s *casino.CashHuntSnapshot, mode string, unicode bool, rtp s
for col := 0; col < cashHuntColumns; col++ {
k := row*cashHuntColumns + col
bg := cashHuntTileBlack
- number := cashHuntCenter(fmt.Sprintf("%d", k+1), cashHuntTileWidth)
- value := cashHuntCenter(fmt.Sprintf("%dx", s.Squares[k]), cashHuntTileWidth)
+ number := cashHuntCenter(fmt.Sprintf("%d", k+1))
+ value := cashHuntCenter(fmt.Sprintf("%dx", s.Squares[k]))
nf, vf := 244, cashHuntPrizeColor(s.Squares[k])
selected := s.Selected == k+1
if selected {
- number = cashHuntCenter(fmt.Sprintf(">%d<", k+1), cashHuntTileWidth)
+ number = cashHuntCenter(fmt.Sprintf(">%d<", k+1))
nf, vf, bg = 16, 16, 226
}
numbers[col] = color.Render(mode, color.ColorSpec{Fg: nf, Bg: bg, Bold: selected}, number)