Character generator - v13 : remove hidden condition on skills pop-up dropdown as a temporary solution. (skill will not be filtered by pre-requisite)
This commit is contained in:
+2
-27
@@ -28,7 +28,7 @@
|
||||
</option>
|
||||
|
||||
{{#each skills.trained as |skill id|}}
|
||||
<option hidden value="{{skill.uuid}}" data-uuid="{{skill.uuid}}" {{skill.disabled}}
|
||||
<option value="{{skill.uuid}}" data-uuid="{{skill.uuid}}" {{skill.disabled}}
|
||||
data-prerequisite_ids='[{{#each skill.system.prerequisite_ids as |id|}}"{{id}}"{{#unless @last}},{{/unless}}{{/each}}]'>
|
||||
{{skill.name}}</option>
|
||||
{{/each}}
|
||||
@@ -37,29 +37,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function updateDropdownExpert() {
|
||||
// Logic to update dropdownTrained based on the selection of dropdownExpert
|
||||
|
||||
let dropdownExpert = document.getElementById('dropdownExpert');
|
||||
let dropdownTrained = document.getElementById('dropdownTrained');
|
||||
let selectedValue = dropdownExpert.options[dropdownExpert.selectedIndex].getAttribute('data-uuid');
|
||||
|
||||
let prerequisiteIds = JSON.parse(dropdownExpert.options[dropdownExpert.selectedIndex].getAttribute('data-prerequisite_ids'));
|
||||
|
||||
for (let i = 0; i < dropdownTrained.options.length; i++) {
|
||||
let option = dropdownTrained.options[i];
|
||||
let optionUuid = option.getAttribute('data-uuid');
|
||||
if (prerequisiteIds.includes(optionUuid)) {
|
||||
option.hidden = false;
|
||||
} else {
|
||||
option.hidden = true;
|
||||
if (dropdownTrained.options[dropdownTrained.selectedIndex].getAttribute('data-uuid') == optionUuid) {
|
||||
dropdownTrained.selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
+5
-53
@@ -1,3 +1,5 @@
|
||||
<script type="text/javascript" src="relative/path/to/your/javascript.js"></script>
|
||||
|
||||
<div class="mosh">
|
||||
|
||||
<form id="skillForm" class="{{cssClass}} characterGeneratorSkillPopup">
|
||||
@@ -27,7 +29,7 @@
|
||||
</option>
|
||||
|
||||
{{#each skills.expert as |skill id|}}
|
||||
<option hidden value="{{skill.uuid}}" data-uuid="{{skill.uuid}}" {{skill.disabled}}
|
||||
<option value="{{skill.uuid}}" data-uuid="{{skill.uuid}}" {{skill.disabled}}
|
||||
data-prerequisite_ids='[{{#each skill.system.prerequisite_ids as |id|}}"{{id}}"{{#unless @last}},{{/unless}}{{/each}}]'>
|
||||
{{skill.name}}</option>
|
||||
{{/each}}
|
||||
@@ -41,7 +43,7 @@
|
||||
</option>
|
||||
|
||||
{{#each skills.trained as |skill id|}}
|
||||
<option hidden value="{{skill.uuid}}" data-uuid="{{skill.uuid}}" {{skill.disabled}}
|
||||
<option value="{{skill.uuid}}" data-uuid="{{skill.uuid}}" {{skill.disabled}}
|
||||
data-prerequisite_ids='[{{#each skill.system.prerequisite_ids as |id|}}"{{id}}"{{#unless @last}},{{/unless}}{{/each}}]'>
|
||||
{{skill.name}}</option>
|
||||
{{/each}}
|
||||
@@ -50,54 +52,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
function updateDropdownMaster() {
|
||||
// Logic to update dropdownExpert based on the selection of dropdownMaster
|
||||
|
||||
let dropdownMaster = document.getElementById('dropdownMaster');
|
||||
let dropdownExpert = document.getElementById('dropdownExpert');
|
||||
let selectedValue = dropdownMaster.options[dropdownMaster.selectedIndex].getAttribute('data-uuid');
|
||||
|
||||
let prerequisiteIds = JSON.parse(dropdownMaster.options[dropdownMaster.selectedIndex].getAttribute('data-prerequisite_ids'));
|
||||
|
||||
for (let i = 0; i < dropdownExpert.options.length; i++) {
|
||||
let option = dropdownExpert.options[i];
|
||||
let optionUuid = option.getAttribute('data-uuid');
|
||||
if (prerequisiteIds.includes(optionUuid)) {
|
||||
option.hidden = false;
|
||||
} else {
|
||||
option.hidden = true;
|
||||
if (dropdownExpert.options[dropdownExpert.selectedIndex].getAttribute('data-uuid') == optionUuid) {
|
||||
dropdownExpert.selectedIndex = 0;
|
||||
let dropdownTrained = document.getElementById('dropdownTrained');
|
||||
dropdownTrained.selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function updateDropdownExpert() {
|
||||
// Logic to update dropdownTrained based on the selection of dropdownExpert
|
||||
|
||||
let dropdownExpert = document.getElementById('dropdownExpert');
|
||||
let dropdownTrained = document.getElementById('dropdownTrained');
|
||||
let selectedValue = dropdownExpert.options[dropdownExpert.selectedIndex].getAttribute('data-uuid');
|
||||
|
||||
let prerequisiteIds = JSON.parse(dropdownExpert.options[dropdownExpert.selectedIndex].getAttribute('data-prerequisite_ids'));
|
||||
|
||||
for (let i = 0; i < dropdownTrained.options.length; i++) {
|
||||
let option = dropdownTrained.options[i];
|
||||
let optionUuid = option.getAttribute('data-uuid');
|
||||
if (prerequisiteIds.includes(optionUuid)) {
|
||||
option.hidden = false;
|
||||
} else {
|
||||
option.hidden = true;
|
||||
if (dropdownTrained.options[dropdownTrained.selectedIndex].getAttribute('data-uuid') == optionUuid) {
|
||||
dropdownTrained.selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
Reference in New Issue
Block a user