Monnaies et armes à distance #563

Merged
uberwald merged 6 commits from VincentVk/foundryvtt-reve-de-dragon:v10 into v10 2022-10-07 23:35:41 +02:00
2 changed files with 13 additions and 13 deletions
Showing only changes of commit d316bba8fa - Show all commits

View File

@ -105,17 +105,6 @@ export class Misc {
return params.reduce((a, b) => a + separator + b); return params.reduce((a, b) => a + separator + b);
} }
static getEntityTypeLabel(entity) {
const documentName = entity?.documentName
const type = entity?.type
if (documentName === 'Actor' || documentName === 'Item') {
const label = CONFIG[documentName]?.typeLabels?.[type] ?? type;
return game.i18n.has(label) ? game.i18n.localize(label) : t;
}
return type;
}
static connectedGMOrUser(ownerId = undefined) { static connectedGMOrUser(ownerId = undefined) {
if (ownerId && game.user.id == ownerId) { if (ownerId && game.user.id == ownerId) {
return ownerId; return ownerId;

View File

@ -1,5 +1,4 @@
import { SYSTEM_RDD } from "./constants.js"; import { SYSTEM_RDD } from "./constants.js";
import { Misc } from "./misc.js";
export class RddCompendiumOrganiser { export class RddCompendiumOrganiser {
static init() { static init() {
@ -17,7 +16,7 @@ export class RddCompendiumOrganiser {
} }
static async setEntityTypeName(pack, element) { static async setEntityTypeName(pack, element) {
const label = Misc.getEntityTypeLabel(await pack.getDocument(element.dataset.documentId)); const label = RddCompendiumOrganiser.getEntityTypeLabel(await pack.getDocument(element.dataset.documentId));
RddCompendiumOrganiser.insertEntityType(element, label); RddCompendiumOrganiser.insertEntityType(element, label);
} }
@ -27,4 +26,16 @@ export class RddCompendiumOrganiser {
} }
} }
static getEntityTypeLabel(entity) {
const documentName = entity?.documentName
const type = entity?.type
if (documentName === 'Actor' || documentName === 'Item') {
const label = CONFIG[documentName]?.typeLabels?.[type] ?? type;
return game.i18n.has(label) ? game.i18n.localize(label) : t;
}
return type;
}
} }