feat(know-your-world): auto-enable hot/cold for learning mode

When a game starts with the "learning" assistance level, automatically
enable hot/cold audio feedback for all players. This ensures the full
learning experience is available without requiring manual toggle.

The setting is also persisted to localStorage so it remains enabled
if the player navigates away and returns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-11-30 20:35:38 -06:00
parent 45730bb4db
commit dcc32c288f
1 changed files with 10 additions and 0 deletions

View File

@ -637,6 +637,16 @@ export function MapRenderer({
return localStorage.getItem('knowYourWorld.hotColdAudio') === 'true' return localStorage.getItem('knowYourWorld.hotColdAudio') === 'true'
}) })
// Auto-enable hot/cold for learning mode (highest assistance level)
// This ensures all players in a learning game get hot/cold feedback enabled
useEffect(() => {
if (assistanceLevel === 'learning' && assistanceAllowsHotCold && !hotColdEnabled) {
setHotColdEnabled(true)
// Also persist to localStorage so it stays enabled if they navigate away
localStorage.setItem('knowYourWorld.hotColdAudio', 'true')
}
}, [assistanceLevel, assistanceAllowsHotCold, hotColdEnabled])
// Whether hot/cold button should be shown at all // Whether hot/cold button should be shown at all
// Uses hasAnyFinePointer because iPads with attached mice should show hot/cold // Uses hasAnyFinePointer because iPads with attached mice should show hot/cold
const showHotCold = isSpeechSupported && hasAnyFinePointer && assistanceAllowsHotCold const showHotCold = isSpeechSupported && hasAnyFinePointer && assistanceAllowsHotCold