Signed-off-by: Matt Bruce <matt.bruce1@toyota.com>

This commit is contained in:
Matt Bruce 2025-12-23 22:20:29 -06:00
parent 34455378fc
commit ace6303a62
2 changed files with 23 additions and 13 deletions

View File

@ -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)

View File

@ -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)")
}
}