Skip to content

Commit

Permalink
Custom sounds not working after API update (#47)
Browse files Browse the repository at this point in the history
* fix: custom sounds were not working after API update

* version bump
  • Loading branch information
EddieDover authored Feb 18, 2024
1 parent f265ec4 commit b1ff582
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#### 1.2.3 (2024-02-18)

##### Bug Fixes

* custom sounds were not working after API update ([b4153ba2](https://github.com/EddieDover/fvtt-player-achievements/commit/b4153ba2a0484a71bba79311f00032daca444c63))

## 1.2.2 (2024-02-08)

##### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fvtt-player-achievements",
"version": "1.2.2",
"version": "1.2.3",
"description": "Player Achievements for Foundry VTT",
"main": "index.js",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"url": "https://github.com/eddiedover/"
}
],
"version": "1.2.2",
"version": "1.2.3",
"compatibility": {
"minimum": "11",
"verified": "11"
Expand Down
10 changes: 5 additions & 5 deletions src/module/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function setupAchievementSocket() {
* @property {string} description Description
* @property {string} image Image URL
* @property {string} cloakedImage Cloaked Image URL
* @property {string} soundEffect Sound Effect URL
* @property {string} sound Sound Effect URL
* @property {Array} completedActors Array of Actor UUIDs
* @property {boolean} showTitleCloaked Show Title Cloaked
*/
Expand All @@ -59,7 +59,7 @@ export function setupAchievementSocket() {
* Create an Achievement
* @param {Achievement} achievement The achievement
*/
export function createAchievement({ id, title, showTitleCloaked, description, image, cloakedImage, soundEffect }) {
export function createAchievement({ id, title, showTitleCloaked, description, image, cloakedImage, sound }) {
const customAchievements = game.settings.get("fvtt-player-achievements", "customAchievements");
customAchievements.push({
id,
Expand All @@ -68,7 +68,7 @@ export function createAchievement({ id, title, showTitleCloaked, description, im
description,
image: image ?? DEFAULT_IMAGE,
cloakedImage: cloakedImage ?? DEFAULT_IMAGE,
soundEffect: soundEffect ?? DEFAULT_SOUND,
sound: sound ?? DEFAULT_SOUND,
});
game.settings.set("fvtt-player-achievements", "customAchievements", customAchievements);
}
Expand All @@ -77,13 +77,13 @@ export function createAchievement({ id, title, showTitleCloaked, description, im
* Edit an Achievement
* @param {Achievement} achievement The achievement
*/
export function editAchievement({ id, title, showTitleCloaked, description, image, cloakedImage, soundEffect }) {
export function editAchievement({ id, title, showTitleCloaked, description, image, cloakedImage, sound }) {
const customAchievements = game.settings.get("fvtt-player-achievements", "customAchievements");
const index = customAchievements.findIndex((a) => a.id === id);
if (index === -1) {
return;
}
customAchievements[index] = { id, title, showTitleCloaked, description, image, cloakedImage, soundEffect };
customAchievements[index] = { id, title, showTitleCloaked, description, image, cloakedImage, sound };
game.settings.set("fvtt-player-achievements", "customAchievements", customAchievements);
}

Expand Down

0 comments on commit b1ff582

Please sign in to comment.