feat(settings): soundEnabled provider gates SFX and haptics
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -120,16 +120,17 @@ class _GameScreenState extends ConsumerState<GameScreen>
|
||||
final audio = ref.read(audioServiceProvider);
|
||||
if (prev?.fxTick != next.fxTick && next.lastPlacement != null) {
|
||||
final placement = next.lastPlacement!;
|
||||
final hapticsOn = ref.read(soundEnabledProvider);
|
||||
if (placement.linesCleared > 0) {
|
||||
audio.play(placement.comboStreak >= 2 ? Sfx.combo : Sfx.clear);
|
||||
HapticFeedback.mediumImpact();
|
||||
if (hapticsOn) HapticFeedback.mediumImpact();
|
||||
if (placement.comboStreak >= 4) {
|
||||
HapticFeedback.heavyImpact();
|
||||
if (hapticsOn) HapticFeedback.heavyImpact();
|
||||
_shake.forward(from: 0);
|
||||
}
|
||||
} else {
|
||||
audio.play(Sfx.place);
|
||||
HapticFeedback.lightImpact();
|
||||
if (hapticsOn) HapticFeedback.lightImpact();
|
||||
}
|
||||
ref.read(tutorialProvider.notifier).onPlaced();
|
||||
if (placement.linesCleared > 0) {
|
||||
|
||||
Reference in New Issue
Block a user