Skip to content

Commit

Permalink
v12 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sneat committed Jul 4, 2024
1 parent 52ca318 commit 525a7bd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v2.2.1

- v12 compatibility.

## v2.2.0

- Re-added "core.compendiumConfiguration" setting to exports to export Compendium Folder structure mappings.
Expand Down
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"allowBugReporter": true
},
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "11",
"version": "2.2.0",
"compatibleCoreVersion": "12",
"version": "2.2.1",
"compatibility": {
"minimum": "0.6.0",
"verified": "11.306"
"verified": "12"
},
"scripts": [],
"esmodules": [
Expand Down
10 changes: 10 additions & 0 deletions scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,11 @@ export default class Core extends FormApplication {
type: 'Setting',
action: 'update',
updates: updates,
operation: {
pack: null,
parent: null,
updates: updates,
}
});
}
if (creates.length) {
Expand All @@ -601,6 +606,11 @@ export default class Core extends FormApplication {
type: 'Setting',
action: 'create',
data: creates,
operation: {
pack: null,
parent: null,
data: creates,
}
});
}
return true;
Expand Down
14 changes: 7 additions & 7 deletions scripts/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export class WorldSetting {
newValue = JSON.parse(newValue);
}
if (typeof existingSetting === 'object' && typeof newValue === 'object') {
let diff = diffObject(existingSetting, newValue);
if (typeof isEmpty === 'function' ? isEmpty(diff) : isObjectEmpty(diff)) {
let diff = foundry.utils.diffObject(existingSetting, newValue);
if (typeof foundry.utils.isEmpty === 'function' ? foundry.utils.isEmpty(diff) : foundry.utils.isObjectEmpty(diff)) {
// No difference in the underlying object.
return new Difference(this.key, null, null);
}
Expand Down Expand Up @@ -167,7 +167,7 @@ export class PlayerSetting {
);
}

let flagDiff = diffObject(userData.flags, setting.flags);
let flagDiff = foundry.utils.diffObject(userData.flags, setting.flags);
for (const prop in flagDiff) {
if (!flagDiff.hasOwnProperty(prop)) {
continue;
Expand Down Expand Up @@ -198,13 +198,13 @@ export class PlayerSetting {
* @returns boolean
*/
hasDataChanges() {
if (typeof isEmpty === 'function') {
return !isEmpty(this.playerDifferences) || !isEmpty(this.playerFlagDifferences);
if (typeof foundry.utils.isEmpty === 'function') {
return !foundry.utils.isEmpty(this.playerDifferences) || !foundry.utils.isEmpty(this.playerFlagDifferences);
}

return (
!isObjectEmpty(this.playerDifferences) ||
!isObjectEmpty(this.playerFlagDifferences)
!foundry.utils.isObjectEmpty(this.playerDifferences) ||
!foundry.utils.isObjectEmpty(this.playerFlagDifferences)
);
}
}
Expand Down

0 comments on commit 525a7bd

Please sign in to comment.