v12 fixes : Fix select to selectOptions

This commit is contained in:
Vlyan
2024-05-24 18:44:24 +02:00
parent fcc2691f4b
commit 3b37859cb5
12 changed files with 87 additions and 201 deletions

View File

@@ -150,7 +150,10 @@ export class TwentyQuestionsDialog extends FormApplication {
skillsList, skillsList,
skillsListStep7, skillsListStep7,
skillsListStep17, skillsListStep17,
noHonorSkillsList: ["commerce", "skulduggery", "medicine", "seafaring", "survival", "labor"], noHonorSkillsList: CONFIG.l5r5e.noHonorSkillsList.map(id => ({
id,
label: game.i18n.localize("l5r5e.skills." + CONFIG.l5r5e.skills.get(id.toLowerCase()) + "." + id.toLowerCase())
})),
techniquesList: game.l5r5e.HelpersL5r5e.getTechniquesList({ displayInTypes: true }), techniquesList: game.l5r5e.HelpersL5r5e.getTechniquesList({ displayInTypes: true }),
data: this.object.data, data: this.object.data,
cache: this.cache, cache: this.cache,

View File

@@ -23,6 +23,7 @@ export const L5R5E = {
skirmish: "tactics", skirmish: "tactics",
mass_battle: "command", mass_battle: "command",
}, },
noHonorSkillsList: ["commerce", "skulduggery", "medicine", "seafaring", "survival", "labor"],
}; };
// *** Techniques *** // *** Techniques ***

View File

@@ -7,7 +7,11 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
/** /**
* Sub Types of advancements * Sub Types of advancements
*/ */
static types = { ring: "l5r5e.rings.label", skill: "l5r5e.skills.label" }; // others have theirs own xp count static types = [
{ id: "ring", label: "l5r5e.rings.label" },
{ id: "skill", label: "l5r5e.skills.label" },
// others have theirs own xp count
];
/** @override */ /** @override */
static get defaultOptions() { static get defaultOptions() {
@@ -43,29 +47,33 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
const currentSkill = this.object.system.skill; const currentSkill = this.object.system.skill;
html.find("#advancement_type").on("change", (event) => { html.find("#advancement_type").on("change", (event) => {
$(event.target).prop("disabled", true); const targetEvt = $(event.target);
if ($(event.target).val() === "skill") { targetEvt.prop("disabled", true);
if (targetEvt.val() === "skill") {
this._updateChoice({ ring: currentRing }, { skill: currentSkill }).then( this._updateChoice({ ring: currentRing }, { skill: currentSkill }).then(
$(event.target).prop("disabled", false) targetEvt.prop("disabled", false)
); );
} else { } else if (targetEvt.val() === "ring") {
this._updateChoice({ skill: currentSkill }, { ring: currentRing }).then( this._updateChoice({ skill: currentSkill }, { ring: currentRing }).then(
$(event.target).prop("disabled", false) targetEvt.prop("disabled", false)
); );
} }
}); });
html.find("#advancement_ring").on("change", (event) => { html.find("#advancement_ring").on("change", (event) => {
$(event.target).prop("disabled", true); const targetEvt = $(event.target);
this._updateChoice({ ring: currentRing }, { ring: $(event.target).val() }).then( targetEvt.prop("disabled", true);
$(event.target).prop("disabled", false) this._updateChoice({ ring: currentRing }, { ring: targetEvt.val() }).then(
targetEvt.prop("disabled", false)
); );
}); });
html.find("#advancement_skill").on("change", (event) => { html.find("#advancement_skill").on("change", (event) => {
$(event.target).prop("disabled", true); const targetEvt = $(event.target);
this._updateChoice({ skill: currentSkill }, { skill: $(event.target).val() }).then( targetEvt.prop("disabled", true);
$(event.target).prop("disabled", false) this._updateChoice({ skill: currentSkill }, { skill: targetEvt.val() }).then(
targetEvt.prop("disabled", false)
); );
}); });
} }
@@ -141,8 +149,5 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
xp_used: xp_used, xp_used: xp_used,
}, },
}); });
// Re render
this.render(false);
} }
} }

View File

@@ -18,7 +18,10 @@ export class WeaponSheetL5r5e extends ItemSheetL5r5e {
// Martial skills only // Martial skills only
sheetData.data.skills = Array.from(CONFIG.l5r5e.skills) sheetData.data.skills = Array.from(CONFIG.l5r5e.skills)
.filter(([id, cat]) => cat === "martial") .filter(([id, cat]) => cat === "martial")
.map(([id, cat]) => id); .map(([id, cat]) => ({
id,
label: "l5r5e.skills." + cat.toLowerCase() + "." + id.toLowerCase(),
}));
return sheetData; return sheetData;
} }

View File

@@ -4,11 +4,7 @@
<label>{{localize 'l5r5e.clans.label'}}</label> <label>{{localize 'l5r5e.clans.label'}}</label>
<div class="form-fields"> <div class="form-fields">
<select class="attribute-dtype" name="clan"> <select class="attribute-dtype" name="clan">
{{#select data.clan}} {{selectOptions clanList selected=data.clan valueAttr='id' labelAttr='label'}}
{{#each clanList as |value|}}
<option value="{{value.id}}">{{value.label}}</option>
{{/each}}
{{/select}}
</select> </select>
</div> </div>
</div> </div>
@@ -16,11 +12,7 @@
<label>{{localize 'l5r5e.social.gender.title'}}</label> <label>{{localize 'l5r5e.social.gender.title'}}</label>
<div class="form-fields"> <div class="form-fields">
<select class="attribute-dtype" name="gender"> <select class="attribute-dtype" name="gender">
{{#select data.gender}} {{selectOptions genderList selected=data.gender valueAttr='id' labelAttr='label'}}
{{#each genderList as |value|}}
<option value="{{value.id}}">{{value.label}}</option>
{{/each}}
{{/select}}
</select> </select>
</div> </div>
</div> </div>

View File

@@ -2,11 +2,7 @@
{{!-- Npc Type (minion / adversary) --}} {{!-- Npc Type (minion / adversary) --}}
<li> <li>
<select class="attribute-dtype" name="system.type" {{^if data.editable_not_soft_locked}}disabled{{/if}}> <select class="attribute-dtype" name="system.type" {{^if data.editable_not_soft_locked}}disabled{{/if}}>
{{#select data.system.type}} {{selectOptions data.types selected=data.system.type valueAttr='id' labelAttr='label'}}
{{#each data.types as |t|}}
<option value="{{t.id}}">{{t.label}}</option>
{{/each}}
{{/select}}
</select> </select>
</li> </li>
{{!-- Martial --}} {{!-- Martial --}}

View File

@@ -22,11 +22,7 @@
<label> <label>
{{localize 'l5r5e.twenty_questions.part0.type'}} {{localize 'l5r5e.twenty_questions.part0.type'}}
<select name="template" class="skill-select"> <select name="template" class="skill-select">
{{#select data.template}} {{selectOptions templates selected=data.template valueAttr='id' labelAttr='label'}}
{{#each templates as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
</label> </label>
<br> <br>
@@ -46,12 +42,8 @@
<label> <label>
{{localize 'l5r5e.twenty_questions.increase_ring1'}} {{localize 'l5r5e.twenty_questions.increase_ring1'}}
<select name="step1.ring" class="ring-select"> <select name="step1.ring" class="ring-select">
{{#select data.step1.ring}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{selectOptions ringsList selected=data.step1.ring valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
</label> </label>
</td> </td>
@@ -59,16 +51,12 @@
<label> <label>
{{localize 'l5r5e.twenty_questions.increase_skill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<select name="step1.skill" class="skill-select"> <select name="step1.skill" class="skill-select">
{{#select data.step1.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step1.skill valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
</label> </label>
</td> </td>
@@ -94,39 +82,27 @@
<td class="third"> <td class="third">
{{localize 'l5r5e.twenty_questions.increase_ring1'}} {{localize 'l5r5e.twenty_questions.increase_ring1'}}
<select name="step2.ring" class="ring-select"> <select name="step2.ring" class="ring-select">
{{#select data.step2.ring}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{selectOptions ringsList selected=data.step2.ring valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
</td> </td>
<td class="third"> <td class="third">
{{localize 'l5r5e.twenty_questions.increase_skill2'}} {{localize 'l5r5e.twenty_questions.increase_skill2'}}
<select name="step2.skill1" class="skill-select"> <select name="step2.skill1" class="skill-select">
{{#select data.step2.skill1}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step2.skill1 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
<select name="step2.skill2" class="skill-select"> <select name="step2.skill2" class="skill-select">
{{#select data.step2.skill2}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step2.skill2 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
</td> </td>
<td class="third"> <td class="third">
@@ -160,20 +136,12 @@
<td class="fifty"> <td class="fifty">
{{localize 'l5r5e.twenty_questions.increase_ring2'}} {{localize 'l5r5e.twenty_questions.increase_ring2'}}
<select name="step3.ring1" class="ring-select"> <select name="step3.ring1" class="ring-select">
{{#select data.step3.ring1}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{selectOptions ringsList selected=data.step3.ring1 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
<select name="step3.ring2" class="ring-select"> <select name="step3.ring2" class="ring-select">
{{#select data.step3.ring2}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{selectOptions ringsList selected=data.step3.ring2 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
{{localize 'l5r5e.twenty_questions.part2.honor'}} {{localize 'l5r5e.twenty_questions.part2.honor'}}
<input type="number" name="step3.social_honor" min="0" max="100" value="{{data.step3.social_honor}}" data-dtype="Number" placeholder="0" /> <input type="number" name="step3.social_honor" min="0" max="100" value="{{data.step3.social_honor}}" data-dtype="Number" placeholder="0" />
@@ -181,64 +149,44 @@
<td class="fifty"> <td class="fifty">
{{localize 'l5r5e.twenty_questions.increase_skill3'}} {{localize 'l5r5e.twenty_questions.increase_skill3'}}
<select name="step3.skill1" class="skill-select"> <select name="step3.skill1" class="skill-select">
{{#select data.step3.skill1}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step3.skill1 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
<select name="step3.skill2" class="skill-select"> <select name="step3.skill2" class="skill-select">
{{#select data.step3.skill2}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step3.skill2 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
<select name="step3.skill3" class="skill-select"> <select name="step3.skill3" class="skill-select">
{{#select data.step3.skill3}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step3.skill3 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
<select name="step3.skill4" class="skill-select"> <select name="step3.skill4" class="skill-select">
{{#select data.step3.skill4}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step3.skill4 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
<select name="step3.skill5" class="skill-select"> <select name="step3.skill5" class="skill-select">
{{#select data.step3.skill5}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step3.skill5 valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
</td> </td>
</tr> </tr>
@@ -271,12 +219,8 @@
<label> <label>
{{localize 'l5r5e.twenty_questions.increase_ring1'}} {{localize 'l5r5e.twenty_questions.increase_ring1'}}
<select name="step4.ring" class="ring-select"> <select name="step4.ring" class="ring-select">
{{#select data.step4.ring}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{selectOptions ringsList selected=data.step4.ring valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
</label> </label>
<button class="next" name="next" type="button">{{localize 'l5r5e.twenty_questions.bt_next'}} <i class='fas fa-arrow-right'></i></button> <button class="next" name="next" type="button">{{localize 'l5r5e.twenty_questions.bt_next'}} <i class='fas fa-arrow-right'></i></button>
@@ -304,16 +248,12 @@
<td class="third"> <td class="third">
{{localize 'l5r5e.twenty_questions.increase_skill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<select name="step7.skill" class="skill-select"> <select name="step7.skill" class="skill-select">
{{#select data.step7.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsListStep7 as |skills catId|}} {{#each skillsListStep7 as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step7.skill valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/select}}
</select> </select>
</td> </td>
<td class="or"> <td class="or">
@@ -332,12 +272,8 @@
<td class="third"> <td class="third">
{{localize 'l5r5e.twenty_questions.increase_skill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<select name="step8.skill" class="skill-select" {{#ifCond data.step8.item.length '>' 0}}disabled{{/ifCond}}> <select name="step8.skill" class="skill-select" {{#ifCond data.step8.item.length '>' 0}}disabled{{/ifCond}}>
{{#select data.step8.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each noHonorSkillsList as |skillId|}} {{selectOptions noHonorSkillsList selected=data.step8.skill valueAttr='id' labelAttr='label'}}
<option value="{{skillId}}">{{localizeSkillId skillId}}</option>
{{/each}}
{{/select}}
</select> </select>
</td> </td>
<td class="or"> <td class="or">
@@ -415,18 +351,14 @@
{{localize 'l5r5e.twenty_questions.and'}} {{localize 'l5r5e.twenty_questions.and'}}
{{localize 'l5r5e.twenty_questions.increase_skill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<select name="step13.skill" class="skill-select" {{#ifCond data.step13.advantage.length '>' 0}}disabled{{/ifCond}}> <select name="step13.skill" class="skill-select" {{#ifCond data.step13.advantage.length '>' 0}}disabled{{/ifCond}}>
{{#select data.step13.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#ifCond cache.step13.advantage.length '==' '0'}} {{#ifCond cache.step13.advantage.length '==' '0'}}
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{selectOptions skills selected=../data.step13.skill valueAttr='id' labelAttr='label'}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup> </optgroup>
{{/each}} {{/each}}
{{/ifCond}} {{/ifCond}}
{{/select}}
</select> </select>
</td> </td>
<td class="or"> <td class="or">
@@ -478,16 +410,12 @@
<label> <label>
{{localize 'l5r5e.twenty_questions.increase_skill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<select name="step17.skill" class="skill-select"> <select name="step17.skill" class="skill-select">
{{#select data.step17.skill}} <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> {{#each skillsListStep17 as |skills catId|}}
{{#each skillsListStep17 as |skills catId|}} <optgroup label="{{localizeSkill catId 'title'}}">
<optgroup label="{{localizeSkill catId 'title'}}"> {{selectOptions skills selected=../data.step17.skill valueAttr='id' labelAttr='label'}}
{{#each skills as |obj|}} </optgroup>
<option value="{{obj.id}}">{{obj.label}}</option> {{/each}}
{{/each}}
</optgroup>
{{/each}}
{{/select}}
</select> </select>
</label> </label>
{{else}} {{else}}
@@ -538,16 +466,12 @@
<td> <td>
{{localize 'l5r5e.twenty_questions.increase_skill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<select name="step18.skill" class="skill-select"> <select name="step18.skill" class="skill-select">
{{#select data.step18.skill}} <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> {{#each skillsList as |skills catId|}}
{{#each skillsList as |skills catId|}} <optgroup label="{{localizeSkill catId 'title'}}">
<optgroup label="{{localizeSkill catId 'title'}}"> {{selectOptions skills selected=../data.step18.skill valueAttr='id' labelAttr='label'}}
{{#each skills as |obj|}} </optgroup>
<option value="{{obj.id}}">{{obj.label}}</option> {{/each}}
{{/each}}
</optgroup>
{{/each}}
{{/select}}
</select> </select>
{{localize 'l5r5e.twenty_questions.part6.d10r2_drop_items'}} {{localize 'l5r5e.twenty_questions.part6.d10r2_drop_items'}}
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step18.heritage_item stepName='step18.heritage_item' itemType='items' hideDndAt=1}} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step18.heritage_item stepName='step18.heritage_item' itemType='items' hideDndAt=1}}
@@ -558,16 +482,12 @@
<label> <label>
{{localize 'l5r5e.twenty_questions.increase_skill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<select name="step17.skill" class="skill-select"> <select name="step17.skill" class="skill-select">
{{#select data.step17.skill}} <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
<option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> {{#each skillsListStep17 as |skills catId|}}
{{#each skillsListStep17 as |skills catId|}} <optgroup label="{{localizeSkill catId 'title'}}">
<optgroup label="{{localizeSkill catId 'title'}}"> {{selectOptions skills selected=../data.step17.skill valueAttr='id' labelAttr='label'}}
{{#each skills as |obj|}} </optgroup>
<option value="{{obj.id}}">{{obj.label}}</option> {{/each}}
{{/each}}
</optgroup>
{{/each}}
{{/select}}
</select> </select>
</label> </label>
{{/ifCond}} {{/ifCond}}

View File

@@ -25,13 +25,11 @@
<label>{{localizeSkill data.skill.cat 'title'}}</label> <label>{{localizeSkill data.skill.cat 'title'}}</label>
{{/if}} {{/if}}
<select class="attribute-dtype" name="skill"> <select class="attribute-dtype" name="skill">
{{#select data.skill.id}} {{#if useCategory}}
{{#select data.skill.cat}} {{selectOptions data.skill.list selected=data.skill.cat valueAttr='id' labelAttr='label'}}
{{#each data.skill.list as |item|}} {{else}}
<option value="{{item.id}}">{{item.label}}</option> {{selectOptions data.skill.list selected=data.skill.id valueAttr='id' labelAttr='label'}}
{{/each}} {{/if}}
{{/select}}
{{/select}}
</select> </select>
{{else}} {{else}}
<label>{{localizeSkill data.skill.cat 'title'}}</label> <label>{{localizeSkill data.skill.cat 'title'}}</label>

View File

@@ -8,36 +8,24 @@
{{!-- Attributes Tab --}} {{!-- Attributes Tab --}}
<article class="attributes" data-group="primary" data-tab="attributes"> <article class="attributes" data-group="primary" data-tab="attributes">
<select name="system.advancement_type" id="advancement_type"> <select name="system.advancement_type" id="advancement_type">
{{#select data.system.advancement_type}} {{selectOptions data.subTypesList selected=data.system.advancement_type valueAttr='id' labelAttr='label' localize=true}}
{{#each data.subTypesList as |label type|}}
<option value="{{type}}">{{localize label}}</option>
{{/each}}
{{/select}}
</select> </select>
{{#ifCond data.system.advancement_type '==' 'ring'}} {{#ifCond data.system.advancement_type '==' 'ring'}}
<select name="system.ring" id="advancement_ring"> <select name="system.ring" id="advancement_ring">
{{#select data.system.ring}} {{selectOptions data.ringsList selected=data.system.ring valueAttr='id' labelAttr='label'}}
{{#each data.ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
{{/ifCond}} {{/ifCond}}
{{#ifCond data.system.advancement_type '==' 'skill'}} {{#ifCond data.system.advancement_type '==' 'skill'}}
<select name="system.skill" id="advancement_skill"> <select name="system.skill" id="advancement_skill">
<option value="">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#select data.system.skill}} {{#each data.skillsList as |skills catId|}}
{{#each data.skillsList as |skills catId|}} <optgroup label="{{localizeSkill catId 'title'}}">
<optgroup label="{{localizeSkill catId 'title'}}"> {{selectOptions skills selected=../data.system.skill valueAttr='id' labelAttr='label'}}
{{#each skills as |obj|}} </optgroup>
<option value="{{obj.id}}">{{obj.label}}</option> {{/each}}
{{/each}} </select>
</optgroup>
{{/each}}
{{/select}}
</select>
{{/ifCond}} {{/ifCond}}
<label class="cursus attribute-value checkbox"> <label class="cursus attribute-value checkbox">
<input type="checkbox" name="system.in_curriculum" {{checked data.system.in_curriculum}} /> <input type="checkbox" name="system.in_curriculum" {{checked data.system.in_curriculum}} />

View File

@@ -8,18 +8,10 @@
{{!-- Attributes Tab --}} {{!-- Attributes Tab --}}
<article class="attributes" data-group="primary" data-tab="attributes"> <article class="attributes" data-group="primary" data-tab="attributes">
<select name="system.ring"> <select name="system.ring">
{{#select data.system.ring}} {{selectOptions data.ringsList selected=data.system.ring valueAttr='id' labelAttr='label'}}
{{#each data.ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
<select class="attribute" name="system.peculiarity_type"> <select class="attribute" name="system.peculiarity_type">
{{#select data.system.peculiarity_type}} {{selectOptions data.subTypesList selected=data.system.peculiarity_type valueAttr='id' labelAttr='label'}}
{{#each data.subTypesList as |type|}}
<option value="{{type.id}}">{{type.label}}</option>
{{/each}}
{{/select}}
</select> </select>
<label class="cursus attribute-value checkbox"> <label class="cursus attribute-value checkbox">
<input type="checkbox" name="system.in_curriculum" {{checked data.system.in_curriculum}} /> <input type="checkbox" name="system.in_curriculum" {{checked data.system.in_curriculum}} />

View File

@@ -8,18 +8,10 @@
{{!-- Attributes Tab --}} {{!-- Attributes Tab --}}
<article class="attributes" data-group="primary" data-tab="attributes"> <article class="attributes" data-group="primary" data-tab="attributes">
<select name="system.ring"> <select name="system.ring">
{{#select data.system.ring}} {{selectOptions data.ringsList selected=data.system.ring valueAttr='id' labelAttr='label'}}
{{#each data.ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
<select name="system.technique_type"> <select name="system.technique_type">
{{#select data.system.technique_type}} {{selectOptions data.techniquesList selected=data.system.technique_type valueAttr='id' labelAttr='label'}}
{{#each data.techniquesList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
</select> </select>
<label class="cursus attribute-value checkbox"> <label class="cursus attribute-value checkbox">
<input type="checkbox" name="system.in_curriculum" {{checked data.system.in_curriculum}} /> <input type="checkbox" name="system.in_curriculum" {{checked data.system.in_curriculum}} />

View File

@@ -23,11 +23,7 @@
<label class="skillType"> <label class="skillType">
{{localize 'l5r5e.skills.label'}} {{localize 'l5r5e.skills.label'}}
<select class="attribute-dtype" name="system.skill"> <select class="attribute-dtype" name="system.skill">
{{#select data.system.skill}} {{selectOptions data.skills selected=data.system.skill valueAttr='id' labelAttr='label' localize=true}}
{{#each data.skills as |id cat|}}
<option value="{{id}}">{{localizeSkillId id}}</option>
{{/each}}
{{/select}}
</select> </select>
</label> </label>
<fieldset class="stats"> <fieldset class="stats">