v12 fixes

- Added French translation for "level zero" folders (packFolders)
- Fix for check link
- Fix for journal with Babele
This commit is contained in:
Vlyan
2024-06-08 15:48:45 +02:00
parent bd508092ec
commit 7c0d583031
6 changed files with 1633 additions and 458 deletions

View File

@@ -614,7 +614,10 @@ export class HelpersL5r5e {
// Create the link
let link = null;
if (document._stats?.compendiumSource) {
if (!document.actor && HelpersL5r5e.isLinkValid(document.link)) {
link = document.link;
}
if (!link && document._stats?.compendiumSource) {
link = document._stats.compendiumSource.replace(/(\w+)\.(.+)/, "@$1[$2]");
if (!HelpersL5r5e.isLinkValid(link)) {
link = null;
@@ -626,12 +629,6 @@ export class HelpersL5r5e {
link = null;
}
}
if (!link && !document.actor) {
link = document.link;
if (!HelpersL5r5e.isLinkValid(link)) {
link = null;
}
}
// Send to Chat
return ChatMessage.create({
@@ -646,7 +643,7 @@ export class HelpersL5r5e {
*/
static async isLinkValid(link) {
const [type, target] = link.replace(/@(\w+)\[([^\]]+)\].*/, "$1|$2").split("|");
const document = await fromUuid(`${type}.${target}`);
const document = await fromUuid((type === 'UUID' ? target : `${type}.${target}`));
return !!document;
}