Skip to content

Commit

Permalink
feat(timetravel): find command offset
Browse files Browse the repository at this point in the history
  • Loading branch information
blakebyrnes committed Mar 5, 2022
1 parent 526d353 commit 298887c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions timetravel/player/TimetravelPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ export default class TimetravelPlayer extends TypedEventEmitter<{
return false;
}

public async findCommandPercentOffset(commandId: number): Promise<number> {
this.isReady ??= this.load();
await this.isReady;
for (const tick of this.activeTab.ticks) {
if (tick.commandId === commandId) return tick.timelineOffsetPercent;
}
return 0;
}

public async loadTick(tick: ITick): Promise<void> {
await this.isReady;
const tab = this.activeTab;
Expand Down

0 comments on commit 298887c

Please sign in to comment.