mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-19 21:03:09 +00:00
All: settings persistence All: pause on menu Flappy: both swipe directions trigger flaps Freecell: skip irrelevant locations Blocks: Lower speed/difficulty Pinball: remove the half-implemented Nudge gesture.
27 lines
773 B
TypeScript
27 lines
773 B
TypeScript
/**
|
|
* The "Sound: on/off" entry in a game's context menu, persisted per app under
|
|
* `<appId>.soundOn` so each game remembers its own choice across launches.
|
|
* Reads default to on; storage failures fall back to on and never throw.
|
|
*/
|
|
import { getBooleanSetting, setBooleanSetting } from "../native/settings-store";
|
|
|
|
function soundKey(appId: string): string {
|
|
return `${appId}.soundOn`;
|
|
}
|
|
|
|
export function loadSoundEnabled(appId: string): boolean {
|
|
try {
|
|
return getBooleanSetting(soundKey(appId), true);
|
|
} catch {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
export function saveSoundEnabled(appId: string, enabled: boolean): void {
|
|
try {
|
|
setBooleanSetting(soundKey(appId), enabled);
|
|
} catch (error) {
|
|
console.warn(`${appId} sound setting save failed: ${error}`);
|
|
}
|
|
}
|