Améliorer le choix du type d'objet à créer #143
Utilisation du fichier de langue Utilisation de la même référence pour les compendiums Fix sur les compendium, le type n'apparaissait pas toujours
This commit is contained in:
@ -108,6 +108,16 @@ export class Misc {
|
||||
return Misc.data(it)?.data ?? {}
|
||||
}
|
||||
|
||||
static getEntityTypeLabel(entity) {
|
||||
const documentName = entity?.documentName;
|
||||
const type = entity?.data.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) {
|
||||
if (ownerId && game.user.id == ownerId) {
|
||||
return ownerId;
|
||||
|
Reference in New Issue
Block a user