added techniques type list checkboxes

This commit is contained in:
Vlyan
2020-12-21 14:26:09 +01:00
parent 3b33dd0c9c
commit 1e0a3f7a00
4 changed files with 17 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ export class BaseSheetL5r5e extends ActorSheet {
sheetData.data.dtypes = ["String", "Number", "Boolean"]; sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.stances = CONFIG.l5r5e.stances; sheetData.data.stances = CONFIG.l5r5e.stances;
sheetData.data.techniquesList = CONFIG.l5r5e.techniques;
return sheetData; return sheetData;
} }
@@ -37,6 +38,13 @@ export class BaseSheetL5r5e extends ActorSheet {
return Promise.resolve(); return Promise.resolve();
} }
// Check if technique is allowed
if (item.data.type === "technique") {
// TODO Verifier que la technique est possible pour ce persos ? technique_type / techniques.kata
//console.log(item.data.data.technique_type, this.actor.data.data.techniques);
//return Promise.resolve();
}
// Ok add item // Ok add item
return super._onDrop(event); return super._onDrop(event);
} }

View File

@@ -7,7 +7,7 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
/** /**
* Sub Types of advancements * Sub Types of advancements
*/ */
static types = ["ring", "skill", "advantage"]; // "technique" has it's own type static types = ["ring", "skill"]; // "advantage" and "technique" have theirs own xp count
/** @override */ /** @override */
static get defaultOptions() { static get defaultOptions() {

View File

@@ -1,4 +1,11 @@
<div class="techniques-wrapper"> <div class="techniques-wrapper">
{{#each actor.data.techniquesList as |technique|}}
<label>
<input type="checkbox" name="data.techniques.{{technique}}" {{checked (lookup ../actor.data.techniques technique)}} />
{{localizeTechnique technique}}
</label>
{{/each}}
<fieldset class="section-header flexrow"> <fieldset class="section-header flexrow">
<legend class="technique-controls"> <legend class="technique-controls">
{{ localize 'l5r5e.techniques.title' }} {{ localize 'l5r5e.techniques.title' }}