diff --git a/module/actor-creature-sheet.js b/module/actor-creature-sheet.js
index 80582eb1..fbced05f 100644
--- a/module/actor-creature-sheet.js
+++ b/module/actor-creature-sheet.js
@@ -4,7 +4,6 @@
* @extends {ActorSheet}
*/
-import { HtmlUtility } from "./html-utility.js";
import { RdDUtility } from "./rdd-utility.js";
import { RdDActorSheet } from "./actor-sheet.js";
import { RdDCarac } from "./rdd-carac.js";
@@ -24,34 +23,11 @@ export class RdDActorCreatureSheet extends RdDActorSheet {
});
}
-
- /* -------------------------------------------- */
- async getData() {
- let formData = await super.getData()
- //console.log("Creature : ", formData, formData.system)
- formData.calc = {
- caracTotal: RdDCarac.computeTotal(formData.system.carac),
- resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures),
- encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
- surEncombrementMessage: this.actor.getMessageSurEncombrement()
- }
-
- RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
- this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
- formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
-
- console.log("Creature : ", this.objetVersConteneur, formData);
-
- return formData;
- }
-
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
- HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
-
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
diff --git a/module/actor-entite-sheet.js b/module/actor-entite-sheet.js
index bdc6e636..4ab81798 100644
--- a/module/actor-entite-sheet.js
+++ b/module/actor-entite-sheet.js
@@ -1,14 +1,8 @@
-/**
- * Extend the basic ActorSheet with some very simple modifications
- * @extends {ActorSheet}
- */
-
+import { RdDActorSheet } from "./actor-sheet.js";
import { HtmlUtility } from "./html-utility.js";
-import { Misc } from "./misc.js";
import { RdDUtility } from "./rdd-utility.js";
-/* -------------------------------------------- */
-export class RdDActorEntiteSheet extends ActorSheet {
+export class RdDActorEntiteSheet extends RdDActorSheet {
/** @override */
static get defaultOptions() {
@@ -22,64 +16,14 @@ export class RdDActorEntiteSheet extends ActorSheet {
});
}
-
- /* -------------------------------------------- */
- async getData() {
- let formData = {
- title: this.title,
- id: this.actor.id,
- type: this.actor.type,
- img: this.actor.img,
- name: this.actor.name,
- editable: this.isEditable,
- cssClass: this.isEditable ? "editable" : "locked",
- system: foundry.utils.deepClone(this.actor.system),
- effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
- // items: items,
- limited: this.actor.limited,
- options: this.options,
- owner: this.actor.isOwner,
- description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
- notesmj: await TextEditor.enrichHTML(this.object.system.notesmj, {async: true}),
- };
-
- formData.options.isGM = game.user.isGM;
- RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
-
-
- return formData;
- }
-
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
- HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
-
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
- // Update Inventory Item
- html.find('.item-edit').click(event => {
- const li = $(event.currentTarget).parents(".item");
- const item = this.actor.getEmbeddedDocument('Item', li.data("itemId"));
- item.sheet.render(true);
- });
-
- // Delete Inventory Item
- html.find('.item-delete').click(event => {
- const li = $(event.currentTarget).parents(".item");
- this.actor.deleteEmbeddedDocuments('Item', [li.data("itemId")]);
- li.slideUp(200, () => this.render(false));
- });
-
- // Roll Carac
- html.find('.carac-label a').click(async event => {
- let caracName = event.currentTarget.attributes.name.value;
- this.actor.rollCarac( caracName.toLowerCase() );
- });
-
// On competence change
html.find('.creature-carac').change(async event => {
let compName = event.currentTarget.attributes.compname.value;
@@ -93,53 +37,6 @@ export class RdDActorEntiteSheet extends ActorSheet {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCreatureCompetence( compName, "dommages", parseInt(event.target.value) );
} );
-
- // Roll Skill
- html.find('.competence-label a').click(async event => {
- let compName = event.currentTarget.text;
- this.actor.rollCompetence( compName );
- });
-
- html.find('.endurance-plus').click(event => {
- this.actor.santeIncDec("endurance", 1);
- this.render(true);
- });
- html.find('.endurance-moins').click(event => {
- this.actor.santeIncDec("endurance", -1);
- this.render(true);
- });
-
- html.find('.encaisser-direct').click(event => {
- this.actor.encaisser();
- });
-
- html.find('.remise-a-neuf').click(event => {
- if (game.user.isGM) {
- this.actor.remiseANeuf();
- }
- });
- }
-
-
- /* -------------------------------------------- */
-
- /** @override */
- setPosition(options = {}) {
- const position = super.setPosition(options);
- const sheetHeader = this.element.find(".sheet-header");
- const sheetTabs = this.element.find(".sheet-tabs");
- const sheetBody = this.element.find(".sheet-body");
- const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
- sheetBody.css("height", bodyHeight);
- return position;
}
-
- /* -------------------------------------------- */
-
- /** @override */
- _updateObject(event, formData) {
- // Update the Actor
- return this.actor.update(formData);
- }
}
diff --git a/module/actor-sheet.js b/module/actor-sheet.js
index 1142e670..9aed24be 100644
--- a/module/actor-sheet.js
+++ b/module/actor-sheet.js
@@ -37,7 +37,7 @@ export class RdDActorSheet extends ActorSheet {
/* -------------------------------------------- */
async getData() {
this.timerRecherche = undefined;
-
+
let formData = {
title: this.title,
id: this.actor.id,
@@ -51,72 +51,70 @@ export class RdDActorSheet extends ActorSheet {
limited: this.actor.limited,
options: this.options,
owner: this.actor.isOwner,
- biographie: await TextEditor.enrichHTML(this.object.system.biographie, {async: true}),
- notes: await TextEditor.enrichHTML(this.object.system.notes, {async: true}),
+ description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
+ biographie: await TextEditor.enrichHTML(this.object.system.biographie, {async: true}),
+ notes: await TextEditor.enrichHTML(this.object.system.notes, {async: true}),
notesmj: await TextEditor.enrichHTML(this.object.system.notesmj, {async: true}),
+ calc: {
+ encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
+ prixTotalEquipement: this.actor.computePrixTotalEquipement(),
+ surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
+ resumeBlessures: this.actor.computeResumeBlessure(this.actor.system.blessures),
+ caracTotal: RdDCarac.computeTotal(this.actor.system.carac, this.actor.system.beaute),
+ surEncombrementMessage: this.actor.getMessageSurEncombrement(),
+ },
}
+ formData.options.isGM = game.user.isGM;
+
RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
-
- formData.options.isGM = game.user.isGM;
-
- if (formData.type == 'creature') return formData; // Shortcut
-
- formData.byCateg = Misc.classify(formData.competences, it => it.system.categorie)
-
- formData.calc = {
- comptageArchetype: RdDItemCompetence.computeResumeArchetype(formData.competences),
- competenceXPTotal: RdDItemCompetence.computeTotalXP(formData.competences),
- caracTotal: RdDCarac.computeTotal(formData.system.carac, formData.system.beaute),
- // Mise à jour de l'encombrement total et du prix de l'équipement
- encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
- prixTotalEquipement: this.actor.computePrixTotalEquipement(),
- surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
- fatigue: RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max),
- resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures),
- surEncombrementMessage: this.actor.getMessageSurEncombrement()
- };
-
- formData.competences.forEach(item => {
- item.system.isVisible = this.options.recherche
- ? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text)
- : (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
- RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value);
- });
- Object.values(formData.system.carac).forEach(c => {
- RdDCarac.levelUp(c);
- });
-
-
- // toujours avoir une liste d'armes (pour mettre esquive et corps à corps)
- formData.combat = duplicate(formData.armes ?? []);
- RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
- RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.system.carac);
- formData.esquives = this.actor.getCompetences("Esquive");
- formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac);
-
- this.armesList = formData.combat;
-
- // Common data
- formData.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
- formData.difficultesLibres = CONFIG.RDD.difficultesLibres;
-
- formData.hautreve = {
- isDemiReve: this.actor.getEffect(STATUSES.StatusDemiReve),
- rencontres: duplicate(formData.system.reve.rencontre.list),
- cacheTMR: this.actor.isTMRCache()
- }
-
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
- formData.subacteurs = {
- vehicules: this.actor.listeVehicules(),
- montures: this.actor.listeMontures(),
- suivants: this.actor.listeSuivants()
- }
- if (this.actor.getBestDraconic().system.niveau > -11 && !this.actor.isHautRevant()) {
- ui.notifications.error(`${this.actor.name} a des compétences draconiques, mais pas le don de Haut-Rêve!
-
Ajoutez-lui la tête "Don de Haut-Rêve" pour lui permettre d'utiliser ses compétences et d'accéder aux terres médianes du rêve`);
+ if (formData.type == 'personnage') {
+ formData.byCateg = Misc.classify(formData.competences, it => it.system.categorie)
+ formData.calc.comptageArchetype = RdDItemCompetence.computeResumeArchetype(formData.competences);
+ formData.calc.competenceXPTotal= RdDItemCompetence.computeTotalXP(formData.competences);
+ formData.calc.fatigue= RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max);
+
+ formData.competences.forEach(item => {
+ item.system.isVisible = this.options.recherche
+ ? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text)
+ : (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
+ RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value);
+ });
+
+ Object.values(formData.system.carac).forEach(c => {
+ RdDCarac.levelUp(c);
+ });
+
+ // toujours avoir une liste d'armes (pour mettre esquive et corps à corps)
+ formData.combat = duplicate(formData.armes ?? []);
+ RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
+ RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.system.carac);
+ formData.esquives = this.actor.getCompetences("Esquive");
+ formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac);
+
+ this.armesList = formData.combat;
+
+ // Common data
+ formData.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
+ formData.difficultesLibres = CONFIG.RDD.difficultesLibres;
+
+ formData.hautreve = {
+ isDemiReve: this.actor.getEffect(STATUSES.StatusDemiReve),
+ rencontres: duplicate(formData.system.reve.rencontre.list),
+ cacheTMR: this.actor.isTMRCache()
+ }
+
+ formData.subacteurs = {
+ vehicules: this.actor.listeVehicules(),
+ montures: this.actor.listeMontures(),
+ suivants: this.actor.listeSuivants()
+ }
+ if (this.actor.getBestDraconic().system.niveau > -11 && !this.actor.isHautRevant()) {
+ ui.notifications.error(`${this.actor.name} a des compétences draconiques, mais pas le don de Haut-Rêve!
+
Ajoutez-lui la tête "Don de Haut-Rêve" pour lui permettre d'utiliser ses compétences et d'accéder aux terres médianes du rêve`);
+ }
}
return formData;
}
@@ -156,7 +154,6 @@ export class RdDActorSheet extends ActorSheet {
activateListeners(html) {
super.activateListeners(html);
- HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
HtmlUtility._showControlWhen($(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
// Everything below here is only needed if the sheet is editable
@@ -168,7 +165,6 @@ export class RdDActorSheet extends ActorSheet {
});
html.find('.item-edit').click(async event => {
const item = RdDSheetUtility.getItem(event, this.actor)
- console.log("ITEM :", item)
item.sheet.render(true)
})
html.find('.display-label a').click(async event => {
@@ -497,7 +493,7 @@ export class RdDActorSheet extends ActorSheet {
html.find('.moral-heureux').click(async event => {
this.actor.jetDeMoral('heureuse');
});
- html.find('#ethylisme-test').click(async event => {
+ html.find('.ethylisme-test').click(async event => {
this.actor.jetEthylisme();
});
@@ -570,7 +566,10 @@ export class RdDActorSheet extends ActorSheet {
const sheetHeader = this.element.find(".sheet-header");
const sheetTabs = this.element.find(".sheet-tabs");
const sheetBody = this.element.find(".sheet-body");
- const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
+ let bodyHeight = position.height - sheetHeader[0].clientHeight;
+ if (sheetTabs.length>0) {
+ bodyHeight -= sheetTabs[0].clientHeight;
+ }
sheetBody.css("height", bodyHeight);
return position;
}
diff --git a/module/actor-vehicule-sheet.js b/module/actor-vehicule-sheet.js
index b2305320..aa7df7c3 100644
--- a/module/actor-vehicule-sheet.js
+++ b/module/actor-vehicule-sheet.js
@@ -1,15 +1,9 @@
-/**
- * Extend the basic ActorSheet with some very simple modifications
- * @extends {ActorSheet}
- */
-
import { RdDUtility } from "./rdd-utility.js";
-import { HtmlUtility } from "./html-utility.js";
-import { Misc } from "./misc.js";
import { RdDSheetUtility } from "./rdd-sheet-utility.js";
+import { RdDActorSheet } from "./actor-sheet.js";
/* -------------------------------------------- */
-export class RdDActorVehiculeSheet extends ActorSheet {
+export class RdDActorVehiculeSheet extends RdDActorSheet {
/** @override */
static get defaultOptions() {
@@ -25,142 +19,5 @@ export class RdDActorVehiculeSheet extends ActorSheet {
});
}
- /* -------------------------------------------- */
- async getData() {
- let formData = {
- title: this.title,
- id: this.actor.id,
- type: this.actor.type,
- img: this.actor.img,
- name: this.actor.name,
- editable: this.isEditable,
- cssClass: this.isEditable ? "editable" : "locked",
- system: foundry.utils.deepClone(this.actor.system),
- effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
- limited: this.actor.limited,
- options: this.options,
- owner: this.actor.isOwner,
- description: await TextEditor.enrichHTML(this.object.system.biographie, {async: true}),
- notesmj: await TextEditor.enrichHTML(this.object.system.notesmj, {async: true}),
- };
- RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
- this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
- formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
-
- formData.options.isGM = game.user.isGM;
-
- formData.calc = {
- encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
- surEncombrementMessage: this.actor.getMessageSurEncombrement()
- }
-
- console.log("DATA", formData);
-
- return formData;
- }
-
- async computeMalusArmure() {
- // pas de malus armure
- }
- /* -------------------------------------------- */
- async _onDropItem(event, dragData) {
- const destItemId = $(event.target)?.closest('.item').attr('data-item-id');
- const dropParams = RdDSheetUtility.prepareItemDropParameters(destItemId, this.actor.id, dragData, this.objetVersConteneur);
- const callSuper = await this.actor.processDropItem(dropParams);
- if (callSuper) {
- await super._onDropItem(event, dragData)
- }
- }
-
- /* -------------------------------------------- */
- async createItem(name, type) {
- await this.actor.createEmbeddedDocuments('Item', [{ name: name, type: type }], { renderSheet: true });
- }
-
- /* -------------------------------------------- */
- async monnaieIncDec(id, value) {
- let monnaie = this.getMonnaie(id);
- if (monnaie) {
- const quantite = Math.max(0, monnaie.system.quantite + value);
- await this.updateEmbeddedDocuments('Item', [{ _id: monnaie.id, 'data.quantite': quantite }]);
- }
- }
-
- /* -------------------------------------------- */
- /** @override */
- activateListeners(html) {
- super.activateListeners(html);
-
- HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
-
- // Everything below here is only needed if the sheet is editable
- if (!this.options.editable) return;
-
- // Update Inventory Item
- html.find('.item-edit').click(async event => {
- const item = RdDSheetUtility.getItem(event, this.actor);
- item.sheet.render(true);
- });
- // Delete Inventory Item
- html.find('.item-delete').click(async event => {
- const li = RdDSheetUtility.getEventElement(event);
- const item = this.actor.getObjet(li.data("item-id"));
- RdDUtility.confirmerSuppressionItem(this, item, li);
- });
- html.find('.item-vendre').click(async event => {
- const item = RdDSheetUtility.getItem(event, this.actor);
- item?.proposerVente();
- });
- html.find('.item-montrer').click(async event => {
- const item = RdDSheetUtility.getItem(event, this.actor);
- item?.postItem();
- });
-
- html.find('.item-action').click(async event => {
- const item = RdDSheetUtility.getItem(event, this.actor);
- this.actor.actionItem(item);
- });
-
- html.find('.creer-un-objet').click(async event => {
- RdDUtility.selectObjetType(this);
- });
- html.find('.nettoyer-conteneurs').click(async event => {
- this.actor.nettoyerConteneurs();
- });
-
- html.find('.monnaie-plus').click(async event => {
- this.actor.monnaieIncDec(RdDSheetUtility.getItemId(event), 1);
- });
- html.find('.monnaie-moins').click(async event => {
- this.actor.monnaieIncDec(RdDSheetUtility.getItemId(event), -1);
- });
-
- // Display info about queue
- html.find('.conteneur-name a').click((event) => {
- RdDUtility.toggleAfficheContenu(RdDSheetUtility.getItemId(event));
- this.render(true);
- });
-
- }
-
- /* -------------------------------------------- */
- /** @override */
- setPosition(options = {}) {
- const position = super.setPosition(options);
- const sheetHeader = this.element.find(".sheet-header");
- const sheetTabs = this.element.find(".sheet-tabs");
- const sheetBody = this.element.find(".sheet-body");
- const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
- sheetBody.css("height", bodyHeight);
- return position;
- }
-
-
- /* -------------------------------------------- */
- /** @override */
- _updateObject(event, formData) {
- // Update the Actor
- return this.actor.update(formData);
- }
}
diff --git a/module/actor.js b/module/actor.js
index 47d9f374..bcd34914 100644
--- a/module/actor.js
+++ b/module/actor.js
@@ -179,7 +179,6 @@ export class RdDActor extends Actor {
this.computeIsHautRevant();
await this.cleanupConteneurs();
await this.computeEncombrementTotalEtMalusArmure();
- this.computePrixTotalEquipement();
this.computeEtatGeneral();
// Sanity check
await this.checkMonnaiePresence();
@@ -1359,14 +1358,15 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async computeMalusArmure() {
- const newMalusArmure = this.filterItems(it => it.type == 'armure' && it.system.equipe)
+ if (this.isPersonnage()) {
+ const malusArmure = this.filterItems(it => it.type == 'armure' && it.system.equipe)
.map(it => it.system.malus ?? 0)
.reduce(Misc.sum(), 0);
- // Mise à jour éventuelle du malus armure
- if (this.system.attributs?.malusarmure?.value != newMalusArmure) {
- await this.updateAttributeValue("malusarmure", newMalusArmure);
+ // Mise à jour éventuelle du malus armure
+ if (this.system.attributs?.malusarmure?.value != malusArmure) {
+ await this.updateAttributeValue("malusarmure", malusArmure);
+ }
}
- return newMalusArmure;
}
/* -------------------------------------------- */
@@ -2557,11 +2557,13 @@ export class RdDActor extends Actor {
if (rollData.competence.system.iscombat) {
if (rollData.competence.system.ispossession) {
RdDPossession.onAttaquePossession(this, rollData.competence)
- } else {
+ return
+ }
+ else if (RdDCombat.getTarget()) {
const arme = RdDItemCompetenceCreature.toActionArme(rollData.competence)
RdDCombat.createUsingTarget(this)?.attaque(competence, arme)
+ return
}
- return
}
// Fake competence pour créature
RdDItemCompetenceCreature.setRollDataCreature(rollData)
@@ -3270,7 +3272,6 @@ export class RdDActor extends Actor {
let update = { _id: item.id, "system.equipe": isEquipe };
await this.updateEmbeddedDocuments('Item', [update]);
this.computeEncombrementTotalEtMalusArmure(); // Mise à jour encombrement
- this.computePrixTotalEquipement(); // Mis à jour du prix total de l'équipement
if (isEquipe)
this.verifierForceMin(item);
}
diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js
index 834c0d7f..ffeb129d 100644
--- a/module/rdd-calendrier.js
+++ b/module/rdd-calendrier.js
@@ -534,9 +534,7 @@ export class RdDCalendrier extends Application {
async activateListeners(html) {
super.activateListeners(html);
- HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
-
- await this.updateDisplay();
+ this.updateDisplay();
html.find('.calendar-btn').click(ev => this.onCalendarButton(ev));
diff --git a/module/rdd-carac.js b/module/rdd-carac.js
index daff7567..252094bc 100644
--- a/module/rdd-carac.js
+++ b/module/rdd-carac.js
@@ -62,7 +62,7 @@ export class RdDCarac {
static computeTotal(carac, beaute = undefined) {
- const total = Object.values(carac).filter(c => !c.derivee)
+ const total = Object.values(carac ?? {}).filter(c => !c.derivee)
.map(it => parseInt(it.value))
.reduce(Misc.sum(), 0);
const beauteSuperieur10 = Math.max((beaute ?? 10) - 10, 0);
diff --git a/module/rdd-sheet-utility.js b/module/rdd-sheet-utility.js
index 9f52b7b6..15dc98e0 100644
--- a/module/rdd-sheet-utility.js
+++ b/module/rdd-sheet-utility.js
@@ -1,5 +1,4 @@
import { DialogSplitItem } from "./dialog-split-item.js";
-import { Misc } from "./misc.js";
export class RdDSheetUtility {
diff --git a/module/rdd-utility.js b/module/rdd-utility.js
index 997e5c33..1d3632dc 100644
--- a/module/rdd-utility.js
+++ b/module/rdd-utility.js
@@ -112,14 +112,28 @@ export class RdDUtility {
static async preloadHandlebarsTemplates() {
const templatePaths = [
//Character Sheets
+ 'systems/foundryvtt-reve-de-dragon/templates/actor-creation-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html',
// sous-parties de feuilles de personnages
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-creature.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-entitee.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.html',
'systems/foundryvtt-reve-de-dragon/templates/actor/competence.html',
- 'systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html',
- 'systems/foundryvtt-reve-de-dragon/templates/actor/effects.html',
+ 'systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html',
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html',
'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html',
'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html',
diff --git a/styles/simple.css b/styles/simple.css
index 40fae084..816b58cf 100644
--- a/styles/simple.css
+++ b/styles/simple.css
@@ -93,7 +93,7 @@
.sheet nav.sheet-tabs {
font-family: "CaslonAntique";
} /* For nav and title */
-.window-app input, .foundryvtt-reve-de-dragon .item-form, .sheet header.sheet-header .flex-group-center.flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-fatigue, select, button, .item-checkbox, #sidebar, #players, #navigation #nav-toggle {
+.window-app input, .foundryvtt-reve-de-dragon .item-form, .sheet header.sheet-header .flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-fatigue, select, button, .item-checkbox, #sidebar, #players, #navigation #nav-toggle {
font-family: "CaslonAntique"; /* For sheet parts */
}
@@ -332,9 +332,9 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
}
.button-img {
vertical-align: baseline;
- width: 8%;
- height: 8%;
- max-height: 48px;
+ width: 32px;
+ height: 32px;
+ max-height: 36px;
border-width: 0;
border: 1px solid rgba(0, 0, 0, 0);
}
@@ -409,10 +409,11 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
flex-wrap: nowrap;
justify-content: stretch;
}
-.rdd.sheet .window-content .sheet-body .carac-list .caracteristique.vehicle {
+.rdd.sheet .window-content .sheet-body .carac-list .caracteristique.streched {
flex-wrap: nowrap;
justify-content: stretch;
flex-basis: 7.5em;
+ width: max-content;
}
.rdd.sheet .window-content .sheet-body .carac-list .caracteristique > .carac-label {
@@ -638,7 +639,14 @@ section.sheet-body{padding: 0.25rem 0.5rem;}
margin: 0.5rem 0 0.5rem 0.5rem;
padding: 0;
}
-
+.sheet header.sheet-header h1 {
+ flex: 3;
+}
+.sheet header.sheet-header img.button-img{
+ height: 48px;
+ padding: 1px;
+ margin: 1px;
+}
.sheet nav.sheet-tabs {
font-size: 0.65rem;
font-weight: bold;
@@ -680,9 +688,13 @@ section.sheet-body:after {
clear: both;
}
-.sheet header.sheet-header .flex-compteurs {text-align: right;}
+.sheet header.sheet-header .flex-compteurs { text-align: right; max-width: max-content;}
.sheet header.sheet-header .resource-content {width: 2rem;}
+li label.compteur {
+ display: inline-block;
+ flex-direction: row;
+}
.compteur span {
display: inline-block;
text-align: left;
diff --git a/template.json b/template.json
index aac793e0..2f567bc6 100644
--- a/template.json
+++ b/template.json
@@ -238,7 +238,7 @@
}
}
},
- "common": {
+ "personnage": {
"carac": {
"taille": {
"type": "number",
@@ -574,7 +574,7 @@
}
},
"personnage": {
- "templates": [ "background", "common", "subacteurs" ]
+ "templates": [ "personnage", "background", "subacteurs" ]
},
"creature": {
"templates": [ "creature", "description" ]
diff --git a/templates/actor-creature-sheet.html b/templates/actor-creature-sheet.html
index 5c431c70..e2381427 100644
--- a/templates/actor-creature-sheet.html
+++ b/templates/actor-creature-sheet.html
@@ -2,33 +2,33 @@
{{!-- Sheet Header --}}