|
|
|
@ -9,7 +9,7 @@ import { PlanService, UrlError } from '../_services/plan.service';
|
|
|
|
|
import { Plan, PlanElement, PlanMetadata } from '../_models/plan';
|
|
|
|
|
import { WorldAreaService } from '../_services/world-area.service';
|
|
|
|
|
import { WorldArea } from '../_models/world-area';
|
|
|
|
|
import { Subscription, from } from 'rxjs';
|
|
|
|
|
import { Subscription, config, from } from 'rxjs';
|
|
|
|
|
import { open } from '@tauri-apps/api/dialog';
|
|
|
|
|
import { OverlayService, StateEvent } from '../_services/overlay.service';
|
|
|
|
|
import { appWindow } from '@tauri-apps/api/window';
|
|
|
|
@ -19,12 +19,6 @@ import { MatDialog } from '@angular/material/dialog';
|
|
|
|
|
import { TimeTrackerService } from '../_services/time-tracker.service';
|
|
|
|
|
import { RunStatService } from '../_services/run-stat.service';
|
|
|
|
|
|
|
|
|
|
enum Resume {
|
|
|
|
|
Discard,
|
|
|
|
|
Next,
|
|
|
|
|
Instant
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'plan-display',
|
|
|
|
|
templateUrl: './plan-display.component.html',
|
|
|
|
@ -84,6 +78,7 @@ export class PlanDisplayComponent implements AfterViewInit, OnInit {
|
|
|
|
|
this.currentPlan = plan;
|
|
|
|
|
|
|
|
|
|
if (this.configService.config.enableStopwatch) {
|
|
|
|
|
console.log(configService.config.runCompareHistory);
|
|
|
|
|
this.loadComparisonData(this.currentPlan);
|
|
|
|
|
}
|
|
|
|
|
this.timeTrackerService.onNewRun(plan);
|
|
|
|
@ -238,6 +233,7 @@ export class PlanDisplayComponent implements AfterViewInit, OnInit {
|
|
|
|
|
this.prev();
|
|
|
|
|
if (this.configService.config.enableStopwatch) {
|
|
|
|
|
this.timeTrackerService.onForcePrev(this.currentPlan!.plan[this.currentPlan!.current].area_key);
|
|
|
|
|
this.checkCheckpoint();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -245,6 +241,7 @@ export class PlanDisplayComponent implements AfterViewInit, OnInit {
|
|
|
|
|
this.next();
|
|
|
|
|
if (this.configService.config.enableStopwatch) {
|
|
|
|
|
this.timeTrackerService.onForceNext(this.currentPlan!.plan[this.currentPlan!.current].area_key);
|
|
|
|
|
this.checkCheckpoint();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -274,6 +271,7 @@ export class PlanDisplayComponent implements AfterViewInit, OnInit {
|
|
|
|
|
const currentElem = this.currentPlan.plan[this.currentPlan.current];
|
|
|
|
|
if(currentElem.checkpoint && !currentElem.checkpoint_your_millis) {
|
|
|
|
|
currentElem.checkpoint_your_millis = this.timeTrackerService.elapsedTimeMillis;
|
|
|
|
|
this.timeTrackerService.reportCheckpoint(currentElem.uuid!);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -281,17 +279,20 @@ export class PlanDisplayComponent implements AfterViewInit, OnInit {
|
|
|
|
|
if (!element.checkpoint || !element.checkpoint_your_millis || !element.checkpoint_millis) return "";
|
|
|
|
|
|
|
|
|
|
const diff = element.checkpoint_your_millis - element.checkpoint_millis;
|
|
|
|
|
const neg = diff < 0;
|
|
|
|
|
const neg = diff <= 0;
|
|
|
|
|
const abs = Math.abs(diff);
|
|
|
|
|
const cssClass = neg ? "negative-diff" : "positive-diff";
|
|
|
|
|
return `${neg ? "-" : "+"}${this.timeTrackerService.hmsTimestamp(abs)}`;
|
|
|
|
|
if(diff == 0) {
|
|
|
|
|
return `${neg ? "-" : "+"}00:00:00`;
|
|
|
|
|
} else {
|
|
|
|
|
return `${neg ? "-" : "+"}${this.timeTrackerService.hmsTimestamp(abs)}`;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
yourDiffClass(element: PlanElement): string {
|
|
|
|
|
if (!element.checkpoint || !element.checkpoint_your_millis || !element.checkpoint_millis) return "";
|
|
|
|
|
|
|
|
|
|
const diff = element.checkpoint_your_millis - element.checkpoint_millis;
|
|
|
|
|
const neg = diff < 0;
|
|
|
|
|
const neg = diff <= 0;
|
|
|
|
|
return neg ? "negative-diff" : "positive-diff";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -371,9 +372,11 @@ export class PlanDisplayComponent implements AfterViewInit, OnInit {
|
|
|
|
|
if (event.deltaY < 0) {
|
|
|
|
|
this.prev();
|
|
|
|
|
this.timeTrackerService.onForcePrev(this.currentPlan!.plan[this.currentPlan!.current].area_key);
|
|
|
|
|
this.checkCheckpoint();
|
|
|
|
|
} else {
|
|
|
|
|
this.next();
|
|
|
|
|
this.timeTrackerService.onForceNext(this.currentPlan!.plan[this.currentPlan!.current].area_key);
|
|
|
|
|
this.checkCheckpoint();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|