dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit c5cb3cceb41e371228b30bc37dacf625ed80013f
parent 6778a1566b664102041eb48f6626c5d4e12b2533
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 26 Dec 2023 17:25:57 -0500

refactor

Diffstat:
Mpkg/web/handlers/poker/events.go | 2+-
Mpkg/web/handlers/poker/poker.go | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/web/handlers/poker/events.go b/pkg/web/handlers/poker/events.go @@ -32,7 +32,7 @@ type ResetCardsEvent struct { type CashBonusEvent struct { PlayerSeatIdx int - Gain database.PokerChip + Amount database.PokerChip Animation bool IsGain bool } diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -329,7 +329,7 @@ func (p *PokerPlayer) doBetAndNotif(g *Game, bet database.PokerChip) { func pubCashBonus(g *Game, seatIdx int, amount database.PokerChip, isGain bool) { g.seatsAnimation[seatIdx] = !g.seatsAnimation[seatIdx] - PubSub.Pub(g.roomID.Topic(), CashBonusEvent{PlayerSeatIdx: seatIdx, Gain: amount, Animation: g.seatsAnimation[seatIdx], IsGain: isGain}) + PubSub.Pub(g.roomID.Topic(), CashBonusEvent{PlayerSeatIdx: seatIdx, Amount: amount, Animation: g.seatsAnimation[seatIdx], IsGain: isGain}) } type playerCard struct { @@ -1831,7 +1831,7 @@ func drawCashBonus(evt CashBonusEvent) (html string) { html += fmt.Sprintf(`#seat%d .cash-bonus { animation: %s %s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; color: %s; font-size: %s; }`, evt.PlayerSeatIdx+1, utils.Ternary(evt.Animation, "cashBonusAnimation", "cashBonusAnimation1"), dur, color, fontSize) html += fmt.Sprintf(`#seat%d .cash-bonus:before { content: "%s%s"; }`, - evt.PlayerSeatIdx+1, utils.Ternary(evt.IsGain, "+", ""), evt.Gain) + evt.PlayerSeatIdx+1, utils.Ternary(evt.IsGain, "+", ""), evt.Amount) html += `</style>` return }