Local sync

This commit is contained in:
LeRatierBretonnien 2020-06-12 22:46:04 +02:00
parent 711ff19b10
commit 3962f33e84
8 changed files with 321 additions and 118 deletions

View File

@ -55,6 +55,7 @@ export class RdDActorSheet extends ActorSheet {
list.push(item);
}
}
// Force empty arme, at least for Esquive
if (data.itemsByType.arme == undefined ) data.itemsByType.arme = [];
for (const arme of data.itemsByType.arme) {
@ -75,13 +76,19 @@ export class RdDActorSheet extends ActorSheet {
}
}
//endurance.max below is normal, this the base used to compute the grid.
data.data.carac.taille.isTaille = true; // To avoid button link;
data.data.nbLegeres = RdDUtility.computeNbBlessures(data.data.blessures, "legeres" );
data.data.nbGraves = RdDUtility.computeNbBlessures(data.data.blessures, "graves" );
data.data.nbCritiques = RdDUtility.computeNbBlessures(data.data.blessures, "critiques" );
// low is normal, this the base used to compute the grid.
data.data.fatigueHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix( data.data.sante.fatigue.value, data.data.sante.endurance.max ).html() + "</table>";
data.data.materiel = this._checkNull(data.itemsByType['objet']);
data.data.armes = this._checkNull(data.itemsByType['arme']);
data.data.armures = this._checkNull(data.itemsByType['armure']);
data.data.livres = this._checkNull(data.itemsByType['livre']);
data.data.potions = this._checkNull(data.itemsByType['potions']);
data.data.herbes = this._checkNull(data.itemsByType['potions']);
data.data.competenceByCategory = data.competenceByCategory;
data.data.armes = data.itemsByType.arme;
//console.log(">>>>> data update");
@ -112,6 +119,12 @@ export class RdDActorSheet extends ActorSheet {
li.slideUp(200, () => this.render(false));
});
// Roll Carac
html.find('.carac-label a').click((event) => {
let caracName = event.currentTarget.attributes.name.value;
this.actor.rollCarac( caracName.toLowerCase() );
});
// Roll Skill
html.find('.competence-label a').click((event) => {
let compName = event.currentTarget.text;
@ -130,12 +143,18 @@ export class RdDActorSheet extends ActorSheet {
//console.log("Value changed :", event, caracName);
this.actor.updateCarac( caracName, parseInt(event.target.value) );
} );
// On competence change
$(".competence-value").change((event) => {
let compName = event.currentTarget.attributes.compname.value;
//console.log("Competence changed :", compName);
this.actor.updateCompetence( compName, parseInt(event.target.value) );
} );
// On competence change
$(".competence-xp").change((event) => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceXP( compName, parseInt(event.target.value) );
} );
$("#vie-plus").click((event) => {
this.actor.santeIncDec("vie", 1);

View File

@ -154,7 +154,8 @@ export class RdDActor extends Actor {
await this.setFlag( "foundryvtt-reve-de-dragon", "rollData", undefined );
await this.setFlag( "foundryvtt-reve-de-dragon", "rollData", rollData );
let chatOptions = { content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong><br>Jet : " +
let lvl = (rollData.competence) ? rollData.competence.name : rollData.bmValue;
let chatOptions = { content: "<strong>Test : " + rollData.selectedCarac.label + " / " + lvl + "</strong><br>Jet : " +
rollData.selectedCarac.value + " / " + rollData.finalLevelStr + " - " + rollData.rollTarget.score + "%<br><strong>Résutat : </strong>" + myroll.total + "<br>" +
"<strong>" + quality + "</strong>" + specialStr + xpmsg,
user: game.user._id,
@ -175,11 +176,8 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
updateCarac( caracName, caracValue )
{
//let data = this.data.data;
let caracpath = "data.carac." + caracName + ".value"
this.update( { caracpath: caracValue } );
//data.carac[caracName].value = caracValue; // Force update ?
//RdDUtility.computeCarac( data );
}
/* -------------------------------------------- */
@ -187,11 +185,20 @@ export class RdDActor extends Actor {
{
let comp = RdDUtility.findCompetence( this.data.items, compName);
if ( comp ) {
//console.log("ACTOR", this);
//comp.data.niveau = compValue;
const update = {_id: comp._id, 'data.niveau': compValue };
const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity
//console.log("UP", updated);
} else {
console.log("Competence not found", compName);
}
}
/* -------------------------------------------- */
async updateCompetenceXP( compName, compValue )
{
let comp = RdDUtility.findCompetence( this.data.items, compName);
if ( comp ) {
const update = {_id: comp._id, 'data.xp': compValue };
const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity
} else {
console.log("Competence not found", compName);
}
@ -298,7 +305,21 @@ export class RdDActor extends Actor {
if ( blessuresData.legeres > 0 || blessuresData.graves > 0 || blessuresData.critiques > 0 )
this.update( { "data.blessures": blessures } );
}
/* -------------------------------------------- */
async rollCarac( caracName )
{
let rollData = {
"selectedCarac": this.data.data.carac[caracName],
"bonusmalusTable": CONFIG.RDD.bonusmalus,
"etat": this.data.data.compteurs.etat.value,
"finalLevel": 0,
"bmValue": 0
}
console.log(caracName, rollData);
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html', rollData);
new RdDRollDialog("carac", html, rollData, this ).render(true);
}
/* -------------------------------------------- */
rollArme( armeName )
{

View File

@ -32,6 +32,10 @@ export class RdDRollDialog extends Dialog {
dialogConf.title = "Test de combat/arme",
dialogOptions.width = 600;
dialogOptions.height = 360;
} else if (mode == "carac") {
dialogConf.title = "Test de caractéristique",
dialogOptions.width = 600;
dialogOptions.height = 320;
}
super(dialogConf, dialogOptions);
@ -54,13 +58,23 @@ export class RdDRollDialog extends Dialog {
var rollData = this.rollData;
function updateRollResult( rollData ) {
rollData.finalLevel = parseInt(rollData.competence.data.niveau) + parseInt(rollData.bmValue) + parseInt(rollData.etat);
if ( rollData.competence )
rollData.finalLevel = parseInt(rollData.competence.data.niveau) + parseInt(rollData.bmValue) + parseInt(rollData.etat);
else
rollData.finalLevel = parseInt(rollData.bmValue) + parseInt(rollData.etat);
rollData.finalLevelStr = (rollData.finalLevel >= 0 ) ? "+" + rollData.finalLevel : rollData.finalLevel;
$("#roll-param").text( rollData.selectedCarac.value + " / " + rollData.finalLevelStr );
rollData.rollTarget = game.data.RdDUtility.getResolutionField( rollData.selectedCarac.value, rollData.finalLevel);
let niveauStr = (rollData.competence.data.niveau >= 0) ? "+" + rollData.competence.data.niveau : rollData.competence.data.niveau;
let armeTitle = ( rollData.arme ) ? " ("+rollData.arme.name+") " : ""; // If a weapon is there, add it in the title
$("#compdialogTitle").text( rollData.selectedCarac.label + "/" + rollData.competence.name + armeTitle + " " + niveauStr );
let niveauStr = "";
if ( rollData.competence ) {
niveauStr = (rollData.competence.data.niveau >= 0) ? "+" + rollData.competence.data.niveau : rollData.competence.data.niveau;
$("#compdialogTitle").text( rollData.selectedCarac.label + "/" + rollData.competence.name + armeTitle + " " + niveauStr );
} else {
$("#compdialogTitle").text( rollData.selectedCarac.label );
}
$(".table-resolution").remove();
game.data.RdDUtility.makeHTMLResolutionTable( $("#resolutionTable"), rollData.selectedCarac.value-2, parseInt(rollData.selectedCarac.value) + 2, -10, 11,
rollData.selectedCarac.value, rollData.finalLevel );
@ -68,10 +82,12 @@ export class RdDRollDialog extends Dialog {
// Setup everything onload
$(function() {
// Set the default carac from the competence item
rollData.selectedCarac = rollData.carac[rollData.competence.data.defaut_carac];
// Update html, according to data
$("#carac").val( rollData.competence.data.defaut_carac );
if (rollData.competence) {
// Set the default carac from the competence item
rollData.selectedCarac = rollData.carac[rollData.competence.data.defaut_carac];
$("#carac").val( rollData.competence.data.defaut_carac );
}
$("#bonusmalus").val( rollData.bmValue );
updateRollResult(rollData);
});

View File

@ -82,7 +82,8 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/competence-base.html',
'systems/foundryvtt-reve-de-dragon/templates/arme-competence.html',
// Dialogs
'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html'
'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html',
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html'
];
return loadTemplates(templatePaths);
@ -347,6 +348,18 @@ export class RdDUtility {
return result;
}
/* -------------------------------------------- */
static computeNbBlessures( blessures, name)
{
let bless = blessures[name];
console.log(blessures, name, bless);
let nbBlessures = 0;
for (let k=0; k<bless.liste.length; k++) {
if (bless.liste[k].active) nbBlessures++;
}
return nbBlessures;
}
/* -------------------------------------------- */
static currentFatigueMalus( value, max)
{

View File

@ -314,6 +314,61 @@ button {
font-family: "GoudyAcc", sans-serif;
}
/* ======================================== */
.sheet-competence-img {
width: 24px;
height: 24px;
flex-grow: 0;
margin-right: 4px;
}
.competence-header {
align-content: flex-start;
}
.competence-label {
flex-grow: 2;
}
.competence-value {
flex-grow: 0;
flex-basis: 64px;
margin-right: 4px;
margin-left: 4px;
}
.competence-xp {
flex-grow: 0;
flex-basis: 64px;
margin-right: 4px;
margin-left: 4px;
}
.blessures-soins {
flex-grow: 0;
flex-basis: 32px;
margin-right: 4px;
margin-left: 4px;
}
.blessures-loc {
flex-grow: 0;
flex-basis: 96px;
margin-right: 4px;
margin-left: 4px;
}
/* ======================================== */
.item-checkbox {
height: 25px;
border: 1px solid #736953a6;
border-left: none;
font-family: CaslonPro;
font-weight: 500;
font-size: 14px;
color: black;
padding-top: 5px;
margin-right: 0px;
width: 45px;
position: relative;
left: 0px;
text-align: center;
}
/* ======================================== */
/* Fatigue CSS */
.table-fatigue {

View File

@ -2,10 +2,10 @@
"name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"description": "L'implémentation de Rêve de Dragon pour FoundryVTT",
"version": "0.7.1",
"version": "0.7.2",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.6.0",
"templateVersion": 11,
"templateVersion": 12,
"author": "LeRatierBretonnien",
"esmodules": [ "module/rdd-main.js", "module/hook-renderChatLog.js" ],
"styles": ["styles/simple.css"],

View File

@ -171,21 +171,18 @@
},
"blessures": {
"legeres": {
"nombre": 0,
"liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
},
"graves": {
"nombre": 0,
"liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
},
"critiques": {
"nombre": 0,
"liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
}
},
"attributs": {
@ -293,8 +290,19 @@
"quantite": 1,
"encombrement": 0,
"equipe": false,
"resistance": 0,
"qualite": 0,
"equipe": false,
"cout": 0
},
"conteneur": {
"description": "",
"capacite": 0,
"encombrement": 0,
"equipe": false,
"qualite": 0,
"cout": 0
},
"arme": {
"description": "",
"quantite": 1,
@ -305,6 +313,9 @@
"resistance": 0,
"competence": "",
"cout": 0,
"portee_courte": 0,
"portee_moyenne": 0,
"portee_longue": 0,
"rapide": false
},
"munition": {
@ -350,12 +361,18 @@
"base": 0,
"cout": 0
},
"tache": {
"nom": "",
"competence": "",
"difficulte": 0,
"points_de_tache": 0,
"points_de_tache_courant": 0
},
"livre": {
"description": "",
"auteur": "",
"difficulte": 0,
"points_de_tache": 0,
"points_de_tache_courant": 0,
"encombrement": 0,
"cout": 0
},

View File

@ -27,9 +27,9 @@
</div>
<div class="flexrow">
<div class="flexrow">
<div class="flex-group-center">Blessures légères : {{data.blessures.legeres.nombre}}</div>
<div class="flex-group-center">Blessures graves : {{data.blessures.graves.nombre}}</div>
<div class="flex-group-center">Blessure critique : {{data.blessures.critiques.nombre}}</div>
<div class="flex-group-center">Blessures légères : {{data.nbLegeres}}</div>
<div class="flex-group-center">Blessures graves : {{data.nbGraves}}</div>
<div class="flex-group-center">Blessure critique : {{data.nbCritiques}}</div>
</div>
</div>
<div class="flexrow">
@ -47,9 +47,10 @@
<a class="item" data-tab="carac">Caractéristiques</a>
<a class="item" data-tab="competences">Compétences</a>
<a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="blessures">Blessures</a>
<a class="item" data-tab="hautreve">Haut-Rêve</a>
<a class="item" data-tab="items">Equipement</a>
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="items">Items</a>
<a class="item" data-tab="attributes">Attributes</a>
</nav>
{{!-- Sheet Body --}}
@ -62,12 +63,16 @@
<ol class="carac-list">
{{#each data.carac as |carac key|}}
<li class="competence flexrow" data-attribute="{{key}}">
<span class="competence-label flexrow" name="data.carac.{{key}}.label">{{carac.label}}</span>
{{#if carac.isTaille}}
<span class="carac-label flexrow" name="data.carac.{{key}}.label">{{carac.label}}</span>
{{else}}
<span class="carac-label flexrow" name="data.carac.{{key}}.label"><a name={{key}}>{{carac.label}}</a></span>
{{/if}}
{{#if carac.derivee}}
<label class="competence-value flexrow">{{carac.value}}</label>
{{else}}
<input class="carac-value flexrow" type="text" name="data.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}"/>
<input class="carac-xp flexrow" type="text" name="data.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number"/>
<input class="competence-value flexrow" type="text" name="data.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}"/>
<input class="competence-xp flexrow" type="text" name="data.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number"/>
{{/if}}
</li>
{{/each}}
@ -92,81 +97,101 @@
{{!-- Compétences Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences">
<header class="competence-header flexrow">
<span class="competence-title">Compétences de base</span>
<span class="competence-title">Niveau</span>
<span class="competence-title">XP</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.generale as |comp key|}}
<li class="item flexrow" data-attribute="{{key}}">
<span class="competence-label" name="data.competenceByCategory.generale[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.generale[{{key}}].data.value" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.generale[{{key}}]].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
</li>
{{/each}}
</ol>
<div class="grid grid-2col">
<div class="flex-group-left flexcol">
<header class="competence-header flexrow">
<span class="competence-title">Compétences de base</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.generale as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.generale[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.generale[{{key}}].data.value" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.generale[{{key}}]].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<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>
{{/each}}
</ol>
<header class="competences-header flexrow">
<span class="competence-title">Compétences Particulières</span>
<span class="competence-title">Niveau</span>
<span class="competence-title">XP</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.particuliere as |comp key|}}
<li class="item flexrow" data-attribute="{{key}}">
<span class="competence-label" name="data.competenceByCategory.particuliere[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
</li>
{{/each}}
</ol>
<header class="competences-header flexrow">
<span class="competence-title">Compétences Particulières</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.particuliere as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.particuliere[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<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>
{{/each}}
</ol>
</div>
<div class="flex-group-left flexcol">
<header class="competences-header flexrow">
<span class="competence-title">Compétences Spécialisées</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.specialisee as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.specialisee[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<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>
{{/each}}
</ol>
<header class="competences-header flexrow">
<span class="competence-title">Compétences Spécialisées</span>
<span class="competence-title">Niveau</span>
<span class="competence-title">XP</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.specialisee as |comp key|}}
<li class="item flexrow" data-attribute="{{key}}">
<span class="competence-label" name="data.competenceByCategory.specialisee[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
</li>
{{/each}}
</ol>
<header class="competence-header flexrow">
<span class="competence-title">Connaissances</span>
<span class="competence-title">Niveau</span>
<span class="competence-title">XP</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.connaissance as |comp key|}}
<li class="item flexrow" data-attribute="{{key}}">
<span class="competence-label" name="data.competenceByCategory.connaissance[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
</li>
{{/each}}
</ol>
<header class="competences-header flexrow">
<span class="competence-title">Draconic</span>
<span class="competence-title">Niveau</span>
<span class="competence-title">XP</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.draconic as |comp key|}}
<li class="item flexrow" data-attribute="{{key}}">
<span class="competence-label" name="data.competenceByCategory.draconic[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.draconic[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.draconic[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
</li>
{{/each}}
</ol>
<header class="competence-header flexrow">
<span class="competence-title">Connaissances</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.connaissance as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.connaissance[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<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>
{{/each}}
</ol>
<header class="competences-header flexrow">
<span class="competence-title">Draconic</span>
</header>
<ol class="item-list">
{{#each data.competenceByCategory.draconic as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.draconic[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.draconic[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.draconic[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<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>
{{/each}}
</ol>
</div>
</div>
</div>
{{!-- Combat Tab --}}
@ -178,7 +203,7 @@
</header>
<ol class="item-list">
{{#each data.armes as |arme key|}}
<li class="item flexrow" data-attribute="{{key}}">
<li class="item flexrow" data-item-id="{{arme._id}}">
<span class="arme-label" name="data.armes[{{key}}].name"><a>{{arme.name}}</a></span>
<span class="competence-label" name="data.armes[{{key}}].data.competence">{{arme.data.competence}}</span>
<span class="competence-label" name="data.armes[{{key}}].data.niveau">{{numberFormat arme.data.niveau decimals=0 sign=true}}</span>
@ -193,7 +218,7 @@
</header>
<ol class="item-list">
{{#each data.competenceByCategory.tir as |comp key|}}
<li class="item flexrow" data-attribute="{{key}}">
<li class="item flexrow" data-item-id="{{arme._id}}">
<span class="competence-label" name="data.competenceByCategory.tir[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.tir[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.tir[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
@ -207,7 +232,7 @@
</header>
<ol class="item-list">
{{#each data.competenceByCategory.lancer as |comp key|}}
<li class="item flexrow" data-attribute="{{key}}">
<li class="item flexrow" data-item-id="{{arme._id}}">
<span class="competence-label" name="data.competenceByCategory.lancer[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.lancer[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.lancer[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
@ -215,13 +240,44 @@
{{/each}}
</ol>
</div>
{{!-- Biography Tab --}}
<div class="tab biography" data-group="primary" data-tab="description" style="height:200px">
{{editor content=data.biographie target="data.biographie" button=true owner=owner editable=editable}}
{{!-- blessures Tab --}}
<div class="tab blessures" data-group="primary" data-tab="blessures" style="height:200px">
<span>Blessures Légeres :</span>
<div class="flexcol">
{{#each data.blessures.legeres.liste as |bless key|}}
<li class="item flexrow" data-attribute={{key}}>
<input type="checkbox" name="data.blessures.legeres.liste[{{key}}].active" class='item-checkbox' {{#if bless.active}}checked{{/if}}/>
Premiers soins <input class="blessures-soins" type="text" name="data.blessures.legeres.liste[{{key}}].premiers_soins" data-dtype="number" value="{{bless.premiers_soins}}"/> -
Soins complets <input class="blessures-soins" type="text" name="data.blessures.legeres.liste[{{key}}].soins_complets" data-dtype="number" value="{{bless.soins_complets}}"/> -
Jours <input class="blessures-soins" type="text" name="data.blessures.legeres.liste[{{key}}].jours" data-dtype="number" value="{{bless.jours}}"/> -
Loc. <input class="blessures-loc" type="text" name="data.blessures.legeres.liste[{{key}}].localisation" data-dtype="String" value="{{bless.localisation}}"/>
</li>
{{/each}}
</div>
<span>Blessures Graves :</span>
<div>
{{#each data.blessures.graves.liste as |bless key|}}
<li class="item flexrow" data-attribute={{key}}>
<span> <input type="checkbox" class='item-checkbox'/> Premiers soins : {{bless.premiers_soins}} - Soins complets : {{bless.soins_complets}} - Nombre de jours : {{bless.jours}} - Localisation : {{bless.localisation}}</span>
</li>
{{/each}}
</div>
<span>Blessure Critique :</span>
<div>
{{#each data.blessures.critiques.liste as |bless key|}}
<li class="item flexrow" data-attribute={{key}}>
<span> <input type="checkbox" class='item-checkbox'/> Premiers soins : {{bless.premiers_soins}} - Soins complets : {{bless.soins_complets}} - Nombre de jours : {{bless.jours}} - Localisation : {{bless.localisation}}</span>
</li>
{{/each}}
</div>
</div>
{{!-- Owned Items Tab --}}
{{!-- hautreve Tab --}}
<div class="tab hautreve" data-group="primary" data-tab="hautreve" style="height:200px">
</div>
{{!-- Equipment Tab --}}
<div class="tab items" data-group="primary" data-tab="items">
<ol class="item-list">
{{#each actor.items as |item id|}}
@ -236,6 +292,12 @@
{{/each}}
</ol>
</div>
{{!-- Biography Tab --}}
<div class="tab biography" data-group="primary" data-tab="description" style="height:200px">
{{editor content=data.biographie target="data.biographie" button=true owner=owner editable=editable}}
</div>
</section>
</form>