Merge branch 'v1.4-fix' into 'v1.4'

Amélioration Haut-rêve

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!226
This commit is contained in:
Leratier Bretonnien 2021-05-04 21:17:06 +00:00
commit cc103b88ac
17 changed files with 203 additions and 284 deletions

View File

@ -35,49 +35,17 @@ export class RdDActorSheet extends ActorSheet {
/* -------------------------------------------- */
async getData() {
// 0.8.0
const objectData = Misc.data(this.object);
// -------------- version 0.7.9
// let formData = {
// cssClass: this.entity.owner ? "editable" : "locked",
// editable: this.isEditable,
// entity: duplicate(this.entity.data),
// limited: this.entity.limited,
// options: this.options,
// owner: this.entity.owner,
// title: this.title
// }
// // Entity data
// formData.actor = formData.entity;
// formData.data = formData.entity.data;
// // Owned items
// formData.items = formData.actor.items;
// formData.items.sort((a, b) => (a.sort || 0) - (b.sort || 0));
// -------------- version 0.8.0
// // Copy and sort Items
// items.sort((a, b) => (a.sort || 0) - (b.sort || 0));
// data.items = items;
// // Copy Active Effects
// data.effects = effects;
//console.log("---- data");
// // Return template data
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
// actor: this.object,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: foundry.utils.deepClone(Misc.templateData(this.object)),
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
// items: items,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,

View File

@ -289,8 +289,18 @@ export class RdDActor extends Actor {
filterItemsData(filter) {
return this.data.items.map(it => Misc.data(it)).filter(filter);
}
filterItems(filter) {
return this.data.items.filter(it => filter(Misc.data(it)));
}
getItemOfType(id, type) {
return id ? this.data.items.find(it => it.id == id && Misc.data(it).type == type) : undefined;
if (id && type) {
let itemById = this.data.items.find(it => it.id == id);
const itemData = Misc.data(itemById);
if (itemData.type == type) {
return itemById;
}
}
return undefined;
}
getMonnaie(id) {
return this.getItemOfType(id, 'monnaie');
@ -1210,13 +1220,13 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
async cacheTMR( ) {
async cacheTMR() {
await this.update({ 'data.reve.tmrpos.cache': true });
}
async montreTMR( ) {
async montreTMR() {
await this.update({ 'data.reve.tmrpos.cache': false });
}
isTMRCache( ) {
isTMRCache() {
return this.data.data.reve.tmrpos.cache;
}
/* -------------------------------------------- */
@ -1307,7 +1317,7 @@ export class RdDActor extends Actor {
async reveActuelIncDec(value) {
let mydata = Misc.templateData(this);
let reve = Math.max(mydata.reve.reve.value + value, 0);
await this.update( { "data.reve.reve.value": reve });
await this.update({ "data.reve.reve.value": reve });
}
/* -------------------------------------------- */
@ -1670,7 +1680,7 @@ export class RdDActor extends Actor {
if (rollEthylisme.isEchec) {
await this._jetDeMoralEthylique(ethylisme);
}
await this.update({'data.compteurs.ethylisme': ethylisme});
await this.update({ 'data.compteurs.ethylisme': ethylisme });
}
/* -------------------------------------------- */
@ -1697,6 +1707,7 @@ export class RdDActor extends Actor {
switch (Misc.data(item).type) {
case 'nourritureboisson': return await this.actionNourritureboisson(item);
case 'potion': return await this.actionPotion(item);
case 'livre': return await this.actionLire(item);
}
}
@ -1708,6 +1719,12 @@ export class RdDActor extends Actor {
async actionPotion(item) {
return await this.consommerPotion(item)
}
async actionLire(item) {
const tache = await this.creerTacheDepuisLivre(item, { renderSheet: false });
if (tache) {
await this.rollTache(tache.id);
}
}
/* -------------------------------------------- */
async consommer(item, choix) {
@ -2006,8 +2023,8 @@ export class RdDActor extends Actor {
let draconicList = this.getDraconicList().map(d => duplicate(Misc.data(d)));
for (let sort of sortList) {
let draconicsSort = this.getDraconicsSort(draconicList, sort).map(it => it.name);
for (let index = 0; index < draconicList.length && sort.data.listIndex==undefined; index++){
if (draconicsSort.includes(draconicList[index].name)){
for (let index = 0; index < draconicList.length && sort.data.listIndex == undefined; index++) {
if (draconicsSort.includes(draconicList[index].name)) {
sort.data.listIndex = index;
}
}
@ -2271,22 +2288,29 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
async creerTacheDepuisLivre(item) {
async creerTacheDepuisLivre(item, options = { renderSheet: true }) {
const itemData = Misc.data(item);
let tache = {
name: "Lire " + item.name, type: 'tache',
data: {
carac: 'intellect',
competence: 'Ecriture',
difficulte: itemData.data.difficulte,
periodicite: "60 minutes",
fatigue: 2,
points_de_tache: itemData.data.points_de_tache,
points_de_tache_courant: 0,
description: "Lecture du livre " + item.name + " - XP : " + itemData.data.xp + " - Compétences : " + itemData.data.competence
const nomTache = "Lire " + itemData.name;
const filterTacheLecture = it => it.type == 'tache' && it.name == nomTache;
let tachesExistantes = this.filterItems(filterTacheLecture);
if (tachesExistantes.length == 0) {
const tache = {
name: nomTache, type: 'tache',
data: {
carac: 'intellect',
competence: 'Ecriture',
difficulte: itemData.data.difficulte,
periodicite: "60 minutes",
fatigue: 2,
points_de_tache: itemData.data.points_de_tache,
points_de_tache_courant: 0,
description: "Lecture du livre " + item.name + " - XP : " + itemData.data.xp + " - Compétences : " + itemData.data.competence
}
}
await this.createEmbeddedDocuments('Item', [tache], options);
tachesExistantes = this.filterItems(filterTacheLecture);
}
await this.createEmbeddedDocuments('Item', [tache], { renderSheet: true });
return tachesExistantes.length > 0 ? tachesExistantes[0] : undefined;
}
/* -------------------------------------------- */
@ -2313,7 +2337,6 @@ export class RdDActor extends Actor {
callbacks: [
this.createCallbackExperience(),
this.createCallbackAppelAuMoral(),
{ condition: r => r.rolled.isETotal, action: r => this._tacheETotal(r) },
{ action: r => this._tacheResult(r) }
]
});
@ -2323,19 +2346,17 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async _tacheResult(rollData) {
// Mise à jour de la tache
rollData.tache = duplicate(rollData.tache);
rollData.tache.data.points_de_tache_courant += rollData.rolled.ptTache;
if (rollData.rolled.isETotal){
rollData.tache.data.difficulte--;
}
this.updateEmbeddedDocuments('Item', [rollData.tache]);
this.santeIncDec("fatigue", rollData.tache.data.fatigue);
RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-tache.html');
}
/* -------------------------------------------- */
_tacheETotal(rollData) {
rollData.tache.data.difficulte--;
this.updateEmbeddedDocuments('Item', [rollData.tache]);
}
/* -------------------------------------------- */
async _rollArt(artData, selected, oeuvre, callBackResult = r => this._resultArt(r)) {
const actorData = Misc.data(this);
@ -2760,7 +2781,7 @@ export class RdDActor extends Actor {
refreshTMRView(tmrData) {
console.log("REFRESH !!!!");
if (this.currentTMR) {
this.currentTMR.externalRefresh( tmrData)
this.currentTMR.externalRefresh(tmrData)
}
}

View File

@ -95,6 +95,7 @@ export class RdDItem extends Item {
switch (itemData.type) {
case 'nourritureboisson': return itemData.data.boisson ? 'Boire' : 'Manger';
case 'potion': return 'Boire';
case 'livre': return 'Lire';
}
if (options.warnIfNot) {
ui.notifications.warn(`Impossible d'utilise un ${itemData.name}, aucune action associée définie.`);

View File

@ -40,7 +40,7 @@ export class RdDTMRDialog extends Dialog {
const dialogOptions = {
classes: ["tmrdialog"],
width: 920, height: 980,
'z-index': 20
'z-index': 40
}
super(dialogConf, dialogOptions);

View File

@ -20,7 +20,7 @@ export class RdDTMRRencontreDialog extends Dialog {
const dialogOptions = {
classes: ["tmrrencdialog"],
width: 320, height: 240,
'z-index': 20
'z-index': 50
}
super(dialogConf, dialogOptions);

View File

@ -7,49 +7,51 @@ import { RdDUtility } from "./rdd-utility.js";
/* -------------------------------------------- */
export class RdDTokenHud {
static init(){
// Integration du TokenHUD
static init() {
// Integration du TokenHUD
Hooks.on('renderTokenHUD', (app, html, data) => { RdDTokenHud.addTokenHudExtensions(app, html, data._id) });
}
/* -------------------------------------------- */
static async removeExtensionHud( app, html, tokenId) {
let combat = html.find('.control-icon.rdd-combat');
combat.remove();
let initiative = html.find('.control-icon.rdd-initiative');
initiative.remove();
static async removeExtensionHud(app, html, tokenId) {
html.find('.control-icon.rdd-combat').remove();
html.find('.control-icon.rdd-initiative').remove();
}
/* -------------------------------------------- */
static async addExtensionHud( app, html, tokenId ) {
static async addExtensionHud(app, html, tokenId) {
let token = canvas.tokens.get(tokenId);
let actor = token.actor;
let combatant = game.combat.combatants.find(c => Misc.data(c).tokenId == tokenId);
app.hasExtension = true;
let armesList = RdDCombatManager.buildListeActionsCombat(combatant) ;
const hudData = { combatant: combatant, armes: armesList,
commandes: [{ name: 'Initiative +1', command: 'inc', value: 0.01}, { name: 'Initiative -1',command: 'dec', value: -0.01}] };
let armesList = RdDCombatManager.buildListeActionsCombat(combatant);
const hudData = {
combatant: combatant, armes: armesList,
commandes: [{ name: 'Initiative +1', command: 'inc', value: 0.01 }, { name: 'Initiative -1', command: 'dec', value: -0.01 }]
};
const controlIconCombat = html.find('.control-icon[data-action=combat]');
// initiative
await RdDTokenHud._configureSubMenu(html.find('.control-icon.combat'), 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html', hudData,
await RdDTokenHud._configureSubMenu(controlIconCombat, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html', hudData,
(event) => {
let initCommand = event.currentTarget.attributes['data-command'].value;
let combatantId = event.currentTarget.attributes['data-combatant-id'].value;
if ( !initCommand ) {
if (!initCommand) {
let armeIndex = event.currentTarget.attributes['data-arme-id'].value;
let arme = armesList[armeIndex];
RdDCombatManager.rollInitiativeCompetence(combatantId, arme);
RdDCombatManager.rollInitiativeCompetence(combatantId, arme);
} else if (initCommand == 'inc') {
RdDCombatManager.incDecInit( combatantId, 0.01 );
} else if ( initCommand == 'dec') {
RdDCombatManager.incDecInit( combatantId, -0.01 );
RdDCombatManager.incDecInit(combatantId, 0.01);
} else if (initCommand == 'dec') {
RdDCombatManager.incDecInit(combatantId, -0.01);
}
});
const controlIconTarget = html.find('.control-icon[data-action=target]');
// combat
await RdDTokenHud._configureSubMenu(html.find('.control-icon.target'), 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html', hudData,
await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html', hudData,
(event) => {
let armeIndex = event.currentTarget.attributes['data-arme-id'].value;
let arme = armesList[armeIndex];
@ -59,38 +61,35 @@ export class RdDTokenHud {
/* -------------------------------------------- */
static async addTokenHudExtensions(app, html, tokenId) {
html.find('.control-icon.combat').click(event => {
if ( event.currentTarget.className.includes('active')) {
RdDTokenHud.removeExtensionHud( app, html, tokenId);
const controlIconCombat = html.find('.control-icon[data-action=combat]');
controlIconCombat.click(event => {
if (event.currentTarget.className.includes('active')) {
RdDTokenHud.removeExtensionHud(app, html, tokenId);
} else {
setTimeout( function() { RdDTokenHud.addExtensionHud( app, html, tokenId) } , 200 );
setTimeout(function () { RdDTokenHud.addExtensionHud(app, html, tokenId) }, 200);
}
} );
});
let combatIcon = html.find('.control-icon.combat');
if ( combatIcon[0].className.includes('active') ) {
RdDTokenHud.addExtensionHud( app, html, tokenId);
if (controlIconCombat.length>0 && controlIconCombat[0].className.includes('active')) {
RdDTokenHud.addExtensionHud(app, html, tokenId);
}
}
/* -------------------------------------------- */
static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) {
const hud = $(await renderTemplate(template, hudData));
const imgHud = hud.find('img.rdd-hud-togglebutton');
const list = hud.find('div.rdd-hud-list');
hud.toggleClass('active');
HtmlUtility._showControlWhen(list, hud.hasClass('active'));
imgHud.click(event => {
hud.toggleClass('active');
HtmlUtility._showControlWhen(list, hud.hasClass('active'));
});
RdDTokenHud._toggleHudListActive(hud, list);
hud.find('img.rdd-hud-togglebutton').click(event => RdDTokenHud._toggleHudListActive(hud, list));
list.find('.rdd-hud-menu').click(onMenuItem);
insertionPoint.after(hud);
}
static _toggleHudListActive(hud, list) {
hud.toggleClass('active');
HtmlUtility._showControlWhen(list, hud.hasClass('active'));
}
}

View File

@ -4,6 +4,7 @@ import { ChatUtility } from "./chat-utility.js";
import { RdDCombat } from "./rdd-combat.js";
import { Misc } from "./misc.js";
import { Grammar } from "./grammar.js";
import { TMRUtility } from "./tmr-utility.js";
/* -------------------------------------------- */
// This table starts at 0 -> niveau -10
@ -108,8 +109,13 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-oeuvre-partial.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html',
// Conteneur/item in Actor sheet
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html',
//Items
'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html',
@ -172,9 +178,6 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/calendar-template.html',
'systems/foundryvtt-reve-de-dragon/templates/calendar-editor-template.html',
'systems/foundryvtt-reve-de-dragon/templates/heures-select-option.html',
// Conteneur/item in Actor sheet
'systems/foundryvtt-reve-de-dragon/templates/actor-inventaire-conteneur.html',
'systems/foundryvtt-reve-de-dragon/templates/editor-notes-mj.html',
// HUD
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html',
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html',
@ -208,6 +211,8 @@ export class RdDUtility {
Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str));
Handlebars.registerHelper('accord', (genre, ...args) => Grammar.accord(genre, args));
Handlebars.registerHelper('buildConteneur', (objet) => { return RdDUtility.buildConteneur(objet); });
Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord));
Handlebars.registerHelper('caseTmr-type', coord => TMRUtility.getTMRType(coord));
return loadTemplates(templatePaths);
}
@ -325,7 +330,7 @@ export class RdDUtility {
if (!niveau) niveau = 1;
objet.niveau = niveau;
//console.log("OBJ:", objet);
let str = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-inventaire-conteneur.html']({ item: objet });
let str = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html']({ item: objet });
if (objet.type == 'conteneur') {
//console.log("ITEM DISPLAYED", objet );
if (this.getAfficheContenu(objet._id)) {

View File

@ -1,5 +1,6 @@
import { TMRRencontres } from "./tmr-rencontres.js";
import { Misc } from "./misc.js";
import { Grammar } from "./grammar.js";
/* -------------------------------------------- */
const TMRMapping = {

View File

@ -26,8 +26,8 @@ export class Pelerinage extends Draconique {
return pixiTMR.sprite(this.code(), {
zIndex: tmrTokenZIndex.conquete,
alpha: 1,
taille: tmrConstants.twoThird,
decallage: tmrConstants.right
taille: tmrConstants.full,
decallage: tmrConstants.center
});
}

View File

@ -183,7 +183,7 @@
<div class="form-group editor">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/editor-notes-mj.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
</div>
</div>

View File

@ -97,7 +97,7 @@
<div class="form-group editor">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/editor-notes-mj.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
</div>
</div>

View File

@ -0,0 +1,8 @@
<header class="competence-header flexrow">
<span class="competence-title">{{categorie}}</span>
</header>
<ul class="item-list alterne-list">
{{#each competences as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>

View File

@ -0,0 +1,11 @@
<li class="item flexrow list-item" data-item-id="{{oeuvre._id}}">
<span>{{upperFirst typeOeuvre}}</span>
<span class="competence-title {{classOeuvre}}">
<a>{{oeuvre.name}} (niveau {{oeuvre.data.niveau}})</a>
</span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>

View File

@ -233,81 +233,18 @@
</div>
<div class="grid grid-2col">
<div class="flex-group-left flexcol competence-column">
<header class="competence-header flexrow">
<span class="competence-title">Compétences générales</span>
</header>
<ul class="item-list alterne-list">
{{#each competenceByCategory.generale as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
<header class="competence-header flexrow">
<span class="competence-title">Compétences Particulières</span>
</header>
<ul class="item-list alterne-list">
{{#each competenceByCategory.particuliere as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
<header class="competence-header flexrow">
<span class="competence-title">Compétences Spécialisées</span>
</header>
<ul class="item-list alterne-list">
{{#each competenceByCategory.specialisee as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=competenceByCategory.generale categorie="Compétences générales"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=competenceByCategory.particuliere categorie="Compétences Particulières"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=competenceByCategory.specialisee categorie="Compétences Spécialisées"}}
</div>
<div class="flex-group-left flexcol competence-column">
<header class="competence-header flexrow">
<span class="competence-title">Compétences de Mêlée</span>
</header>
<ul class="item-list alterne-list">
{{#each competenceByCategory.melee as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
<header class="competence-header flexrow">
<span class="competence-title">Compétences de Tir</span>
</header>
<ul class="item-list alterne-list">
{{#each competenceByCategory.tir as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
<header class="competence-header flexrow">
<span class="competence-title">Compétences de Lancer</span>
</header>
<ul class="item-list alterne-list">
{{#each competenceByCategory.lancer as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
<header class="competence-header flexrow">
<span class="competence-title">Connaissances</span>
</header>
<ul class="item-list alterne-list">
{{#each competenceByCategory.connaissance as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=competenceByCategory.melee categorie="Compétences de Mêlée"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=competenceByCategory.tir categorie="Compétences de Tir"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=competenceByCategory.lancer categorie="Compétences de Lancer"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=competenceByCategory.connaissance categorie="Connaissances"}}
{{#if data.attributs.hautrevant.value}}
<header class="competence-header flexrow">
<span class="competence-title">Draconic</span>
</header>
<ul class="item-list alterne-list">
{{#each competenceByCategory.draconic as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=competenceByCategory.draconic categorie="Draconic"}}
{{/if}}
<div>
@ -384,44 +321,19 @@
<h3>Oeuvres diverses :</h3><a class="creer-une-oeuvre">Créer une oeuvre</a>
<ul class="item-list alterne-list">
{{#each chants as |chant id|}}
<li class="item flexrow list-item" data-item-id="{{chant._id}}"><span>Chant</span><span class="competence-title chant-label"><a>{{chant.name}} (niveau {{chant.data.niveau}})</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-oeuvre-partial.html" oeuvre=chant typeOeuvre="Chant" classOeuvre="chant-label"}}
{{/each}}
{{#each musiques as |musique id|}}
<li class="item flexrow list-item" data-item-id="{{musique._id}}"><span>Musique</span><span class="competence-title musique-label"><a>{{musique.name}} (niveau {{musique.data.niveau}})</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-oeuvre-partial.html" oeuvre=musique typeOeuvre="Musique" classOeuvre="musique-label"}}
{{/each}}
{{#each danses as |danse id|}}
<li class="item flexrow list-item" data-item-id="{{danse._id}}"><span>Danse</span><span class="competence-title danse-label"><a>{{danse.name}} (niveau {{danse.data.niveau}})</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-oeuvre-partial.html" oeuvre=danse typeOeuvre="Danse" classOeuvre="danse-label"}}
{{/each}}
{{#each oeuvres as |oeuvre id|}}
<li class="item flexrow list-item" data-item-id="{{oeuvre._id}}"><span>{{upperFirst oeuvre.data.competence}}</span><span class="competence-title oeuvre-label"><a>{{oeuvre.name}} (niveau {{oeuvre.data.niveau}})</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-oeuvre-partial.html" oeuvre=oeuvre typeOeuvre=oeuvre.data.competence classOeuvre="oeuvre-label"}}
{{/each}}
{{#each recettescuisine as |recette id|}}
<li class="item flexrow list-item" data-item-id="{{recette._id}}"><span>Recette de cuisine</span><span class="competence-title recettecuisine-label"><a>{{recette.name}} (niveau {{recette.data.niveau}})</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-oeuvre-partial.html" oeuvre=recette typeOeuvre="Recette de cuisine" classOeuvre="recettecuisine-label"}}
{{/each}}
</ul>
<h3>Jeux :</h3>
@ -472,14 +384,16 @@
</li>
{{/if}}
<li class="item flexrow">
<span class="competence-label">Position en TMR :</span>
<span class="competence-label">Demi rêve :</span>
<span>
{{#if options.isGM}}
{{caseTmr-label data.reve.tmrpos.coord}}
<input class="competence-value" type="text" name="data.reve.tmrpos.coord" value="{{data.reve.tmrpos.coord}}" data-dtype="String"/>
{{else}}
{{#if hautreve.cacheTMR}}
??
{{else}}
{{caseTmr-label data.reve.tmrpos.coord}}
{{data.reve.tmrpos.coord}}
{{/if}}
{{/if}}
@ -510,77 +424,43 @@
</div>
<hr>
{{#if data.attributs.hautrevant.value}}
<div>
<h3>Sorts:</h3>
<ul class="item-list">
{{#each sorts as |mysort key|}}
<li class="item flexrow" data-item-id="{{mysort._id}}" data-attribute="{{key}}">
<span class="sort-label"> <a data-id="{{mysort._id}}">{{mysort.name}}</a></span>
<span>{{mysort.data.draconic}} / {{mysort.data.difficulte}}</span>
<div class="item-controls">
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<hr>
<div>
<h3>Sorts en Réserve:</h3>
<ul class="item-list">
{{#each hautreve.sortsReserve as |reserve key|}}
<li class="item flexrow" data-item-id="{{mysort._id}}" data-attribute="{{key}}">
<span class="sort-label"> {{reserve.sort.name}} - {{reserve.coord}}</span>
</li>
{{/each}}
</ul>
</div>
<hr>
<div>
<h3>Méditations:</h3>
<ul class="item-list">
{{#each meditations as |meditation key|}}
<li class="item flexrow" data-item-id="{{meditation._id}}" data-attribute="{{key}}">
<span class="meditation-label"><a data-id="{{meditation._id}}">{{meditation.name}} - {{meditation.data.competence}}</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<hr>
<div>
<h3>Cases Spéciales:</h3>
<ul class="item-list">
{{#each hautreve.casesTmr as |casetmr key|}}
<li class="item flexrow" data-item-id="{{casetmr._id}}" data-attribute="{{key}}">
<span class="case-label"><a data-id="{{casetmr._id}}">{{casetmr.name}}</a></span>
<div class="item-controls">
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<hr>
<div>
<h3>Rencontres présentes:</h3>
<ul class="item-list">
{{#each hautreve.rencontres as |rencontre key|}}
<li class="item flexrow" data-item-id="{{key}}" data-attribute="{{key}}">
<span class="case-label"><a data-id="{{key}}">{{rencontre.rencontre.name}} - {{rencontre.coord}} {{#if rencontre.rencontre.date}}({{rencontre.rencontre.date}} - {{rencontre.rencontre.heure}}){{/if}}</a></span>
<div class="item-controls">
<a class="item-control rencontre-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<h3>Sorts:</h3>
<ul class="item-list alterne-list">
{{#each sorts as |mysort key|}}
<li class="item list-item flexrow" data-item-id="{{mysort._id}}" data-attribute="{{key}}">
<span class="sort-label"> <a data-id="{{mysort._id}}">{{mysort.name}}</a></span>
<span>{{mysort.data.draconic}} / {{mysort.data.difficulte}}</span>
<div class="item-controls">
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<h3>Sorts en Réserve:</h3>
<ul class="item-list alterne-list">
{{#each hautreve.sortsReserve as |reserve key|}}
<li class="item list-item flexrow" data-item-id="{{mysort._id}}" data-attribute="{{key}}">
<img class="sheet-competence-img" src="{{reserve.sort.img}}" />
<span class="sort-label"> {{reserve.sort.name}} - {{reserve.coord}} - {{caseTmr-label reserve.coord}} - r{{reserve.sort.data.ptreve_reel}}</span>
</li>
{{/each}}
</ul>
<h3>Méditations:</h3>
<ul class="item-list">
{{#each meditations as |meditation key|}}
<li class="item flexrow" data-item-id="{{meditation._id}}" data-attribute="{{key}}">
<span class="meditation-label"><a data-id="{{meditation._id}}">{{meditation.name}} - {{meditation.data.competence}}</a></span>
<div class="item-controls">
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<hr>
{{/if}}
{{!-- Queues, Souffles, Tetes, Ombre --}}
<h3>Queues:</h3>
<ul class="flex-group-left">
@ -626,7 +506,32 @@
</li>
{{/each}}
</ul>
{{#if data.attributs.hautrevant.value}}
<hr>
<h3>Rencontres présentes:</h3>
<ul class="item-list">
{{#each hautreve.rencontres as |rencontre key|}}
<li class="item flexrow" data-item-id="{{key}}" data-attribute="{{key}}">
<span class="case-label"><a data-id="{{key}}">{{rencontre.rencontre.name}} - {{rencontre.coord}} {{#if rencontre.rencontre.date}}({{rencontre.rencontre.date}} - {{rencontre.rencontre.heure}}){{/if}}</a></span>
<div class="item-controls">
<a class="item-control rencontre-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<hr>
<h3>Cases Spéciales:</h3>
<ul class="item-list">
{{#each hautreve.casesTmr as |casetmr key|}}
<li class="item" data-item-id="{{casetmr._id}}" data-attribute="{{key}}">
<span class="item-controls">
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</span>
<span class="case-label"><a data-id="{{casetmr._id}}">{{casetmr.name}}</a></span>
</li>
{{/each}}
</ul>
{{/if}}
</div>
{{!-- Equipment Tab --}}
@ -669,7 +574,7 @@
{{#each objets as |item id|}}
{{#unless item.estContenu}}
{{#if (ne item.type 'conteneur')}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-inventaire-conteneur.html" item=item }}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item }}
{{/if}}
{{/unless}}
{{/each}}
@ -789,7 +694,7 @@
<div class="form-group editor">
{{editor content=data.notes target="data.notes" button=true owner=owner editable=editable}}
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/editor-notes-mj.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
</article>
</div>

View File

@ -110,7 +110,7 @@
<div class="form-group editor">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
{{>"systems/foundryvtt-reve-de-dragon/templates/editor-notes-mj.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
</div>
</div>