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