Skip to content

Commit

Permalink
Fix popup text not showing up in raid emulator for some triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
Huynhs committed Jan 6, 2025
1 parent 4fc0d14 commit 44e1360
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ui/raidboss/emulator/overrides/RaidEmulatorTimelineUI.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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');
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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);
}
}
}
1 change: 1 addition & 0 deletions ui/raidboss/raidemulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const raidEmulatorOnLoad = async () => {

timelineController.SetPopupTextInterface(new PopupTextGenerator(popupText));

timelineUI.setPopupText(popupText);
emulator.setPopupText(popupText);

const emulatorWatchCombatantsOverride = new RaidEmulatorWatchCombatantsOverride(
Expand Down

0 comments on commit 44e1360

Please sign in to comment.