FXLayer also show messages for negative income in onBonusEvent

This commit is contained in:
scamiv
2025-11-21 17:56:43 +01:00
parent 2d2d0e8b5a
commit 3e744d62ed
+5 -4
View File
@@ -126,10 +126,11 @@ export class FxLayer implements Layer {
const gold = bonus.gold;
const troops = bonus.troops;
if (gold > 0) {
const shortened = renderNumber(gold, 0);
this.addTextFx(`+ ${shortened}`, x, y);
y += 10; // increase y so the next popup starts bellow
if (gold !== 0) {
const shortened = renderNumber(Math.abs(gold), 0);
const sign = gold > 0 ? "+" : "-";
this.addTextFx(`${sign} ${shortened}`, x, y);
y += 10; // increase y so the next popup starts below
}
if (troops > 0) {