diff game/js/ui.js @ 13:8df95050fc8b

no more build during pause; tower popup closes on any click outside it
author ark
date 2026-10-19 21:59 +0200
parents a77857594150
children c1c7e4f54bf6
line wrap: on
line diff
--- a/game/js/ui.js	Mon Oct 19 20:41:45 2026 +0200
+++ b/game/js/ui.js	Mon Oct 19 21:59:53 2026 +0200
@@ -273,7 +273,7 @@
             var bubble = game.shop !== b.tower ? "shop_bubble"
                 : Math.floor(view.now / BUBBLE_FLIP) % 2 ? "shop_bubble_dark2" : "shop_bubble_dark";
             ctx.drawImage(A.img(bubble), b.x, b.y, b.w, b.h);
-            ctx.globalAlpha = game.canAfford(def.cost) ? 1 : 0.35;
+            ctx.globalAlpha = game.canAfford(def.cost) && !game.paused ? 1 : 0.35;
             fit(ctx, b.tower, cx, b.y + 28, 44, 38);
             price(ctx, def.cost, cx, b.y + b.h - 15);
             ctx.globalAlpha = 1;
@@ -295,7 +295,7 @@
             }
             fit(ctx, "sell_button", b.cx, b.bubble.y + b.bubble.h * 0.4, 46 * k, 44 * k);
             ctx.restore();
-            price(ctx, MM.tower.refund(game.selected, game.pauseNumber()), b.cx,
+            price(ctx, MM.tower.refund(game.selected), b.cx,
                   b.bubble.y + b.bubble.h * 0.7);
         }
     }