diff options
| author | historia <[not public]> | 2026-10-03 01:46:58 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-03 01:46:58 -0400 |
| commit | efccf58741ae43d9e891c6b743b146982b344ccf (patch) | |
| tree | 505a068497c5531b91ac72da32db14145737e982 /internal/casino/roulette.go | |
| parent | 0ec8f3692960a064616e630c914058298b22897b (diff) | |
| download | thehouseoficarus-efccf58741ae43d9e891c6b743b146982b344ccf.tar.gz | |
fix: don't show roulette table after each bet
Diffstat (limited to 'internal/casino/roulette.go')
| -rw-r--r-- | internal/casino/roulette.go | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/internal/casino/roulette.go b/internal/casino/roulette.go index 783d22f..8f45d49 100644 --- a/internal/casino/roulette.go +++ b/internal/casino/roulette.go @@ -510,7 +510,11 @@ func (t *rouletteTable) board(_ string) Snapshot { defer t.mu.Unlock() return t.view() } -func (t *rouletteTable) menuEvent(name string) Event { + +// menuEvent builds the next-spin menu. board controls whether it also carries +// the table graphic: sitting down and the live status keep it, settlement does +// not, so a resolved spin does not redraw the wheel, racetrack, and history. +func (t *rouletteTable) menuEvent(name string, board bool) Event { commands := []MenuCommand{} p := t.players.get(name) if t.phase != phasePlaying && p != nil && !p.HasBet { @@ -527,20 +531,22 @@ func (t *rouletteTable) menuEvent(name string) Event { commands = withTableHints(commands, t.wagerRows()) } e := t.betMenuEvent(name, commands) - e.Snapshot = t.view() + if board { + e.Snapshot = t.view() + } return e } func (t *rouletteTable) join(name string) []Event { t.mu.Lock() defer t.mu.Unlock() if t.players.has(name) { - return []Event{t.menuEvent(name)} + return []Event{t.menuEvent(name, true)} } if t.players.count() >= t.Config.MaxPlayers { return []Event{t.private(name, "That roulette table is full.")} } e := t.addSeatLocked(name, &roulettePlayer{Participant: Participant{Name: name, Connected: true}}) - return []Event{e, t.menuEvent(name)} + return []Event{e, t.menuEvent(name, true)} } func (t *rouletteTable) leave(name string) []Event { t.mu.Lock() @@ -715,7 +721,8 @@ func (t *rouletteTable) settle() []Event { wheel[(index+1)%n], wheel[(index+2)%n], } t.lastResult = s - e := t.event("The ball lands in {casino_emphasis}"+pocket+"{/}!", true) + // A leading blank line separates the reveal from the spinning strips above. + e := t.event("\nThe ball lands in {casino_emphasis}"+pocket+"{/}!", true) e.Snapshot = s events := []Event{e} for _, p := range t.players.ordered() { @@ -762,7 +769,7 @@ func (t *rouletteTable) settle() []Event { events = append(events, t.finishControlsLocked()...) for _, p := range t.players.ordered() { if p.Connected && !p.SittingOut { - events = append(events, t.menuEvent(p.Name)) + events = append(events, t.menuEvent(p.Name, false)) } } return events @@ -799,7 +806,7 @@ func (t *rouletteTable) rebet(name string) (string, int) { func (t *rouletteTable) status(name string) []Event { t.mu.Lock() defer t.mu.Unlock() - e := t.menuEvent(name) + e := t.menuEvent(name, true) events := []Event{e} if t.phase == phaseWaiting && t.lastResult != nil { last := t.private(name, "Last spin:") |
