diff --git a/changelog.md b/changelog.md index 6ee771d3..25556b34 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,13 @@ # 11.2 +## 11.2.17 - Le cache-oeil d'Akarlikarlikar +- Le titre des fenêtre d'objet affiche de nouveau le type traduit +- Les tooltips des boutons edit/delete sont maintenant en Français +- La case à cocher "Cacher les points de tâches" fonctionne de nouveau +- Les personnages non-liés ne sont plus dans les liste de personnages joueurs pour le repos, le stress, la fatigue +- L'utilisation de Thanatos est visible dans l'onglet Haut-Rêve pour indiquer que la prochaine queue est une ombre +- La fenêtre des TMRs ne devrait plus afficher une zone noire au lieu de la carte. -## 11.2.16 - La Tri d'Akarlikarlikar +## 11.2.16 - Le Tri d'Akarlikarlikar - Tri alphabétique des items dans la fenêtre de création - Mise à jour comptage de monde diff --git a/module/actor.js b/module/actor.js index 7f33f5a4..9b2ae3f2 100644 --- a/module/actor.js +++ b/module/actor.js @@ -95,25 +95,27 @@ export class RdDActor extends RdDBaseActorSang { return ![TYPES.competencecreature, TYPES.tarot, TYPES.service].includes(item.type) } + isPersonnageJoueur() { + return this.hasPlayerOwner && this.prototypeToken.actorLink + } + isPersonnage() { return true } isHautRevant() { return this.system.attributs.hautrevant.value != "" } /* -------------------------------------------- */ - getAgilite() { return Number(this.system.carac.agilite?.value ?? 0) } - getChance() { return Number(this.system.carac.chance?.value ?? 0) } + getAgilite() { return this.system.carac.agilite?.value ?? 0 } + getChance() { return this.system.carac.chance?.value ?? 0 } - getReveActuel() { return Misc.toInt(this.system.reve?.reve?.value ?? this.carac.reve.value) } - getChanceActuel() { return Misc.toInt(this.system.compteurs.chance?.value ?? 10) } - getMoralTotal() { return Number(this.system.compteurs.moral?.value ?? 0) } + getReveActuel() { return this.system.reve?.reve?.value ?? this.carac.reve.value ?? 0 } + getChanceActuel() { return this.system.compteurs.chance?.value ?? 10 } + getMoralTotal() { return this.system.compteurs.moral?.value ?? 0 } /* -------------------------------------------- */ getEtatGeneral(options = { ethylisme: false }) { - const etatGeneral = Misc.toInt(this.system.compteurs.etat?.value) - if (options.ethylisme) { - // Pour les jets d'Ethylisme, on retire le malus d'éthylisme (p.162) - return etatGeneral - this.malusEthylisme() - } - return etatGeneral + const etatGeneral = this.system.compteurs.etat?.value ?? 0 + // Pour les jets d'Ethylisme, on retire le malus d'éthylisme (p.162) + const annuleMalusEthylisme = options.ethylisme ? this.malusEthylisme() : 0 + return etatGeneral - annuleMalusEthylisme } /* -------------------------------------------- */ diff --git a/module/actor/base-actor.js b/module/actor/base-actor.js index 2cd4f79c..acc22ee4 100644 --- a/module/actor/base-actor.js +++ b/module/actor/base-actor.js @@ -85,6 +85,8 @@ export class RdDBaseActor extends Actor { return game.actors.get(actorId) } + isPersonnageJoueur() { return false } + static extractActorMin = (actor) => { return { id: actor?.id, type: actor?.type, name: actor?.name, img: actor?.img }; }; static getParentActor(document) { diff --git a/module/actor/experience-log.js b/module/actor/experience-log.js index 2d60ed9e..ad282e78 100644 --- a/module/actor/experience-log.js +++ b/module/actor/experience-log.js @@ -12,7 +12,7 @@ export const XP_TOPIC = { export class ExperienceLog { static async add(actor, topic, from, to, raison, manuel = false) { - if (!actor.hasPlayerOwner || !actor.isPersonnage()) { + if (!actor.isPersonnageJoueur()) { return } if (from == to) { diff --git a/module/misc.js b/module/misc.js index 10edee27..5f4d6fad 100644 --- a/module/misc.js +++ b/module/misc.js @@ -46,7 +46,7 @@ export class Misc { } static typeName(type, subType) { - return subType ? game.i18n.localize(`TYPES.${type}.${Misc.upperFirst(subType)}`) + return subType ? game.i18n.localize(`TYPES.${type}.${subType}`) : ''; } diff --git a/module/rdd-commands.js b/module/rdd-commands.js index fdf88956..88b08dc3 100644 --- a/module/rdd-commands.js +++ b/module/rdd-commands.js @@ -463,14 +463,13 @@ export class RdDCommands { let motif = params.slice(1, params.length - 2); let name = params[params.length - 1]; + const personnages = game.actors.filter(actor => actor.isPersonnageJoueur()); if (name == undefined) { - for (let actor of game.actors) { - // TODO: ne plus stresser les entités de cauchemar! + for (let actor of personnages) { await actor.distribuerStress('stress', stress, motif); } } else { - //console.log(stressValue, nomJoueur); - let actor = Misc.findActor(name, game.actors.filter(it => it.hasPlayerOwner)) ?? Misc.findPlayer(name)?.character + let actor = Misc.findActor(name, personnages) ?? Misc.findPlayer(name)?.character if (actor) { await actor.distribuerStress('stress', stress, motif); } diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index bfd3cc96..4e497720 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -44,16 +44,15 @@ export class RdDTMRDialog extends Dialog { type: Number, range: TMR_DISPLAY_SIZE.range }) - await PixiTMR.init() } static async create(actor, tmrData) { + await PixiTMR.init() let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html', tmrData); - if (tmrData.mode != 'visu' && !game.user.isGM) { ChatMessage.create({ content: actor.name + " est monté dans les TMR en mode : " + tmrData.mode, whisper: ChatMessage.getWhisperRecipients("GM") }); } - return new RdDTMRDialog(html, actor, tmrData); + return new RdDTMRDialog(html, actor, tmrData) } /* -------------------------------------------- */ @@ -298,13 +297,12 @@ export class RdDTMRDialog extends Dialog { /* -------------------------------------------- */ async updateValuesDisplay() { - if (!this.rendered) { + if (this.viewOnly || !this.rendered) { return; } const coord = this._getCoordActor(); - HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord)); - + let ptsreve = document.getElementById("tmr-pointsreve-value"); ptsreve.innerHTML = this.actor.system.reve.reve.value; diff --git a/module/sommeil/app-astrologie.js b/module/sommeil/app-astrologie.js index d993eaf7..bd09f0ed 100644 --- a/module/sommeil/app-astrologie.js +++ b/module/sommeil/app-astrologie.js @@ -85,7 +85,7 @@ export class AppAstrologie extends Application { const nbAstral = calendrier.getNombreAstral() const heures = RdDTimestamp.heures(); return { - ajustementsActors: game.actors.filter(it => it.isPersonnage() && it.hasPlayerOwner) + ajustementsActors:game.actors.filter(actor => actor.isPersonnageJoueur()) .map(actor => this.getAjustementActor(actor, nbAstral, heures)), nombresAstraux: calendrier.getNombresAstraux().map(na => this.getDetailNombreAstral(na)) } diff --git a/module/sommeil/dialog-chateau-dormant.js b/module/sommeil/dialog-chateau-dormant.js index 49faa706..0a928e29 100644 --- a/module/sommeil/dialog-chateau-dormant.js +++ b/module/sommeil/dialog-chateau-dormant.js @@ -3,10 +3,8 @@ export class DialogChateauDormant extends Dialog { static async create() { const date = game.system.rdd.calendrier.dateCourante(); - const actors = game.actors.filter(actor => actor.hasPlayerOwner && actor.isPersonnage()); - const dialogData = { - actors: actors, + actors: game.actors.filter(actor => actor.isPersonnageJoueur()), date: date, motifStress: `Nuit du ${date}`, finChateauDormant: game.system.rdd.calendrier.getTimestampFinChateauDormant() diff --git a/module/sommeil/dialog-stress.js b/module/sommeil/dialog-stress.js index fd413798..1a6502f2 100644 --- a/module/sommeil/dialog-stress.js +++ b/module/sommeil/dialog-stress.js @@ -6,7 +6,7 @@ export class DialogStress extends Dialog { motif: "Motif", stress: 10, immediat: false, - actors: game.actors.filter(actor => actor.hasPlayerOwner && actor.isPersonnage()) + actors: game.actors.filter(actor => actor.isPersonnageJoueur()) .map(actor => ({ id: actor.id, name: actor.name, diff --git a/module/tmr/pixi-tmr.js b/module/tmr/pixi-tmr.js index ce0f32de..781e138b 100644 --- a/module/tmr/pixi-tmr.js +++ b/module/tmr/pixi-tmr.js @@ -1,4 +1,3 @@ -import { SYSTEM_RDD } from "../constants.js"; import { Misc } from "../misc.js"; import { TMRConstants, tmrTokenZIndex } from "../tmr-constants.js"; import { TMRUtility } from "../tmr-utility.js"; @@ -14,12 +13,12 @@ export class PixiTMR { static register(name, img) { PixiTMR.textures[name] = img; } + static async init() { await Promise.all( Object.values(PixiTMR.textures) - .filter(img => img != undefined) - .map(async img => PIXI.Sprite.from(await PIXI.Assets.load(img))) - ) + .filter(img => img != undefined && !PIXI.utils.TextureCache[img]) + .map(async img => PIXI.Sprite.from(await PIXI.Assets.load(img)))) } constructor(tmrDialog, displaySize) { @@ -106,8 +105,9 @@ export class PixiTMR { sprite(code, options = {}) { let img = PixiTMR.getImgFromCode(code) - const texture = PIXI.utils.TextureCache[img] + let texture = PIXI.utils.TextureCache[img] if (!texture) { + // TODO: charger la texture console.error("Texture manquante", code, PIXI.utils.TextureCache) return; } diff --git a/module/voyage/dialog-fatigue-voyage.js b/module/voyage/dialog-fatigue-voyage.js index a874d1fc..d8bfde69 100644 --- a/module/voyage/dialog-fatigue-voyage.js +++ b/module/voyage/dialog-fatigue-voyage.js @@ -33,11 +33,10 @@ export class DialogFatigueVoyage extends Dialog { return } if (!DialogFatigueVoyage.dialog) { - const playerActors = game.actors.filter(actor => actor.hasPlayerOwner && actor.isPersonnage()) - .map(actor => DialogFatigueVoyage.prepareActor(actor)) const parameters = { tableauFatigueMarche: TABLEAU_FATIGUE_MARCHE, - playerActors: playerActors, + playerActors: game.actors.filter(actor => actor.isPersonnageJoueur()) + .map(actor => DialogFatigueVoyage.prepareActor(actor)), nombreHeures: 1, } DialogFatigueVoyage.setModeDeplacement(parameters, undefined, undefined) diff --git a/styles/simple.css b/styles/simple.css index d13871b1..69cecd34 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1315,10 +1315,7 @@ div.competence-column div.categorie-competence{ margin-right: 0.2rem; margin-left: 0.2rem; } -.blessures-title { - font-weight: bold; -} -.alchimie-title { +.item-label { font-weight: bold; } .pointsreve-value { diff --git a/system.json b/system.json index 3035c75e..5c0eab1a 100644 --- a/system.json +++ b/system.json @@ -1,8 +1,8 @@ { "id": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", - "version": "11.2.16", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.2.16.zip", + "version": "11.2.17", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.2.17.zip", "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json", "changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md", "compatibility": { diff --git a/templates/actor/alchimie.html b/templates/actor/alchimie.html index 9b8741ac..2fd9399e 100644 --- a/templates/actor/alchimie.html +++ b/templates/actor/alchimie.html @@ -4,8 +4,8 @@ {{#each (trier recettesAlchimiques) as |recette id|}}