Change token name too ;)
This commit is contained in:
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
## 1.3.1 - Scholar helper
|
## 1.3.1 - Scholar helper
|
||||||
- Added a Journal Compendium for School Curriculums.
|
- Added a Journal Compendium for School Curriculums.
|
||||||
- Fix for the "bought_at_rank" value when an Item was on dropped on a sheet.
|
- Added Curriculums in description for Titles.
|
||||||
- Fix for issue #23 "Token image does not save".
|
|
||||||
- Added English Compendiums for Field of Victory (thanks to mdosantos !).
|
- Added English Compendiums for Field of Victory (thanks to mdosantos !).
|
||||||
|
- Fix for the "bought_at_rank" does not change according to the PC rank value when an Item is drop on a sheet.
|
||||||
|
- Fix for issue #23 "Token image does not save". Now we reflect the change on the token name/image only if it's a linked actor and if the token/sheet have the same values.
|
||||||
|
|
||||||
## 1.3.0 - Foundry 0.8 Compatibility
|
## 1.3.0 - Foundry 0.8 Compatibility
|
||||||
__! Be certain to carefully back up any critical user data before installing this update !__
|
__! Be certain to carefully back up any critical user data before installing this update !__
|
||||||
|
|||||||
@@ -69,14 +69,18 @@ export class ActorL5r5e extends Actor {
|
|||||||
data["_id"] = this.id;
|
data["_id"] = this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the token image if the sheet image changed, but only if they are the same and linked to actor
|
// Only on linked Actor
|
||||||
if (
|
if (data.token?.actorLink || (data.token?.actorLink === undefined && this.data.token.actorLink)) {
|
||||||
data.img &&
|
// Update the token name/image if the sheet name/image changed, but only if they was previously the same
|
||||||
this.data.img === this.data.token.img &&
|
["name", "img"].forEach((fieldName) => {
|
||||||
this.data.img !== data.img &&
|
if (
|
||||||
(data.token?.actorLink || (data.token?.actorLink === undefined && this.data.token.actorLink))
|
data[fieldName] &&
|
||||||
) {
|
this.data[fieldName] === this.data.token[fieldName] &&
|
||||||
data["token.img"] = data.img;
|
this.data[fieldName] !== data[fieldName]
|
||||||
|
) {
|
||||||
|
data["token." + fieldName] = data[fieldName];
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now using updateDocuments
|
// Now using updateDocuments
|
||||||
|
|||||||
Reference in New Issue
Block a user