From c94728c929045f7c1bdf0166df152d944e5f99bc Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 1 Oct 2026 15:47:17 -0400 Subject: feat: better casino game look output, more concise table instructions --- internal/casino/pai_gow.go | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'internal/casino/pai_gow.go') diff --git a/internal/casino/pai_gow.go b/internal/casino/pai_gow.go index 21abf4b..17d8971 100644 --- a/internal/casino/pai_gow.go +++ b/internal/casino/pai_gow.go @@ -70,7 +70,21 @@ func (t *paiGowTable) hasParticipant(name string) bool { func (t *paiGowTable) overview() string { t.mu.Lock() defer t.mu.Unlock() - return fmt.Sprintf("%s | %s | %d/%d seats", t.Config.Label(), t.phase, len(t.players), t.Config.MaxPlayers) + return fmt.Sprintf("%s | %d/%d seated", t.Config.Label(), len(t.players), t.Config.MaxPlayers) +} +func (t *paiGowTable) seats() []string { + t.mu.Lock() + defer t.mu.Unlock() + names := make([]string, 0, len(t.players)) + for _, p := range t.players { + names = append(names, p.name) + } + return names +} +func (t *paiGowTable) state() string { + t.mu.Lock() + defer t.mu.Unlock() + return t.phase } func (t *paiGowTable) hintsLocked(name string) []MenuCommand { p := t.player(name) @@ -145,7 +159,13 @@ func (t *paiGowTable) statusLocked(name string) []Event { } e := t.private(name, t.Config.Label()) e.Snapshot = s - e.Menu = &MenuView{Heading: t.Config.Label() + " | " + t.phase, ShowBalance: true, Commands: t.hintsLocked(name)} + // Context-aware hints are attached as a live menu; the shared board + // renderer places them below the felt. Stand-ins (for example a watcher) + // get no menu, so they cannot be told how to bet a game they have not joined. + if commands := t.hintsLocked(name); len(commands) > 0 { + e.Color = "casino_menu" + e.Menu = &MenuView{Heading: t.Config.Label() + " | " + t.phase, ShowBalance: true, Commands: commands} + } return []Event{e} } func (t *paiGowTable) status(name string) []Event { -- cgit v1.2.3