forked from xziino/ff14-mitigator
Planner import modal: default to Mechaniken + Mitigation, rename option
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8f832e1a0a
commit
d73dd340c2
@ -375,9 +375,11 @@ function aoeEventsToMechanics(aoeEvents, fightStart, phases, players, withMitiga
|
|||||||
ev.timestamp >= p.startTime && ev.timestamp < p.endTime
|
ev.timestamp >= p.startTime && ev.timestamp < p.endTime
|
||||||
);
|
);
|
||||||
|
|
||||||
const targetsWithData = ev.targets.filter(t => (t.unmitigatedAmount ?? 0) > 0);
|
const nonTankTargets = ev.targets.filter(t => t.role !== 'tank' && (t.unmitigatedAmount ?? 0) > 0);
|
||||||
const avgUnmit = targetsWithData.length > 0
|
const fallbackTargets = ev.targets.filter(t => (t.unmitigatedAmount ?? 0) > 0);
|
||||||
? Math.round(targetsWithData.reduce((s, t) => s + t.unmitigatedAmount, 0) / targetsWithData.length)
|
const relevantTargets = nonTankTargets.length > 0 ? nonTankTargets : fallbackTargets;
|
||||||
|
const avgUnmit = relevantTargets.length > 0
|
||||||
|
? Math.round(relevantTargets.reduce((s, t) => s + t.unmitigatedAmount, 0) / relevantTargets.length)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
let assignments = [];
|
let assignments = [];
|
||||||
@ -465,7 +467,7 @@ function showImportModal(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reset to defaults
|
// Reset to defaults
|
||||||
document.querySelectorAll('input[name="import-what"]').forEach(r => { r.checked = r.value === 'mechanics'; });
|
document.querySelectorAll('input[name="import-what"]').forEach(r => { r.checked = r.value === 'with-mitigations'; });
|
||||||
document.querySelectorAll('input[name="import-where"]').forEach(r => { r.checked = r.value === 'new'; });
|
document.querySelectorAll('input[name="import-where"]').forEach(r => { r.checked = r.value === 'new'; });
|
||||||
document.getElementById('import-new-section').style.display = '';
|
document.getElementById('import-new-section').style.display = '';
|
||||||
document.getElementById('import-merge-section').style.display = 'none';
|
document.getElementById('import-merge-section').style.display = 'none';
|
||||||
|
|||||||
@ -43,12 +43,12 @@
|
|||||||
<div class="modal-section">
|
<div class="modal-section">
|
||||||
<div class="modal-label">Was importieren?</div>
|
<div class="modal-label">Was importieren?</div>
|
||||||
<label class="modal-radio-label">
|
<label class="modal-radio-label">
|
||||||
<input type="radio" name="import-what" value="mechanics" checked>
|
<input type="radio" name="import-what" value="with-mitigations" checked>
|
||||||
<span>Nur Mechaniken</span>
|
<span>Mechaniken + Mitigation</span>
|
||||||
</label>
|
</label>
|
||||||
<label class="modal-radio-label">
|
<label class="modal-radio-label">
|
||||||
<input type="radio" name="import-what" value="with-mitigations">
|
<input type="radio" name="import-what" value="mechanics">
|
||||||
<span>Mechaniken + erkannte Mitigations als Startpunkt</span>
|
<span>Nur Mechaniken</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user