2021-11-11 02:43:38 +01:00
|
|
|
import { SYSTEM_RDD } from "./constants.js";
|
2021-01-02 00:04:27 +01:00
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
const context2file = {
|
|
|
|
"argent": { file: "son_piece_monnaie.mp3", isGlobal: false }
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
export class RdDAudio {
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
static PlayContextAudio(context) {
|
2021-11-11 02:43:38 +01:00
|
|
|
if (game.settings.get(SYSTEM_RDD, "activer-sons-audio") ) {
|
2021-01-12 20:58:30 +01:00
|
|
|
let audioData = context2file[context];
|
|
|
|
if ( audioData ) {
|
|
|
|
let audioPath = "systems/foundryvtt-reve-de-dragon/sounds/" + audioData.file;
|
2021-05-24 22:08:01 +02:00
|
|
|
console.log(`foundryvtt-reve-de-dragon | Playing Sound: ${audioPath}`)
|
2021-01-12 20:58:30 +01:00
|
|
|
AudioHelper.play({ src: audioPath }, audioData.isGlobal);
|
|
|
|
}
|
2021-01-02 00:04:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|