From fd1ea8230ab73007cb33f7ab9d486841321275cc Mon Sep 17 00:00:00 2001 From: Souma-Sumire <553469159@qq.com> Date: Wed, 4 Feb 2026 14:23:43 +0800 Subject: [PATCH 1/2] Update popup-text.ts --- ui/raidboss/popup-text.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/raidboss/popup-text.ts b/ui/raidboss/popup-text.ts index 017c4f3744d..d711020c79e 100644 --- a/ui/raidboss/popup-text.ts +++ b/ui/raidboss/popup-text.ts @@ -719,7 +719,7 @@ export class PopupText { } uniqueById.set(triggerSet.id, triggerSet); } - this.triggerSets = [...noIdList, ...uniqueById.values()]; + this.triggerSets = [...uniqueById.values(), ...noIdList]; this.triggerSetsById = Object.fromEntries(uniqueById); } From 76264bee510b6c4e9efe42ab970b9ac7bb705637 Mon Sep 17 00:00:00 2001 From: Souma-Sumire <553469159@qq.com> Date: Wed, 4 Feb 2026 16:00:42 +0800 Subject: [PATCH 2/2] Update popup-text.ts --- ui/raidboss/popup-text.ts | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/ui/raidboss/popup-text.ts b/ui/raidboss/popup-text.ts index d711020c79e..705b2cd3b1a 100644 --- a/ui/raidboss/popup-text.ts +++ b/ui/raidboss/popup-text.ts @@ -704,23 +704,26 @@ export class PopupText { this.triggerSets.push(...this.options.Triggers); // Eliminate any trigger sets with duplicate ids, allowing later ones to override earlier ones. - const uniqueById = new Map(); - const noIdList: typeof this.triggerSets = []; - for (const triggerSet of this.triggerSets) { - if (triggerSet.id === undefined) { - noIdList.push(triggerSet); - continue; - } - const existing = uniqueById.get(triggerSet.id); - if (existing !== undefined) { - console.log( - `Overriding trigger set id '${triggerSet.id}' from '${existing.filename}' with '${triggerSet.filename}'`, - ); + // Filter the list to keep the last instance of each ID while preserving order. + const lastVersionOfId = new Map(); + for (const set of this.triggerSets) { + if (set.id !== undefined) { + const existing = lastVersionOfId.get(set.id); + if (existing !== undefined) { + console.log( + `Overriding trigger set id '${set.id}' from '${existing.filename}' with '${set.filename}'`, + ); + } + lastVersionOfId.set(set.id, set); } - uniqueById.set(triggerSet.id, triggerSet); } - this.triggerSets = [...uniqueById.values(), ...noIdList]; - this.triggerSetsById = Object.fromEntries(uniqueById); + + this.triggerSets = this.triggerSets.filter((set) => { + if (set.id === undefined) + return true; + return lastVersionOfId.get(set.id) === set; + }); + this.triggerSetsById = Object.fromEntries(lastVersionOfId); } OnChangeZone(e: EventResponses['ChangeZone']): void {