From ace6303a62f1794b4929402425a4e5050cf4c272 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 23 Dec 2025 22:20:29 -0600 Subject: [PATCH] Signed-off-by: Matt Bruce --- .../Blackjack/Theme/DesignConstants.swift | 12 +++++++++- .../Blackjack/Views/Game/GameTableView.swift | 24 +++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Blackjack/Blackjack/Theme/DesignConstants.swift b/Blackjack/Blackjack/Theme/DesignConstants.swift index 24eb15d..9b813d7 100644 --- a/Blackjack/Blackjack/Theme/DesignConstants.swift +++ b/Blackjack/Blackjack/Theme/DesignConstants.swift @@ -17,7 +17,17 @@ enum Design { // MARK: - Debug /// Set to true to show layout debug borders on views - static let showDebugBorders = true + 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) diff --git a/Blackjack/Blackjack/Views/Game/GameTableView.swift b/Blackjack/Blackjack/Views/Game/GameTableView.swift index 9f80b4c..b55c72e 100644 --- a/Blackjack/Blackjack/Views/Game/GameTableView.swift +++ b/Blackjack/Blackjack/Views/Game/GameTableView.swift @@ -141,10 +141,10 @@ struct GameTableView: View { .frame(maxWidth: maxContentWidth) .debugBorder(showDebugBorders, color: .pink, label: "ChipSelector") .onAppear { - print("🎰 Chip selector APPEARED (banner showing: \(state.showResultBanner))") + Design.debugLog("🎰 Chip selector APPEARED (banner showing: \(state.showResultBanner))") } .onDisappear { - print("🎰 Chip selector DISAPPEARED") + Design.debugLog("🎰 Chip selector DISAPPEARED") } } @@ -157,7 +157,7 @@ struct GameTableView: View { .frame(maxWidth: .infinity, alignment: .top) .zIndex(1) .onChange(of: state.currentPhase) { oldPhase, newPhase in - print("🔄 Phase changed: \(oldPhase) → \(newPhase)") + Design.debugLog("🔄 Phase changed: \(oldPhase) → \(newPhase)") } // Insurance popup overlay (covers entire screen) @@ -187,13 +187,13 @@ struct GameTableView: View { minBet: state.settings.minBet, onNewRound: { state.newRound() }, onPlayAgain: { state.resetGame() } - ) - .onAppear { - print("🎯 RESULT BANNER APPEARED") - } - .onDisappear { - print("❌ RESULT BANNER DISAPPEARED") - } + ) + .onAppear { + Design.debugLog("🎯 RESULT BANNER APPEARED") + } + .onDisappear { + Design.debugLog("❌ RESULT BANNER DISAPPEARED") + } } .ignoresSafeArea() .allowsHitTesting(true) @@ -221,10 +221,10 @@ struct GameTableView: View { } } .onChange(of: state.playerHands.count) { oldCount, newCount in - print("👥 Player hands count: \(oldCount) → \(newCount)") + Design.debugLog("👥 Player hands count: \(oldCount) → \(newCount)") } .onChange(of: state.balance) { oldBalance, newBalance in - print("💰 Balance: \(oldBalance) → \(newBalance)") + Design.debugLog("💰 Balance: \(oldBalance) → \(newBalance)") } }