diff options
| author | historia <[not public]> | 2026-10-03 02:16:00 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-03 02:16:00 -0400 |
| commit | 6232d41e5639f9c38e47b2bb65266e343ca26e8f (patch) | |
| tree | ad0c1676838a6c7e162d3a5c055f914016dac803 /internal/casino/manager.go | |
| parent | efccf58741ae43d9e891c6b743b146982b344ccf (diff) | |
| download | thehouseoficarus-6232d41e5639f9c38e47b2bb65266e343ca26e8f.tar.gz | |
feat: add casino_hints option and standardize casino command syntax
Diffstat (limited to 'internal/casino/manager.go')
| -rw-r--r-- | internal/casino/manager.go | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/internal/casino/manager.go b/internal/casino/manager.go index 8a33df6..bdd9249 100644 --- a/internal/casino/manager.go +++ b/internal/casino/manager.go @@ -205,7 +205,7 @@ func (m *Manager) JoinMachine(roomID int, cfg MachineConfig, name string) []Even if machine == nil { return []Event{{RoomID: roomID, TableID: cfg.ID, Type: EventResult, PrivateTo: name, Message: "That game is not available here."}} } - return machine.join(name) + return markHints(machine.join(name)) } func (m *Manager) SetMachineBet(roomID int, machineID, name string, amount int, wallet Wallet) []Event { @@ -247,7 +247,21 @@ func (m *Manager) Join(roomID int, cfg TableConfig, name string) []Event { if table == nil { return []Event{{RoomID: roomID, TableID: cfg.ID, Type: EventResult, PrivateTo: name, Message: "That game is not available here."}} } - return table.join(name) + return markHints(table.join(name)) +} + +// markHints tags the first menu in a join/status result so the presentation +// layer always shows its command hints under the "casino_hints once" default. +// Recurring menus (after a bet or action) leave the flag clear, and other +// events (seat notices, rule felts) are untouched. +func markHints(events []Event) []Event { + for i := range events { + if events[i].Menu != nil { + events[i].Menu.ShowHints = true + break + } + } + return events } func (m *Manager) Leave(roomID int, tableID, name string) []Event { |
