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:
parent
45730bb4db
commit
dcc32c288f
|
|
@ -637,6 +637,16 @@ export function MapRenderer({
|
|||
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
|
||||
// Uses hasAnyFinePointer because iPads with attached mice should show hot/cold
|
||||
const showHotCold = isSpeechSupported && hasAnyFinePointer && assistanceAllowsHotCold
|
||||
|
|
|
|||
Loading…
Reference in New Issue