Compare commits

..

No commits in common. "ace6303a62f1794b4929402425a4e5050cf4c272" and "f1028bd6267a004e0bc0883ca51629574c6c8510" have entirely different histories.

11 changed files with 4259 additions and 4918 deletions

View File

@ -71,28 +71,6 @@
}
}
},
"%@: %@": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "%1$@: %2$@"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "%1$@: %2$@"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "%1$@ : %2$@"
}
}
}
},
"%lld" : {
"comment" : "A label displaying the amount wagered in the current hand. The argument is the amount wagered in the current hand.",
"isCommentAutoGenerated" : true,
@ -690,26 +668,7 @@
}
},
"21+3: Poker hand from your cards + dealer's upcard." : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "21+3: Poker hand from your cards + dealer's upcard."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "21+3: Mano de póquer con tus cartas + carta visible del crupier."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "21+3 : Main de poker avec vos cartes + carte visible du croupier."
}
}
}
},
"A 'soft' hand has an Ace counting as 11." : {
"comment" : "Explanation of how an Ace can be counted as either 1 or 11 in a hand.",
@ -760,26 +719,7 @@
}
},
"Aces can be high or low in straights (A-2-3 or Q-K-A)." : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Aces can be high or low in straights (A-2-3 or Q-K-A)."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Los ases pueden ser altos o bajos en escaleras (A-2-3 o Q-K-A)."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Les as peuvent être hauts ou bas dans les suites (A-2-3 ou Q-K-A)."
}
}
}
},
"Actions" : {
"localizations" : {
@ -1387,49 +1327,10 @@
},
"Bet on your first two cards forming a pair" : {
"comment" : "Description of the Perfect Pairs side bet.",
"isCommentAutoGenerated": true,
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Bet on your first two cards forming a pair"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Apuesta a que tus primeras dos cartas formen un par"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Pariez sur vos deux premières cartes formant une paire"
}
}
}
"isCommentAutoGenerated" : true
},
"Bet on your first two cards forming a pair." : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Bet on your first two cards forming a pair."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Apuesta a que tus primeras dos cartas formen un par."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Pariez sur vos deux premières cartes formant une paire."
}
}
}
},
"Betting Hint" : {
"comment" : "A label describing the view that shows betting recommendations.",
@ -1968,26 +1869,7 @@
}
},
"Colored Pair (same color): 12:1" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Colored Pair (same color): 12:1"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Par de color (mismo color): 12:1"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Paire de couleur (même couleur) : 12:1"
}
}
}
},
"Common shoe game" : {
"comment" : "Description of a deck count option when the user selects 4 decks.",
@ -2107,27 +1989,7 @@
},
"Current bet $%lld" : {
"comment" : "A hint that appears when a user taps on a side bet zone. The text varies depending on whether a bet is currently placed or not.",
"isCommentAutoGenerated": true,
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Current bet $%lld"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Apuesta actual $%lld"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Pari actuel %lld $"
}
}
}
"isCommentAutoGenerated" : true
},
"Custom" : {
"localizations" : {
@ -2473,7 +2335,7 @@
"localizations" : {
"en" : {
"stringUnit" : {
"state": "translated",
"state" : "new",
"value" : "Dealer: %1$@. Value: %2$@"
}
},
@ -2917,50 +2779,7 @@
},
"Double tap to place bet" : {
"comment" : "A hint text that describes the action to take to place a side bet.",
"isCommentAutoGenerated": true,
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Double tap to place bet"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Toca dos veces para apostar"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Touchez deux fois pour parier"
}
}
}
},
"Double, not Hit (TC %@)": {
"comment": "Short hint to double instead of hit based on true count.",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Double, not Hit (TC %@)"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Doblar, no Pedir (TC %@)"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Doubler, pas Tirer (TC %@)"
}
}
}
"isCommentAutoGenerated" : true
},
"Enable 'Card Count' in Settings to practice." : {
"localizations" : {
@ -2985,26 +2804,7 @@
}
},
"Enable in Settings to play side bets." : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Enable in Settings to play side bets."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Habilita en Configuración para jugar apuestas laterales."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Activez dans les réglages pour jouer les paris latéraux."
}
}
}
},
"Enable Side Bets" : {
"localizations" : {
@ -3051,70 +2851,13 @@
}
},
"Example: K♠ K♠ = Perfect Pair" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Example: K♠ K♠ = Perfect Pair"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Ejemplo: K♠ K♠ = Par perfecto"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Exemple : K♠ K♠ = Paire parfaite"
}
}
}
},
"Example: K♠ K♣ = Colored Pair (both black)" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Example: K♠ K♣ = Colored Pair (both black)"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Ejemplo: K♠ K♣ = Par de color (ambos negros)"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Exemple : K♠ K♣ = Paire de couleur (tous deux noirs)"
}
}
}
},
"Example: K♠ K♥ = Mixed Pair (red/black)" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Example: K♠ K♥ = Mixed Pair (red/black)"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Ejemplo: K♠ K♥ = Par mixto (rojo/negro)"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Exemple : K♠ K♥ = Paire mixte (rouge/noir)"
}
}
}
},
"Fewer decks = easier to count accurately." : {
"localizations" : {
@ -3185,48 +2928,10 @@
}
},
"Flush (same suit): 5:1" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Flush (same suit): 5:1"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Color (mismo palo): 5:1"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Couleur (même couleur) : 5:1"
}
}
}
},
"Forms a poker hand: your 2 cards + dealer upcard." : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Forms a poker hand: your 2 cards + dealer upcard."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Forma una mano de póquer: tus 2 cartas + carta visible del crupier."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Forme une main de poker : vos 2 cartes + carte visible du croupier."
}
}
}
},
"GAME STYLE" : {
"localizations" : {
@ -3546,29 +3251,6 @@
}
}
},
"Hit, not Stand (TC %@)": {
"comment": "Short hint to hit instead of stand based on true count.",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Hit, not Stand (TC %@)"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Pedir, no Plantarse (TC %@)"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Tirer, pas Rester (TC %@)"
}
}
}
},
"Hit: Take another card" : {
"comment" : "Action available in Blackjack: Hit (take another card).",
"isCommentAutoGenerated" : true,
@ -4326,26 +4008,7 @@
}
},
"Mixed Pair (diff. color): 6:1" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Mixed Pair (diff. color): 6:1"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Par mixto (diferente color): 6:1"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Paire mixte (couleur différente) : 6:1"
}
}
}
},
"More decks = harder to count cards." : {
"localizations" : {
@ -4709,26 +4372,7 @@
}
},
"Optional bets placed before the deal." : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Optional bets placed before the deal."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Apuestas opcionales colocadas antes del reparto."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Paris optionnels placés avant la distribution."
}
}
}
},
"Other Game Icons" : {
"comment" : "A label displayed above a section of the BrandingPreviewView that shows icons for other games.",
@ -4871,26 +4515,7 @@
}
},
"Perfect Pair (same suit): 25:1" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Perfect Pair (same suit): 25:1"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Par perfecto (mismo palo): 25:1"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Paire parfaite (même couleur) : 25:1"
}
}
}
},
"Perfect Pairs" : {
"comment" : "Name of the Perfect Pairs side bet type.",
@ -4917,48 +4542,10 @@
}
},
"Perfect Pairs (25:1) and 21+3 (100:1)" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Perfect Pairs (25:1) and 21+3 (100:1)"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Pares perfectos (25:1) y 21+3 (100:1)"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Paires parfaites (25:1) et 21+3 (100:1)"
}
}
}
},
"Perfect Pairs: Bet on your first two cards being a pair." : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Perfect Pairs: Bet on your first two cards being a pair."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Pares perfectos: Apuesta a que tus primeras dos cartas sean un par."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Paires parfaites : Pariez sur vos deux premières cartes formant une paire."
}
}
}
},
"Play Again" : {
"localizations" : {
@ -4988,7 +4575,7 @@
"localizations" : {
"en" : {
"stringUnit" : {
"state": "translated",
"state" : "new",
"value" : "Player hand: %1$@. Value: %2$@"
}
},
@ -5030,27 +4617,7 @@
},
"Poker hand from your first two cards + dealer's upcard" : {
"comment" : "Description of the 21+3 side bet type.",
"isCommentAutoGenerated": true,
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Poker hand from your first two cards + dealer's upcard"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Mano de póquer con tus primeras dos cartas + carta visible del crupier"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Main de poker avec vos deux premières cartes + carte visible du croupier"
}
}
}
"isCommentAutoGenerated" : true
},
"Positive count = more high cards remain = player advantage." : {
"localizations" : {
@ -5683,48 +5250,10 @@
}
},
"SIDE BETS" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "SIDE BETS"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "APUESTAS LATERALES"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "PARIS LATÉRAUX"
}
}
}
},
"Side bets have higher house edge than main game." : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Side bets have higher house edge than main game."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Las apuestas laterales tienen mayor ventaja de la casa que el juego principal."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Les paris latéraux ont un avantage de la maison plus élevé que le jeu principal."
}
}
}
},
"Sign in to iCloud to sync progress" : {
"localizations" : {
@ -5862,28 +5391,6 @@
}
}
},
"Split up to 4 hands, but not aces.": {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Split up to 4 hands, but not aces."
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Divide hasta 4 manos, pero no ases."
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Séparez jusqu'à 4 mains, mais pas les as."
}
}
}
},
"Split, not Stand (TC %@)" : {
"comment" : "Short hint to split instead of stand based on true count.",
"localizations" : {
@ -5907,6 +5414,121 @@
}
}
},
"Stand, not Hit (TC %@)" : {
"comment" : "Short hint to stand instead of hit based on true count.",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Stand, not Hit (TC %@)"
}
},
"es-MX" : {
"stringUnit" : {
"state" : "translated",
"value" : "Plantarse, no Pedir (TC %@)"
}
},
"fr-CA" : {
"stringUnit" : {
"state" : "translated",
"value" : "Rester, pas Tirer (TC %@)"
}
}
}
},
"Hit, not Stand (TC %@)" : {
"comment" : "Short hint to hit instead of stand based on true count.",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Hit, not Stand (TC %@)"
}
},
"es-MX" : {
"stringUnit" : {
"state" : "translated",
"value" : "Pedir, no Plantarse (TC %@)"
}
},
"fr-CA" : {
"stringUnit" : {
"state" : "translated",
"value" : "Tirer, pas Rester (TC %@)"
}
}
}
},
"Double, not Hit (TC %@)" : {
"comment" : "Short hint to double instead of hit based on true count.",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Double, not Hit (TC %@)"
}
},
"es-MX" : {
"stringUnit" : {
"state" : "translated",
"value" : "Doblar, no Pedir (TC %@)"
}
},
"fr-CA" : {
"stringUnit" : {
"state" : "translated",
"value" : "Doubler, pas Tirer (TC %@)"
}
}
}
},
"Split instead of Stand (TC %@, dealer very likely to bust)" : {
"comment" : "A hint to split a pair of 10s when the true count is high enough.",
"isCommentAutoGenerated" : true,
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Split instead of Stand (TC %@, dealer very likely to bust)"
}
},
"es-MX" : {
"stringUnit" : {
"state" : "translated",
"value" : "Dividir en vez de Plantarse (TC %@, el crupier probablemente se pase)"
}
},
"fr-CA" : {
"stringUnit" : {
"state" : "translated",
"value" : "Séparer au lieu de Rester (TC %@, le croupier va probablement sauter)"
}
}
}
},
"Split up to 4 hands, but not aces." : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Split up to 4 hands, but not aces."
}
},
"es-MX" : {
"stringUnit" : {
"state" : "translated",
"value" : "Divide hasta 4 manos, pero no ases."
}
},
"fr-CA" : {
"stringUnit" : {
"state" : "translated",
"value" : "Séparez jusqu'à 4 mains, mais pas les as."
}
}
}
},
"Split: If you have two cards of the same value, split into two hands" : {
"comment" : "Description of the 'Split' action in the game rules.",
"isCommentAutoGenerated" : true,
@ -5975,29 +5597,6 @@
}
}
},
"Stand, not Hit (TC %@)": {
"comment": "Short hint to stand instead of hit based on true count.",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Stand, not Hit (TC %@)"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Plantarse, no Pedir (TC %@)"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Rester, pas Tirer (TC %@)"
}
}
}
},
"Stand: Keep your current hand" : {
"comment" : "Action to keep your current hand in Blackjack.",
"isCommentAutoGenerated" : true,
@ -6137,26 +5736,7 @@
}
},
"Straight (consecutive): 10:1" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Straight (consecutive): 10:1"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Escalera (consecutivas): 10:1"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Suite (consécutives) : 10:1"
}
}
}
},
"Straight Flush" : {
"comment" : "Description of a 21+3 side bet outcome when the player has a straight flush.",
@ -6183,26 +5763,7 @@
}
},
"Straight Flush: 40:1" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Straight Flush: 40:1"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Escalera de color: 40:1"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Quinte flush : 40:1"
}
}
}
},
"Suited Trips" : {
"comment" : "Name of a 21+3 side bet outcome when the user has three cards of the same rank and suit.",
@ -6229,26 +5790,7 @@
}
},
"Suited Trips (same rank & suit): 100:1" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Suited Trips (same rank & suit): 100:1"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Trío del mismo palo (mismo rango y palo): 100:1"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Brelan assorti (même rang et couleur) : 100:1"
}
}
}
},
"Surrender" : {
"localizations" : {
@ -6567,26 +6109,7 @@
}
},
"Three of a Kind: 30:1" : {
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Three of a Kind: 30:1"
}
},
"es-MX": {
"stringUnit": {
"state": "translated",
"value": "Trío: 30:1"
}
},
"fr-CA": {
"stringUnit": {
"state": "translated",
"value": "Brelan : 30:1"
}
}
}
},
"Total Winnings" : {
"localizations" : {

View File

@ -19,16 +19,6 @@ enum Design {
/// Set to true to show layout debug borders on views
static let showDebugBorders = false
/// Set to true to show debug log statements
static let showDebugLogs = false
/// Debug logger - only prints when showDebugLogs is true
static func debugLog(_ message: String) {
if showDebugLogs {
print(message)
}
}
// MARK: - Shared Constants (from CasinoKit)
typealias Spacing = CasinoDesign.Spacing
@ -81,33 +71,6 @@ enum Design {
// Table
static let tableHeight: CGFloat = 280
// Result banner
static let resultRowAmountWidth: CGFloat = 70
static let resultRowResultWidth: CGFloat = 150
// Side bet zones
static let sideBetLabelFontSize: CGFloat = 13
static let sideBetPayoutFontSize: CGFloat = 11
// Side bet toast notifications
static let sideBetToastTitleFontSize: CGFloat = 11
static let sideBetToastResultFontSize: CGFloat = 12
static let sideBetToastAmountFontSize: CGFloat = 14
}
// MARK: - Blackjack-Specific Delays
enum Delay {
/// Delay before playing game over sound
static let gameOverSound: Double = 1.0
}
// MARK: - Blackjack-Specific Animation
enum AnimationExtra {
/// Bounce for side bet toast animations
static let toastBounce: Double = 0.4
}
}

View File

@ -35,8 +35,10 @@ struct ActionButtonsView: View {
EmptyView()
}
}
.animation(.spring(duration: Design.Animation.quick), value: state.currentPhase)
.animation(.easeInOut(duration: Design.Animation.standard), value: state.currentBet > 0)
}
.frame(height: containerHeight)
.frame(minHeight: containerHeight)
.padding(.horizontal, Design.Spacing.large)
}

View File

@ -130,22 +130,20 @@ struct GameTableView: View {
)
.frame(maxWidth: maxContentWidth)
// Chip selector - only shown during betting phase AND when result banner is NOT showing
if state.currentPhase == .betting && !state.showResultBanner {
// Chip selector - only shown during betting phase
if state.currentPhase == .betting {
Spacer()
.debugBorder(showDebugBorders, color: .yellow, label: "ChipSpacer")
ChipSelectorView(
selectedChip: $selectedChip,
balance: state.balance,
currentBet: state.minBetForChipSelector,
currentBet: state.minBetForChipSelector, // Use min bet so chips stay enabled if any bet type can accept more
maxBet: state.settings.maxBet
)
.frame(maxWidth: maxContentWidth)
.transition(.opacity.combined(with: .move(edge: .bottom)))
.debugBorder(showDebugBorders, color: .pink, label: "ChipSelector")
.onAppear {
Design.debugLog("🎰 Chip selector APPEARED (banner showing: \(state.showResultBanner))")
}
.onDisappear {
Design.debugLog("🎰 Chip selector DISAPPEARED")
}
}
// Action buttons - minimal spacing during player turn
@ -154,33 +152,21 @@ struct GameTableView: View {
.padding(.bottom, Design.Spacing.small)
.debugBorder(showDebugBorders, color: .blue, label: "ActionBtns")
}
.frame(maxWidth: .infinity, alignment: .top)
.zIndex(1)
.onChange(of: state.currentPhase) { oldPhase, newPhase in
Design.debugLog("🔄 Phase changed: \(oldPhase)\(newPhase)")
}
.frame(maxWidth: .infinity)
// Insurance popup overlay (covers entire screen)
if state.currentPhase == .insurance {
Color.clear
.overlay(alignment: .center) {
InsurancePopupView(
betAmount: state.currentBet / 2,
balance: state.balance,
onTake: { Task { await state.takeInsurance() } },
onDecline: { state.declineInsurance() }
)
}
.ignoresSafeArea()
.allowsHitTesting(true)
.transition(.opacity.combined(with: .scale(scale: 0.9)))
.zIndex(100)
}
// Result banner overlay
if state.showResultBanner, let result = state.lastRoundResult {
Color.clear
.overlay(alignment: .center) {
ResultBannerView(
result: result,
currentBalance: state.balance,
@ -188,43 +174,20 @@ struct GameTableView: View {
onNewRound: { state.newRound() },
onPlayAgain: { state.resetGame() }
)
.onAppear {
Design.debugLog("🎯 RESULT BANNER APPEARED")
}
.onDisappear {
Design.debugLog("❌ RESULT BANNER DISAPPEARED")
}
}
.ignoresSafeArea()
.allowsHitTesting(true)
.zIndex(100)
}
// Confetti for wins (matching Baccarat pattern)
if state.showResultBanner && (state.lastRoundResult?.totalWinnings ?? 0) > 0 {
ConfettiView()
.zIndex(101)
}
// Game over
if state.isGameOver && !state.showResultBanner {
Color.clear
.overlay(alignment: .center) {
GameOverView(
roundsPlayed: state.roundsPlayed,
onPlayAgain: { state.resetGame() }
)
}
.ignoresSafeArea()
.allowsHitTesting(true)
.zIndex(100)
}
}
.onChange(of: state.playerHands.count) { oldCount, newCount in
Design.debugLog("👥 Player hands count: \(oldCount)\(newCount)")
}
.onChange(of: state.balance) { oldBalance, newBalance in
Design.debugLog("💰 Balance: \(oldBalance)\(newBalance)")
}
}

View File

@ -54,6 +54,7 @@ struct ResultBannerView: View {
ZStack {
// Full screen dark background
Color.black.opacity(Design.Opacity.strong)
.ignoresSafeArea()
// Content card
VStack(spacing: Design.Spacing.xLarge) {
@ -192,18 +193,18 @@ struct ResultBannerView: View {
.shadow(color: mainResultColor.opacity(Design.Opacity.hint), radius: Design.Shadow.radiusXLarge)
.frame(maxWidth: CasinoDesign.Size.maxModalWidth)
.padding(.horizontal, Design.Spacing.large) // Prevent clipping on sides
.scaleEffect(showContent ? Design.Scale.normal : Design.Scale.slightShrink)
.scaleEffect(showContent ? 1.0 : 0.8)
.opacity(showContent ? 1.0 : 0)
}
.onAppear {
withAnimation(.spring(duration: Design.Animation.springDuration, bounce: Design.Animation.springBounce)) {
withAnimation(.spring(duration: Design.Animation.springDuration, bounce: 0.3)) {
showContent = true
}
// Play game over sound if out of chips (after a delay so it doesn't overlap with result sound)
if isGameOver {
Task {
try? await Task.sleep(for: .seconds(Design.Delay.gameOverSound))
try? await Task.sleep(for: .seconds(1))
SoundManager.shared.play(.gameOver)
}
}
@ -221,8 +222,6 @@ struct ResultRow: View {
let result: HandResult
var amount: Int? = nil
private var showDebugBorders: Bool { Design.showDebugBorders }
private var amountText: String? {
guard let amount = amount else { return nil }
if amount > 0 {
@ -244,31 +243,24 @@ struct ResultRow: View {
var body: some View {
HStack {
Text(label)
.font(.system(size: Design.BaseFontSize.medium))
.font(.system(size: Design.BaseFontSize.body))
.foregroundStyle(.white.opacity(Design.Opacity.strong))
.debugBorder(showDebugBorders, color: .blue, label: "Label")
Spacer()
.debugBorder(showDebugBorders, color: .yellow, label: "Spacer")
// Show amount if provided
if let amountText = amountText {
Text(amountText)
.font(.system(size: Design.BaseFontSize.medium, weight: .semibold, design: .rounded))
.font(.system(size: Design.BaseFontSize.body, weight: .semibold, design: .rounded))
.foregroundStyle(amountColor)
.frame(width: Design.Size.resultRowAmountWidth, alignment: .trailing)
.debugBorder(showDebugBorders, color: .green, label: "Amount")
.frame(width: 70, alignment: .trailing)
}
Text(result.displayText)
.font(.system(size: Design.BaseFontSize.large, weight: .bold))
.font(.system(size: Design.BaseFontSize.body, weight: .bold))
.foregroundStyle(result.color)
.frame(width: Design.Size.resultRowResultWidth, alignment: .trailing)
.lineLimit(1)
.minimumScaleFactor(Design.MinScaleFactor.comfortable)
.debugBorder(showDebugBorders, color: .red, label: "Result")
.frame(width: 100, alignment: .trailing)
}
.debugBorder(showDebugBorders, color: .white, label: "ResultRow")
}
}
@ -280,8 +272,6 @@ struct SideBetResultRow: View {
let isWin: Bool
let amount: Int
private var showDebugBorders: Bool { Design.showDebugBorders }
private var amountText: String {
if amount > 0 {
return "+$\(amount)"
@ -305,28 +295,23 @@ struct SideBetResultRow: View {
var body: some View {
HStack {
Text(label)
.font(.system(size: Design.BaseFontSize.medium))
.font(.system(size: Design.BaseFontSize.body))
.foregroundStyle(.white.opacity(Design.Opacity.strong))
.debugBorder(showDebugBorders, color: .blue, label: "Label")
Spacer()
.debugBorder(showDebugBorders, color: .yellow, label: "Spacer")
Text(amountText)
.font(.system(size: Design.BaseFontSize.medium, weight: .semibold, design: .rounded))
.font(.system(size: Design.BaseFontSize.body, weight: .semibold, design: .rounded))
.foregroundStyle(amountColor)
.frame(width: Design.Size.resultRowAmountWidth, alignment: .trailing)
.debugBorder(showDebugBorders, color: .green, label: "Amount")
.frame(width: 70, alignment: .trailing)
Text(resultText)
.font(.system(size: Design.BaseFontSize.large, weight: .bold))
.font(.system(size: Design.BaseFontSize.body, weight: .bold))
.foregroundStyle(resultColor)
.frame(width: Design.Size.resultRowResultWidth, alignment: .trailing)
.frame(width: 100, alignment: .trailing)
.lineLimit(1)
.minimumScaleFactor(Design.MinScaleFactor.comfortable)
.debugBorder(showDebugBorders, color: .red, label: "Result")
}
.debugBorder(showDebugBorders, color: .white, label: "SideBetRow")
}
}

View File

@ -31,9 +31,9 @@ struct PlayerHandsView: View {
// Display hands in reverse order (right to left play order)
// Visual order: Hand 3, Hand 2, Hand 1 (left to right)
// Play order: Hand 1 played first (rightmost), then Hand 2, etc.
ForEach(Array(hands.enumerated()).reversed(), id: \.element.id) { index, hand in
ForEach(hands.indices.reversed(), id: \.self) { index in
PlayerHandView(
hand: hand,
hand: hands[index],
isActive: index == activeHandIndex && isPlayerTurn,
showCardCount: showCardCount,
// Hand numbers: rightmost (index 0) is Hand 1, played first
@ -41,39 +41,35 @@ struct PlayerHandsView: View {
cardWidth: cardWidth,
cardSpacing: cardSpacing
)
.id(hand.id)
.transition(.scale.combined(with: .opacity))
.id(index)
}
}
.animation(.spring(duration: Design.Animation.springDuration), value: hands.count)
.padding(.horizontal, Design.Spacing.xxLarge) // More padding for scrolling
}
.scrollClipDisabled()
.scrollBounceBehavior(.always) // Always allow bouncing for better scroll feel
.defaultScrollAnchor(.center) // Center the content by default
.onChange(of: activeHandIndex) { _, newIndex in
scrollToActiveHand(proxy: proxy)
scrollToHand(proxy: proxy, index: newIndex)
}
.onChange(of: totalCardCount) { _, _ in
// Scroll to active hand when cards are added (hit)
scrollToActiveHand(proxy: proxy)
scrollToHand(proxy: proxy, index: activeHandIndex)
}
.onChange(of: hands.count) { _, _ in
// Scroll to active hand when split occurs
scrollToActiveHand(proxy: proxy)
scrollToHand(proxy: proxy, index: activeHandIndex)
}
.onAppear {
scrollToActiveHand(proxy: proxy)
scrollToHand(proxy: proxy, index: activeHandIndex)
}
}
.frame(maxWidth: .infinity)
}
private func scrollToActiveHand(proxy: ScrollViewProxy) {
guard activeHandIndex < hands.count else { return }
let activeHandId = hands[activeHandIndex].id
private func scrollToHand(proxy: ScrollViewProxy, index: Int) {
withAnimation(.easeInOut(duration: Design.Animation.quick)) {
proxy.scrollTo(activeHandId, anchor: .center)
proxy.scrollTo(index, anchor: .center)
}
}
}

View File

@ -18,9 +18,9 @@ struct SideBetToastView: View {
@State private var isShowing = false
@ScaledMetric(relativeTo: .caption) private var titleFontSize: CGFloat = Design.Size.sideBetToastTitleFontSize
@ScaledMetric(relativeTo: .callout) private var resultFontSize: CGFloat = Design.Size.sideBetToastResultFontSize
@ScaledMetric(relativeTo: .body) private var amountFontSize: CGFloat = Design.Size.sideBetToastAmountFontSize
@ScaledMetric(relativeTo: .caption) private var titleFontSize: CGFloat = 10
@ScaledMetric(relativeTo: .caption2) private var resultFontSize: CGFloat = 11
@ScaledMetric(relativeTo: .caption2) private var amountFontSize: CGFloat = 13
private var backgroundColor: Color {
isWin ? Color.green.opacity(Design.Opacity.heavy) : Color.red.opacity(Design.Opacity.heavy)
@ -68,14 +68,14 @@ struct SideBetToastView: View {
)
)
.shadow(color: borderColor.opacity(Design.Opacity.medium), radius: Design.Shadow.radiusMedium)
.scaleEffect(isShowing ? Design.Scale.normal : Design.Scale.shrunk)
.scaleEffect(isShowing ? 1.0 : 0.5)
.opacity(isShowing ? 1.0 : 0)
.offset(x: isShowing ? 0 : (showOnLeft ? -Design.Spacing.toastSlide : Design.Spacing.toastSlide))
.accessibilityElement(children: .combine)
.accessibilityLabel("\(title): \(result)")
.accessibilityValue(amountText)
.onAppear {
withAnimation(.spring(duration: Design.Animation.springDuration, bounce: Design.AnimationExtra.toastBounce).delay(showOnLeft ? 0 : Design.Animation.staggerDelay1)) {
withAnimation(.spring(duration: Design.Animation.springDuration, bounce: 0.4).delay(showOnLeft ? 0 : Design.Animation.staggerDelay1)) {
isShowing = true
}
}

View File

@ -16,8 +16,8 @@ struct SideBetZoneView: View {
let isAtMax: Bool
let onTap: () -> Void
@ScaledMetric(relativeTo: .callout) private var labelFontSize: CGFloat = Design.Size.sideBetLabelFontSize
@ScaledMetric(relativeTo: .caption) private var payoutFontSize: CGFloat = Design.Size.sideBetPayoutFontSize
@ScaledMetric(relativeTo: .caption) private var labelFontSize: CGFloat = 11
@ScaledMetric(relativeTo: .caption2) private var payoutFontSize: CGFloat = 9
private var backgroundColor: Color {
switch betType {
@ -49,7 +49,7 @@ struct SideBetZoneView: View {
RoundedRectangle(cornerRadius: Design.CornerRadius.medium)
.strokeBorder(
Color.white.opacity(Design.Opacity.hint),
lineWidth: Design.LineWidth.medium
lineWidth: Design.LineWidth.thin
)
)

View File

@ -1,17 +0,0 @@
//
// BlackjackTests.swift
// BlackjackTests
//
// Created by Matt Bruce on 12/17/25.
//
import Testing
@testable import Blackjack
struct BlackjackTests {
@Test func example() async throws {
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
}
}

View File

@ -1,41 +0,0 @@
//
// BlackjackUITests.swift
// BlackjackUITests
//
// Created by Matt Bruce on 12/17/25.
//
import XCTest
final class BlackjackUITests: XCTestCase {
override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
// In UI tests its important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
@MainActor
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
@MainActor
func testLaunchPerformance() throws {
// This measures how long it takes to launch your application.
measure(metrics: [XCTApplicationLaunchMetric()]) {
XCUIApplication().launch()
}
}
}

View File

@ -1,33 +0,0 @@
//
// BlackjackUITestsLaunchTests.swift
// BlackjackUITests
//
// Created by Matt Bruce on 12/17/25.
//
import XCTest
final class BlackjackUITestsLaunchTests: XCTestCase {
override class var runsForEachTargetApplicationUIConfiguration: Bool {
true
}
override func setUpWithError() throws {
continueAfterFailure = false
}
@MainActor
func testLaunch() throws {
let app = XCUIApplication()
app.launch()
// Insert steps here to perform after app launch but before taking a screenshot,
// such as logging into a test account or navigating somewhere in the app
let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = "Launch Screen"
attachment.lifetime = .keepAlways
add(attachment)
}
}