Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
7800d3474d
commit
545271e9bd
@ -214,14 +214,13 @@ struct GameTableView: View {
|
||||
|
||||
Spacer(minLength: Design.Spacing.xSmall)
|
||||
|
||||
// Chip selector
|
||||
// Chip selector - full width so all chips are tappable
|
||||
ChipSelectorView(
|
||||
selectedChip: $selectedChip,
|
||||
balance: state.balance,
|
||||
currentBet: state.totalBetAmount,
|
||||
maxBet: state.maxBet
|
||||
)
|
||||
.frame(maxWidth: maxContentWidth)
|
||||
.debugBorder(showDebugBorders, color: .pink, label: "ChipSelector")
|
||||
|
||||
Spacer(minLength: Design.Spacing.xSmall)
|
||||
@ -310,14 +309,13 @@ struct GameTableView: View {
|
||||
Spacer(minLength: mediumSpacerHeight)
|
||||
.debugBorder(showDebugBorders, color: .yellow, label: "Spacer4")
|
||||
|
||||
// Chip selector (from CasinoKit)
|
||||
// Chip selector - full width so all chips are tappable
|
||||
ChipSelectorView(
|
||||
selectedChip: $selectedChip,
|
||||
balance: state.balance,
|
||||
currentBet: state.totalBetAmount,
|
||||
maxBet: state.maxBet
|
||||
)
|
||||
.frame(maxWidth: isLargeScreen ? maxContentWidth : .infinity)
|
||||
.debugBorder(showDebugBorders, color: .pink, label: "ChipSelector")
|
||||
|
||||
Spacer(minLength: smallSpacerHeight)
|
||||
|
||||
@ -148,6 +148,7 @@ struct GameTableView: View {
|
||||
Spacer(minLength: 0)
|
||||
|
||||
// Chip selector - only shown during betting phase AND when result banner is NOT showing
|
||||
// Full width on iPad so all chips are tappable
|
||||
if state.currentPhase == .betting && !state.showResultBanner {
|
||||
ChipSelectorView(
|
||||
selectedChip: $selectedChip,
|
||||
@ -155,7 +156,6 @@ struct GameTableView: View {
|
||||
currentBet: state.minBetForChipSelector,
|
||||
maxBet: state.settings.maxBet
|
||||
)
|
||||
.frame(maxWidth: maxContentWidth)
|
||||
.debugBorder(showDebugBorders, color: .pink, label: "ChipSelector")
|
||||
}
|
||||
|
||||
|
||||
@ -77,6 +77,7 @@ public struct ChipSelectorView: View {
|
||||
.padding(.vertical, CasinoDesign.Spacing.medium)
|
||||
.frame(minWidth: geometry.size.width) // Center when content fits
|
||||
}
|
||||
.scrollClipDisabled() // Allow visual overflow during scroll/animation
|
||||
.scrollBounceBehavior(fitsOnScreen ? .basedOnSize : .automatic)
|
||||
}
|
||||
.frame(height: CasinoDesign.Size.chipLarge + CasinoDesign.Spacing.medium * 2)
|
||||
|
||||
@ -81,6 +81,7 @@ public struct CasinoResultBannerView<Content: View>: View {
|
||||
@ScaledMetric(relativeTo: .largeTitle) private var resultFontSize: CGFloat = CasinoDesign.BaseFontSize.largeTitle
|
||||
@ScaledMetric(relativeTo: .title3) private var totalFontSize: CGFloat = CasinoDesign.BaseFontSize.xxLarge + CasinoDesign.Spacing.xSmall
|
||||
@ScaledMetric(relativeTo: .headline) private var buttonFontSize: CGFloat = CasinoDesign.BaseFontSize.xLarge
|
||||
@ScaledMetric(relativeTo: .title) private var gameOverFontSize: CGFloat = CasinoDesign.BaseFontSize.xxLarge
|
||||
|
||||
// MARK: - Computed Properties
|
||||
|
||||
@ -137,9 +138,24 @@ public struct CasinoResultBannerView<Content: View>: View {
|
||||
|
||||
// Banner card
|
||||
VStack(spacing: CasinoDesign.Spacing.medium) {
|
||||
// Result text with gradient and glow
|
||||
// Game Over header (shown prominently at top when out of chips)
|
||||
if isGameOver {
|
||||
VStack(spacing: CasinoDesign.Spacing.xSmall) {
|
||||
Text(String(localized: "GAME OVER", bundle: .module))
|
||||
.font(.system(size: gameOverFontSize, weight: .black, design: .rounded))
|
||||
.foregroundStyle(.red)
|
||||
|
||||
Text(String(localized: "You've run out of chips!", bundle: .module))
|
||||
.font(.system(size: CasinoDesign.BaseFontSize.medium, weight: .medium))
|
||||
.foregroundStyle(.white.opacity(CasinoDesign.Opacity.strong))
|
||||
}
|
||||
.scaleEffect(showText ? CasinoDesign.Scale.normal : CasinoDesign.Scale.shrunk)
|
||||
.opacity(showText ? CasinoDesign.Scale.normal : 0)
|
||||
}
|
||||
|
||||
// Result text with gradient and glow (smaller when game over)
|
||||
Text(resultText)
|
||||
.font(.system(size: resultFontSize, weight: .black, design: .rounded))
|
||||
.font(.system(size: isGameOver ? resultFontSize * 0.7 : resultFontSize, weight: .black, design: .rounded))
|
||||
.foregroundStyle(
|
||||
LinearGradient(
|
||||
colors: [.white, resultColor],
|
||||
@ -208,25 +224,19 @@ public struct CasinoResultBannerView<Content: View>: View {
|
||||
@ViewBuilder
|
||||
private var buttonSection: some View {
|
||||
if isGameOver {
|
||||
// Game Over - show message and restart button
|
||||
VStack(spacing: CasinoDesign.Spacing.medium) {
|
||||
Text(String(localized: "You've run out of chips!", bundle: .module))
|
||||
.font(.system(size: CasinoDesign.BaseFontSize.medium, weight: .medium))
|
||||
.foregroundStyle(.red.opacity(CasinoDesign.Opacity.heavy))
|
||||
|
||||
Button {
|
||||
onPlayAgain()
|
||||
} label: {
|
||||
HStack(spacing: CasinoDesign.Spacing.small) {
|
||||
Image(systemName: "arrow.counterclockwise")
|
||||
Text(String(localized: "Play Again", bundle: .module))
|
||||
}
|
||||
.font(.system(size: buttonFontSize, weight: .bold))
|
||||
.foregroundStyle(.black)
|
||||
.padding(.horizontal, CasinoDesign.Spacing.xxxLarge + CasinoDesign.Spacing.small)
|
||||
.padding(.vertical, CasinoDesign.Spacing.medium + CasinoDesign.Spacing.xxSmall)
|
||||
.background(goldButtonBackground)
|
||||
// Game Over - show restart button (message is at top)
|
||||
Button {
|
||||
onPlayAgain()
|
||||
} label: {
|
||||
HStack(spacing: CasinoDesign.Spacing.small) {
|
||||
Image(systemName: "arrow.counterclockwise")
|
||||
Text(String(localized: "Play Again", bundle: .module))
|
||||
}
|
||||
.font(.system(size: buttonFontSize, weight: .bold))
|
||||
.foregroundStyle(.black)
|
||||
.padding(.horizontal, CasinoDesign.Spacing.xxxLarge + CasinoDesign.Spacing.small)
|
||||
.padding(.vertical, CasinoDesign.Spacing.medium + CasinoDesign.Spacing.xxSmall)
|
||||
.background(goldButtonBackground)
|
||||
}
|
||||
} else {
|
||||
// Normal - New Round button
|
||||
|
||||
Loading…
Reference in New Issue
Block a user