From 7b8c950bef324f4d27b358d6af2ace36770433e5 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sat, 16 May 2026 16:48:06 -0700 Subject: [PATCH] fix: remove duplicate conquest gold popup on canvas2D MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DynamicUILayer subscribed to ConquestEvent and drew a floating "+gold" text on capture, but the WebGL renderer now draws the same popup via ConquestPopupPass (fed through applyConquestEvents in uploadFrameData). The result was two popups stacked on every capture. Drop the canvas2D handler. Bonus events and unit-death FX use the same duplication pattern but are left intact for now — separate change when the WebGL versions are verified visually. --- src/client/graphics/layers/DynamicUILayer.ts | 24 +------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/client/graphics/layers/DynamicUILayer.ts b/src/client/graphics/layers/DynamicUILayer.ts index b151a1b83..a6200e360 100644 --- a/src/client/graphics/layers/DynamicUILayer.ts +++ b/src/client/graphics/layers/DynamicUILayer.ts @@ -1,11 +1,7 @@ import { renderNumber } from "src/client/Utils"; import { EventBus } from "src/core/EventBus"; import { UnitType } from "src/core/game/Game"; -import { - BonusEventUpdate, - ConquestUpdate, - GameUpdateType, -} from "src/core/game/GameUpdates"; +import { BonusEventUpdate, GameUpdateType } from "src/core/game/GameUpdates"; import type { GameView, UnitView } from "../../../core/game/GameView"; import { MoveWarshipIntentEvent } from "../../Transport"; import { TransformHandler } from "../TransformHandler"; @@ -18,7 +14,6 @@ import { Layer } from "./Layer"; const TEXT_OFFSET_Y = -5; const TEXT_STACK_SPACING = 8; -const TEXT_DURATION = 2500; export class DynamicUILayer implements Layer { private readonly uiElements: Array = []; @@ -61,11 +56,6 @@ export class DynamicUILayer implements Layer { if (bonusEvent === undefined) return; this.onBonusEvent(bonusEvent); }); - - updates[GameUpdateType.ConquestEvent]?.forEach((update) => { - if (update === undefined) return; - this.onConquestEvent(update); - }); } onBonusEvent(bonus: BonusEventUpdate) { @@ -89,18 +79,6 @@ export class DynamicUILayer implements Layer { } } - onConquestEvent(conquest: ConquestUpdate) { - // Only display text for the current player - const conqueror = this.game.player(conquest.conquerorId); - if (conqueror !== this.game.myPlayer()) { - return; - } - const nameLocation = this.game.player(conquest.conqueredId).nameLocation(); - const x = nameLocation.x; - const y = nameLocation.y; - this.addNumber(conquest.gold, x, y + 8, TEXT_DURATION, 0); - } - onUnitEvent(unit: UnitView) { switch (unit.type()) { case UnitType.HydrogenBomb: