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|}}
  • {{recette.name}}
    - - + +
  • {{/each}} diff --git a/templates/actor/chirurgie.html b/templates/actor/chirurgie.html index 76ed8a4b..16797573 100644 --- a/templates/actor/chirurgie.html +++ b/templates/actor/chirurgie.html @@ -13,8 +13,8 @@ {{tache.name}} ({{tache.system.points_de_tache_courant}}/{{tache.system.points_de_tache}})
    - - + +
    {{/if}} diff --git a/templates/actor/combat.html b/templates/actor/combat.html index f7909763..f9ec0ac2 100644 --- a/templates/actor/combat.html +++ b/templates/actor/combat.html @@ -64,8 +64,8 @@ {{emp.system.pointsemp}}
    - - + +
    {{/each}} diff --git a/templates/actor/comp-creature.html b/templates/actor/comp-creature.html index a51f4b3f..54c3a519 100644 --- a/templates/actor/comp-creature.html +++ b/templates/actor/comp-creature.html @@ -23,8 +23,8 @@ /> {{#if @root.options.vueDetaillee}}
    - - + +
    {{/if}} diff --git a/templates/actor/comp-possession.html b/templates/actor/comp-possession.html index 69382805..c82d584a 100644 --- a/templates/actor/comp-possession.html +++ b/templates/actor/comp-possession.html @@ -6,8 +6,8 @@ {{possession.name}}
    - - + +
    {{/each}} diff --git a/templates/actor/dragon-queue.html b/templates/actor/dragon-queue.html index 5bf3ad82..39990c91 100644 --- a/templates/actor/dragon-queue.html +++ b/templates/actor/dragon-queue.html @@ -8,7 +8,7 @@ {{queue.name}}
    - + {{#if queue.system.refoulement}} Refouler {{/if}} diff --git a/templates/actor/dragon-souffles.html b/templates/actor/dragon-souffles.html index 7b8ac6f6..4bbff132 100644 --- a/templates/actor/dragon-souffles.html +++ b/templates/actor/dragon-souffles.html @@ -6,7 +6,7 @@ {{souffle.name}}
    - +
    {{/each}} diff --git a/templates/actor/dragon-tetes.html b/templates/actor/dragon-tetes.html index af43979c..5a00853d 100644 --- a/templates/actor/dragon-tetes.html +++ b/templates/actor/dragon-tetes.html @@ -6,7 +6,7 @@ {{tete.name}}
    - +
    {{/each}} diff --git a/templates/actor/jeux.html b/templates/actor/jeux.html index 1ef0c99c..017a6c06 100644 --- a/templates/actor/jeux.html +++ b/templates/actor/jeux.html @@ -5,8 +5,8 @@
  • {{jeu.name}} (base {{jeu.system.base}})
    - - + +
  • {{/each}} diff --git a/templates/actor/maladies-poisons.html b/templates/actor/maladies-poisons.html index 91dd9aac..a97fa240 100644 --- a/templates/actor/maladies-poisons.html +++ b/templates/actor/maladies-poisons.html @@ -1,5 +1,5 @@ {{#if maladiesPoisons.length}} -

    Maladies & Poisons:

    +

    Maladies & Poisons:


    {{> "systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queues.html"}} diff --git a/templates/actor/oeuvre.html b/templates/actor/oeuvre.html index 3e001bb2..174aaa77 100644 --- a/templates/actor/oeuvre.html +++ b/templates/actor/oeuvre.html @@ -5,8 +5,8 @@ {{oeuvre.name}} (niveau {{oeuvre.system.niveau}})
    - - + +
    diff --git a/templates/actor/possessions.html b/templates/actor/possessions.html index 150407bb..f81dee00 100644 --- a/templates/actor/possessions.html +++ b/templates/actor/possessions.html @@ -1,6 +1,6 @@ {{#if possessions.length}} {{!-- Possession --}} -

    Possession:

    +

    Possession:

    {{else}} {{#if (and isGM hasPlayerOwner)}} -
    -

    Le gardien gére les TMR du joueur, le joueur ne peut pas monter dans les TMR!

    -
    +
    +

    Le gardien gére les TMR du joueur, le joueur ne peut pas monter dans les TMR!

    +
    {{/if}} -
    - - - -
    -
    - 0 -
    -
    - - - -
    -
    - Lire un signe draconique -
    -
    - Lancer un Sort -
    -
    -
    - -
    -
    - 0 -
    -
    - 0 -
    -
    - 0 -
    -
    - Fatigue - {{{fatigue.html}}} -
    +
    + + + +
    +
    + 0 +
    +
    + + + +
    +
    + Lire un signe draconique +
    +
    + Lancer un Sort +
    +
    +
    + +
    +
    + 0 +
    +
    + 0 +
    +
    + 0 +
    +
    + Fatigue + {{{fatigue.html}}} +
    {{/if}} -
    -
    +
    diff --git a/templates/item-arme-sheet.html b/templates/item-arme-sheet.html index 74e0c45c..5842ae3d 100644 --- a/templates/item-arme-sheet.html +++ b/templates/item-arme-sheet.html @@ -8,7 +8,7 @@
    - {{#select system.competence}} {{>"systems/foundryvtt-reve-de-dragon/templates/enum-competence.html" categorie='melee'}} @@ -26,7 +26,7 @@
    - {{#select system.tir}} {{>"systems/foundryvtt-reve-de-dragon/templates/enum-competence.html" categorie='tir'}} @@ -52,7 +52,7 @@
    - {{#select system.categorie_parade}} {{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html"}} {{/select}} @@ -104,7 +104,7 @@
    - {{#select system.initpremierround}} {{>"systems/foundryvtt-reve-de-dragon/templates/enum-initpremierround.html"}} {{/select}} diff --git a/templates/item-casetmr-sheet.html b/templates/item-casetmr-sheet.html index e692e464..b198701b 100644 --- a/templates/item-casetmr-sheet.html +++ b/templates/item-casetmr-sheet.html @@ -7,8 +7,8 @@
    - - {{#select system.specific}} {{>"systems/foundryvtt-reve-de-dragon/templates/enum-tmr-effet.html"}} {{/select}} diff --git a/templates/item-chant-sheet.html b/templates/item-chant-sheet.html index 7fbd9714..dfb9dc77 100644 --- a/templates/item-chant-sheet.html +++ b/templates/item-chant-sheet.html @@ -3,11 +3,11 @@ {{!-- Sheet Body --}}
    - +
    - +
    diff --git a/templates/item-competencecreature-sheet.html b/templates/item-competencecreature-sheet.html index e68571fa..0af9b008 100644 --- a/templates/item-competencecreature-sheet.html +++ b/templates/item-competencecreature-sheet.html @@ -38,8 +38,8 @@ {{/if}} {{#if isparade}}
    - - {{#select system.categorie_parade}} {{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html"}} {{/select}} diff --git a/templates/item-conteneur-sheet.html b/templates/item-conteneur-sheet.html index 6a9f3243..0d337d6b 100644 --- a/templates/item-conteneur-sheet.html +++ b/templates/item-conteneur-sheet.html @@ -9,7 +9,7 @@
    - +
    {{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}} diff --git a/templates/item-danse-sheet.html b/templates/item-danse-sheet.html index 59e0f358..5232a7fb 100644 --- a/templates/item-danse-sheet.html +++ b/templates/item-danse-sheet.html @@ -3,7 +3,7 @@ {{!-- Sheet Body --}}
    - +
    - +
    - +
    - +
    - +
    diff --git a/templates/item-empoignade-sheet.html b/templates/item-empoignade-sheet.html index aff87868..220931c4 100644 --- a/templates/item-empoignade-sheet.html +++ b/templates/item-empoignade-sheet.html @@ -3,7 +3,7 @@ {{!-- Sheet Body --}}
    - +
    {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} diff --git a/templates/item-gemme-sheet.html b/templates/item-gemme-sheet.html index b13fc670..85fa2dad 100644 --- a/templates/item-gemme-sheet.html +++ b/templates/item-gemme-sheet.html @@ -7,8 +7,8 @@
    - - {{#select system.type}} {{{gemmeTypeList}}} {{/select}} diff --git a/templates/item-jeu-sheet.html b/templates/item-jeu-sheet.html index e562b5c1..efad7fed 100644 --- a/templates/item-jeu-sheet.html +++ b/templates/item-jeu-sheet.html @@ -4,26 +4,26 @@ {{!-- Sheet Body --}}
    - +
    - +
    - +
    - +
    diff --git a/templates/item-livre-sheet.html b/templates/item-livre-sheet.html index 73847be6..12015e12 100644 --- a/templates/item-livre-sheet.html +++ b/templates/item-livre-sheet.html @@ -5,9 +5,9 @@

    {{#if options.isOwned}} - {{/if}} + {{/if}}