mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 05:01:21 +00:00
FXLayer also show messages for negative income in onBonusEvent
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user