Add cash game session setup and reload

This commit is contained in:
Jay
2026-07-26 14:55:15 -04:00
parent 14c35f18a3
commit 3aa55dd2ce
7 changed files with 302 additions and 25 deletions
@@ -145,6 +145,8 @@ fun TableScreen(vm: PokerViewModel) {
offer = offer,
handSummary = handSummary,
nextHandRequested = state.nextHandRequested,
rebuyRequired = state.heroNeedsRebuy,
buyIn = state.gameConfig?.buyIn ?: DEFAULT_BUY_IN,
heroFolded = hero?.folded == true,
onFold = vm::fold,
onCheckCall = vm::checkOrCall,
@@ -243,6 +245,8 @@ private fun ActionBar(
offer: com.jsjdesigns.poker.game.DecisionOffer?,
handSummary: HandSummary?,
nextHandRequested: Boolean,
rebuyRequired: Boolean,
buyIn: Int,
heroFolded: Boolean,
onFold: (Long) -> Unit,
onCheckCall: (Long) -> Unit,
@@ -254,6 +258,8 @@ private fun ActionBar(
HandResultBar(
summary = handSummary,
nextHandRequested = nextHandRequested,
rebuyRequired = rebuyRequired,
buyIn = buyIn,
onNextHand = onNextHand,
)
} else {
@@ -333,6 +339,8 @@ private fun ActionBar(
private fun HandResultBar(
summary: HandSummary,
nextHandRequested: Boolean,
rebuyRequired: Boolean,
buyIn: Int,
onNextHand: (Int) -> Unit,
) {
Card(
@@ -354,6 +362,14 @@ private fun HandResultBar(
color = Color.White.copy(alpha = 0.7f),
fontSize = 12.sp,
)
if (rebuyRequired) {
Text(
"Your stack cannot cover the big blind.",
color = Color(0xFFC9545B),
fontSize = 12.sp,
fontWeight = FontWeight.Medium,
)
}
Spacer(Modifier.height(8.dp))
Button(
onClick = { onNextHand(summary.handNumber) },
@@ -366,7 +382,7 @@ private fun HandResultBar(
disabledContentColor = Color.White.copy(alpha = 0.65f),
),
) {
Text(if (nextHandRequested) "Dealing…" else "Next hand")
Text(continuationButtonLabel(nextHandRequested, rebuyRequired, buyIn))
}
}
}