snapshot_poker_uiux_cleanup
This commit is contained in:
+33
-5
@@ -27,6 +27,14 @@ const POKER_TABLE_FOOTER_PREFIX =
|
||||
const POKER_CARD_RESPONSE_LIFETIME =
|
||||
5000;
|
||||
|
||||
const POKER_ACTIVE_STATES_FOR_DISPLAY =
|
||||
new Set([
|
||||
"PREFLOP",
|
||||
"FLOP",
|
||||
"TURN",
|
||||
"RIVER"
|
||||
]);
|
||||
|
||||
|
||||
function getPokerGameIdFromInteraction(
|
||||
interaction
|
||||
@@ -509,14 +517,26 @@ function buildPokerTableEmbed(
|
||||
);
|
||||
|
||||
const stateLabel =
|
||||
publicGame.state
|
||||
.replaceAll("_", " ");
|
||||
publicGame.state ===
|
||||
"NEXT_HAND"
|
||||
? "🏆 HAND COMPLETE"
|
||||
: POKER_ACTIVE_STATES_FOR_DISPLAY.has(
|
||||
publicGame.state
|
||||
)
|
||||
? `🃏 ${publicGame.state.replaceAll("_", " ")}`
|
||||
: publicGame.state
|
||||
.replaceAll("_", " ");
|
||||
|
||||
const pot =
|
||||
hand?.pot ?? 0;
|
||||
|
||||
const description = [
|
||||
`**State:** ${stateLabel}`,
|
||||
hand && POKER_ACTIVE_STATES_FOR_DISPLAY.has(
|
||||
publicGame.state
|
||||
)
|
||||
? `**Hand #${publicGame.data.handNumber}** • 🃏 Cards have been dealt. Use **Cards** to view your hand.`
|
||||
: null,
|
||||
`**Blinds:** ${publicGame.data.smallBlind.toLocaleString()} / ${publicGame.data.bigBlind.toLocaleString()} 🍪`,
|
||||
`**Buy-In:** ${publicGame.data.buyIn.toLocaleString()} 🍪`,
|
||||
`**Pot:** ${pot.toLocaleString()} 🍪`,
|
||||
@@ -547,16 +567,21 @@ function buildPokerTableEmbed(
|
||||
if (current) {
|
||||
description.push(
|
||||
"",
|
||||
`### <@${current.userId}>'s turn`
|
||||
"━━━━━━━━━━━━━━━━━━",
|
||||
`### 👉 CURRENT TURN: <@${current.userId}>`
|
||||
);
|
||||
|
||||
if (
|
||||
publicGame.data.turnExpiresAt
|
||||
) {
|
||||
description.push(
|
||||
`⏱️ Auto-folds <t:${publicGame.data.turnExpiresAt}:R>`
|
||||
`⏱️ **90-second turn** • Auto-folds <t:${publicGame.data.turnExpiresAt}:R>`
|
||||
);
|
||||
}
|
||||
|
||||
description.push(
|
||||
"━━━━━━━━━━━━━━━━━━"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,7 +600,10 @@ function buildPokerTableEmbed(
|
||||
|
||||
if (
|
||||
publicGame.state ===
|
||||
"WAITING"
|
||||
"WAITING"
|
||||
||
|
||||
publicGame.state ===
|
||||
"NEXT_HAND"
|
||||
) {
|
||||
description.push(
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user