forked from xziino/ff14-mitigator
Merge remote-tracking branch 'origin/main' into akus_schabernack4
This commit is contained in:
commit
4345fadc1c
@ -836,7 +836,9 @@ function layoutBossActions(mechanics, duration) {
|
||||
}
|
||||
|
||||
function assignmentWindowMs(assignment) {
|
||||
return Math.max(1, assignmentDurationSeconds(assignment)) * 1000;
|
||||
const durationMs = Math.max(1, assignmentDurationSeconds(assignment)) * 1000;
|
||||
const cooldownMs = assignmentCooldownSeconds(assignment) * 1000;
|
||||
return Math.max(durationMs, cooldownMs);
|
||||
}
|
||||
|
||||
function sameAssignmentRef(mechanic, assignment, ref) {
|
||||
@ -847,7 +849,9 @@ function sameAssignmentRef(mechanic, assignment, ref) {
|
||||
}
|
||||
|
||||
function assignmentOverlapsJob(plan, job, ability, timestamp, ignore = null, candidate = null) {
|
||||
const candidateWindow = Math.max(candidate ? assignmentDurationSeconds(candidate) : 0, 1) * 1000;
|
||||
const candidateDurationMs = 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 candidateEnd = candidateStart + candidateWindow;
|
||||
const ignoredActivation = assignmentEntryForRef(plan, ignore);
|
||||
@ -1034,7 +1038,12 @@ function refreshTimeline(planId) {
|
||||
if (normalizeActivationCopies(plan)) updatePlan(planId, { mechanics: plan.mechanics });
|
||||
const timeline = document.getElementById('planner-timeline');
|
||||
const settings = document.getElementById('timeline-settings');
|
||||
if (timeline) timeline.innerHTML = renderTimelineHtml(plan);
|
||||
if (timeline) {
|
||||
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);
|
||||
}
|
||||
|
||||
@ -1242,7 +1251,7 @@ function initTimeline(planId) {
|
||||
timeline.addEventListener('pointermove', e => {
|
||||
if (!timelinePan || timelinePan.pointerId !== e.pointerId) return;
|
||||
const dx = e.clientX - timelinePan.startX;
|
||||
if (Math.abs(dx) > 3) {
|
||||
if (Math.abs(dx) > 8) {
|
||||
timelinePan.moved = true;
|
||||
timelinePan.scroll.classList.add('timeline-scroll--dragging');
|
||||
timelinePan.scroll.scrollLeft = timelinePan.startScrollLeft - dx;
|
||||
@ -1307,8 +1316,11 @@ function initTimeline(planId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const track = e.target.closest('.timeline-player-row .timeline-track');
|
||||
const row = e.target.closest('.timeline-player-row');
|
||||
// setPointerCapture() leitet compatibility mouse events (inkl. click) an das
|
||||
// capturing element um, daher e.target nicht verlässlich — echtes Element per Hit-Test:
|
||||
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;
|
||||
const plan = getPlan(planId);
|
||||
if (!plan) return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user