forked from public/foundryvtt-reve-de-dragon
Ajouter de "jet de dés" dans les descriptions,
On peut maintenant ajouter des liens dans les descriptions (acteurs, items) et autres champs similaires.
This commit is contained in:
@ -12,8 +12,9 @@ import { SystemCompendiums } from "./settings/system-compendiums.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||
import { ITEM_TYPES, RdDItem } from "./item.js";
|
||||
import { ACTOR_TYPES, ITEM_TYPES, RdDItem } from "./item.js";
|
||||
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
||||
import { RdDTextEditor } from "./apps/rdd-text-roll.js";
|
||||
|
||||
/**
|
||||
* Extend the basic ItemSheet for RdD specific items
|
||||
@ -97,11 +98,11 @@ export class RdDItemSheet extends ItemSheet {
|
||||
name: this.item.name,
|
||||
system: this.item.system,
|
||||
actorId: this.actor?.id,
|
||||
description: await TextEditor.enrichHTML(this.item.system.description, { async: true }),
|
||||
descriptionmj: await TextEditor.enrichHTML(this.item.system.descriptionmj, { async: true }),
|
||||
description: await RdDTextEditor.enrichHTML(this.item.system.description),
|
||||
descriptionmj: await RdDTextEditor.enrichHTML(this.item.system.descriptionmj),
|
||||
isComestible: this.item.getUtilisationCuisine(),
|
||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
||||
competences: await SystemCompendiums.getCompetences('personnage'),
|
||||
competences: await SystemCompendiums.getCompetences(ACTOR_TYPES.personnage),
|
||||
categories: RdDItem.getCategories(this.item.type),
|
||||
}
|
||||
|
||||
@ -120,18 +121,18 @@ export class RdDItemSheet extends ItemSheet {
|
||||
formData.competences = formData.competences.filter(it => it.isCompetenceArme())
|
||||
}
|
||||
if (this.item.type == ITEM_TYPES.recettecuisine) {
|
||||
formData.ingredients = await TextEditor.enrichHTML(this.object.system.ingredients, { async: true })
|
||||
formData.ingredients = await RdDTextEditor.enrichHTML(this.object.system.ingredients)
|
||||
}
|
||||
if (this.item.type == ITEM_TYPES.extraitpoetique) {
|
||||
formData.extrait = await TextEditor.enrichHTML(this.object.system.extrait, { async: true })
|
||||
formData.texte = await TextEditor.enrichHTML(this.object.system.texte, { async: true })
|
||||
formData.extrait = await RdDTextEditor.enrichHTML(this.object.system.extrait)
|
||||
formData.texte = await RdDTextEditor.enrichHTML(this.object.system.texte)
|
||||
}
|
||||
if (this.item.type == ITEM_TYPES.recettealchimique) {
|
||||
RdDAlchimie.processManipulation(this.item, this.actor?.id);
|
||||
formData.manipulation_update = await TextEditor.enrichHTML(this.object.system.manipulation_update, { async: true })
|
||||
formData.utilisation = await TextEditor.enrichHTML(this.object.system.utilisation, { async: true })
|
||||
formData.enchantement = await TextEditor.enrichHTML(this.object.system.enchantement, { async: true })
|
||||
formData.sureffet = await TextEditor.enrichHTML(this.object.system.sureffet, { async: true })
|
||||
const manipulation = RdDAlchimie.processManipulation(this.item, this.actor?.id);
|
||||
formData.manipulation = await RdDTextEditor.enrichHTML(manipulation)
|
||||
formData.utilisation = await RdDTextEditor.enrichHTML(this.object.system.utilisation)
|
||||
formData.enchantement = await RdDTextEditor.enrichHTML(this.object.system.enchantement)
|
||||
formData.sureffet = await RdDTextEditor.enrichHTML(this.object.system.sureffet)
|
||||
}
|
||||
if (this.item.type == ITEM_TYPES.gemme) {
|
||||
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
||||
@ -207,6 +208,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
this.html.find('.creer-potion-base').click((event) => this._getEventActor(event).actionHerbe(this.item));
|
||||
this.html.find('input[name="system.cacher_points_de_tache"]').change(async event => await this.item.update({ 'system.cacher_points_de_tache': event.currentTarget.checked }));
|
||||
|
||||
this.html.find('.roll-carac-competence').click(async event => await RdDTextEditor.rollText(event, this.actor))
|
||||
this.html.find('.alchimie-tache a').click((event) => {
|
||||
let actor = this._getEventActor(event);
|
||||
if (actor) {
|
||||
@ -272,7 +274,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
}
|
||||
}
|
||||
|
||||
async supprimerBonusCase(deleteCoord){
|
||||
async supprimerBonusCase(deleteCoord) {
|
||||
if (this.item.type == ITEM_TYPES.sort) {
|
||||
const oldList = RdDItemSort.getBonusCaseList(this.item)
|
||||
const newList = oldList.filter(it => it.case != deleteCoord);
|
||||
|
Reference in New Issue
Block a user