This commit is contained in:
Vlyan
2020-12-24 19:42:32 +01:00
parent 540ad7b3ac
commit ac0f3f7e85
3 changed files with 9 additions and 3 deletions

View File

@@ -164,7 +164,7 @@ export class TwentyQuestionsDialog extends FormApplication {
this._addOwnedItem(item, stepKey);
// TODO specific event (no added honor if tech selected etc)
console.log(this.object.data, this.cache);
// console.log(this.object.data, this.cache);
this.render(false);
} catch (err) {
@@ -237,7 +237,10 @@ export class TwentyQuestionsDialog extends FormApplication {
*/
_addOwnedItem(item, stepName) {
// Add to Step (uniq id only)
const step = getProperty(this.object.data, stepName);
let step = getProperty(this.object.data, stepName);
if (!step) {
step = [];
}
if (step.some((e) => e === item.id)) {
return;
}

View File

@@ -308,6 +308,9 @@ export class TwentyQuestions {
const exceed = {};
TwentyQuestions[listName].forEach((formName) => {
const id = getProperty(this.data, formName);
if (id === "none") {
return;
}
if (!store[id]) {
store[id] = 0;
}

View File

@@ -1,7 +1,7 @@
<fieldset data-step="{{stepName}}" class="tq-drag-n-drop">
<ul class="item-list">
{{#each itemsList as |item id|}}
{{> 'systems/l5r5e/templates/items/property/property-entry.html' item=item id=id }}
{{> 'systems/l5r5e/templates/items/property/property-entry.html' item=item id=id editable=../options.editable }}
{{/each}}
</ul>
</fieldset>