forked from xziino/ff14-mitigator
Compare commits
No commits in common. "4345fadc1cb2ad8cbc11d42804009922219eee2d" and "28c045fee7ff43e0d1aa754b5ef482f49089d92a" have entirely different histories.
4345fadc1c
...
28c045fee7
@ -836,9 +836,7 @@ function layoutBossActions(mechanics, duration) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function assignmentWindowMs(assignment) {
|
function assignmentWindowMs(assignment) {
|
||||||
const durationMs = Math.max(1, assignmentDurationSeconds(assignment)) * 1000;
|
return Math.max(1, assignmentDurationSeconds(assignment)) * 1000;
|
||||||
const cooldownMs = assignmentCooldownSeconds(assignment) * 1000;
|
|
||||||
return Math.max(durationMs, cooldownMs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sameAssignmentRef(mechanic, assignment, ref) {
|
function sameAssignmentRef(mechanic, assignment, ref) {
|
||||||
@ -849,9 +847,7 @@ function sameAssignmentRef(mechanic, assignment, ref) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function assignmentOverlapsJob(plan, job, ability, timestamp, ignore = null, candidate = null) {
|
function assignmentOverlapsJob(plan, job, ability, timestamp, ignore = null, candidate = null) {
|
||||||
const candidateDurationMs = Math.max(candidate ? assignmentDurationSeconds(candidate) : 0, 1) * 1000;
|
const candidateWindow = Math.max(candidate ? assignmentDurationSeconds(candidate) : 0, 1) * 1000;
|
||||||
const candidateCooldownMs = candidate ? assignmentCooldownSeconds(candidate) * 1000 : 0;
|
|
||||||
const candidateWindow = Math.max(candidateDurationMs, candidateCooldownMs);
|
|
||||||
const candidateStart = Math.max(0, timestamp);
|
const candidateStart = Math.max(0, timestamp);
|
||||||
const candidateEnd = candidateStart + candidateWindow;
|
const candidateEnd = candidateStart + candidateWindow;
|
||||||
const ignoredActivation = assignmentEntryForRef(plan, ignore);
|
const ignoredActivation = assignmentEntryForRef(plan, ignore);
|
||||||
@ -1038,12 +1034,7 @@ function refreshTimeline(planId) {
|
|||||||
if (normalizeActivationCopies(plan)) updatePlan(planId, { mechanics: plan.mechanics });
|
if (normalizeActivationCopies(plan)) updatePlan(planId, { mechanics: plan.mechanics });
|
||||||
const timeline = document.getElementById('planner-timeline');
|
const timeline = document.getElementById('planner-timeline');
|
||||||
const settings = document.getElementById('timeline-settings');
|
const settings = document.getElementById('timeline-settings');
|
||||||
if (timeline) {
|
if (timeline) timeline.innerHTML = renderTimelineHtml(plan);
|
||||||
const savedScroll = timeline.querySelector('.timeline-scroll')?.scrollLeft ?? 0;
|
|
||||||
timeline.innerHTML = renderTimelineHtml(plan);
|
|
||||||
const newScroll = timeline.querySelector('.timeline-scroll');
|
|
||||||
if (newScroll && savedScroll > 0) newScroll.scrollLeft = savedScroll;
|
|
||||||
}
|
|
||||||
if (settings) settings.innerHTML = renderTimelineSettingsHtml(plan);
|
if (settings) settings.innerHTML = renderTimelineSettingsHtml(plan);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1251,7 +1242,7 @@ function initTimeline(planId) {
|
|||||||
timeline.addEventListener('pointermove', e => {
|
timeline.addEventListener('pointermove', e => {
|
||||||
if (!timelinePan || timelinePan.pointerId !== e.pointerId) return;
|
if (!timelinePan || timelinePan.pointerId !== e.pointerId) return;
|
||||||
const dx = e.clientX - timelinePan.startX;
|
const dx = e.clientX - timelinePan.startX;
|
||||||
if (Math.abs(dx) > 8) {
|
if (Math.abs(dx) > 3) {
|
||||||
timelinePan.moved = true;
|
timelinePan.moved = true;
|
||||||
timelinePan.scroll.classList.add('timeline-scroll--dragging');
|
timelinePan.scroll.classList.add('timeline-scroll--dragging');
|
||||||
timelinePan.scroll.scrollLeft = timelinePan.startScrollLeft - dx;
|
timelinePan.scroll.scrollLeft = timelinePan.startScrollLeft - dx;
|
||||||
@ -1316,11 +1307,8 @@ function initTimeline(planId) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setPointerCapture() leitet compatibility mouse events (inkl. click) an das
|
const track = e.target.closest('.timeline-player-row .timeline-track');
|
||||||
// capturing element um, daher e.target nicht verlässlich — echtes Element per Hit-Test:
|
const row = e.target.closest('.timeline-player-row');
|
||||||
const actualTarget = document.elementFromPoint(e.clientX, e.clientY);
|
|
||||||
const track = actualTarget?.closest('.timeline-player-row .timeline-track');
|
|
||||||
const row = actualTarget?.closest('.timeline-player-row');
|
|
||||||
if (!track || !row) return;
|
if (!track || !row) return;
|
||||||
const plan = getPlan(planId);
|
const plan = getPlan(planId);
|
||||||
if (!plan) return;
|
if (!plan) return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user