Compare commits

...

3 Commits

Author SHA1 Message Date
Vlyan
1dce3a5444 v1.9.2 - Advancements ownership fix 2022-09-09 09:49:40 +02:00
Vlyan
b04ac12636 v1.9.1 - Advancements Bugfixes 2022-09-08 11:09:17 +02:00
Vlyan
3a674fd0f4 Fix for advancements fail to add new items ("_id" readonly error. see #42) 2022-09-08 09:44:32 +02:00
6 changed files with 23 additions and 11 deletions

View File

@@ -1,6 +1,12 @@
# Changelog # Changelog
Date format : day/month/year Date format : day/month/year
## 1.9.2 - 09/09/2022 - Advancements Again
- Fix for advancements ownership (items in items).
## 1.9.1 - 08/09/2022 - Advancements Bugfixes
- Fix for advancements fail to add new items ("_id" readonly error. see #42).
## 1.9.0 - 01/09/2022 - Foundry v10 Compatibility ## 1.9.0 - 01/09/2022 - Foundry v10 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 !__
- Updated the System to FoundryVTT v10. - Updated the System to FoundryVTT v10.

View File

@@ -2,6 +2,7 @@
![Banner Legend of the Five Rings](./l5rBan.jpg) ![Banner Legend of the Five Rings](./l5rBan.jpg)
[![Buy Me a Coffee](./tags-bymecoffee.svg)](https://ko-fi.com/vlyan) [![Buy Me a Coffee](./tags-bymecoffee.svg)](https://ko-fi.com/vlyan)
[![FoundryVTT version](https://img.shields.io/badge/FVTT-v10.x-informational)](https://foundryvtt.com/)
[![Forge Installs](https://img.shields.io/badge/dynamic/json?label=Forge%20Installs&query=package.installs&suffix=%25&url=https%3A%2F%2Fforge-vtt.com%2Fapi%2Fbazaar%2Fpackage%2Fl5r5e&colorB=4aa94a)](https://forge-vtt.com/bazaar#package=l5r5e) [![Forge Installs](https://img.shields.io/badge/dynamic/json?label=Forge%20Installs&query=package.installs&suffix=%25&url=https%3A%2F%2Fforge-vtt.com%2Fapi%2Fbazaar%2Fpackage%2Fl5r5e&colorB=4aa94a)](https://forge-vtt.com/bazaar#package=l5r5e)
[![Foundry Hub Endorsements](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fendorsements)](https://www.foundryvtt-hub.com/package/l5r5e/) [![Foundry Hub Endorsements](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fendorsements)](https://www.foundryvtt-hub.com/package/l5r5e/)
[![Foundry Hub Comments](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fcomments)](https://www.foundryvtt-hub.com/package/l5r5e/) [![Foundry Hub Comments](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fcomments)](https://www.foundryvtt-hub.com/package/l5r5e/)

View File

@@ -135,14 +135,14 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
async _onDrop(event) { async _onDrop(event) {
// *** Everything below here is only needed if the sheet is editable *** // *** Everything below here is only needed if the sheet is editable ***
if (!this.isEditable || this.actor.system.soft_locked) { if (!this.isEditable || this.actor.system.soft_locked) {
console.log("LR5E | Not editable"); console.log("L5R5E | This sheet is not editable");
return; return;
} }
// Check item type and subtype // Check item type and subtype
const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
if (!item || !["Item", "JournalEntry"].includes(item.documentName) || item.type === "property") { if (!item || !["Item", "JournalEntry"].includes(item.documentName) || item.type === "property") {
console.log(`LR5E | Wrong subtype ${item?.type}`, item); console.log(`L5R5E | Wrong subtype ${item?.type}`, item);
return; return;
} }
@@ -150,7 +150,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
if (item.documentName === "JournalEntry") { if (item.documentName === "JournalEntry") {
// npc does not have this // npc does not have this
if (!this.actor.system.identity?.school_curriculum_journal) { if (!this.actor.system.identity?.school_curriculum_journal) {
console.log("LR5E | NPC won't go to school :'("); console.log("L5R5E | NPC won't go to school :'(");
return; return;
} }
this.actor.system.identity.school_curriculum_journal = { this.actor.system.identity.school_curriculum_journal = {
@@ -180,7 +180,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
return embedItem._id === item._id; return embedItem._id === item._id;
}) })
) { ) {
console.log("LR5E | This item already exist in this actor", item.uuid); console.log("L5R5E | This element has been ignored because it already exists in this actor", item.uuid);
return; return;
} }

View File

@@ -216,12 +216,17 @@ export class ItemL5r5e extends Item {
} }
// New id // New id
if (newId) { if (newId || !item._id) {
item._id = foundry.utils.randomID(); // Bypass the readonly for "_id"
const tmpData = item.toJSON();
tmpData._id = foundry.utils.randomID();
item = new ItemL5r5e(tmpData);
} }
// Copy the parent permission to the sub item // Copy the parent permission to the sub item
item.ownership = this.ownership; // In v10 actor's items inherit the ownership from the actor, but theirs ownership do not reflect that.
// So we must take actor's ownership for sub-item
item.ownership = this.actor?.ownership ?? this.ownership;
// Tag parent (flags won't work as we have no id in db) // Tag parent (flags won't work as we have no id in db)
item.system.parent_id = this.getParentsIds(); item.system.parent_id = this.getParentsIds();

View File

@@ -7,11 +7,11 @@
"changelog": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/CHANGELOG.md", "changelog": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/CHANGELOG.md",
"license": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/LICENSE.md", "license": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/LICENSE.md",
"manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json", "manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json",
"download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.9.0/raw/l5r5e.zip?job=build", "download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.9.2/raw/l5r5e.zip?job=build",
"version": "1.9.0", "version": "1.9.2",
"compatibility": { "compatibility": {
"minimum": 10, "minimum": 10,
"verified": "10.283" "verified": "10.284"
}, },
"manifestPlusVersion": "1.2.0", "manifestPlusVersion": "1.2.0",
"socket": true, "socket": true,

View File

@@ -24,7 +24,7 @@ Nothing fancy, just accept when FoundryVTT prompt you to download or activate th
| Module name | Notes | | Module name | Notes |
|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Babele](https://foundryvtt.com/packages/babele) | Required for non english compendium translation | | [Babele](https://foundryvtt.com/packages/babele) | Required for non english compendium translation |
| [Permission Viewer](https://foundryvtt.com/packages/permission_viewer) | Lets you see instantly who has permissions to see what item | | [Ownership Viewer](https://foundryvtt.com/packages/permission_viewer) | Lets you see instantly who has permissions to see what item |
| [Dice So Nice!](https://foundryvtt.com/packages/dice-so-nice) | Add 3D dices that bounce on the screen when you roll dice | | [Dice So Nice!](https://foundryvtt.com/packages/dice-so-nice) | Add 3D dices that bounce on the screen when you roll dice |
| [Small Legend of the 5 Rings Tools](https://foundryvtt.com/packages/l5r-dragruler) | Series of tools for L5R | | [Small Legend of the 5 Rings Tools](https://foundryvtt.com/packages/l5r-dragruler) | Series of tools for L5R |
| [Search Anywhere](https://foundryvtt.com/packages/searchanywhere) | Don't spent too much time searching the right technique | | [Search Anywhere](https://foundryvtt.com/packages/searchanywhere) | Don't spent too much time searching the right technique |