setSfxVolume method

Future<void> setSfxVolume(
  1. double value
)

Sets the player's chosen SFX volume multiplier (ENH-95), clamped to [0, 1] and persisted via StorageKeys.sfxVolume. Multiplies every subsequent playSfx call's own volume argument.

Implementation

Future<void> setSfxVolume(double value) async {
  final clamped = value.clamp(0.0, 1.0);
  sfxVolume.value = clamped;
  await StorageService.to.setDouble(StorageKeys.sfxVolume, clamped);
}