Skip to content

Commit

Permalink
feat: Skip first split and add finish split for runs without a compar…
Browse files Browse the repository at this point in the history
…ison
  • Loading branch information
Panzerhandschuh committed Dec 28, 2024
1 parent a908c77 commit 4cdc2ff
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions scripts/pages/end-of-run/end-of-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ class EndOfRunHandler {

// Loop through each zone in the run and create a neutral Split panel with no diff/delta
run.runSplits.segments.forEach((segment, i) => {
if (i === 0) {
return;
}

// TODO: Subsegments!
const name = Timer.getSegmentName(i, 0);

Expand All @@ -213,13 +217,23 @@ class EndOfRunHandler {
time: segment.subsegments[0].timeReached,
isFirst: true
});
});

// Scroll the rightmost split
if (i === run.runSplits.segments.length - 1) {
splitWrapper.ScrollParentToMakePanelFit(3, false);
}
// Finish split
const numSegments = run.runSplits.segments.length;
const splitWrapper = $.CreatePanel('Panel', this.panels.splits, `Split${numSegments}`, {
class: 'endofrun__split'
});

Object.assign($.CreatePanel('Split', splitWrapper, '', { class: 'split--eor' }), {
name: numSegments,
time: run.runTime,
isFirst: true
});

// Scroll the rightmost split
splitWrapper.ScrollParentToMakePanelFit(3, false);

this.panels.cp.SetDialogVariable('comparison_name', '');

this.panels.detailedStats.AddClass('endofrun__stats--hidden');
Expand Down

0 comments on commit 4cdc2ff

Please sign in to comment.