From 3b33dd0c9c3a7cce4559054a421005fa248f564d Mon Sep 17 00:00:00 2001 From: Vlyan Date: Mon, 21 Dec 2020 12:13:21 +0100 Subject: [PATCH] Fix for actor img not linked on token when change Item class moved out of item's sheets folder --- system/lang/fr-fr.json | 2 +- system/scripts/actor.js | 12 ++++++++++++ system/scripts/{items => }/item.js | 0 system/scripts/main-l5r5e.js | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) rename system/scripts/{items => }/item.js (100%) diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index 3989a1d..7de3f01 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -113,7 +113,7 @@ "rank": "Rang", "name": "Nom", "social": { - "title": "Position Social", + "title": "Position Sociale", "honor": "Honneur", "glory": "Gloire", "status": "Status", diff --git a/system/scripts/actor.js b/system/scripts/actor.js index 08c8b5a..024281f 100644 --- a/system/scripts/actor.js +++ b/system/scripts/actor.js @@ -57,6 +57,18 @@ export class ActorL5r5e extends Actor { await super.create(data, options); } + /** + * Entity-specific actions that should occur when the Entity is updated + * @override + */ + update(data, options = {}) { + // Fix for token image unliked from character... dunno why + if (data.img) { + data["token.img"] = data.img; + } + return super.update(data, options); + } + /** @override */ prepareData() { super.prepareData(); diff --git a/system/scripts/items/item.js b/system/scripts/item.js similarity index 100% rename from system/scripts/items/item.js rename to system/scripts/item.js diff --git a/system/scripts/main-l5r5e.js b/system/scripts/main-l5r5e.js index c61386f..e526db3 100644 --- a/system/scripts/main-l5r5e.js +++ b/system/scripts/main-l5r5e.js @@ -14,7 +14,7 @@ import { RingDie } from "./dice/dietype/ring-die.js"; import { RollL5r5e } from "./dice/roll.js"; import { DicePickerDialog } from "./dice/dice-picker-dialog.js"; // Items -import { ItemL5r5e } from "./items/item.js"; +import { ItemL5r5e } from "./item.js"; import { ItemSheetL5r5e } from "./items/item-sheet.js"; import { ArmorSheetL5r5e } from "./items/armor-sheet.js"; import { WeaponSheetL5r5e } from "./items/weapon-sheet.js";