Skip to content

Commit

Permalink
Add ignore XP update setting
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPrimate committed Jul 7, 2024
1 parent 2b92ea2 commit 08d9b62
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Next up

- Foe Slayer effect from @motomoto0295
- Option to preserve XP on character import @pwim

# 5.2.24

Expand Down
4 changes: 4 additions & 0 deletions src/apps/DDBCharacterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ ${item.system.description.chat}
updatePolicyHitDie: game.settings.get("ddb-importer", "character-update-policy-hit-die"),
updatePolicyCurrency: game.settings.get("ddb-importer", "character-update-policy-currency"),
updatePolicyBio: game.settings.get("ddb-importer", "character-update-policy-bio"),
updatePolicyXP: game.settings.get("ddb-importer", "character-update-policy-xp"),
updatePolicySpellUse: game.settings.get("ddb-importer", "character-update-policy-spell-use"),
updatePolicyLanguages: game.settings.get("ddb-importer", "character-update-policy-languages"),
updatePolicyImage: game.settings.get("ddb-importer", "character-update-policy-image"),
Expand Down Expand Up @@ -1275,6 +1276,9 @@ ${item.system.description.chat}
if (!this.settings.updatePolicyHP) {
this.result.character.system.attributes.hp = this.actorOriginal.system.attributes.hp;
}
if (!this.settings.updatePolicyXP) {
this.result.character.system.details.xp = this.actorOriginal.system.details.xp;
}
if (!this.settings.updatePolicyHitDie) {
this.result.character.system.attributes.hd = this.actorOriginal.system.attributes.hd;
this.result.classes = this.result.classes.map((klass) => {
Expand Down
5 changes: 5 additions & 0 deletions src/lib/MuncherSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ const MuncherSettings = {
isChecked: game.settings.get(SETTINGS.MODULE_ID, "character-update-policy-hp"),
description: "HP",
},
{
name: "xp",
isChecked: game.settings.get(SETTINGS.MODULE_ID, "character-update-policy-xp"),
description: "XP",
},
{
name: "hit-die",
isChecked: game.settings.get(SETTINGS.MODULE_ID, "character-update-policy-hit-die"),
Expand Down
5 changes: 5 additions & 0 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,11 @@ const SETTINGS = {
type: Boolean,
default: true,
},
"character-update-policy-xp": {
scope: "player",
type: Boolean,
default: true,
},
"character-update-policy-spell-use": {
scope: "player",
type: Boolean,
Expand Down

0 comments on commit 08d9b62

Please sign in to comment.