Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
706acab070 | ||
|
|
a9f9d9ce2e | ||
|
|
7b7926674a | ||
|
|
36997c099e | ||
|
|
5aed5629bf |
@@ -29,6 +29,8 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
globals: {
|
globals: {
|
||||||
foundry: "readonly",
|
foundry: "readonly",
|
||||||
|
TokenDocument: "readonly",
|
||||||
|
Babele: "readonly",
|
||||||
AudioHelper: "readonly",
|
AudioHelper: "readonly",
|
||||||
Collection: "readonly",
|
Collection: "readonly",
|
||||||
Hooks: "readonly",
|
Hooks: "readonly",
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
Date format : day/month/year
|
Date format : day/month/year
|
||||||
|
|
||||||
|
## 1.7.1 - 01/04/2022 - Spring fixes
|
||||||
|
- PC/NPC sheet :
|
||||||
|
- Fixed technique with a skill set, in a title, now open the DicePicker as intended.
|
||||||
|
- Roll/DP/RnK :
|
||||||
|
- Fixed the way an actor is lightweight and re-construct from chat message. This fix minions npc sync with multiple token (missing context).
|
||||||
|
- Added "changelog" and "readme" properties in system.json
|
||||||
|
|
||||||
## 1.7.0 - 28/03/2022 - Strife, DiceRoller for Techniques & Npc Generator
|
## 1.7.0 - 28/03/2022 - Strife, DiceRoller for Techniques & Npc Generator
|
||||||
- NPC Sheet :
|
- NPC Sheet :
|
||||||
- Added a random generator feature (Demeanor, Clan and Families names courteously authorized by Edge).
|
- Added a random generator feature (Demeanor, Clan and Families names courteously authorized by Edge).
|
||||||
@@ -33,6 +40,7 @@ Date format : day/month/year
|
|||||||
- Fixed loading properties from custom compendiums.
|
- Fixed loading properties from custom compendiums.
|
||||||
- Added a line strike on removed/unknown property and ability to remove them.
|
- Added a line strike on removed/unknown property and ability to remove them.
|
||||||
- Added Inversion and Mantra icon and tag symbols (thanks to TesserWract).
|
- Added Inversion and Mantra icon and tag symbols (thanks to TesserWract).
|
||||||
|
- Added a Changelog link in system tab.
|
||||||
- Fixed image following the technique_type on technique sheet.
|
- Fixed image following the technique_type on technique sheet.
|
||||||
- Fixed linked actor image compatibility with Tokenizer.
|
- Fixed linked actor image compatibility with Tokenizer.
|
||||||
- Fixed svg height/width for firefox.
|
- Fixed svg height/width for firefox.
|
||||||
|
|||||||
@@ -268,6 +268,30 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
|
|||||||
return this.actor.createEmbeddedDocuments("Item", [itemData]);
|
return this.actor.createEmbeddedDocuments("Item", [itemData]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @inheritdoc */
|
||||||
|
_onDragStart(event) {
|
||||||
|
// Patch Owned Items
|
||||||
|
const li = event.currentTarget;
|
||||||
|
if (li.dataset.itemParentId && li.dataset.itemId) {
|
||||||
|
const item = this.actor.items.get(li.dataset.itemParentId)?.items.get(li.dataset.itemId);
|
||||||
|
if (item) {
|
||||||
|
const dragData = {
|
||||||
|
actorId: this.actor.id,
|
||||||
|
sceneId: this.actor.isToken ? canvas.scene?.id : null,
|
||||||
|
tokenId: this.actor.isToken ? this.actor.token.id : null,
|
||||||
|
pack: this.actor.pack,
|
||||||
|
type: "Item",
|
||||||
|
data: foundry.utils.duplicate(item.data),
|
||||||
|
};
|
||||||
|
dragData.data.data.parent_id = null;
|
||||||
|
event.dataTransfer.setData("text/plain", JSON.stringify(dragData));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Else regular
|
||||||
|
super._onDragStart(event);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscribe to events from the sheet.
|
* Subscribe to events from the sheet.
|
||||||
* @param {jQuery} html HTML content of the sheet.
|
* @param {jQuery} html HTML content of the sheet.
|
||||||
@@ -613,12 +637,12 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
|
|||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_openDicePickerForTechnique(event) {
|
async _openDicePickerForTechnique(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
const itemId = $(event.currentTarget).data("item-id") || null;
|
// Required for tech in titles, search in sub items
|
||||||
const item = this.actor.items.get(itemId);
|
const item = await game.l5r5e.HelpersL5r5e.getEmbedItemByEvent(event, this.actor);
|
||||||
if (!item || item.type !== "technique" || !item.data.data.skill) {
|
if (!item || item.type !== "technique" || !item.data.data.skill) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,13 +370,25 @@ export class RollL5r5e extends Roll {
|
|||||||
roll.data = foundry.utils.duplicate(data.data);
|
roll.data = foundry.utils.duplicate(data.data);
|
||||||
roll.l5r5e = foundry.utils.duplicate(data.l5r5e);
|
roll.l5r5e = foundry.utils.duplicate(data.l5r5e);
|
||||||
|
|
||||||
// get real Actor object
|
// Get real Actor object
|
||||||
if (data.l5r5e.actor) {
|
if (data.l5r5e.actor) {
|
||||||
if (data.l5r5e.actor instanceof game.l5r5e.ActorL5r5e) {
|
if (data.l5r5e.actor instanceof game.l5r5e.ActorL5r5e) {
|
||||||
// duplicate break the object, relink it
|
// Duplicate break the object, relink it
|
||||||
roll.l5r5e.actor = data.l5r5e.actor;
|
roll.l5r5e.actor = data.l5r5e.actor;
|
||||||
} else {
|
} else if (data.l5r5e.actor.uuid) {
|
||||||
// only id, get the object
|
// Only uuid, get the object
|
||||||
|
let actor;
|
||||||
|
let tmpItem = game.l5r5e.HelpersL5r5e.fromUuidNoPack(data.l5r5e.actor.uuid);
|
||||||
|
if (tmpItem instanceof Actor) {
|
||||||
|
actor = tmpItem;
|
||||||
|
} else if (tmpItem instanceof TokenDocument) {
|
||||||
|
actor = tmpItem.actor;
|
||||||
|
}
|
||||||
|
if (actor) {
|
||||||
|
roll.l5r5e.actor = actor;
|
||||||
|
}
|
||||||
|
} else if (data.l5r5e.actor.id) {
|
||||||
|
// Compat old chat message : only id
|
||||||
const actor = game.actors.get(data.l5r5e.actor.id);
|
const actor = game.actors.get(data.l5r5e.actor.id);
|
||||||
if (actor) {
|
if (actor) {
|
||||||
roll.l5r5e.actor = actor;
|
roll.l5r5e.actor = actor;
|
||||||
@@ -398,9 +410,9 @@ export class RollL5r5e extends Roll {
|
|||||||
json.l5r5e = foundry.utils.duplicate(this.l5r5e);
|
json.l5r5e = foundry.utils.duplicate(this.l5r5e);
|
||||||
|
|
||||||
// lightweight the Actor
|
// lightweight the Actor
|
||||||
if (json.l5r5e.actor) {
|
if (json.l5r5e.actor && this.l5r5e.actor?.uuid) {
|
||||||
json.l5r5e.actor = {
|
json.l5r5e.actor = {
|
||||||
id: json.l5r5e.actor._id, // method "id" not exist in json, need to use "_id" here
|
uuid: this.l5r5e.actor.uuid,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,36 @@ export class HelpersL5r5e {
|
|||||||
return CONFIG.l5r5e.roles.map((e) => game.i18n.localize(`l5r5e.roles.${e}`));
|
return CONFIG.l5r5e.roles.map((e) => game.i18n.localize(`l5r5e.roles.${e}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a Document by its Universally Unique Identifier (uuid).
|
||||||
|
* Exactly the same as fromUuid but without Compendium as it need async.
|
||||||
|
* @param {string} uuid The uuid of the Document to retrieve
|
||||||
|
* @return {Document|null}
|
||||||
|
*/
|
||||||
|
static fromUuidNoPack(uuid) {
|
||||||
|
let parts = uuid.split(".");
|
||||||
|
let doc;
|
||||||
|
|
||||||
|
if (parts[0] === "Compendium") {
|
||||||
|
// Compendium Documents need asynchronous
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
// World Documents
|
||||||
|
const [docName, docId] = parts.slice(0, 2);
|
||||||
|
parts = parts.slice(2);
|
||||||
|
const collection = CONFIG[docName].collection.instance;
|
||||||
|
doc = collection.get(docId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Embedded Documents
|
||||||
|
while (doc && parts.length > 1) {
|
||||||
|
const [embeddedName, embeddedId] = parts.slice(0, 2);
|
||||||
|
doc = doc.getEmbeddedDocument(embeddedName, embeddedId);
|
||||||
|
parts = parts.slice(2);
|
||||||
|
}
|
||||||
|
return doc || null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the target object on a drag n drop event, or null if not found
|
* Return the target object on a drag n drop event, or null if not found
|
||||||
* @param {DragEvent} event
|
* @param {DragEvent} event
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable no-undef */
|
|
||||||
export default class HooksL5r5e {
|
export default class HooksL5r5e {
|
||||||
/**
|
/**
|
||||||
* Do anything after initialization but before ready
|
* Do anything after initialization but before ready
|
||||||
@@ -59,7 +58,7 @@ export default class HooksL5r5e {
|
|||||||
case "settings":
|
case "settings":
|
||||||
// Add Changelog link
|
// Add Changelog link
|
||||||
html.find("#game-details .system").append(
|
html.find("#game-details .system").append(
|
||||||
`<p><a href="${game.system.data.url}/-/blob/master/CHANGELOG.md" target="_blank">Changelog</a></p>`
|
`<p><a href="${game.system.data.changelog}" target="_blank">Changelog</a></p>`
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
"title": "Legend of the Five Rings (5th Edition)",
|
"title": "Legend of the Five Rings (5th Edition)",
|
||||||
"description": "This is an authorised multilingual game system En|Fr|Es, for Legend of the Five Rings (5th Edition) by <a href='https://edge-studio.net/'>Edge Studio</a> <p> - Join the official Discord server: <a href='https://discord.gg/foundryvtt'> Official Discord</a></p><p> - Rejoignez la communauté Francophone: <a href='https://discord.gg/pPSDNJk'>Francophone Discord</a></p>",
|
"description": "This is an authorised multilingual game system En|Fr|Es, for Legend of the Five Rings (5th Edition) by <a href='https://edge-studio.net/'>Edge Studio</a> <p> - Join the official Discord server: <a href='https://discord.gg/foundryvtt'> Official Discord</a></p><p> - Rejoignez la communauté Francophone: <a href='https://discord.gg/pPSDNJk'>Francophone Discord</a></p>",
|
||||||
"url": "https://gitlab.com/teaml5r/l5r5e",
|
"url": "https://gitlab.com/teaml5r/l5r5e",
|
||||||
|
"readme": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/README.md",
|
||||||
|
"changelog": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/CHANGELOG.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.7.0/raw/l5r5e.zip?job=build",
|
"download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.7.1/raw/l5r5e.zip?job=build",
|
||||||
"version": "1.7.0",
|
"version": "1.7.1",
|
||||||
"minimumCoreVersion": "9",
|
"minimumCoreVersion": "9",
|
||||||
"compatibleCoreVersion": "9",
|
"compatibleCoreVersion": "9",
|
||||||
"manifestPlusVersion": "1.0.0",
|
"manifestPlusVersion": "1.0.0",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<li class="item technique flexcol" data-item-id="{{technique._id}}">
|
<li class="item technique flexcol" data-item-id="{{technique._id}}" {{#if technique.data.parent_id.item_id}}data-item-parent-id="{{technique.data.parent_id.item_id}}"{{/if}}>
|
||||||
<ul class="item-header technique-controls">
|
<ul class="item-header technique-controls">
|
||||||
<li class="item-img"><img src="{{technique.img}}" title="{{technique.name}}" width="32px" height="32px"/></li>
|
<li class="item-img"><img src="{{technique.img}}" title="{{technique.name}}" width="32px" height="32px"/></li>
|
||||||
<li class="item-name l5r5e-tooltip {{#if technique.data.skill}}dice-picker-tech{{/if}}" data-item-id="{{technique._id}}" {{#if technique.data.parent_id.item_id}}data-item-parent-id="{{technique.data.parent_id.item_id}}"{{/if}}>{{technique.name}}</li>
|
<li class="item-name l5r5e-tooltip {{#if technique.data.skill}}dice-picker-tech{{/if}}" data-item-id="{{technique._id}}" {{#if technique.data.parent_id.item_id}}data-item-parent-id="{{technique.data.parent_id.item_id}}"{{/if}}>{{technique.name}}</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user