diff --git a/ui/raidboss/emulator/overrides/RaidEmulatorTimelineUI.ts b/ui/raidboss/emulator/overrides/RaidEmulatorTimelineUI.ts index af7241c602..a202374471 100644 --- a/ui/raidboss/emulator/overrides/RaidEmulatorTimelineUI.ts +++ b/ui/raidboss/emulator/overrides/RaidEmulatorTimelineUI.ts @@ -1,4 +1,6 @@ import { UnreachableCode } from '../../../../resources/not_reached'; +import { LooseTimelineTrigger } from '../../../../types/trigger'; +import { PopupText } from '../../popup-text'; import { RaidbossOptions } from '../../raidboss_options'; import { TimelineUI } from '../../timeline'; import { Event } from '../../timeline_parser'; @@ -23,6 +25,9 @@ export default class RaidEmulatorTimelineUI extends TimelineUI { emulatedStatus = 'pause'; $barContainer: HTMLElement; $progressTemplate: HTMLElement; + + private popupText?: PopupText; + constructor(protected options: RaidbossOptions) { super(); const container = document.querySelector('.timer-bar-container'); @@ -100,6 +105,10 @@ export default class RaidEmulatorTimelineUI extends TimelineUI { bar.$bar.style.width = `${barProg}%`; } + setPopupText(popupText: PopupText): void { + this.popupText = popupText; + } + override Init(): void { // This space intentionally left blank } @@ -168,4 +177,15 @@ export default class RaidEmulatorTimelineUI extends TimelineUI { bar.forceRemoveAt += this.options.KeepExpiredTimerBarsForSeconds * 1000; }); } + + // Override + override OnTrigger( + trigger: LooseTimelineTrigger, + matches: RegExpExecArray | null, + currentTime: number, + ): void { + if (this.popupText) { + this.popupText.OnTrigger(trigger, matches, currentTime); + } + } } diff --git a/ui/raidboss/raidemulator.ts b/ui/raidboss/raidemulator.ts index 8bac5f0a39..11df2827fe 100644 --- a/ui/raidboss/raidemulator.ts +++ b/ui/raidboss/raidemulator.ts @@ -191,6 +191,7 @@ const raidEmulatorOnLoad = async () => { timelineController.SetPopupTextInterface(new PopupTextGenerator(popupText)); + timelineUI.setPopupText(popupText); emulator.setPopupText(popupText); const emulatorWatchCombatantsOverride = new RaidEmulatorWatchCombatantsOverride(