From 4f40f116ba884111c9a66849e620ff9fbc67530a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 2 Oct 2026 14:43:26 -0400 Subject: feat: compact craps layout, ux cleanup --- internal/casino/craps_ux.go | 45 ++++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) (limited to 'internal/casino/craps_ux.go') diff --git a/internal/casino/craps_ux.go b/internal/casino/craps_ux.go index d0d8a62..f41ad67 100644 --- a/internal/casino/craps_ux.go +++ b/internal/casino/craps_ux.go @@ -2,7 +2,6 @@ package casino import ( "fmt" - "strings" ) func (t *crapsTable) commands(name string) []MenuCommand { @@ -32,7 +31,7 @@ func (t *crapsTable) commands(name string) []MenuCommand { } if p.HasBet { if !simplified { - if t.shooter() == p && (!t.multiplayer || t.roundElapsed >= crapsBetDelay) { + if t.shooter() == p && (!t.multiplayer || t.roundElapsed >= crapsBetDelay) && t.pendingRoll == 0 { commands = append(commands, MenuCommand{Command: "roll", Desc: "Shoot now"}) } if !p.autoRoll { @@ -87,39 +86,27 @@ func crapsBetLabel(b *crapsBet) string { // Numbers describe covered targets, not a promise that every listed roll wins // (don't/lay bets oppose their number; bonus bets need complete sequences). -// betSummary lists each open wager, then the dice pairs that beat them. The +// betSummary lists the dice pairs that settle the player's open wagers. The // roll table shares payout math with settlement (crapsNet), so the numbers -// never promise a win a real roll cannot pay. +// never promise a win a real roll cannot pay. The open-bet list itself is no +// longer shown: the settlement wager table already names every stake. func (t *crapsTable) betSummary(p *crapsPlayer) Event { - text := "{casino_emphasis}YOUR BETS{/}" - if len(p.bets) == 0 { - text += " No active bets." - } else { - for _, b := range p.bets { - label := crapsBetLabel(b) - if strings.HasPrefix(b.kind, "dont") || b.kind == "lay" { - label += " (against)" - } - if t.point == 0 && (b.kind == "place" || b.kind == "buy" || b.kind == "hard") { - label += " (off)" - } - text += fmt.Sprintf("\n {casino_action}%-24s{/} {casino_chips}%d{/}", label, b.stake.Total) - if b.odds.Total > 0 { - text += fmt.Sprintf(" + %d odds", b.odds.Total) - if t.point == 0 && b.kind == "come" { - text += " (odds off)" - } - } - } + return t.private(p.Name, t.rollTable(p)) +} + +// shooterHeading names the current shooter for the join, status and reminder +// menus. The board no longer carries its own Shooter line. +func (t *crapsTable) shooterHeading() string { + if shooter := t.shooter(); shooter != nil { + return "Shooter " + shooter.Name } - e := t.private(p.Name, text+"\n"+t.rollTable(p)) - e.ShowBalance = true - return e + return "Shooter" } func (t *crapsTable) reminder(name string) Event { - e := t.private(name, "Your move") + heading := t.shooterHeading() + e := t.private(name, heading) e.Color = "casino_menu" - e.Menu = &MenuView{Heading: "Your move", Commands: t.commands(name)} + e.Menu = &MenuView{ShowBalance: true, Heading: heading, Commands: t.commands(name)} return e } func (t *crapsTable) settlementEvent(p *crapsPlayer, lines []settlementLine, failed bool) Event { -- cgit v1.2.3