#93 - Option de controle des bruitages

This commit is contained in:
sladecraven 2021-01-12 20:58:30 +01:00
parent f3ed299ac9
commit ad00a3f700
3 changed files with 17 additions and 8 deletions

View File

@ -9,11 +9,13 @@ export class RdDAudio {
/* -------------------------------------------- */ /* -------------------------------------------- */
static PlayContextAudio(context) { static PlayContextAudio(context) {
let audioData = context2file[context]; if (game.settings.get("foundryvtt-reve-de-dragon", "activer-sons-audio") ) {
if ( audioData ) { let audioData = context2file[context];
let audioPath = "systems/foundryvtt-reve-de-dragon/sounds/" + audioData.file; if ( audioData ) {
console.log(`wfrp4e | Playing Sound: ${audioPath}`) let audioPath = "systems/foundryvtt-reve-de-dragon/sounds/" + audioData.file;
AudioHelper.play({ src: audioPath }, audioData.isGlobal); console.log(`wfrp4e | Playing Sound: ${audioPath}`)
AudioHelper.play({ src: audioPath }, audioData.isGlobal);
}
} }
} }
} }

View File

@ -171,8 +171,15 @@ Hooks.once("init", async function() {
default: true, default: true,
type: Boolean type: Boolean
}); });
/* -------------------------------------------- */
//game.settings.get("<systemName>","<settingName>") to retrieve it and game.settings.set("<systemName>","<settingName>", <newValue>) game.settings.register("foundryvtt-reve-de-dragon", "activer-sons-audio", {
name: "Activer les bruitages intégrés",
hint: "Si activé, certaines actions en jeu déclenchent un son d'ambiance",
scope: "world",
config: true,
default: true,
type: Boolean
});
/* -------------------------------------------- */ /* -------------------------------------------- */
// Set an initiative formula for the system // Set an initiative formula for the system

View File

@ -60,7 +60,7 @@ const taille2derivee = { 1: { poids: "moins de 1kg", plusdom:-5, sconst: 0.5, s
30: { poids: "901-1000", plusdom:+9, sconst: 10, sust: 15 }, 30: { poids: "901-1000", plusdom:+9, sconst: 10, sust: 15 },
31: { poids: "1001-1500", plusdom:+10, sconst: 10, sust: 16 }, 31: { poids: "1001-1500", plusdom:+10, sconst: 10, sust: 16 },
32: { poids: "1501-2000", plusdom:+11, sconst: 10, sust: 17 } 32: { poids: "1501-2000", plusdom:+11, sconst: 10, sust: 17 }
} };
/* -------------------------------------------- */ /* -------------------------------------------- */
function _buildAllSegmentsFatigue(max) { function _buildAllSegmentsFatigue(max) {