Gestion des blocs secrets dans les descriptions
This commit is contained in:
parent
b87f406093
commit
7e736a00d7
@ -3,6 +3,7 @@
|
|||||||
- on peut ajouter des liens "jet de dés" dans les descriptions, notes, ...
|
- on peut ajouter des liens "jet de dés" dans les descriptions, notes, ...
|
||||||
- les liens "jet de dés" peuvent être utilisés pour un acteur, ou les items de l'acteurs
|
- les liens "jet de dés" peuvent être utilisés pour un acteur, ou les items de l'acteurs
|
||||||
- les liens "jet de dés" d'"un item non lié à un acteur agit sur les tokens sélectionnés
|
- les liens "jet de dés" d'"un item non lié à un acteur agit sur les tokens sélectionnés
|
||||||
|
- gestion des blocs secrets dans les descriptions
|
||||||
|
|
||||||
## 12.0.33 - la vieillesse d'Astrobazzarh
|
## 12.0.33 - la vieillesse d'Astrobazzarh
|
||||||
- retour de l'expérience pour les joueurs
|
- retour de l'expérience pour les joueurs
|
||||||
|
@ -45,8 +45,8 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
cssClass: this.isEditable ? "editable" : "locked",
|
cssClass: this.isEditable ? "editable" : "locked",
|
||||||
limited: this.actor.limited,
|
limited: this.actor.limited,
|
||||||
owner: this.actor.isOwner,
|
owner: this.actor.isOwner,
|
||||||
biographie: await RdDTextEditor.enrichHTML(this.actor.system.biographie),
|
biographie: await RdDTextEditor.enrichHTML(this.actor.system.biographie, this.actor),
|
||||||
notes: await RdDTextEditor.enrichHTML(this.actor.system.notes),
|
notes: await RdDTextEditor.enrichHTML(this.actor.system.notes, this.actor),
|
||||||
});
|
});
|
||||||
foundry.utils.mergeObject(formData.calc, {
|
foundry.utils.mergeObject(formData.calc, {
|
||||||
surenc: this.actor.computeMalusSurEncombrement(),
|
surenc: this.actor.computeMalusSurEncombrement(),
|
||||||
|
@ -36,8 +36,8 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
img: this.actor.img,
|
img: this.actor.img,
|
||||||
name: this.actor.name,
|
name: this.actor.name,
|
||||||
system: this.actor.system,
|
system: this.actor.system,
|
||||||
description: await RdDTextEditor.enrichHTML(this.actor.system.description),
|
description: await RdDTextEditor.enrichHTML(this.actor.system.description, this.actor),
|
||||||
notesmj: await RdDTextEditor.enrichHTML(this.actor.system.notesmj),
|
notesmj: await RdDTextEditor.enrichHTML(this.actor.system.notesmj, this.actor),
|
||||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.actor, this.isEditable),
|
options: RdDSheetUtility.mergeDocumentRights(this.options, this.actor, this.isEditable),
|
||||||
effects: this.actor.effects
|
effects: this.actor.effects
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,14 @@ import { ACTOR_TYPES } from "../item.js";
|
|||||||
const XREGEXP_ROLL = XRegExp("@roll\\[(?<carac>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+)(\\/(?<competence>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+))?(/(?<diff>[\\+\\-]?\\d+))?\\]", 'giu')
|
const XREGEXP_ROLL = XRegExp("@roll\\[(?<carac>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+)(\\/(?<competence>[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+))?(/(?<diff>[\\+\\-]?\\d+))?\\]", 'giu')
|
||||||
|
|
||||||
export class RdDTextEditor {
|
export class RdDTextEditor {
|
||||||
static async enrichHTML(text) {
|
static async enrichHTML(text, object) {
|
||||||
const rddTextEditor = new RdDTextEditor(text)
|
const rddTextEditor = new RdDTextEditor(text)
|
||||||
const replacedRolls = await rddTextEditor.replaceRolls()
|
const replacedRolls = await rddTextEditor.replaceRolls()
|
||||||
return await TextEditor.enrichHTML(replacedRolls, { async: true })
|
return await TextEditor.enrichHTML(replacedRolls, {
|
||||||
|
relativeTo: object,
|
||||||
|
secrets: object?.isOwner,
|
||||||
|
async: true
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(text) {
|
constructor(text) {
|
||||||
|
@ -98,8 +98,8 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
name: this.item.name,
|
name: this.item.name,
|
||||||
system: this.item.system,
|
system: this.item.system,
|
||||||
actorId: this.actor?.id,
|
actorId: this.actor?.id,
|
||||||
description: await RdDTextEditor.enrichHTML(this.item.system.description),
|
description: await RdDTextEditor.enrichHTML(this.item.system.description, this.item),
|
||||||
descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj),
|
descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj, this.item),
|
||||||
isComestible: this.item.getUtilisationCuisine(),
|
isComestible: this.item.getUtilisationCuisine(),
|
||||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
||||||
competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage),
|
competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage),
|
||||||
@ -121,18 +121,18 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
formData.competences = formData.competences.filter(it => it.isCompetenceArme())
|
formData.competences = formData.competences.filter(it => it.isCompetenceArme())
|
||||||
}
|
}
|
||||||
if (this.item.type == ITEM_TYPES.recettecuisine) {
|
if (this.item.type == ITEM_TYPES.recettecuisine) {
|
||||||
formData.ingredients = await RdDTextEditor.enrichHTML(this.object.system.ingredients)
|
formData.ingredients = await RdDTextEditor.enrichHTML(this.item.system.ingredients, this.item)
|
||||||
}
|
}
|
||||||
if (this.item.type == ITEM_TYPES.extraitpoetique) {
|
if (this.item.type == ITEM_TYPES.extraitpoetique) {
|
||||||
formData.extrait = await RdDTextEditor.enrichHTML(this.object.system.extrait)
|
formData.extrait = await RdDTextEditor.enrichHTML(this.item.system.extrait, this.item)
|
||||||
formData.texte = await RdDTextEditor.enrichHTML(this.object.system.texte)
|
formData.texte = await RdDTextEditor.enrichHTML(this.item.system.texte, this.item)
|
||||||
}
|
}
|
||||||
if (this.item.type == ITEM_TYPES.recettealchimique) {
|
if (this.item.type == ITEM_TYPES.recettealchimique) {
|
||||||
const manipulation = RdDAlchimie.processManipulation(this.item, this.actor?.id);
|
const manipulation = RdDAlchimie.processManipulation(this.item, this.actor?.id);
|
||||||
formData.manipulation = await RdDTextEditor.enrichHTML(manipulation)
|
formData.manipulation = await RdDTextEditor.enrichHTML(manipulation, this.item)
|
||||||
formData.utilisation = await RdDTextEditor.enrichHTML(this.object.system.utilisation)
|
formData.utilisation = await RdDTextEditor.enrichHTML(this.item.system.utilisation, this.item)
|
||||||
formData.enchantement = await RdDTextEditor.enrichHTML(this.object.system.enchantement)
|
formData.enchantement = await RdDTextEditor.enrichHTML(this.item.system.enchantement, this.item)
|
||||||
formData.sureffet = await RdDTextEditor.enrichHTML(this.object.system.sureffet)
|
formData.sureffet = await RdDTextEditor.enrichHTML(this.item.system.sureffet, this.item)
|
||||||
}
|
}
|
||||||
if (this.item.type == ITEM_TYPES.gemme) {
|
if (this.item.type == ITEM_TYPES.gemme) {
|
||||||
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
||||||
|
@ -128,7 +128,7 @@ export class SystemReveDeDragon {
|
|||||||
console.log(`Initializing Reve de Dragon System Settings`)
|
console.log(`Initializing Reve de Dragon System Settings`)
|
||||||
|
|
||||||
// preload handlebars templates
|
// preload handlebars templates
|
||||||
RdDUtility.preloadHandlebarsTemplates()
|
await RdDUtility.preloadHandlebarsTemplates()
|
||||||
AppPersonnageAleatoire.preloadHandlebars()
|
AppPersonnageAleatoire.preloadHandlebars()
|
||||||
RdDItemSort.preloadHandlebars()
|
RdDItemSort.preloadHandlebars()
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ export class RdDUtility {
|
|||||||
Handlebars.registerHelper('typeTmr-name', type => TMRUtility.typeTmrName(type));
|
Handlebars.registerHelper('typeTmr-name', type => TMRUtility.typeTmrName(type));
|
||||||
Handlebars.registerHelper('effetRencontre-name', coord => TMRUtility.typeTmrName(coord));
|
Handlebars.registerHelper('effetRencontre-name', coord => TMRUtility.typeTmrName(coord));
|
||||||
|
|
||||||
return loadTemplates(templatePaths);
|
await loadTemplates(templatePaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getItem(itemId, actorId = undefined) {
|
static getItem(itemId, actorId = undefined) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user